mantidimaging.gui.windows.live_viewer.presenter module#

class mantidimaging.gui.windows.live_viewer.presenter.LiveViewerWindowPresenter(view: LiveViewerWindowView, main_window: MainWindowView)[source]#

Bases: BasePresenter

The presenter for the Live Viewer window.

This presenter is responsible for handling user interaction with the view and updating the model and view accordingly to look after the state of the window.

clear_label() → None[source]#

Clear the label.

close() → None[source]#

Close the window.

convert_image_to_imagestack(image_data) → ImageStack[source]#

Convert the single image to an imagestack so the Operations framework can be used

display_image(image_data_obj: Image_Data) → None[source]#

Display image in the view after validating contents

handle_deleted() → None[source]#

Handle the deletion of the image.

handle_notify_roi_moved() → None[source]#
handle_roi_moved(force_clear: bool = False) → None[source]#

Recalculate mean intensity in background thread. If already running, request delayed until running calculation complete rather than having overlapping thread that could cause race condition over shared model state.

load_as_dataset() → None[source]#
static load_image_from_path(image_path: Path) → ndarray[source]#

Load a .Tif, .Tiff or .Fits file only if it exists and returns as an ndarray

model: LiveViewerWindowModel#
notify_update_image_list() → None[source]#

Notify when image list needs to be updated if not already being updated

old_image_list_paths: list[Path] = []#
op_func: Callable#
perform_operations(image_data) → ndarray[source]#
select_image(index: int) → None[source]#
set_dataset_path(path: Path) → None[source]#

Set the path to the dataset.

set_roi_enabled(enable: bool)[source]#
thread_cleanup(thread: TaskWorkerThread) → None[source]#

Handles clean thread closure and updates intensity profile with latest mean calculation. Consume pending recalculation requests if any and trigger recalculation and/or roi updates only if active thread has completed to avoid request loss or race conditions.

try_add_mean(image: Image_Data) → None[source]#
try_next_mean_chunk() → None[source]#
try_next_mean_chunk_count: int = 0#
try_next_mean_chunk_max_retry: int = 100#
update_image_list() → None[source]#

Update the image in the view.

update_image_modified(image_path: Path) → None[source]#

Update the displayed image when the file is modified

update_image_operation() → None[source]#

Reload the current image if an operation has been performed on the current image

update_intensity(spec_data: list | ndarray) → None[source]#
update_intensity_with_mean() → None[source]#
view: LiveViewerWindowView#