Beispiel #1
0
class SectionTracking(SectionCore):

    SECTION_NAME = SECTION_NAME_TRACKING

    OPTIONS = [
        ('tracking', [
            ('region', SelectionTrait2(None, [], label='Region name')),
            ('tracking_maxobjectdistance',
             IntTrait(0, 0, 4000, label='Max object x-y distance')),
            ('tracking_maxtrackinggap',
             IntTrait(0, 0, 4000, label='Max time-point gap')),
            ('tracking_maxsplitobjects',
             IntTrait(0, 0, 4000, label='Max split events')),
            ('tracking_exporttrackfeatures',
             BooleanTrait(True, label='Export tracks')),
            ('tracking_compressiontrackfeatures',
             SelectionTrait(COMPRESSION_FORMATS[0],
                            COMPRESSION_FORMATS,
                            label='Compression')),
        ]),
        ('visualization', [
            ('tracking_visualization',
             BooleanTrait(False, label='Visualization')),
            ('tracking_visualize_track_length',
             IntTrait(5, -1, 10000, label='Max. time-points')),
            ('tracking_centroid_radius',
             IntTrait(3, -1, 50, label='Centroid radius')),
        ]),
    ]
Beispiel #2
0
class SectionGeneral(SectionCore):

    SECTION_NAME = SECTION_NAME_GENERAL

    OPTIONS = [('general', [
        ('pathin',
         StringTrait('',
                     label='Image Directory',
                     widget_info=StringTrait.STRING_PATH)),
        ('has_multiple_plates', BooleanTrait(False, label='Multiple Plates')),
        ('pathout',
         StringTrait('',
                     label='Output Directory',
                     widget_info=StringTrait.STRING_PATH)),
        ('plate_layout',
         StringTrait('',
                     label='Plate Layout',
                     widget_info=StringTrait.STRING_PATH)),
        ('namingscheme',
         SelectionTrait(CecogEnvironment.naming_schema.sections()[0],
                        CecogEnvironment.naming_schema.sections(),
                        label='Image Naming Scheme')),
        ('framerange', BooleanTrait(False, label='Timelapse')),
        ('framerange_begin', IntTrait(1, 0, 10000, label='first')),
        ('framerange_end', IntTrait(1, 0, 1000, label='last')),
        ('frameincrement', IntTrait(1, 1, 100, label='increment')),
        ('skip_finished', BooleanTrait(False,
                                       label='Skip finished positions')),
        ('constrain_positions', BooleanTrait(False, label='Positions')),
        ('positions', StringTrait('', 1000, label="", mask='(\w+,)*\w+')),
        ('process_primary', BooleanTrait(True, label='primary')),
        ('process_secondary', BooleanTrait(False, label='secondary')),
        ('process_tertiary', BooleanTrait(False, label='tertiary')),
        ('process_merged', BooleanTrait(False, label='merged')),
        ('crop_image', BooleanTrait(False, label='Image cropping')),
        ('crop_image_x0', IntTrait(-1, -1, 4000, label='upper left x:')),
        ('crop_image_y0', IntTrait(-1, -1, 4000, label='upper left y')),
        ('crop_image_x1', IntTrait(-1, -1, 4000, label='lower right x')),
        ('crop_image_y1', IntTrait(-1, -1, 4000, label='lower right y')),
        ('crop_image', BooleanTrait(False, label='Image cropping')),
        ('rendering', DictTrait({}, label='Rendering')),
        ('version',
         StringTrait('',
                     6,
                     label='Cecog %s, file version:' % version,
                     widget_info=StringTrait.STRING_GRAYED)),
        ('rendering_class', DictTrait({}, label='Rendering class')),
        ('primary_featureextraction_exportfeaturenames',
         ListTrait(['n2_avg', 'n2_stddev', 'roisize'],
                   label='Primary channel')),
        ('secondary_featureextraction_exportfeaturenames',
         ListTrait(['n2_avg', 'n2_stddev', 'roisize'],
                   label='Secondary channel')),
        ('tertiary_featureextraction_exportfeaturenames',
         ListTrait(['n2_avg', 'n2_stddev', 'roisize'],
                   label='Tertiary channel')),
    ])]
