Example #1
0
    def __init__(self, display, watch_overlay=True, **traits):
        if 'name' not in traits:
            traits['name'] = 'Image Planes'
        VisualComponent.__init__(self, **traits)
        self.trait_setq(display=display)
        for trait in ('blender', 'func_man', 'master_src',
                      'principle_plane_colors'):
            self.add_trait(trait, DelegatesTo('display'))

        # -- GUI event, dispatch on new thread
        if watch_overlay:
            # only attach these listeners if the BlendedImages object
            # is not being controlled elsewhere
            self.on_trait_change(self._alpha_scale, 'func_man.alpha_scale',
                                 dispatch='new')
            self.on_trait_change(self._set_over_cmap, 'func_man.cmap_option',
                                 dispatch='new')
            self.on_trait_change(self._set_over_norm, 'func_man.norm',
                                 dispatch='new')

        # -- Data updates
            self.on_trait_change(self._update_colors_from_func_man,
                                 'func_man.overlay_updated')

        self.on_trait_change(self.change_colors,
                             'master_src.colors_changed')
 def __init__(self, display, **traits):
     if 'name' not in traits:
         traits['name'] = 'Overlay Surfaces'
     traits['display'] = display
     VisualComponent.__init__(self, **traits)
     for trait in ('func_man', 'master_src'):
         self.add_trait(trait, DelegatesTo('display'))
Example #3
0
 def __init__(self, display, **traits):
     if 'name' not in traits:
         traits['name'] = 'Cortical Surface'
     traits['display'] = display
     VisualComponent.__init__(self, **traits)
     for trait in ('poly_extractor', 'master_src',
                   '_planes_function', '_volume_function'):
         self.add_trait(trait, DelegatesTo('display'))
     if not self._volume_function.volume:
         self._volume_function.volume = self.master_src.data
     self.poly_extractor.implicit_function = self._volume_function
Example #4
0
    def __init__(self, display, **traits):
        if 'name' not in traits:
            traits['name'] = 'Fixed Planes'
        traits['display'] = display
        VisualComponent.__init__(self, **traits)
        for trait in ('master_src',):
            self.add_trait(trait, t.DelegatesTo('display'))
        
        # XXX: appears broken
##         self.aa = set_image_active_attribute(self.master_src)
        self.aa = mlab.pipeline.set_active_attribute(self.master_src)
        self.sync_trait('color_chan', self.aa, alias='point_scalars_name')