예제 #1
0
파일: tracking.py 프로젝트: bobi5rova/cecog
    def _get_modified_settings(self, name, has_timelapse=True):
        settings = BaseProcessorFrame._get_modified_settings(self, name, has_timelapse)

        settings.set('Processing', 'tracking', True)
        settings.set('Processing', 'eventselection', False)
        settings.set('General', 'rendering_class', {})
        settings.set('General', 'rendering', {})
        settings.set('Classification', 'collectsamples', False)
        settings.set('Output', 'hdf5_create_file', False)

        # tracking only invokes the primary channel
        settings.set('Processing', 'primary_classification', False)
        settings.set('Processing', 'primary_featureextraction', True)
        settings.set('General', 'process_secondary', False)
        settings.set('Processing', 'secondary_featureextraction', False)
        settings.set('Processing', 'secondary_classification', False)
        settings.set('General', 'process_tertiary', False)
        settings.set('Processing', 'tertiary_featureextraction', False)
        settings.set('Processing', 'tertiary_classification', False)
        settings.set('General', 'process_merged', False)
        settings.set('Processing', 'merged_classification', False)
        settings.set('Output', 'events_export_gallery_images', False)

        region_name = settings.get('Tracking', 'region')
        show_ids = settings.get('Output', 'rendering_contours_showids')
        pct = {'primary_contours':
                   {CH_PRIMARY[0].title(): {'raw': ('#FFFFFF', 1.0),
                                         'contours': {region_name: ('#FF0000', 1, show_ids)}}}}

        settings.set('General', 'rendering', pct)
        return settings
예제 #2
0
파일: tracking.py 프로젝트: imcf/cecog
    def _get_modified_settings(self, name, has_timelapse=True):
        settings = BaseProcessorFrame._get_modified_settings(self, name, has_timelapse)

        settings.set_section('ObjectDetection')
        prim_id = PrimaryChannel.NAME

        settings.set_section('Processing')
        settings.set2('tracking', True)
        settings.set2('tracking_synchronize_trajectories', False)
        settings.set_section('Tracking')
        region_name = settings.get2('tracking_regionname')
        settings.set_section('General')
        settings.set2('rendering_class', {})
        settings.set2('rendering', {})
        settings.set_section('Classification')
        settings.set2('collectsamples', False)

        settings.set('Output', 'hdf5_create_file', False)
        show_ids = settings.get('Output', 'rendering_contours_showids')
        show_ids_class = settings.get('Output', 'rendering_class_showids')

        if name == self.PROCESS_TRACKING:
            # tracking only invokes the primary channel
            settings.set_section('Processing')
            settings.set2('primary_classification', False)
            settings.set2('primary_featureextraction', True)

            settings.set2('secondary_processChannel', False)
            settings.set2('secondary_featureextraction', False)
            settings.set2('secondary_classification', False)

            settings.set2('tertiary_processChannel', False)
            settings.set2('tertiary_featureextraction', False)
            settings.set2('tertiary_classification', False)

            settings.set2('merged_processChannel', False)
            settings.set2('merged_classification', False)

            settings.set('Output', 'events_export_gallery_images', False)
            settings.set('General', 'rendering', {'primary_contours':
                                                      {PrimaryChannel.NAME: {'raw': ('#FFFFFF', 1.0),
                                                                             'contours': {region_name: ('#FF0000', 1, show_ids)}}}})
        else:
            settings.set_section('Processing')
            settings.set2('primary_featureextraction', True)
            settings.set2('primary_classification', True)
            settings.set2('tracking_synchronize_trajectories', True)
            cl_rnd = {'primary_classification':
                          {PrimaryChannel.NAME: {'raw': ('#FFFFFF', 1.0),
                                                 'contours': [('primary', 'class_label', 1, False),
                                                              ('primary', '#000000', 1, show_ids_class)]}},                                                        }
            settings.set('General', 'rendering_class', cl_rnd)


            settings.set_section('Processing')
            self._channel_render_settings(settings, SecondaryChannel.NAME, show_ids_class)
            self._channel_render_settings(settings, TertiaryChannel.NAME, show_ids_class)
            self._channel_render_settings(settings, MergedChannel.NAME, show_ids_class)

        return settings
