mantidimaging.gui.windows.main.presenter module#

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_alternative_180_if_required(dataset: Dataset) None[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_images_to_existing_dataset(dataset_id: UUID, new_images: ImageStack, images_type: str)[source]#
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_shuttercounts_to_sample(stack_id: UUID, shuttercount_file: Path) None[source]#
add_sinograms_to_dataset_and_update_view(sino_stack: ImageStack, original_stack_id: UUID) None[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_dataset_stack_visualisers(dataset: Dataset) StackVisualiserView[source]#

Creates the StackVisualiserView widgets for a new 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.

property datasets: Iterable[Dataset]#
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) Dataset | 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]#
handle_add_images_to_existing_dataset_from_dialog() None[source]#

Adds / replaces images to an existing dataset. Updates the tree view and deletes the previous stack if necessary.

property have_active_stacks: bool#
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.

save_image_files() None[source]#
save_nexus_file() None[source]#
show_operation(operation_name: str) None[source]#
property stack_visualiser_list: list[StackId]#
property stack_visualiser_names: list[str]#
update_dataset_tree() None[source]#
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, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

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