def setup(): from glue.logger import logger from glue.config import tool_registry from glue.viewers.image.qt import ImageWidget from .contour_selection import ContourSelectionTool tool_registry.add(ContourSelectionTool, widget_cls=ImageWidget) logger.info("Loaded VizieR importer plugin")
from glue.config import tool_registry from glue.qt.widgets import ImageWidget import sys sys.path.insert(0,'.') from galfaglue import loaders from galfaglue import viewers from galfaglue import spectra from galfaglue.plugin import GALFASpectrumTool try: tool_registry.add(GALFASpectrumTool, widget_cls=ImageWidget) except TypeError: tool_registry.add(GALFASpectrumTool, restrict_to=ImageWidget)
self._shape_tag = tag obj = self.parent_canvas.getObjectByTag(tag) roi = ginga_graphic_to_roi(obj) return self._update_from_roi(roi) def _setup_mouse_mode(self): # XXX fix this ugliness class Dummy: def clear(self): pass return Dummy() tool_registry.add(GingaPVSlicer, GingaWidget) tool_registry.add(GingaSpectrumTool, GingaWidget) def cmap2pixmap(cmap, steps=50): """Convert a Ginga colormap into a QtGui.QPixmap :param cmap: The colormap to use :type cmap: Ginga colormap instance (e.g. ginga.cmap.get_cmap('gray')) :param steps: The number of color steps in the output. Default=50 :type steps: int :rtype: QtGui.QPixmap """ inds = np.linspace(0, 1, steps) n = len(cmap.clst) - 1
return self._shape_tag = tag obj = self.parent_canvas.getObjectByTag(tag) roi = ginga_graphic_to_roi(obj) return self._update_from_roi(roi) def _setup_mouse_mode(self): # XXX fix this ugliness class Dummy: def clear(self): pass return Dummy() tool_registry.add(GingaPVSlicer, GingaWidget) tool_registry.add(GingaSpectrumTool, GingaWidget) def cmap2pixmap(cmap, steps=50): """Convert a Ginga colormap into a QtGui.QPixmap :param cmap: The colormap to use :type cmap: Ginga colormap instance (e.g. ginga.cmap.get_cmap('gray')) :param steps: The number of color steps in the output. Default=50 :type steps: int :rtype: QtGui.QPixmap """ inds = np.linspace(0, 1, steps) n = len(cmap.clst) - 1
def activate(self): return class SpectrumExtractorMode(RoiMode): """ Let's the user select a region in an image and, when connected to a SpectrumExtractorTool, uses this to display spectra extracted from that position """ persistent = True def __init__(self, axes, **kwargs): super(SpectrumExtractorMode, self).__init__(axes, **kwargs) self.icon = QIcon('cube_spectrum') self.mode_id = 'MySpectrum' self.action_text = 'MySpectrum' self.tool_tip = 'Extract a spectrum from the selection' self._roi_tool = qt_roi.QtRectangularROI(self._axes) self._roi_tool.plot_opts.update(edgecolor='#00ff00', facecolor=None, edgewidth=3, alpha=1.0) self.shortcut = 'S' # tool_registry.add(MySpectrumTool, widget_cls=ImageWidget) tool_registry.add(SpecViewTool, widget_cls=ImageWidget)
def setup(): from glue.config import tool_registry from glue.viewers.image.qt import ImageWidget from glue.plugins.tools.spectrum_tool.qt import SpectrumTool tool_registry.add(SpectrumTool, widget_cls=ImageWidget)
def setup(): from glue.config import tool_registry from glue.viewers.image.qt import ImageWidget from glue.plugins.tools.pv_slicer.qt import PVSlicerTool tool_registry.add(PVSlicerTool, widget_cls=ImageWidget)
def setup(): from glue.config import tool_registry from glue.qt.widgets import ImageWidget tool_registry.add(PVSlicerTool, widget_cls=ImageWidget)