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 stack. 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. :return: The 180 Images object if loading was successful, None otherwise.

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 Images object. :param child_name: The name that should appear in the tree view.

add_log_to_sample(stack_name: str, log_file: str) None[source]
add_projection_angles_to_sample(stack_name: str, proj_angles: ProjectionAngles) None[source]
add_recon_item_to_tree_view(parent_id: UUID, child_id: UUID, recon_count: int)[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 Images object. :param recon_count: The number of the recon in the dataset. One indicates the first recon that has been added.

add_sinograms_to_dataset_and_update_view(sino_stack: Images, 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]
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: Images) StackVisualiserView[source]

Creates a stack for a single Images object and focuses on it. :param images: The Images 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 dataset_list: List[DatasetId]
property datasets: Iterable[MixedDataset | StrictDataset]
get_active_stack_visualisers() List[StackVisualiserView][source]
get_all_180_projections() List[Images][source]
get_all_stack_visualisers_with_180deg_proj() List[StackVisualiserView][source]
get_all_stacks() List[Images][source]
get_stack(stack_id: UUID) Images[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: Images) StackVisualiserView[source]
property have_active_stacks: bool
load_dataset(par: LoadingParameters | None = None) 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]
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() None[source]
set_images_in_stack(stack_id: UUID, images: Images) None[source]
show_operation(operation_name: str) None[source]
property stack_visualiser_list: List[StackId]
property stack_visualiser_names: List[str]
update_stack_with_images(images: Images) 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 = 7
FOCUS_TAB = 6
LOAD = 1
NEXUS_LOAD = 5
REMOVE_STACK = 3
RENAME_STACK = 4
SAVE = 2
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