예제 #3
0
    def _get_modified_settings(self, name, has_timelapse=True):
        settings = BaseProcessorFrame._get_modified_settings( \
            self, name, has_timelapse)

        # turn on tracking and event seletion
        settings.set('Processing', 'tracking', True)
        settings.set('Processing', 'eventselection', True)
        settings.set('General', 'rendering_class', {})
        settings.set('General', 'rendering', {})

        settings.set('Classification', 'collectsamples', False)
        settings.set('Output', 'hdf5_create_file', False)
        settings.set('Output', 'events_export_gallery_images', False)

        # only primary channel for event selection
        settings.set('Processing', 'secondary_featureextraction', False)
        settings.set('Processing', 'secondary_classification', False)
        settings.set('General', 'process_secondary', False)
        settings.set('Processing', 'tertiary_featureextraction', False)
        settings.set('Processing', 'tertiary_classification', False)
        settings.set('General', 'process_tertiary', False)
        settings.set('Processing', 'merged_classification', False)
        settings.set('General', 'process_merged', False)

        show_ids = settings.get('Output', 'rendering_contours_showids')
        show_ids_class = settings.get('Output', 'rendering_class_showids')

        render_contours = {
            PrimaryChannel.NAME: {
                'raw': ('#FFFFFF', 1.0),
                'contours': {
                    'primary': ('#FF0000', 1, show_ids)
                }
            }
        }

        render_class = {
            PrimaryChannel.NAME: {
                'raw': ('#FFFFFF', 1.0),
                'contours': [('primary', 'class_label', 1, False),
                             ('primary', '#000000', 1, show_ids_class)]
            }
        }

        # setting up primary channel and live rendering
        if settings.get('EventSelection', 'unsupervised_event_selection'):
            settings.set('Processing', 'primary_featureextraction', True)
            settings.set('Processing', 'primary_classification', True)
            settings.set('Processing', 'secondary_classification', False)
            settings.set('Processing', 'tertiary_classification', False)
            settings.set('Processing', 'merged_classification', False)
            settings.set('General', 'rendering',
                         {'primary_contours': render_contours})

        elif settings.get('EventSelection', 'supervised_event_selection'):
            settings.set('Processing', 'primary_featureextraction', True)
            settings.set('Processing', 'primary_classification', True)
            settings.set('General', 'rendering_class',
                         {'primary_classification': render_class})
        return settings
예제 #4
0
    def _get_modified_settings(self, name, has_timelapse=True):
        settings = BaseProcessorFrame._get_modified_settings(self, name, has_timelapse)

        settings.set_section('ObjectDetection')

        settings.set_section('Processing')
        for prefix in ['primary', 'secondary', 'tertiary']:
            settings.set2('%s_featureextraction' % prefix, False)
            settings.set2('%s_classification' % prefix, False)
        settings.set2('tracking', False)
        settings.set_section('Classification')
        settings.set2('collectsamples', False)

        settings.set_section('General')
        settings.set2('rendering_class', {})

        settings.set('Output', 'events_export_gallery_images', False)
        settings.set('Output', 'hdf5_create_file', False)
        settings.set('Output', 'export_object_counts', False)
        settings.set('Output', 'export_file_names', False)
        settings.set('Output', 'export_object_details', False)
        settings.set('Output', 'export_tracking_as_dot', False)
        settings.set('Output', 'export_track_data', False)

        show_ids = settings.get('Output', 'rendering_contours_showids')


        current_tab = self._tab.current_index
        # turn of merged channel
        settings.set('General', 'process_merged', False)
        if current_tab == 0:
            settings.set('General', 'process_secondary', False)
            settings.set('General', 'process_tertiary', False)
            prefix = 'primary'
        elif current_tab == 1:
            settings.set('General', 'process_secondary', True)
            settings.set('General', 'process_tertiary', False)
            prefix = 'secondary'
        else:
            settings.set('General', 'process_secondary', True)
            settings.set('General', 'process_tertiary', True)
            prefix = 'tertiary'

        region_info = self.plugin_mgr.region_info
        colors = region_info.colors
        rdn = dict([('%s_contours_%s' % (prefix, x),
                     {prefix.capitalize(): {'raw': ('#FFFFFF', 1.0),
                                            'contours': [(x, colors[x] , 1, show_ids)]
                                            }
                      }
                     ) for x in region_info.names[prefix]])

        settings.set('General', 'rendering', rdn)

        return settings
