def display (image, palette_name = "grayscale", title = None , color_index_max = None) :
    """
    """

    w = SlideViewer()

    if not isinstance(image,SpatialImage):
        image = SpatialImage(image)

    if image.ndim < 3 :
        image = image.reshape(image.shape + (1,))

    if color_index_max is None :
        cmax = image.max()
    else :
        cmax = color_index_max

    palette = palette_factory(palette_name,cmax)

    w.set_palette(palette,palette_name)
    w.set_image(image)

    w.set_title(title)

    w.show()
    return w
def display (image, palette_name = "grayscale", title = None , color_index_max = None) :
    """
    """

    w = SlideViewer()

    if not isinstance(image,SpatialImage):
        image = SpatialImage(image)

    if image.ndim < 3 :
        image = image.reshape(image.shape + (1,))

    if color_index_max is None :
        cmax = image.max()
    else :
        cmax = color_index_max

    palette = palette_factory(palette_name,cmax)

    w.set_palette(palette,palette_name)
    w.set_image(image)

    w.set_title(title)

    w.show()
    return w
    def change_palette(self, palette_name):
        if palette_name == self._palette_name:
            return

        self._palette_name = palette_name
        self.emit_stack_changed()

        img = self._im_view.image()
        if img is None:
            return

        palette = palette_factory(palette_name, img.max())
        self._im_view.set_palette(palette, self.axis)
        self.update_pix()
def point_selection (image, palette_name = "grayscale", color_index_max = None) :
    
    if not isinstance(image,SpatialImage):
        image = SpatialImage(image)

    w = PointSelection()
    w.set_image(image)
    if color_index_max is None :
        cmax = image.max()
    else :
        cmax = color_index_max
    palette = palette_factory(palette_name,cmax)
    w.set_palette(palette)
    w.show()
    return w
def point_selection(image, palette_name="grayscale", color_index_max=None):

    if not isinstance(image, SpatialImage):
        image = SpatialImage(image)

    w = PointSelection()
    w.set_image(image)
    if color_index_max is None:
        cmax = image.max()
    else:
        cmax = color_index_max
    palette = palette_factory(palette_name, cmax)
    w.set_palette(palette)
    w.show()
    return w
 def palette_name_changed (self, palette_index) :
     palname = str(self._palette_select.currentText() )
     img = self._view.image()
     if img is not None :
         self.set_palette(palette_factory(str(palname),img.max() ) )
 def palette_name_changed(self, palette_index):
     palname = str(self._palette_select.currentText())
     img = self._view.image()
     if img is not None:
         self.set_palette(palette_factory(str(palname), img.max()))