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 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_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 datasets: Iterable[MixedDataset | StrictDataset]¶
- get_active_stack_visualisers() List[StackVisualiserView] [source]¶
- get_all_stack_visualisers_with_180deg_proj() List[StackVisualiserView] [source]¶
- get_stack_visualiser(stack_id: UUID) StackVisualiserView [source]¶
- get_stack_with_images(images: Images) StackVisualiserView [source]¶
- load_dataset(par: LoadingParameters | None = None) None [source]¶
- notify(signal: Notification, **baggage)[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.
- view: MainWindowView¶