예제 #5
0
    def _get_modified_settings(self, name, has_timelapse=True):
        settings = BaseProcessorFrame._get_modified_settings(
            self, name, has_timelapse)

        settings.set_section('ObjectDetection')

        settings.set_section('Processing')
        for prefix in ['primary', 'secondary', 'tertiary']:
            settings.set2('%s_featureextraction' % prefix, False)
            settings.set2('%s_classification' % prefix, False)
        settings.set2('tracking', False)
        settings.set_section('Classification')
        settings.set2('collectsamples', False)

        settings.set_section('General')
        settings.set2('rendering_class', {})

        settings.set('Output', 'events_export_gallery_images', False)
        settings.set('Output', 'hdf5_create_file', False)
        settings.set('Output', 'export_object_counts', False)
        settings.set('Output', 'export_file_names', False)
        settings.set('Output', 'export_object_details', False)
        settings.set('Output', 'export_tracking_as_dot', False)
        settings.set('Output', 'export_track_data', False)

        show_ids = settings.get('Output', 'rendering_contours_showids')

        current_tab = self._tab.current_index
        # turn of merged channel
        settings.set('General', 'process_merged', False)
        if current_tab == 0:
            settings.set('General', 'process_secondary', False)
            settings.set('General', 'process_tertiary', False)
            prefix = 'primary'
        elif current_tab == 1:
            settings.set('General', 'process_secondary', True)
            settings.set('General', 'process_tertiary', False)
            prefix = 'secondary'
        else:
            settings.set('General', 'process_secondary', True)
            settings.set('General', 'process_tertiary', True)
            prefix = 'tertiary'

        region_info = self.plugin_mgr.region_info
        colors = region_info.colors
        rdn = dict([('%s_contours_%s' % (prefix, x), {
            prefix.capitalize(): {
                'raw': ('#FFFFFF', 1.0),
                'contours': [(x, colors[x], 1, show_ids)]
            }
        }) for x in region_info.names[prefix]])

        settings.set('General', 'rendering', rdn)

        return settings
예제 #6
0
 def _get_modified_settings(self, name, has_timelapse=True):
     settings = BaseProcessorFrame._get_modified_settings(self, name, has_timelapse)
     settings.set_section('Processing')
     if settings.get2('primary_classification'):
         settings.set2('primary_errorcorrection', True)
     if not settings.get2('secondary_processchannel'):
         settings.set2('secondary_classification', False)
         settings.set2('secondary_errorcorrection', False)
     elif settings.get2('secondary_classification'):
         settings.set2('secondary_errorcorrection', True)
     return settings
예제 #7
0
 def _get_modified_settings(self, name, has_timelapse=True):
     settings = BaseProcessorFrame._get_modified_settings(self, name, has_timelapse)
     settings.set_section('Processing')
     if settings.get2('primary_classification'):
         settings.set2('primary_errorcorrection', True)
     if not settings.get2('secondary_processchannel'):
         settings.set2('secondary_classification', False)
         settings.set2('secondary_errorcorrection', False)
     elif settings.get2('secondary_classification'):
         settings.set2('secondary_errorcorrection', True)
     return settings
