(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"""
        fname, fname_mrk = self.data_path(subject)
        data = loadmat(fname, squeeze_me=True, struct_as_record=False)["cnt"]
        mrk = loadmat(fname_mrk, squeeze_me=True, struct_as_record=False)["mrk"]

        sessions = {}
        # motor imagery
        if self.motor_imagery:
            for ii in [0, 2, 4]:
                session = self._convert_one_session(data, mrk, ii, trig_offset=0)
                sessions["session_%d" % ii] = session

        # arithmetic/rest
        if self.mental_arithmetic:
            for ii in [1, 3, 5]:
                session = self._convert_one_session(data, mrk, ii, trig_offset=2)
                sessions["session_%d" % ii] = session

        return sessions
def _get_single_subject_data ( self , subject ) : fname , fname_mrk = self . data_path ( subject ) data = loadmat ( fname , squeeze_me = True , struct_as_record = False ) [ "cnt" ] mrk = loadmat ( fname_mrk , squeeze_me = True , struct_as_record = False ) [ "mrk" ] sessions = { } # motor imagery if self . motor_imagery : for ii in [ 0 , 2 , 4 ] : session = self . _convert_one_session ( data , mrk , ii , trig_offset = 0 ) sessions [ "session_%d" % ii ] = session # arithmetic/rest if self . mental_arithmetic : for ii in [ 1 , 3 , 5 ] : session = self . _convert_one_session ( data , mrk , ii , trig_offset = 2 ) sessions [ "session_%d" % ii ] = session return sessions