Beispiel #1
0
 def __init__(self, bbox, colorbar=None,
              loc_signal=None, image_signal=None, props_signal=None,
              overlay=None, **traits):
     """
     Parameters
     ----------
     bbox : iterable
         the {x,y,z} limits of the volume in which to plot an overlay
     colorbar : ColorbarPanel object (optional)
         a Qt4 widget with a color table mapping the overlay values
     loc_signal : QtCore.pyqtSignal (optional)
         optional PyQt4 callback signal to emit when peak finding
         (call pattern is loc_signal.emit(x,y,z))
     image_signal : QtCore.pyqtSignal (optional)
         optional PyQt4 callback signal to emit when updating the image
         (call pattern is image_signal.emit(self))
     props_signal : QtCore.pyqtSignal (optional)
         optional PyQt4 callback signal to emit when only updating
         image mapping properties
     overlay : str, NIPY Image (optional)
         some version of the data to be overlaid
     """
     OverlayInterface.__init__(self,
                               loc_signal=loc_signal,
                               props_signal=props_signal,
                               image_signal=image_signal,
                               **traits)
     self.bbox = bbox
     self.threshold = ThresholdMap()
     self.connect_colorbar(colorbar)
     if overlay:
         self.set_ndimage_data(overlay)
    def __init__(self, bbox,
                 image_signal=None,
                 loc_signal=None,
                 props_signal=None,
                 beam_vox_signal=None,
                 **traits):
        """
        Create a TFBeamManager

        Parameters
        ----------
        bbox : iterable
            the {x,y,z} limits of the enrounding volume box to which TFBeam
            overlays will be mapped.
        loc_signal : QtCore.pyqtSignal
            optional PyQt4 callback signal to emit when peak finding
            (call pattern is loc_signal.emit(x,y,z))
        props_signal : QtCore.pyqtSignal
            optional PyQt4 callback signal to emit when image colormapping
            properties change
        image_signal : QtCore.pyqtSignal
            optional PyQt4 callback signal to emit when updating the image
            (call pattern is image_signal.emit(self))
        beam_vox_signal : QtCore.pyqtSignal
            optional PyQt4 callback signal to emit when the current TFBeam
            voxel list index has changed. (call pattern is beam_vox_signal(vox))
        """
        self.bbox = bbox
        self.beam = None
        # want to start out with larger alpha, unless requested differently
        if 'alpha_scale' not in traits:
            traits['alpha_scale'] = 2.0
        OverlayInterface.__init__(self,
                                  loc_signal=loc_signal,
                                  props_signal=props_signal,
                                  image_signal=image_signal,
                                  **traits)
        self.beam_vox_signal = beam_vox_signal
        self._max_radius = np.round(maximum_world_distance(bbox))
        self.__needs_refresh = False
        self.bstats_manager.tfbeam_man = self
        self.bstats_manager.on_trait_change(self._lame_coupling,
                                            'thresh_changed')