예제 #8
0
    def _get_modified_settings(self, name, has_timelapse=True):
        settings = BaseProcessorFrame._get_modified_settings( \
            self, name, has_timelapse)

        # turn on tracking and event seletion
        settings.set('Processing', 'tracking', True)
        settings.set('Processing', 'eventselection', True)
        settings.set('General', 'rendering_class', {})
        settings.set('General', 'rendering', {})

        settings.set('Classification', 'collectsamples', False)
        settings.set('Output', 'hdf5_create_file', False)
        settings.set('Output', 'events_export_gallery_images', False)

        # only primary channel for event selection
        settings.set('Processing', 'secondary_featureextraction', False)
        settings.set('Processing', 'secondary_classification', False)
        settings.set('General', 'process_secondary', False)
        settings.set('Processing', 'tertiary_featureextraction', False)
        settings.set('Processing', 'tertiary_classification', False)
        settings.set('General', 'process_tertiary', False)
        settings.set('Processing', 'merged_classification', False)
        settings.set('General', 'process_merged', False)

        show_ids = settings.get('Output', 'rendering_contours_showids')
        show_ids_class = settings.get('Output', 'rendering_class_showids')

        render_contours = {PrimaryChannel.NAME:
                           {'raw': ('#FFFFFF', 1.0),
                            'contours': {'primary': ('#FF0000', 1, show_ids)}}}

        render_class = {PrimaryChannel.NAME:
                            {'raw': ('#FFFFFF', 1.0),
                             'contours': [('primary', 'class_label', 1, False),
                                          ('primary', '#000000', 1,
                                           show_ids_class)]}}

        # setting up primary channel and live rendering
        if settings.get('EventSelection', 'unsupervised_event_selection'):
            settings.set('Processing', 'primary_featureextraction', True)
            settings.set('Processing', 'primary_classification', True)
            settings.set('Processing', 'secondary_classification', False)
            settings.set('Processing', 'tertiary_classification', False)
            settings.set('Processing', 'merged_classification', False)
            settings.set('General', 'rendering',
                         {'primary_contours': render_contours})

        elif settings.get('EventSelection', 'supervised_event_selection'):
            settings.set('Processing', 'primary_featureextraction', True)
            settings.set('Processing', 'primary_classification', True)
            settings.set('General', 'rendering_class',
                         {'primary_classification': render_class})
        return settings
예제 #9
0
    def _get_modified_settings(self, name, has_timelapse=True):
        settings = BaseProcessorFrame._get_modified_settings(self, name, has_timelapse)

        settings.set_section('ObjectDetection')
        prim_id = PrimaryChannel.NAME
        sec_id = SecondaryChannel.NAME
        sec_regions = [v for k,v in SECONDARY_REGIONS.iteritems()
                       if settings.get2(k)]
        tert_id = TertiaryChannel.NAME
        tert_regions = [v for k,v in TERTIARY_REGIONS.iteritems()
                       if settings.get2(k)]

        settings.set_section('Processing')
        for prefix in ['primary', 'secondary', 'tertiary']:
            settings.set2('%s_featureextraction' % prefix, False)
            settings.set2('%s_classification' % prefix, False)
        settings.set2('tracking', False)
        settings.set_section('Classification')
        settings.set2('collectsamples', False)

        settings.set_section('General')
        settings.set2('rendering_class', {})
        #settings.set2('rendering_discwrite', True)
        #settings.set2('rendering_class_discwrite', True)

        settings.set('Output', 'events_export_gallery_images', False)
        show_ids = settings.get('Output', 'rendering_contours_showids')
        #settings.set('Output', 'export_object_details', False)
        #settings.set('Output', 'export_object_counts', False)


        current_tab = self._tab.currentIndex()
        print current_tab
        if current_tab == 0:
            settings.set('Processing', 'secondary_processchannel', False)
            settings.set('Processing', 'tertiary_processchannel', False)
            settings.set('General', 'rendering', {'primary_contours': {prim_id: {'raw': ('#FFFFFF', 1.0), 'contours': {'primary': ('#FF0000', 1, show_ids)}}}})
        elif current_tab == 1:
            settings.set('Processing', 'secondary_processchannel', True)
            settings.set('Processing', 'tertiary_processchannel', False)
            settings.set('General', 'rendering', dict([('secondary_contours_%s' % x, {sec_id: {'raw': ('#FFFFFF', 1.0),
                                                                                                      'contours': [(x, SECONDARY_COLORS[x] , 1, show_ids)]
                                                                                             }})
                                                              for x in sec_regions]))
        else:
            settings.set('Processing', 'secondary_processChannel', True)
            settings.set('Processing', 'tertiary_processchannel', True)
            settings.set('General', 'rendering', dict([('tertiary_contours_%s' % x, {tert_id: {'raw': ('#FFFFFF', 1.0),
                                                                                               'contours': [(x, SECONDARY_COLORS[x] , 1, show_ids)]
                                                                                             }})
                                                              for x in tert_regions]))
        return settings
