Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GUI] Add silx histogram action #1046

Merged
merged 5 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion PyMca5/PyMcaGui/io/hdf5/Hdf5NodeView.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,17 @@ def __init__(self, parent=None):
method="getPlugin2DInstance",
directoryList=PLUGINS_DIR)
self._toolbar.addWidget(pluginsToolButton)
if hasattr(self, "getIntensityHistogramAction"):
self.getIntensityHistogramAction().setVisible(True)
else:
print("Plot2D getIntensityHistogramAction missing")


class Plot2DViewWithPlugins(DataViews._Plot2dView):
def createWidget(self, parent):
widget = Plot2DWithPlugins(parent=parent)
widget.setDefaultColormap(self.defaultColormap())
widget.getColormapAction().setColorDialog(self.defaultColorDialog())
widget.getIntensityHistogramAction().setVisible(True)
widget.setKeepDataAspectRatio(False)
widget.getXAxis().setLabel('X')
widget.getYAxis().setLabel('Y')
Expand Down
9 changes: 7 additions & 2 deletions PyMca5/PyMcaGui/plotting/SilxMaskImageWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,11 @@ def __init__(self, parent=None):
PlotActions.ColormapAction(plot=self.plot, parent=self))
self.addAction(self.colormapAction)

self.pixelIntensitiesHistoAction = self.group.addAction(
PlotActions.PixelIntensitiesHistoAction(plot=self.plot, parent=self))
self.addAction(self.pixelIntensitiesHistoAction)
self.pixelIntensitiesHistoAction.setVisible(True)

self.copyAction = self.group.addAction(
PlotActions.CopyAction(plot=self.plot, parent=self))
self.addAction(self.copyAction)
Expand Down Expand Up @@ -675,8 +680,8 @@ def _createToolBar(self, title, parent):
index = objects.index(self.colormapAction)
objects.insert(index + 1, self.keepDataAspectRatioButton)
objects.insert(index + 2, self.yAxisInvertedButton)
objects.insert(index + 3, self.saveToolbutton)
objects.insert(index + 4, self.backgroundButton)
objects.insert(index + 4, self.saveToolbutton)
objects.insert(index + 5, self.backgroundButton)
for obj in objects:
if isinstance(obj, qt.QAction):
toolbar.addAction(obj)
Expand Down
2 changes: 1 addition & 1 deletion PyMca5/PyMcaGui/pymca/PyMcaImageWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def _addImageClicked(self):
self._connectCorrelator()
if self._imageData is None:
return
if self._imageData == []:
if len(self._imageData) == 0:
return

if not RGBImageCalculator.RGBImageCalculator._addImageClicked(self):
Expand Down
2 changes: 1 addition & 1 deletion PyMca5/PyMcaGui/pymca/RGBImageCalculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def _addImageClicked(self):
_logger.debug("Add image clicked")
if self._imageData is None:
return
if self._imageData == []:
if len(self._imageData) == 0:
return
text = "%s" % self.name.text()
if not len(text):
Expand Down