(self, subject)
return out
return data for a single subject
return data for a single subject
return data for a single subject
def _get_single_subject_data(self, subject):
        """return data for a single subject"""

        sessions = []
        if self.imagined:
            sessions.append("imagination")

        if self.executed:
            sessions.append("execution")

        out = {}
        for session in sessions:
            paths = self.data_path(subject, session=session)

            eog = ["eog-l", "eog-m", "eog-r"]
            montage = make_standard_montage("standard_1005")
            data = {}
            for ii, path in enumerate(paths):
                raw = read_raw_gdf(
                    path, eog=eog, misc=range(64, 96), preload=True, verbose="ERROR"
                )
                raw.set_montage(montage)
                # there is nan in the data
                raw._data[np.isnan(raw._data)] = 0
                # Modify the annotations to match the name of the command
                stim = raw.annotations.description.astype(np.dtype("<21U"))
                stim[stim == "1536"] = "right_elbow_flexion"
                stim[stim == "1537"] = "right_elbow_extension"
                stim[stim == "1538"] = "right_supination"
                stim[stim == "1539"] = "right_pronation"
                stim[stim == "1540"] = "right_hand_close"
                stim[stim == "1541"] = "right_hand_open"
                stim[stim == "1542"] = "rest"
                raw.annotations.description = stim
                data["run_%d" % ii] = raw

            out[session] = data
        return out
def _get_single_subject_data ( self , subject ) : sessions = [ ] if self . imagined : sessions . append ( "imagination" ) if self . executed : sessions . append ( "execution" ) out = { } for session in sessions : paths = self . data_path ( subject , session = session ) eog = [ "eog-l" , "eog-m" , "eog-r" ] montage = make_standard_montage ( "standard_1005" ) data = { } for ii , path in enumerate ( paths ) : raw = read_raw_gdf ( path , eog = eog , misc = range ( 64 , 96 ) , preload = True , verbose = "ERROR" ) raw . set_montage ( montage ) # there is nan in the data raw . _data [ np . isnan ( raw . _data ) ] = 0 # Modify the annotations to match the name of the command stim = raw . annotations . description . astype ( np . dtype ( "<21U" ) ) stim [ stim == "1536" ] = "right_elbow_flexion" stim [ stim == "1537" ] = "right_elbow_extension" stim [ stim == "1538" ] = "right_supination" stim [ stim == "1539" ] = "right_pronation" stim [ stim == "1540" ] = "right_hand_close" stim [ stim == "1541" ] = "right_hand_open" stim [ stim == "1542" ] = "rest" raw . annotations . description = stim data [ "run_%d" % ii ] = raw out [ session ] = data return out