예제 #10
0
    def _get_modified_settings(self, name, has_timelapse=True):
        settings = BaseProcessorFrame._get_modified_settings(self, name, has_timelapse)

        # turn on tracking and event seletion
        settings.set("Processing", "tracking", True)
        settings.set("Processing", "eventselection", True)
        settings.set("General", "rendering_class", {})
        settings.set("General", "rendering", {})

        settings.set("Classification", "collectsamples", False)
        settings.set("Output", "hdf5_create_file", False)
        settings.set("Output", "events_export_gallery_images", False)

        # only primary channel for event selection
        settings.set("Processing", "secondary_featureextraction", False)
        settings.set("Processing", "secondary_classification", False)
        settings.set("General", "process_secondary", False)
        settings.set("Processing", "tertiary_featureextraction", False)
        settings.set("Processing", "tertiary_classification", False)
        settings.set("General", "process_tertiary", False)
        settings.set("Processing", "merged_classification", False)
        settings.set("General", "process_merged", False)

        show_ids = settings.get("Output", "rendering_contours_showids")
        show_ids_class = settings.get("Output", "rendering_class_showids")

        render_contours = {
            PrimaryChannel.NAME: {"raw": ("#FFFFFF", 1.0), "contours": {"primary": ("#FF0000", 1, show_ids)}}
        }

        render_class = {
            PrimaryChannel.NAME: {
                "raw": ("#FFFFFF", 1.0),
                "contours": [("primary", "class_label", 1, False), ("primary", "#000000", 1, show_ids_class)],
            }
        }

        # setting up primary channel and live rendering
        if settings.get("EventSelection", "unsupervised_event_selection"):
            settings.set("Processing", "primary_featureextraction", True)
            settings.set("Processing", "primary_classification", True)
            settings.set("Processing", "secondary_classification", False)
            settings.set("Processing", "tertiary_classification", False)
            settings.set("Processing", "merged_classification", False)
            settings.set("General", "rendering", {"primary_contours": render_contours})

        elif settings.get("EventSelection", "supervised_event_selection"):
            settings.set("Processing", "primary_featureextraction", True)
            settings.set("Processing", "primary_classification", True)
            settings.set("General", "rendering_class", {"primary_classification": render_class})
        return settings
