diff options
Diffstat (limited to 'silx/gui/data/DataViews.py')
-rw-r--r-- | silx/gui/data/DataViews.py | 46 |
1 files changed, 10 insertions, 36 deletions
diff --git a/silx/gui/data/DataViews.py b/silx/gui/data/DataViews.py index 6575d0d..664090d 100644 --- a/silx/gui/data/DataViews.py +++ b/silx/gui/data/DataViews.py @@ -893,53 +893,27 @@ class _Plot3dView(DataView): label="Cube", icon=icons.getQIcon("view-3d")) try: - import silx.gui.plot3d #noqa + from ._VolumeWindow import VolumeWindow # noqa except ImportError: - _logger.warning("Plot3dView is not available") + _logger.warning("3D visualization is not available") _logger.debug("Backtrace", exc_info=True) raise self.__resetZoomNextTime = True def createWidget(self, parent): - from silx.gui.plot3d import ScalarFieldView - from silx.gui.plot3d import SFViewParamTree + from ._VolumeWindow import VolumeWindow - plot = ScalarFieldView.ScalarFieldView(parent) + plot = VolumeWindow(parent) plot.setAxesLabels(*reversed(self.axesNames(None, None))) - - def computeIsolevel(data): - data = data[numpy.isfinite(data)] - if len(data) == 0: - return 0 - else: - return numpy.mean(data) + numpy.std(data) - - plot.addIsosurface(computeIsolevel, '#FF0000FF') - - # Create a parameter tree for the scalar field view - options = SFViewParamTree.TreeView(plot) - options.setSfView(plot) - - # Add the parameter tree to the main window in a dock widget - dock = qt.QDockWidget() - dock.setWidget(options) - plot.addDockWidget(qt.Qt.RightDockWidgetArea, dock) - return plot def clear(self): - self.getWidget().setData(None) + self.getWidget().clear() self.__resetZoomNextTime = True - def normalizeData(self, data): - data = DataView.normalizeData(self, data) - data = _normalizeComplex(data) - return data - def setData(self, data): data = self.normalizeData(data) - plot = self.getWidget() - plot.setData(data) + self.getWidget().setData(data) self.__resetZoomNextTime = False def axesNames(self, data, info): @@ -973,10 +947,10 @@ class _ComplexImageView(DataView): def createWidget(self, parent): from silx.gui.plot.ComplexImageView import ComplexImageView widget = ComplexImageView(parent=parent) - widget.setColormap(self.defaultColormap(), mode=ComplexImageView.Mode.ABSOLUTE) - widget.setColormap(self.defaultColormap(), mode=ComplexImageView.Mode.SQUARE_AMPLITUDE) - widget.setColormap(self.defaultColormap(), mode=ComplexImageView.Mode.REAL) - widget.setColormap(self.defaultColormap(), mode=ComplexImageView.Mode.IMAGINARY) + widget.setColormap(self.defaultColormap(), mode=ComplexImageView.ComplexMode.ABSOLUTE) + widget.setColormap(self.defaultColormap(), mode=ComplexImageView.ComplexMode.SQUARE_AMPLITUDE) + widget.setColormap(self.defaultColormap(), mode=ComplexImageView.ComplexMode.REAL) + widget.setColormap(self.defaultColormap(), mode=ComplexImageView.ComplexMode.IMAGINARY) widget.getPlot().getColormapAction().setColorDialog(self.defaultColorDialog()) widget.getPlot().getIntensityHistogramAction().setVisible(True) widget.getPlot().setKeepDataAspectRatio(True) |