|
7 | 7 |
|
8 | 8 | import mne |
9 | 9 | import numpy as np |
10 | | -import pandas as pd |
11 | 10 | import yaml |
12 | 11 | from mne.channels import make_standard_montage |
13 | 12 | from mne.utils import _open_lock |
@@ -852,50 +851,5 @@ def data_path( |
852 | 851 | ): |
853 | 852 | return _bi_data_path(self, subject, path, force_update, update_path, verbose) |
854 | 853 |
|
855 | | - def get_block_repetition(self, paradigm, subjects, block_list, repetition_list): |
856 | | - """Select data for all provided subjects, blocks and repetitions. Each |
857 | | - subject has 12 blocks of 5 repetitions. |
858 | | -
|
859 | | - The returned data is a dictionary with the following structure:: |
860 | | -
|
861 | | - data = {'subject_id' : |
862 | | - {'session_id': |
863 | | - {'run_id': raw} |
864 | | - } |
865 | | - } |
866 | | -
|
867 | | - See also |
868 | | - -------- |
869 | | - BaseDataset.get_data |
870 | | -
|
871 | | - Parameters |
872 | | - ---------- |
873 | | - subjects: List of int |
874 | | - List of subject number |
875 | | - block_list: List of int |
876 | | - List of block number (from 0 to 11) |
877 | | - repetition_list: List of int |
878 | | - List of repetition number inside a block (from 0 to 4) |
879 | | -
|
880 | | - Returns |
881 | | - ------- |
882 | | - data: Dict |
883 | | - dict containing the raw data |
884 | | - """ |
885 | | - X, labels, meta = paradigm.get_data(self, subjects) |
886 | | - X_select = [] |
887 | | - labels_select = [] |
888 | | - meta_select = [] |
889 | | - for block in block_list: |
890 | | - for repetition in repetition_list: |
891 | | - run = block_rep(block, repetition, self.n_repetitions) |
892 | | - X_select.append(X[meta["run"] == run]) |
893 | | - labels_select.append(labels[meta["run"] == run]) |
894 | | - meta_select.append(meta[meta["run"] == run]) |
895 | | - X_select = np.concatenate(X_select) |
896 | | - labels_select = np.concatenate(labels_select) |
897 | | - meta_select = np.concatenate(meta_select) |
898 | | - df = pd.DataFrame(meta_select, columns=meta.columns) |
899 | | - meta_select = df |
900 | | - |
901 | | - return X_select, labels_select, meta_select |
| 854 | + def _block_rep(self, block, repetition): |
| 855 | + return block_rep(block, repetition, self.n_repetitions) |
0 commit comments