mantidimaging.gui.windows.main.presenter module¶
- class mantidimaging.gui.windows.main.presenter.DatasetId(id, name)[source]¶
Bases:
NamedTuple
- 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_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]¶
- 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]¶
- 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_stack(stack_id: UUID) ImageStack [source]¶
- get_stack_visualiser(stack_id: UUID) StackVisualiserView [source]¶
- get_stack_with_images(images: ImageStack) StackVisualiserView [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.
- view: MainWindowView¶
- 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¶