mantidimaging.gui.widgets.mi_image_view.view module

class mantidimaging.gui.widgets.mi_image_view.view.MIImageView(parent=None, name='ImageView', view=None, imageItem=None, levelMode='mono', detailsSpanAllCols=False, *args)[source]

Bases: ImageView, BadDataOverlay, AutoColorMenu

close()[source]

Closes the widget nicely, making sure to clear the graphics scene and release memory.

details: QLabel
extend_roi_plot_mouse_press_handler()[source]
get_roi() Tuple[CloseEnoughPoint, CloseEnoughPoint][source]
property histogram: HistogramLUTItem
imageItem: ImageItem
property image_data: np.ndarray
image_hover_event(event: HoverEvent)[source]
property image_item: ImageItem
roiChanged()[source]

Re-implements the roiChanged function to expect only 3D data, and uses a faster mean calculation on the ROI view of the data, instead of the full sized data.

roiString = None
roi_changed_callback: Callable[[SensibleROI], None] | None = None
setImage(*args, **kwargs)[source]

Set the image to be displayed in the widget.

Parameters

imgnp.ndarray

The image to be displayed. See ImageItem.setImage() and notes below.

autoRangebool

Whether to scale/pan the view to fit the image.

autoLevelsbool

Whether to update the white/black levels to fit the image.

levelstuple

(min, max) white and black level values to use.

axesdict

Dictionary indicating the interpretation for each axis. This is only needed to override the default guess. Format is:

{'t':0, 'x':1, 'y':2, 'c':3};
xvalsnp.ndarray

1D array of values corresponding to the first axis in a 3D image. For video, this array should contain the time of each frame.

pos

Change the position of the displayed image

scale

Change the scale of the displayed image

transform

Set the transform of the displayed image. This option overrides pos and scale.

autoHistogramRangebool

If True, the histogram y-range is automatically scaled to fit the image data.

levelModestr

If specified, this sets the user interaction mode for setting image levels. Options are ‘mono’, which provides a single level control for all image channels, and ‘rgb’ or ‘rgba’, which provide individual controls for each channel.

Notes

For backward compatibility, image data is assumed to be in column-major order (column, row). However, most image data is stored in row-major order (row, column) and will need to be transposed before calling setImage():

imageview.setImage(imagedata.T)

This requirement can be changed by the imageAxisOrder global configuration option.

set_log_scale()[source]
set_selected_image(image_index: int)[source]
set_timeline_to_tick_nearest(x_pos_clicked)[source]
timeLineChanged()[source]

Re-implements timeLineChanged function, and the only change is that now self.updateImage will NOT auto range the histogram

toggle_jumping_frame(images_to_jump_by=None)[source]
property viewbox: ViewBox
class mantidimaging.gui.widgets.mi_image_view.view.UnrotateablePlotROI(size)[source]

Bases: ROI

Like PlotROI but does not add a rotation handle.