mantidimaging.gui.windows.main.presenter module#

class mantidimaging.gui.windows.main.presenter.DatasetId(id, name)[source]#

Bases: NamedTuple

id: UUID#

Alias for field number 0

name: str#

Alias for field number 1

class mantidimaging.gui.windows.main.presenter.MainWindowPresenter(view: MainWindowView)[source]#

Bases: BasePresenter

LOAD_ERROR_STRING = 'Failed to load stack. Error: {}'#
SAVE_ERROR_STRING = 'Failed to save data. Error: {}'#
property active_stacks: dict[UUID, StackVisualiserView]#
add_180_deg_file_to_dataset(dataset_id: UUID, _180_deg_file: str)[source]#

Loads a 180 file then adds it to the dataset, creates a stack window, and updates the dataset tree view. :param dataset_id: The ID of the dataset to update. :param _180_deg_file: The filename for the 180 file.

add_alternative_180_if_required(dataset: StrictDataset)[source]#

Checks if the dataset has a 180 projection and tries to find an alternative if one is missing. :param dataset: The loaded dataset.

add_child_item_to_tree_view(parent_id: UUID, child_id: UUID, child_name: str)[source]#

Adds a child item to the tree view. :param parent_id: The ID of the parent dataset. :param child_id: The ID of the corresponding ImageStack object. :param child_name: The name that should appear in the tree view.

add_log_to_sample(stack_id: UUID, log_file: Path) None[source]#
add_projection_angles_to_sample(stack_id: UUID, proj_angles: ProjectionAngles) None[source]#
add_recon_item_to_tree_view(parent_id: UUID, child_id: UUID, name: str)[source]#

Adds a recon item to the tree view. :param parent_id: The ID of the parent dataset. :param child_id: The ID of the corresponding ImageStack object. :param name: The name to display for the recon in the tree view.

add_sinograms_to_dataset_and_update_view(sino_stack: ImageStack, original_stack_id: UUID)[source]#

Adds sinograms to a dataset or replaces an existing one. :param sino_stack: The sinogram stack. :param original_stack_id: The ID of a stack in the dataset.

add_stack_to_dictionary(stack: StackVisualiserView) None[source]#
property all_dataset_ids: Iterable[UUID]#
property all_stack_ids: Iterable[UUID]#
create_mixed_dataset_stack_windows(dataset: MixedDataset) StackVisualiserView[source]#

Creates stack windows for a mixed dataset. :param dataset: The dataset object. :return: The first stack visualiser from the dataset.

create_mixed_dataset_tree_view_items(dataset: MixedDataset)[source]#

Creates the tree view items for a mixed dataset. :param dataset: The loaded dataset.

create_single_tabbed_images_stack(images: ImageStack) StackVisualiserView[source]#

Creates a stack for a single ImageStack object and focuses on it. :param images: The ImageStack object for the new stack window. :return: The new StackVisualiserView.

create_strict_dataset_stack_windows(dataset: StrictDataset) StackVisualiserView[source]#

Creates the stack widgets for the strict dataset. :param dataset: The loaded dataset. :return: The stack widget for the sample.

create_strict_dataset_tree_view_items(dataset: StrictDataset)[source]#

Creates the tree view items for a strict dataset. :param dataset: The loaded dataset.

property datasets: Iterable[MixedDataset | StrictDataset]#
do_update_UI() None[source]#
get_active_stack_visualisers() list[StackVisualiserView][source]#
get_all_180_projections() list[ImageStack][source]#
get_all_stacks() list[ImageStack][source]#
get_dataset(dataset_id: UUID) MixedDataset | StrictDataset | None[source]#
get_dataset_id_for_stack(stack_id: UUID) UUID[source]#
get_stack(stack_id: UUID) ImageStack[source]#
get_stack_id_by_name(search_name: str) UUID | None[source]#
get_stack_visualiser(stack_id: UUID) StackVisualiserView[source]#
get_stack_visualiser_history(stack_id: UUID) dict[str, Any][source]#
get_stack_with_images(images: ImageStack) StackVisualiserView[source]#
property have_active_stacks: bool#
is_dataset_strict(ds_id: UUID) bool[source]#
load_image_files() None[source]#
load_image_stack(file_path: str) None[source]#
load_nexus_file() None[source]#
load_stacks_from_folder(file_path: str) bool[source]#
notify(signal: Notification, **baggage)[source]#
remove_item_from_tree_view(uuid_remove: UUID) None[source]#

Removes an item from the tree view using a given ID. :param uuid_remove: The ID of the item to remove.

replace_child_item_id(dataset_id: UUID, prev_id: UUID, new_id: UUID)[source]#

Replaces the ID in an existing child item. :param dataset_id: The ID of the parent dataset. :param prev_id: The previous ID of the tree view item. :param new_id: The new ID that should be given to the tree view item.

save_image_files() None[source]#
save_nexus_file()[source]#
show_operation(operation_name: str) None[source]#
property stack_visualiser_list: list[StackId]#
property stack_visualiser_names: list[str]#
property strict_dataset_list: list[DatasetId]#
static use_fusion_dark_mode() None[source]#
static use_fusion_light_mode() None[source]#
view: MainWindowView#
wizard_action_load() None[source]#
wizard_action_show_reconstruction() None[source]#
class mantidimaging.gui.windows.main.presenter.Notification(value)[source]#

Bases: Enum

An enumeration.

ADD_RECON = 8#
DATASET_ADD = 10#
FOCUS_TAB = 7#
IMAGE_FILE_LOAD = 1#
IMAGE_FILE_SAVE = 2#
MOVE_STACK = 13#
NEXUS_LOAD = 5#
NEXUS_SAVE = 6#
REMOVE_STACK = 3#
RENAME_STACK = 4#
SHOW_ADD_STACK_DIALOG = 9#
SHOW_MOVE_STACK_DIALOG = 12#
TAB_CLICKED = 11#
class mantidimaging.gui.windows.main.presenter.StackId(id, name)[source]#

Bases: NamedTuple

id: UUID#

Alias for field number 0

name: str#

Alias for field number 1