The Manager

class pumpia.module_handling.manager.Manager

Manages the data and shared widgets of the application.

Users can drag images from the treeview widgets created by a Manager into a Viewer to show that image in the viewer.

Right click menus within the treeviews have different options depending on the focus, for example:

  • copy the filepath for images loaded from files

  • show the tags of DICOM images

  • delete ROIs

patients

The set of patients.

Type:

set[Patient]

general_images

The set of general images

Type:

set[GeneralImage]

select_time

The time of the last selection.

Type:

int

focus
Type:

Patient | Study | BaseImageSet | BaseROI | None

selected

The list of selected items.

Type:

list[Patient | Study | BaseImageSet | BaseROI]

current_action

The current mouse action.

Type:

MouseOptionsType

roi_action

The current ROI action.

Type:

ROIOptionsType

viewers

The list of viewers.

Type:

list[BaseViewer]

popup_menu_options

A list containing the popup menu options for the current focus.

Type:

list[tuple[str, Callable[[], None]]]

load_folder(add: bool = True, tk_parent: tk.Misc | None = None, counter_column: int = 0, counter_row: int = 0, counter_stack_direction: DirectionType = 'Vertical') None

Loads DICOM files from a folder.

load_image(filepath: Path, add: bool = True)

Loads an image given by filepath.

load_images(files: list[Path], add: bool = True, tk_parent: tk.Misc | None = None, counter_column: int = 0, counter_row: int = 0, counter_stack_direction: DirectionType = 'Vertical') None

Loads images from a list of files.

load_dicom(open_dicom: FileDataset, file: Path) Series | Instance

Loads a DICOM file.

update_trees()

Updates the treeviews with the current data.

add_roi(roi: BaseROI, moving: bool = False)

Adds an ROI to the treeviews.

delete_current_roi()

Deletes the current focus if it is an ROI.

show_tags()

Shows the DICOM tags of the current focus if a DICOM file.

copy_filepath()

Copies the filepath of the current focus to the clipboard.

copy_filepath_as_posix()

Copies the filepath of the current focus to the clipboard in POSIX format.

copy_directory()

Copies the directory of the current focus to the clipboard.

copy_directory_as_posix()

Copies the directory of the current focus to the clipboard in POSIX format.

update_viewers(image: BaseImageSet | None = None)

Updates the viewers linked to the Manager.

get_tree_frame(parent: tk.Misc) ttk.Frame

Returns a frame containing a treeview.

get_mouse_options_combobox(parent: tk.Misc, size: Literal['full', 'reduced'] = 'full') ttk.Combobox

Returns a combobox for selecting mouse options.

set_current_action(option: MouseOptionsType)

Sets the current action.

get_roi_options_frame(parent: tk.Misc, direction: DirectionType = 'Vertical') ttk.Labelframe

Returns a frame containing ROI options.

set_current_roi_action(option: ROIOptionsType)

Sets the current ROI action.