Beispiel #3
0
class SectionGeneral(SectionCore):

    SECTION_NAME = SECTION_NAME_GENERAL

    OPTIONS = [('general', [
        ('pathin',
         StringTrait('',
                     1000,
                     label='Image folder',
                     widget_info=StringTrait.STRING_PATH)),
        ('has_multiple_plates', BooleanTrait(False, label='Multiple plates')),
        ('pathout',
         StringTrait('',
                     1000,
                     label='Analysis folder',
                     widget_info=StringTrait.STRING_PATH)),
        ('image_import_namingschema',
         BooleanTrait(True,
                      label='Import via naming schema',
                      widget_info=BooleanTrait.RADIOBUTTON)),
        ('image_import_structurefile',
         BooleanTrait(False,
                      label='Import via coordinate file',
                      widget_info=BooleanTrait.RADIOBUTTON)),
        ('namingscheme',
         SelectionTrait(CecogEnvironment.naming_schema.sections()[0],
                        CecogEnvironment.naming_schema.sections(),
                        label='Naming scheme')),
        ('structure_filename',
         StringTrait('',
                     1000,
                     label='Coordinate filename',
                     widget_info=StringTrait.STRING_FILE)),
        ('structure_file_pathin',
         BooleanTrait(True,
                      label='Image folder',
                      widget_info=BooleanTrait.RADIOBUTTON)),
        ('structure_file_pathout',
         BooleanTrait(False,
                      label='Analysis folder',
                      widget_info=BooleanTrait.RADIOBUTTON)),
        ('structure_file_extra_path',
         BooleanTrait(False,
                      label='Different location',
                      widget_info=BooleanTrait.RADIOBUTTON)),
        ('structure_file_extra_path_name',
         StringTrait('',
                     1000,
                     label='Path',
                     widget_info=StringTrait.STRING_PATH)),
        ('constrain_positions', BooleanTrait(False,
                                             label='Constrain positions')),
        ('positions',
         StringTrait('', 1000, label='Positions', mask='(\w+,)*\w+')),
        ('crop_image', BooleanTrait(False, label='Crop image')),
        ('crop_image_x0', IntTrait(-1, -1, 4000, label='Upper left X')),
        ('crop_image_y0', IntTrait(-1, -1, 4000, label='Upper left Y')),
        ('crop_image_x1', IntTrait(-1, -1, 4000, label='Lower right X')),
        ('crop_image_y1', IntTrait(-1, -1, 4000, label='Lower right Y')),
        ('crop_image', BooleanTrait(False, label='Crop image')),
        ('redofailedonly', BooleanTrait(True,
                                        label='Skip processed positions')),
        ('framerange', BooleanTrait(False, label='Constrain timepoints')),
        ('framerange_begin', IntTrait(1, 0, 10000, label='Begin')),
        ('framerange_end', IntTrait(1, 0, 1000, label='End')),
        ('frameincrement', IntTrait(1, 1, 100, label='Timepoint increment')),
        ('rendering', DictTrait({}, label='Rendering')),
        ('version',
         StringTrait('',
                     6,
                     label='Cecog %s, file version:' % VERSION,
                     widget_info=StringTrait.STRING_GRAYED)),
        ('rendering_class', DictTrait({}, label='Rendering class')),
        ('primary_featureextraction_exportfeaturenames',
         ListTrait(['n2_avg', 'n2_stddev', 'roisize'],
                   label='Primary channel')),
        ('secondary_featureextraction_exportfeaturenames',
         ListTrait(['n2_avg', 'n2_stddev', 'roisize'],
                   label='Secondary channel')),
        ('tertiary_featureextraction_exportfeaturenames',
         ListTrait(['n2_avg', 'n2_stddev', 'roisize'],
                   label='Tertiary channel')),
    ])]
