Profile: Toolbars with profile tools

Utility functions, toolbars and actions to create profile on images and stacks of images

ProfileToolBar class

class ProfileToolBar(parent=None, plot=None, profileWindow=None, title=None)[source]

Bases: PyQt5.QtWidgets.QToolBar

QToolBar providing profile tools operating on a PlotWindow.

Attributes:

  • plot: Associated PlotWindow on which the profile line is drawn.
  • actionGroup: QActionGroup of available actions.

To run the following sample code, a QApplication must be initialized. First, create a PlotWindow and add a ProfileToolBar.

>>> from silx.gui.plot import PlotWindow
>>> from silx.gui.plot.Profile import ProfileToolBar
>>> plot = PlotWindow()  # Create a PlotWindow
>>> toolBar = ProfileToolBar(plot=plot)  # Create a profile toolbar
>>> plot.addToolBar(toolBar)  # Add it to plot
>>> plot.show()  # To display the PlotWindow with the profile toolbar
Parameters:
  • plotPlotWindow instance on which to operate.
  • profileWindow – Plot widget instance where to display the profile curve or None to create one.
  • title (str) – See QToolBar.
  • parent – See QToolBar.
getPlotWidget()[source]

The PlotWidget associated to the toolbar.

getProfileManager()[source]

Return the manager of the profiles.

Return type:ProfileManager
getProfilePlot()[source]

Return plot widget in which the profile curve or the profile image is plotted.

getProfileMainWindow()[source]

Return window containing the profile curve widget.

This can return None if no profile was computed.

overlayColor

This method does nothing anymore. But could be implemented if needed.

It was used to set color to use for the ROI.

If set to None (the default), the overlay color is adapted to the active image colormap and changes if the active image colormap changes.

clearProfile()[source]

Remove profile curve and profile area.

updateProfile()[source]

This method does nothing anymore. But could be implemented if needed.

It was used to update the displayed profile and profile ROI.

This uses the current active image of the plot and the current ROI.

hideProfileWindow()[source]

Hide profile window.

Profile3DToolBar class

class Profile3DToolBar(parent=None, stackview=None, title=None)[source]

Bases: silx.gui.plot.Profile.ProfileToolBar

stackView = None

StackView instance