예제 #11
0
파일: classification.py 프로젝트: jni/cecog
    def _get_modified_settings(self, name, has_timelapse=True):
        settings = BaseProcessorFrame._get_modified_settings( \
            self, name, has_timelapse)

        settings.set('Processing', 'primary_classification', False)
        settings.set('Processing', 'secondary_classification', False)
        settings.set('Processing', 'tracking', False)
        settings.set('Classification', 'collectsamples', False)
        settings.set('General', 'rendering', {})
        settings.set('General', 'rendering_class', {})
        settings.set('Output', 'events_export_gallery_images', False)
        settings.set('Output', 'hdf5_create_file', False)
        settings.set('Output', 'rendering_channel_gallery', False)

        current_tab = self._tab.current_index
        if current_tab == 0:
            prefix = 'primary'
            settings.set('Processing', 'primary_featureextraction', True)
            settings.set('Processing', 'secondary_featureextraction', False)
            settings.set('Processing', 'tertiary_featureextraction', False)
            settings.set('General', 'process_secondary', False)
            settings.set('General', 'process_tertiary', False)
            settings.set('General', 'process_merged', False)
            rdn = {"%s_%s" %(prefix, settings.get("Classification",
                                                  "%s_classification_regionname" %prefix)): {}}
        elif current_tab == 1:
            prefix = 'secondary'
            settings.set('Processing', 'primary_featureextraction', False)
            settings.set('Processing', 'secondary_featureextraction', True)
            settings.set('General', 'process_secondary', True)
            settings.set('Processing', 'tertiary_featureextraction', False)
            settings.set('General', 'process_tertiary', False)
            settings.set('General', 'process_merged', False)

            # to setup the rending of the image currently processed
            rdn = {"%s_%s" %(prefix, settings.get("Classification",
                                                  "%s_classification_regionname" %prefix)): {}}
        elif current_tab == 2:
            prefix = 'tertiary'
            seg_region = settings.get('Classification',
                                      'tertiary_classification_regionname')
            settings.set('Processing', 'primary_featureextraction', False)
            settings.set('Processing', 'secondary_featureextraction', False)
            settings.set('General', 'process_secondary', True)
            settings.set('Processing', 'tertiary_featureextraction', True)
            settings.set('General', 'process_tertiary', True)
            settings.set('General', 'process_merged', False)

            rdn = {"%s_%s" %(prefix, settings.get("Classification",
                                                  "%s_classification_regionname" %prefix)): {}}
        else:
            # checkboxes in merged channel tab
            pch = settings.get('Classification', 'merge_primary')
            sch = settings.get('Classification', 'merge_secondary')
            tch = settings.get('Classification', 'merge_tertiary')

            settings.set('Processing', 'primary_featureextraction', pch)
            settings.set('Processing', 'secondary_featureextraction', sch)
            settings.set('General', 'process_secondary', sch)
            settings.set('Processing', 'tertiary_featureextraction', tch)
            settings.set('General', 'process_tertiary', tch)
            settings.set('General', 'process_merged', True)
            prefix = 'merged'

            rdn = {}
            for pfx in (CH_PRIMARY+CH_OTHER):
                if settings.get("Classification", "merge_%s" %pfx):
                    rdn["%s_%s" %(pfx, settings.get("Classification","merged_%s_region" %pfx))] = {}


        settings.set('Classification', 'collectsamples_prefix', prefix)
        if name == self.TESTING:
            rdn = dict()
            settings.set('Processing', '%s_classification' % prefix, True)
            settings.set('General', 'rendering_class',
                         self._class_rendering_params(prefix, settings))
        else:
            settings.set('Classification', 'collectsamples', True)
            settings.set('General', 'positions', '')
        settings.set('General', 'rendering', rdn)
        return settings