Beispiel #4
0
class SectionObjectdetection(SectionCore):

    SECTION_NAME = SECTION_NAME_OBJECTDETECTION

    OPTIONS = [
      ('primary_image',
       [('primary_channelid',
            SelectionTrait2(None, [], label='Primary channel ID')),
        ('primary_normalizemin',
            IntTrait(0, -2**16, 2**16, label='Min.')),
        ('primary_normalizemax',
            IntTrait(255, -2**16, 2**16, label='Max.')),
        ('primary_zslice_selection',
            BooleanTrait(True, label='Z-slice selection',
                         widget_info=BooleanTrait.RADIOBUTTON)),
        ('primary_flat_field_correction',
            BooleanTrait(False, label='Z-slice flat field correction',
                         widget_info=BooleanTrait.CHECKBOX)),
        ('primary_flat_field_correction_image_dir',
            StringTrait('', 1000, label='Correction image directory',
                                   widget_info=StringTrait.STRING_PATH)),
        ('primary_zslice_selection_slice',
            IntTrait(1, 0, 1000, label='Slice')),
        ('primary_zslice_projection',
            BooleanTrait(False, label='Z-slice projection',
                         widget_info=BooleanTrait.RADIOBUTTON)),
        ('primary_zslice_projection_method',
            SelectionTrait(ZSLICE_PROJECTION_METHODS[0],
                           ZSLICE_PROJECTION_METHODS, label='Method')),
        ('primary_zslice_projection_begin',
            IntTrait(1, 0, 1000, label='Begin')),
        ('primary_zslice_projection_end',
            IntTrait(1, 0, 1000, label='End')),
        ('primary_zslice_projection_step',
         IntTrait(1, 1, 1000, label='Step')),
        # these two options are nopes, just to have no
        # special casing in channel classes
        ('primary_channelregistration_x',
         IntTrait(0, -99999, 99999, label='Shift X')),
        ('primary_channelregistration_y',
         IntTrait(0, -99999, 99999, label='Shift Y')),
        ]),
      ] + \
      unlist(
      [[('%s_image' % prefix,
       [('%s_channelid' % prefix,
            SelectionTrait2(None, [], label='%s channel ID' % name)),
        ('%s_normalizemin' % prefix,
            IntTrait(0, -2**16, 2**16, label='Min.')),
        ('%s_normalizemax' % prefix,
            IntTrait(255, -2**16, 2**16, label='Max.')),

        ('%s_zslice_selection' % prefix,
            BooleanTrait(True, label='Z-slice selection',
                         widget_info=BooleanTrait.RADIOBUTTON)),
        ('%s_flat_field_correction' % prefix,
            BooleanTrait(False, label='Z-slice flat field correction',
                         widget_info=BooleanTrait.CHECKBOX)),
        ('%s_flat_field_correction_image_dir' % prefix,
            StringTrait('', 1000, label='Correction image directory',
                                   widget_info=StringTrait.STRING_PATH)),
        ('%s_zslice_selection_slice' % prefix,
            IntTrait(1, 0, 1000, label='Slice')),
        ('%s_zslice_projection' % prefix,
            BooleanTrait(False, label='Z-slice projection',
                         widget_info=BooleanTrait.RADIOBUTTON)),
        ('%s_zslice_projection_method' % prefix,
            SelectionTrait(ZSLICE_PROJECTION_METHODS[0],
                           ZSLICE_PROJECTION_METHODS, label='Method')),
        ('%s_zslice_projection_begin' % prefix,
            IntTrait(1, 0, 1000, label='Begin')),
        ('%s_zslice_projection_end' % prefix,
            IntTrait(1, 0, 1000, label='End')),
        ('%s_zslice_projection_step' % prefix,
            IntTrait(1, 1, 1000, label='Step')),
       ]),

      ('%s_registration' % prefix,
       [('%s_channelregistration_x' % prefix,
            IntTrait(0, -99999, 99999, label='Shift X')),
        ('%s_channelregistration_y' % prefix,
            IntTrait(0, -99999, 99999, label='Shift Y')),
       ]),

       ]
       for name, prefix in [('Secondary', 'secondary'),
                            ('Tertiary', 'tertiary'),
                            # moste merged channel options are nopes
                            # to avoid special casing
                            ('Merged', 'merged')
                            ]]
      )
Beispiel #5
0
class SectionTracking(SectionCore):

    SECTION_NAME = SECTION_NAME_TRACKING

    OPTIONS = [
        ('tracking', [
            ('tracking_regionname',
             SelectionTrait2(None, [], label='Region name')),
            ('tracking_maxobjectdistance',
             IntTrait(0, 0, 4000, label='Max object x-y distance')),
            ('tracking_maxtrackinggap',
             IntTrait(0, 0, 4000, label='Max time-point gap')),
            ('tracking_maxsplitobjects',
             IntTrait(0, 0, 4000, label='Max split events')),
            ('tracking_maxindegree', IntTrait(1,
                                              0,
                                              4000,
                                              label='Max in-degree')),
            ('tracking_maxoutdegree',
             IntTrait(2, 0, 4000, label='Max out-degree')),
            ('tracking_exporttrackfeatures',
             BooleanTrait(True, label='Export tracks')),
            ('tracking_compressiontrackfeatures',
             SelectionTrait(COMPRESSION_FORMATS[0],
                            COMPRESSION_FORMATS,
                            label='Compression')),
        ]),
        ('event_selection', [
            ('tracking_labeltransitions',
             StringTrait('',
                         200,
                         label='Class transition motif(s)',
                         mask='(\(\d+,\d+\),)*\(\d+,\d+\)')),
            ('tracking_backwardrange',
             FloatTrait(0, -1, 4000, label='Duration [pre]')),
            ('tracking_forwardrange',
             FloatTrait(0, -1, 4000, label='Duration [post]')),
            ('tracking_backwardlabels',
             StringTrait('',
                         200,
                         label='Class filter [pre]',
                         mask='(\d+,)*\d+')),
            ('tracking_forwardlabels',
             StringTrait('',
                         200,
                         label='Class filter [post]',
                         mask='(\d+,)*\d+')),
            ('tracking_backwardcheck',
             FloatTrait(2, 0, 4000, label='Filter duration [pre]')),
            ('tracking_forwardcheck',
             FloatTrait(2, 0, 4000, label='Filter duration [post]')),
            ('tracking_duration_unit',
             SelectionTrait2(TRACKING_DURATION_UNITS_DEFAULT[0],
                             TRACKING_DURATION_UNITS_DEFAULT,
                             label='Duration unit')),
            ('tracking_backwardrange_min', BooleanTrait(False, label='Min.')),
            ('tracking_forwardrange_min', BooleanTrait(False, label='Min.')),
        ]),
        ('visualization', [
            ('tracking_visualization',
             BooleanTrait(False, label='Visualization')),
            ('tracking_visualize_track_length',
             IntTrait(5, -1, 10000, label='Max. time-points')),
            ('tracking_centroid_radius',
             IntTrait(3, -1, 50, label='Centroid radius')),
        ]),
    ]