示例#1
0
 def create_cnt_y_by_signal_processor(self):
     if self.end_marker_def is None:
         self.y = create_cnt_y(self.signal_processor.cnt, 
             self.signal_processor.segment_ival, 
             self.signal_processor.marker_def, timeaxis=-2)
     else:
         self.y = create_cnt_y_start_end_marker(self.signal_processor.cnt, 
             self.signal_processor.marker_def, self.end_marker_def, 
             self.signal_processor.segment_ival, timeaxis=-2)
示例#2
0
 def segment(self, cnt):
     # marker segmenter, dann restrict range, dann restrict classes, dann evtl. add breaks
     assert np.all([len(labels) == 1 for labels in 
             self.marker_def.values()]), (
             "Expect only one label per class, otherwise rewrite...")
     # get class names, assume they are sorted by marker codes
     class_names = sorted(self.marker_def.keys(), 
         key= lambda k: self.marker_def[k][0])
     if self.end_marker_def is None:
         y = create_cnt_y(cnt, self.segment_ival,self.marker_def,
             trial_classes=self.trial_classes)
     else:
         y = create_cnt_y_start_end_marker(cnt,self.marker_def, self.end_marker_def,
             segment_ival=self.segment_ival,
             trial_classes=self.trial_classes)
     return y, class_names
 def create_cnt_y_by_signal_processor(self):
     if self.end_marker_def is None:
         self.y = create_cnt_y(
             self.signal_processor.cnt,
             self.signal_processor.segment_ival,
             self.signal_processor.marker_def,
             timeaxis=-2,
         )
     else:
         self.y = create_cnt_y_start_end_marker(
             self.signal_processor.cnt,
             self.signal_processor.marker_def,
             self.end_marker_def,
             self.signal_processor.segment_ival,
             timeaxis=-2,
         )
示例#4
0
 def segment(self, cnt, y=None, class_names=None):
     assert y is None
     assert class_names is None
     # marker segmenter, dann restrict range, dann restrict classes, dann evtl. add breaks
     assert np.all([
         len(labels) == 1 for labels in self.marker_def.values()
     ]), ("Expect only one label per class, otherwise rewrite...")
     # get class names, assume they are sorted by marker codes
     class_names = sorted(self.marker_def.keys(),
                          key=lambda k: self.marker_def[k][0])
     if self.end_marker_def is None:
         y = create_cnt_y(cnt,
                          self.segment_ival,
                          self.marker_def,
                          trial_classes=self.trial_classes)
     else:
         y = create_cnt_y_start_end_marker(cnt,
                                           self.marker_def,
                                           self.end_marker_def,
                                           segment_ival=self.segment_ival,
                                           trial_classes=self.trial_classes)
     return y, class_names