예제 #12
0
    def _get_modified_settings(self, name, has_timelapse=True):
        settings = BaseProcessorFrame._get_modified_settings( \
            self, name, has_timelapse)

        settings.set('Processing', 'primary_classification', False)
        settings.set('Processing', 'secondary_classification', False)
        settings.set('Processing', 'tracking', False)
        settings.set('Classification', 'collectsamples', False)
        settings.set('General', 'rendering', {})
        settings.set('General', 'rendering_class', {})
        settings.set('Output', 'events_export_gallery_images', False)
        settings.set('Output', 'hdf5_create_file', False)
        settings.set('Output', 'rendering_channel_gallery', False)

        current_tab = self._tab.current_index
        if current_tab == 0:
            prefix = 'primary'
            settings.set('Processing', 'primary_featureextraction', True)
            settings.set('Processing', 'secondary_featureextraction', False)
            settings.set('Processing', 'tertiary_featureextraction', False)
            settings.set('General', 'process_secondary', False)
            settings.set('General', 'process_tertiary', False)
            settings.set('General', 'process_merged', False)
            rdn = {
                "%s_%s" % (prefix,
                           settings.get(
                               "Classification", "%s_classification_regionname" % prefix)):
                {}
            }
        elif current_tab == 1:
            prefix = 'secondary'
            settings.set('Processing', 'primary_featureextraction', False)
            settings.set('Processing', 'secondary_featureextraction', True)
            settings.set('General', 'process_secondary', True)
            settings.set('Processing', 'tertiary_featureextraction', False)
            settings.set('General', 'process_tertiary', False)
            settings.set('General', 'process_merged', False)

            # to setup the rending of the image currently processed
            rdn = {
                "%s_%s" % (prefix,
                           settings.get(
                               "Classification", "%s_classification_regionname" % prefix)):
                {}
            }
        elif current_tab == 2:
            prefix = 'tertiary'
            seg_region = settings.get('Classification',
                                      'tertiary_classification_regionname')
            settings.set('Processing', 'primary_featureextraction', False)
            settings.set('Processing', 'secondary_featureextraction', False)
            settings.set('General', 'process_secondary', True)
            settings.set('Processing', 'tertiary_featureextraction', True)
            settings.set('General', 'process_tertiary', True)
            settings.set('General', 'process_merged', False)

            rdn = {
                "%s_%s" % (prefix,
                           settings.get(
                               "Classification", "%s_classification_regionname" % prefix)):
                {}
            }
        else:
            # checkboxes in merged channel tab
            pch = settings.get('Classification', 'merge_primary')
            sch = settings.get('Classification', 'merge_secondary')
            tch = settings.get('Classification', 'merge_tertiary')

            settings.set('Processing', 'primary_featureextraction', pch)
            settings.set('Processing', 'secondary_featureextraction', sch)
            settings.set('General', 'process_secondary', sch)
            settings.set('Processing', 'tertiary_featureextraction', tch)
            settings.set('General', 'process_tertiary', tch)
            settings.set('General', 'process_merged', True)
            prefix = 'merged'

            rdn = {}
            for pfx in (CH_PRIMARY + CH_OTHER):
                if settings.get("Classification", "merge_%s" % pfx):
                    rdn["%s_%s" %
                        (pfx,
                         settings.get("Classification",
                                      "merged_%s_region" % pfx))] = {}

        settings.set('Classification', 'collectsamples_prefix', prefix)
        if name == self.PROCESS_TESTING:
            rdn = dict()
            settings.set('Processing', '%s_classification' % prefix, True)
            settings.set('General', 'rendering_class',
                         self._class_rendering_params(prefix, settings))
        else:
            settings.set('Classification', 'collectsamples', True)
            settings.set('General', 'positions', '')
        settings.set('General', 'rendering', rdn)
        return settings
예제 #13
0
    def _get_modified_settings(self, name, has_timelapse=True):
        settings = BaseProcessorFrame._get_modified_settings(
            self, name, has_timelapse)

        settings.set_section('ObjectDetection')
        prim_id = PrimaryChannel.NAME

        settings.set_section('Processing')
        settings.set2('tracking', True)
        settings.set2('tracking_synchronize_trajectories', False)
        settings.set_section('Tracking')
        region_name = settings.get2('tracking_regionname')
        settings.set_section('General')
        settings.set2('rendering_class', {})
        settings.set2('rendering', {})
        settings.set_section('Classification')
        settings.set2('collectsamples', False)

        settings.set('Output', 'hdf5_create_file', False)
        show_ids = settings.get('Output', 'rendering_contours_showids')
        show_ids_class = settings.get('Output', 'rendering_class_showids')

        if name == self.PROCESS_TRACKING:
            # tracking only invokes the primary channel
            settings.set_section('Processing')
            settings.set2('primary_classification', False)
            settings.set2('primary_featureextraction', True)

            settings.set2('secondary_processChannel', False)
            settings.set2('secondary_featureextraction', False)
            settings.set2('secondary_classification', False)

            settings.set2('tertiary_processChannel', False)
            settings.set2('tertiary_featureextraction', False)
            settings.set2('tertiary_classification', False)

            settings.set2('merged_processChannel', False)
            settings.set2('merged_classification', False)

            settings.set('Output', 'events_export_gallery_images', False)
            settings.set(
                'General', 'rendering', {
                    'primary_contours': {
                        PrimaryChannel.NAME: {
                            'raw': ('#FFFFFF', 1.0),
                            'contours': {
                                region_name: ('#FF0000', 1, show_ids)
                            }
                        }
                    }
                })
        else:
            settings.set_section('Processing')
            settings.set2('primary_featureextraction', True)
            settings.set2('primary_classification', True)
            settings.set2('tracking_synchronize_trajectories', True)
            cl_rnd = {
                'primary_classification': {
                    PrimaryChannel.NAME: {
                        'raw': ('#FFFFFF', 1.0),
                        'contours': [('primary', 'class_label', 1, False),
                                     ('primary', '#000000', 1, show_ids_class)]
                    }
                },
            }
            settings.set('General', 'rendering_class', cl_rnd)

            settings.set_section('Processing')
            self._channel_render_settings(settings, SecondaryChannel.NAME,
                                          show_ids_class)
            self._channel_render_settings(settings, TertiaryChannel.NAME,
                                          show_ids_class)
            self._channel_render_settings(settings, MergedChannel.NAME,
                                          show_ids_class)

        return settings
