(self, subject)
return sessions
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"""

        file_path_list = self.data_path(subject)
        sessions = {}
        for file_path in file_path_list:

            session_number = file_path.split(os.sep)[-2].replace("Session", "")
            session_name = "session_" + session_number
            if session_name not in sessions.keys():
                sessions[session_name] = {}

            run_number = file_path.split(os.sep)[-1]
            run_number = run_number.split("_")[-1]
            run_number = run_number.split(".gdf")[0]
            run_name = "run_" + run_number

            raw_original = mne.io.read_raw_gdf(file_path, preload=True)
            raw_original.rename_channels({"FP1": "Fp1", "FP2": "Fp2"})
            raw_original.set_montage(make_standard_montage("standard_1020"))

            sessions[session_name][run_name] = raw_original

        return sessions
def _get_single_subject_data ( self , subject ) : file_path_list = self . data_path ( subject ) sessions = { } for file_path in file_path_list : session_number = file_path . split ( os . sep ) [ - 2 ] . replace ( "Session" , "" ) session_name = "session_" + session_number if session_name not in sessions . keys ( ) : sessions [ session_name ] = { } run_number = file_path . split ( os . sep ) [ - 1 ] run_number = run_number . split ( "_" ) [ - 1 ] run_number = run_number . split ( ".gdf" ) [ 0 ] run_name = "run_" + run_number raw_original = mne . io . read_raw_gdf ( file_path , preload = True ) raw_original . rename_channels ( { "FP1" : "Fp1" , "FP2" : "Fp2" } ) raw_original . set_montage ( make_standard_montage ( "standard_1020" ) ) sessions [ session_name ] [ run_name ] = raw_original return sessions