예제 #14
0
    def _get_modified_settings(self, name, has_timelapse=True):
        settings = BaseProcessorFrame._get_modified_settings(self, name, has_timelapse)

        settings.set_section('ObjectDetection')
        prim_id = PrimaryChannel.NAME
        sec_id = SecondaryChannel.NAME
        #sec_regions = settings.get2('secondary_regions')
        settings.set_section('Processing')
        settings.set2('primary_classification', False)
        settings.set2('secondary_classification', False)
        settings.set2('tracking', False)
        settings.set_section('Classification')
        settings.set2('collectsamples', False)
        settings.set('General', 'rendering', {})
        settings.set('General', 'rendering_class', {})
        settings.set('Output', 'events_export_gallery_images', False)

        show_ids_class = settings.get('Output', 'rendering_class_showids')

        current_tab = self._tab.currentIndex()
        if current_tab == 0:
            settings.set('Processing', 'primary_featureextraction', True)
            settings.set('Processing', 'secondary_featureextraction', False)
            settings.set_section('Classification')
            settings.set2('collectsamples_prefix', 'primary')
            settings.set('Processing', 'secondary_processChannel', False)

            if name == self.PROCESS_TESTING:
                settings.set('Processing', 'primary_classification', True)
                settings.set('General', 'rendering_class', {'primary_classification': {prim_id: {'raw': ('#FFFFFF', 1.0),
                                                                                                 'contours': [('primary', 'class_label', 1, False),
                                                                                                              ('primary', '#000000', 1, show_ids_class),
                                                                                                              ]}}})
            else:
                settings.set2('collectsamples', True)
                settings.set('General', 'positions', '')
                settings.set('General', 'framerange_begin', 0)
                settings.set('General', 'framerange_end', 0)

        else:
            settings.set('Processing', 'primary_featureextraction', False)
            settings.set('Processing', 'secondary_featureextraction', True)
            settings.set_section('Classification')
            sec_region = settings.get2('secondary_classification_regionname')
            settings.set2('collectsamples_prefix', 'secondary')
            for k,v in SECONDARY_REGIONS.iteritems():
                settings.set('ObjectDetection', k, v == sec_region)
            settings.set('Processing', 'secondary_processchannel', True)
            if name == self.PROCESS_TESTING:
                settings.set('Processing', 'secondary_classification', True)
                settings.set('General', 'rendering_class', {'secondary_classification_%s' % sec_region: {sec_id: {'raw': ('#FFFFFF', 1.0),
                                                                                                                  'contours': [(sec_region, 'class_label', 1, False),
                                                                                                                               (sec_region, '#000000', 1, show_ids_class),
                                                                                                                               ]}}})
            else:
                settings.set2('collectsamples', True)
                settings.set('General', 'positions', '')
                settings.set('General', 'framerange_begin', 0)
                settings.set('General', 'framerange_end', 0)

        return settings