populse_mia.user_interface package

User interface module, encompass the main window and its tabs definition, as well as pop ups.

Contains:
Modules:
  • data_browser

  • data_viewer

  • main_window

  • pipeline_manager

  • pop_ups

Subpackages

Submodules

populse_mia.user_interface.main_window module

Module to define main window appearance, functions and settings.

Initialize the software appearance and defines interactions with the user.

Contains:
Class:
  • MainWindow

  • _ProcDeleter

class populse_mia.user_interface.main_window.MainWindow(project, test=False, deleted_projects=None)[source]

Bases: QMainWindow

Initialize software appearance and define interactions with the user.

__init__(project, test=False, deleted_projects=None)[source]

Main window class, initializes the software appearance and defines interactions with the user.

Parameters:
  • project – Current project in the software.

  • test – Boolean indicating if the widget is launched from unit tests or not.

  • deleted_projects – Projects that have been deleted.

add_clinical_tags()[source]

Add the clinical tags to the database and the data browser.

check_database()[source]

Check if files in database have been modified since first import.

check_unsaved_modifications()[source]

Check if there are differences between the current project and the database.

Return (bool):

True if there are unsaved modifications, False otherwise

closeEvent(event)[source]

Override the QWidget closing event to check if there are unsaved modifications.

Parameters:

event – closing event

create_project_pop_up()[source]

Create a new project.

create_tabs()[source]

Create the tabs and initializes the DataBrowser and PipelineManager classes.

create_view_actions()[source]

Create the actions and their shortcuts in each menu

create_view_menus()[source]

Create the menu-bar view.

create_view_window()[source]

Create the main window view.

credits()[source]

Open the credits in a web browser

del_clinical_tags()[source]

Remove the clinical tags to the database and the data browser

delete_project()[source]

Open a pop-up to open a project and updates the recent projects list.

static documentation()[source]

Open the documentation in a web browser.

get_controller_version()[source]

Gives the value of the controller_version_changed attribute.

Returns:

Boolean

import_data()[source]

Import MRI data using the MRI File Manager and load it into the database.

This method performs the following steps: 1. Launches the MRI conversion software to convert MRI files to

Nifti/JSON format

  1. Attempts import with maximum heap size of 4096M, falls back to 1024M if needed

  2. Updates the database with newly imported scans

  3. Refreshes the data browser UI with new scan information

install_processes_pop_up(folder=False)[source]

Open the install processes pop-up.

Parameters:

folder – boolean, True if installing from a folder

static last_window_closed()[source]

Force exit the event loop after ipython console is closed.

If the ipython console has been run, something prevents Qt from quitting after the window is closed. The cause is not known yet. So: force exit the event loop.

open_project_pop_up()[source]

Open a dialog to select and open a project, updating recent projects list.

This method handles: 1. Checking for unsaved modifications in current project 2. Opening project selection dialog 3. Validating project path 4. Switching to new project 5. Updating clinical mode based on database fields 6. Updating database paths if project is external

open_recent_project()[source]

Open a recent project.

open_shell()[source]

Open a Qt console shell with an IPython kernel seeing the program internals.

package_library_pop_up()[source]

Open the package library pop-up

project_properties_pop_up()[source]

Open the project properties pop-up

redo()[source]

Redo the last action made by the user.

remove_raw_files_useless()[source]

Remove the useless raw files of the current project.

Close the database connection. The project is not valid any longer after this call.

static run_ipconsole_kernel(mode='qtconsole')[source]

Starts and initializes an IPython kernel with support for a Qt-based GUI.

This method is designed to set up and run an IPython kernel for interactive computing, with the specified mode (defaulting to qtconsole). It handles initialization of the kernel and associated event loops, ensuring proper integration with Qt-based applications.

Parameters:

(str) (mode) – The mode for running the IPython kernel. Default is “qtconsole”. It determines the GUI integration mode of the kernel.

Return (IPKernelApp):

The instance of the IPython kernel application.

Notes:
  • The method ensures that the kernel is properly initialized if it hasn’t been set up already.

  • To support Qt-based GUIs, the Qt event loop is properly integrated with the IPython kernel.

  • Special handling for Tornado versions >= 4.5 ensures compatibility with its callback mechanism.

save()[source]

Save either the current project or the current pipeline

saveChoice()[source]

Check if the project needs to be ‘saved as’ or just ‘saved’.

save_as()[source]

Save either the current project or the current pipeline under a new name.

save_project_as()[source]

Open a pop-up to save the current project as

see_all_projects()[source]

Open a pop-up to show the recent projects.

set_controller_version()[source]

Reverses the value of the controller_version_changed attribute.

From False to True and vice versa

setup_menu_actions(sources_images_dir)[source]

Initialize menu actions with icons and descriptions.

Parameters:

sources_images_dir – Directory containing source images for icons.

setup_window_size()[source]

Set the window size and maximize if needed.

software_preferences_pop_up()[source]

Open the Mia preferences pop-up.

switch_project(file_path, name)[source]

Check if it’s possible to open the selected project and quit the current one.

Parameters:
  • file_path – raw file_path

  • name – project name

Returns:

Boolean

tab_changed()[source]

Update the window when switching between application tab.

Updates the UI state and data when switching between Data Browser, Data Viewer, and Pipeline Manager tabs. Handles data synchronization, search state preservation, and unsaved changes warnings.

The method performs the following operations based on the selected tab: - Data Browser: Refreshes table data, preserves search state and

visualization settings

  • Data Viewer: Loads current viewer and updates document list

  • Pipeline Manager: Updates scan lists and handles unsaved

    modifications

undo()[source]

Reverts the last action performed by the user, depending on the active tab.

If the “Data Browser” tab is active, the undo operation is applied to the project’s database. If the “Pipeline Manager” tab is active, the pipeline manager’s undo function is invoked.

update_project(file_path, call_update_table=True)[source]

Updates the project after a database change.

This method updates the database, the window title, and the recent and saved projects menus.

Parameters:
  • (str) (file_path) – The file path of the new project.

  • (bool) (call_update_table) – Whether to update the table data. Defaults to True.

update_recent_projects_actions()[source]

Updates the list of recent projects in the UI.

Hides all recent project actions first, then updates and displays the most recent ones based on the configured maximum.

populse_mia.user_interface.pop_ups module

Module that defines all the pop-ups used across the Mia software.

Contains:
Class:
  • ClickableLabel

  • DefaultValueListCreation

  • DefaultValueQLineEdit

  • PopUpAddPath

  • PopUpAddTag

  • PopUpCloneTag

  • PopUpClosePipeline

  • PopUpDataBrowserCurrentSelection

  • PopUpDeletedProject

  • PopUpDeleteProject

  • PopUpFilterSelection

  • PopUpInformation

  • PopUpInheritanceDict

  • PopUpMultipleSort

  • PopUpNewProject

  • PopUpOpenProject

  • PopUpPreferences

  • PopUpProperties

  • PopUpQuit

  • PopUpRemoveScan

  • PopUpRemoveTag

  • PopUpSaveProjectAs

  • PopUpSeeAllProjects

  • PopUpSelectFilter

  • PopUpSelectIteration

  • PopUpTagSelection (must precede PopUpSelectTag)

  • PopUpSelectTag

  • PopUpSelectTagCountTable

  • PopUpShowHistory

  • PopUpVisualizedTags

  • QLabel_clickable

class populse_mia.user_interface.pop_ups.ClickableLabel[source]

Bases: QLabel

A QLabel subclass that emits a signal when clicked.

__init__()[source]

Initializes the ClickableLabel.

clicked

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

mousePressEvent(event)[source]

Handles the mouse press event by emitting the clicked signal.

Parameters:

(QMouseEvent) (event) – The mouse event triggering the signal.

class populse_mia.user_interface.pop_ups.DefaultValueListCreation(parent, type)[source]

Bases: QDialog

A dialog for creating or editing a list’s default value.

This widget allows users to input and manage a list of values based on a specified type (e.g., integers, floats, booleans, etc.).

__init__(parent, type)[source]

Initializes the DefaultValueListCreation dialog.

Parameters:
  • (DefaultValueQLineEdit) (parent) – The parent object.

  • (Type) (type) – The type of the list elements (e.g., int, float, str).

add_element()[source]

Adds a new empty element to the list.

Increases the number of columns in the table by one and adds an empty QTableWidgetItem for user input.

default_init_table()[source]

Initializes the table with a default value.

If no previous value exists, the table is set up with a single empty column to allow user input.

remove_element()[source]

Removes the last element from the list.

Ensures that at least one column remains to prevent an empty table. Adjusts the table size accordingly.

resize_table()[source]

Adjusts the size of the popup window based on the table content.

Dynamically resizes the table width and height based on the number of columns and rows, with a maximum width limit of 900 pixels.

update_default_value()[source]

Validates user input and updates the parent’s default value.

Converts table values to the specified list type, ensuring that each entry is valid. If any value is invalid, a warning message is displayed, and the update is aborted.

If all values are valid, they are stored in the parent widget, and the dialog is closed.

class populse_mia.user_interface.pop_ups.DefaultValueQLineEdit(parent)[source]

Bases: QLineEdit

A QLineEdit override for handling default values.

This class customizes QLineEdit to handle list-type default values by displaying a popup when clicked.

__init__(parent)[source]
Parameters:

parent – The parent widget, expected to have a type attribute.

mousePressEvent(event)[source]

Handles mouse press events.

If the parent’s type is a list, displays a popup for list creation.

Parameters:

(QMouseEvent) (event) – The mouse press event (unused).

class populse_mia.user_interface.pop_ups.PopUpAddPath(project, databrowser)[source]

Bases: QDialog

Dialog for adding a document to the project without using the MRI Files Manager (File > Import).

__init__(project, databrowser)[source]

Initializes the pop-up for adding a document.

Parameters:
  • (Project) (project) – The current project instance.

  • (DataBrowser) (databrowser) – The application’s data browser.

file_to_choose()[source]

Opens a file dialog for selecting documents.

find_type()[source]

Determines the document type when the file path changes.

save_path()[source]

Adds the selected document paths to the database and updates the UI.

class populse_mia.user_interface.pop_ups.PopUpAddTag(databrowser, project)[source]

Bases: QDialog

Dialog for adding a new tag to the project.

This dialog allows users to create a new tag by specifying its name, default value, description, unit, and type.

Attributes:

signal_add_tag: Signal emitted when a new tag is successfully added

Methods:
  • _connect_signals: Connect signals to slots

  • _setup_layouts: Set up the layout of UI elements

  • _setup_ui: Set up the dialog UI elements

  • _show_error: Display an error message box

  • ok_action: Validates input fields and adds the new tag if valid

  • on_activated: Updates form fields when tag type is changed

__init__(databrowser, project)[source]

Initialize the dialog for adding a new tag.

Parameters:
  • databrowser – The data browser instance

  • project – The current project in the software

ok_action()[source]

Validate inputs and add the new tag if all fields are correct.

Performs validation on the tag name, type and default value to ensure they are valid before adding the tag to the project.

on_activated(text)[source]

Update the default value when the tag type changes.

Parameters:

text – The new type selected from combo box

signal_add_tag

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

class populse_mia.user_interface.pop_ups.PopUpCloneTag(databrowser, project)[source]

Bases: QDialog

Dialog for cloning an existing tag with a new name.

This dialog allows users to select an existing tag from the project and clone it with a new name.

Attributes:

signal_clone_tag: Signal emitted when a tag is successfully cloned

Methods:
  • _connect_signals: Connect signals to slots

  • _populate_tag_list: Populate the tag list with available tags

  • _setup_ui: Set up the dialog UI elements

  • _show_error: Display an error message box

  • ok_action: Validates the new tag name and clones the selected tag

  • search_str: Filters the tag list based on a search string

__init__(databrowser, project)[source]

Initialize the dialog for cloning a tag.

Parameters:
  • databrowser – The data browser instance

  • project – The current project in the software

ok_action(project)[source]

Validate new tag name and clone the selected tag if valid.

Parameters:

project – The current project

search_str(project, search_text)[source]

Filter the tag list based on the search string.

Parameters:
  • project – The current project

  • search_text – The search string to filter by

signal_clone_tag

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

class populse_mia.user_interface.pop_ups.PopUpClosePipeline(pipeline_name)[source]

Bases: QDialog

Dialog displayed when closing a modified pipeline editor.

This dialog asks the user whether they want to save changes before closing the pipeline editor. It provides three options: save, don’t save, or cancel.

Signals:

save_as_signal: Emitted when the user chooses to save the pipeline. do_not_save_signal: Emitted when the user chooses not to save

the pipeline.

cancel_signal: Emitted when the user cancels the closing action.

Attributes:
bool_save_as (bool): Indicates if the pipeline should be saved

under a new name.

bool_exit (bool): Indicates if the editor can be closed. pipeline_name (str): Name of the pipeline being edited.

__init__(pipeline_name)[source]

Initialize the dialog with the pipeline name.

Parameters:

(str) (pipeline_name) – Name of the pipeline (basename).

can_exit()[source]

Check if the editor can be closed.

Return (bool): True if the editor can be closed, False otherwise.

cancel_clicked()[source]

Handle the cancel button click.

Sets bool_exit to False, emits cancel_signal, and closes the dialog.

cancel_signal

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

do_not_save_clicked()[source]

Handle the ‘Do not save’ button click.

Sets bool_exit to True, emits do_not_save_signal, and closes the dialog.

do_not_save_signal

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

save_as_clicked()[source]

Handle the ‘Save’ button click.

Sets bool_save_as and bool_exit to True, emits save_as_signal, and closes the dialog.

save_as_signal

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

class populse_mia.user_interface.pop_ups.PopUpDataBrowserCurrentSelection(project, databrowser, filter, main_window)[source]

Bases: QDialog

Dialog to display and confirm the current data browser selection.

This dialog shows a table of the currently selected document from the data browser and allows the user to confirm or cancel the selection. When confirmed, it updates the scan_list attribute of relevant components in the main window.

Attributes:

project: Current project in the software. databrowser: Data browser instance of the software. filter: List of the current documents in the data browser. main_window: Main window of the software.

__init__(project, databrowser, filter, main_window)[source]

Initialize the dialog with the current project and selection data.

Parameters:
  • project – Current project in the software

  • databrowser – Data browser instance of the software

  • (list) (filter) – List of the current documents in the data browser

  • main_window – Main window of the software

ok_clicked()[source]

Update the scan_list attribute of components when OK is clicked.

This method propagates the current filter (selected documents) to various components in the main window’s pipeline manager, and marks the data as sent in the data browser before closing the dialog.

class populse_mia.user_interface.pop_ups.PopUpDeleteProject(main_window)[source]

Bases: QDialog

Dialog for deleting selected projects.

Allows the user to select and delete one or more projects from the projects directory after confirmation.

__init__(main_window)[source]

Initializes the delete project dialog.

Parameters:

(QMainWindow) (main_window) – The main application window

ok_clicked()[source]

Deletes the selected projects after user confirmation.

class populse_mia.user_interface.pop_ups.PopUpDeletedProject(deleted_projects)[source]

Bases: QMessageBox

Message box that displays a list of deleted, renamed, or moved projects.

This dialog appears when the software starts and detects that previously available projects are no longer accessible at their expected locations.

Attributes:
deleted_projects (list): List of project names that are no longer

accessible.

__init__(deleted_projects)[source]

Initialize the message box with a list of inaccessible projects.

Parameters:

(list) (deleted_projects) – List of project names that are no longer accessible (deleted, renamed, or moved).

class populse_mia.user_interface.pop_ups.PopUpFilterSelection(project)[source]

Bases: QDialog

Dialog for selecting a previously saved filter.

Methods:
  • cancel_clicked: Closes the pop-up.

  • ok_clicked: Handles actions when the “OK” button is clicked.

  • search_str: Filters the list based on the search input.

__init__(project)[source]

Initializes the pop-up dialog.

Parameters:

(object) (project) – The current project containing saved filters

cancel_clicked()[source]

Closes the pop-up dialog.

ok_clicked()[source]

Handles actions when the “OK” button is clicked.

This method should be overridden in subclasses to implement specific behavior.

search_str(search_text)[source]

Filters the list of saved filters based on the search input.

Parameters:

(str) (search_text) – The text pattern to search for

class populse_mia.user_interface.pop_ups.PopUpInformation(project)[source]

Bases: QWidget

Popup window displaying the current project’s information.

__init__(project)[source]

Initializes the popup window with project details.

Parameters:

(Project) (project) – The current project instance

signal_preferences_change

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

class populse_mia.user_interface.pop_ups.PopUpInheritanceDict(values, node_name, plug_name, iterate)[source]

Bases: QDialog

Dialog for selecting tag inheritance between input and output plugs.

This dialog allows users to select which input plug should pass its tags to a specific output plug, or to choose to ignore tag inheritance altogether.

Methods:
  • _setup_buttons: Set up action buttons for the dialog

  • _setup_radio_buttons: Set up radio buttons for each input option

  • ok_clicked: Event when ok button is clicked

  • okall_clicked: Event when Ok all button is clicked

  • on_clicked: Event when radiobutton is clicked

  • ignoreall_clicked: Event when ignore all plugs button is clicked

  • ignore_clicked: Event when ignore button is clicked

  • ignore_node_clicked: Event when ignore all nodes button is clicked

__init__(values, node_name, plug_name, iterate)[source]

Initialize the inheritance selection dialog.

Parameters:
  • (dict) (values) – Dict mapping input names (keys) to their paths (values)

  • (str) (plug_name) – Name of the current node

  • (str) – Name of the current output plug

  • (bool) (iterate) – Boolean indicating if the choice applies to iterations

ignore_clicked()[source]

Handle Ignore button click.

Accepts the dialog with tag inheritance ignored for current plug.

ignore_node_clicked()[source]

Handle ‘Ignore for all nodes in the pipeline’ button click.

Accepts the dialog with tag inheritance ignored for the entire pipeline.

ignoreall_clicked()[source]

Handle ‘Ignore for all output plugs’ button click.

Accepts the dialog with tag inheritance ignored for all output plugs.

ok_clicked()[source]

Handle OK button click.

Accepts the dialog with current selection applied to current plug.

okall_clicked()[source]

Handle ‘OK for all output plugs’ button click.

Accepts the dialog with current selection applied to all output plugs.

on_clicked()[source]

Handle radio button selection event.

Updates the currently selected input value and key.

class populse_mia.user_interface.pop_ups.PopUpMultipleSort(project, table_data_browser)[source]

Bases: QDialog

Dialog for sorting the data browser’s table based on multiple tags.

This dialog allows users to select multiple tags (columns) for sorting table data in either ascending or descending order. Users can dynamically add or remove sort criteria.

__init__(project, table_data_browser)[source]

Initialize the multiple sort dialog.

Parameters:
  • project – Current project in the software

  • table_data_browser – Data browser’s table to be sorted

add_tag()[source]

Add a new tag button to the sort criteria.

fill_values(idx)[source]

Collect unique values for the selected tag.

Parameters:

idx – Index of the tag button in the push_buttons list

refresh_layout()[source]

Update the dialog layout to reflect current tag buttons.

remove_tag()[source]

Remove the last tag button from the sort criteria.

select_tag(idx)[source]

Open a pop-up dialog to choose a tag for the specified button.

Parameters:

idx – Index of the button in the push_buttons list

sort_scans()[source]

Collect sorting parameters and send them to the data browser.

class populse_mia.user_interface.pop_ups.PopUpNewProject[source]

Bases: QFileDialog

Dialog for creating a new project.

This dialog is displayed when the user wants to create a new project. It manages file selection and handles the creation process.

__init__()[source]

Initialize the new project dialog with appropriate settings.

get_filename(file_name_tuple)[source]

Process the selected filename and set up project attributes.

Parameters:

(tuple) (file_name_tuple) – Tuple containing the selected filename(s), obtained from the selectedFiles method

Note:

If the file already exists, displays an error message. Otherwise, closes the dialog and emits signal_create_project.

signal_create_project

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

class populse_mia.user_interface.pop_ups.PopUpOpenProject[source]

Bases: QFileDialog

Dialog for opening an existing MIA project.

This dialog allows users to select an existing project directory from the filesystem. It uses the default projects directory as the starting location and emits a signal when a valid project is selected.

__init__()[source]
get_filename(file_name_tuple)[source]

Process the selected directory and emit signal if valid.

Sets the path, name, and relative_path attributes based on the selected directory. If the directory exists, emits signal_create_project.

Parameters:

(tuple) (file_name_tuple) – Tuple containing selected directory path(s). Typically obtained from selectedFiles() method.

signal_create_project

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

class populse_mia.user_interface.pop_ups.PopUpPreferences(main_window)[source]

Bases: QDialog

Dialog for changing software preferences.

This class manages the preferences dialog for the software, allowing users to configure various settings related to tools, projects, and appearance.

__init__(main_window)[source]

Initialize the preferences dialog.

Parameters:

main_window – The main window object of the software

admin_mode_switch()[source]

Handle the admin mode checkbox click event.

browse_afni()[source]

Browse for the AFNI directory.

browse_ants()[source]

Browse for the ANTS directory.

browse_freesurfer()[source]

Browse for the FreeSurfer env file.

browse_fsl()[source]

Browse for the FSL config file.

browse_matlab()[source]

Browse for the Matlab file.

browse_matlab_standalone()[source]

Browse for the Matlab standalone directory.

browse_mri_conv_path()[source]

Browse for the MRIFileManager.jar file.

browse_mrtrix()[source]

Browse for the mrtrix directory.

browse_projects_save_path()[source]

Browse for the projects folder.

browse_resources_path()[source]

Browse for the resources folder.

browse_spm()[source]

Browse for the SPM directory.

browse_spm_standalone()[source]

Browse for the SPM standalone directory.

change_admin_psswd(status)[source]

Open a dialog to change the admin password with validation checks.

Parameters:

(str) (status) – Initial status message to display in the dialog.

control_checkbox_toggled()[source]

Check if the user really wants to change the controller version.

create_afni_group()[source]

Create the AFNI group box.

create_ants_group()[source]

Create the ANTS group box.

create_appearance_tab(_translate)[source]

Create and configure the ‘Appearance’ tab with color and display settings.

Parameters:

(callable) (_translate) – Function used to translate UI text (translate method of QCoreApplication in the Qt framework.)

create_capsul_group(groupbox_capsul)[source]

Create and configure the CAPSUL group box with a configuration button.

Parameters:

(QGroupBox) (groupbox_capsul) – The group box to be configured for CAPSUL settings.

create_freesurfer_group()[source]

Create the FreeSurfer group box.

create_fsl_group()[source]

Create the FSL group box.

create_global_preferences()[source]

Create the global preferences group box.

create_horizontal_box(*widgets, add_stretch=True)[source]

Create a horizontal box layout containing the specified widgets.

Parameters:
  • ...]) (widgets (tuple[QtWidgets.QWidget,) – The widgets to add to the layout.

  • (bool) (add_stretch) – Whether to add stretch at the end to push the widgets to the left. Defaults to True.

Return (QHBoxLayout):

The created horizontal box layout.

create_matlab_group()[source]

Create the Matlab group box.

create_mrtrix_group()[source]

Create the mrtrix group box.

create_pipeline_tab(_translate)[source]

Create the ‘Pipeline’ tab in the settings interface.

This tab allows configuring various neuroimaging tool settings, including Matlab, SPM, FSL, AFNI, ANTS, FreeSurfer, MRtrix, and CAPSUL.

Parameters:

(Callable) (_translate) – Function used to translate UI text (translate method of QCoreApplication in the Qt framework.)

create_populse_preferences()[source]

Create the POPULSE third party preferences group box.

create_projects_preferences()[source]

Create the projects preferences group box.

create_resources_preferences()[source]

Create the external resources preferences group box.

create_spm_group()[source]

Create the SPM group box.

create_tools_tab(_translate)[source]

Create the ‘Tools’ tab in the settings interface.

This tab contains various sections for configuring global preferences, project-specific settings, third-party tool integration, and external resources.

Parameters:

(Callable) (_translate) – Function used to translate UI text (translate method of QCoreApplication in the Qt framework.)

edit_capsul_config()[source]

Capsul engine edition.

This method is used when user hit the Edit CAPSUL config button (File > MIA preferences > Pipeline tab).

edit_config_file()[source]

Create a window to view, edit the mia configuration file.

findChar()[source]

Highlights characters in red when using the Find button in the configuration editor.

This method searches for a pattern entered in the find field and highlights all matching occurrences in the text editor.

load_config()[source]

Load the configuration settings.

not_use_clinical_mode_signal

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

ok_clicked()[source]

Handle the OK button click event.

save_full_config(config)[source]

Saves the full configuration and validates settings.

Parameters:

(Config) (config) – The configuration object to update and save.

Return (bool):

True if the configuration is valid and successfully saved, False otherwise.

save_minimal_config(config)[source]

Saves a minimal configuration for CAPSUL config synchronization.

Parameters:

(Config) (config) – The configuration object to update and save.

setup_ui()[source]

Set up the user interface components.

show_error_message(title, message)[source]

Displays an error message dialog.

Parameters:
  • (str) (message) – The title of the error message dialog.

  • (str) – The detailed error message to display.

show_warning_message(title, message)[source]

Displays a warning message dialog.

Parameters:
  • (str) (message) – The title of the warning message dialog.

  • (str) – The detailed warning message to display.

signal_preferences_change

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

update_gui_from_capsul_config(conf)[source]

Updates the GUI elements based on the CAPSUL configuration.

This method retrieves the configuration settings for various neuroimaging tools (e.g., AFNI, ANTs, FreeSurfer, FSL, Matlab, SPM, etc.) and updates the corresponding GUI fields, including checkboxes and text fields.

Parameters:

(CapsulConfig) (conf) – The CAPSUL configuration object containing the paths and usage states of different tools.

use_afni_changed()[source]

Handle the use_afni checkbox change event.

use_ants_changed()[source]

Handle the use_ants checkbox change event.

use_clinical_mode_signal

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

use_current_mainwindow_size()[source]

Use the current main window size.

use_freesurfer_changed()[source]

Handle the use_freesurfer checkbox change event.

use_fsl_changed()[source]

Handle the use_fsl checkbox change event.

use_matlab_changed()[source]

Handle the use_matlab checkbox change event.

use_matlab_standalone_changed()[source]

Handle the use_matlab_standalone checkbox change event.

use_mrtrix_changed()[source]

Handle the use_mrtrix checkbox change event.

use_spm_changed()[source]

Handle the use_spm checkbox change event.

use_spm_standalone_changed()[source]

Handle the use_spm_standalone checkbox change event.

validate_and_save(OK_clicked=False)[source]

Validate and save the preferences.

Parameters:

(bool) (ok_clicked) – Whether the OK button was clicked (True) when this method was launched.

Contains:
  • remove_capsul_config: Helper function to remove a

    module’s configuration

  • clean_spm_config: Cleans the SPM configuration based

    on standalone mode

  • clean_matlab_config: Removes MATLAB-related configuration keys

validate_matlab_path(path, config)[source]

Validates the given Matlab executable path.

Parameters:
  • (str) (path) – The path to the Matlab executable.

  • (Config) (config) – The configuration object to update.

Return (bool):

True if the path is valid and updated in the configuration, False otherwise.

validate_matlab_standalone_path(path, config)[source]

Validate the Matlab standalone path.

This method does not thoroughly test the configuration for Matlab MCR alone (without SPM standalone) due to the lack of a concrete example.

Parameters:
  • (str) (path) – The path to the Matlab standalone directory.

  • (Config) (config) – The configuration object to update.

Return (bool):

True if the path is valid and updated in the configuration, False otherwise.

validate_paths(config)[source]

Validate the paths and settings.

This method checks the validity of paths for various neuroimaging tools (AFNI, ANTS, FreeSurfer, FSL, MRtrix, Matlab, SPM, etc.) and updates the configuration accordingly. It also validates additional paths such as the projects folder, MRIFileManager.jar path, and resources folder.

Parameters:

(Config) (config) – The configuration object where validated paths and settings will be stored.

Return (bool):

True if all paths and settings are valid, False otherwise.

validate_spm_path(path, config)[source]

Validates the SPM path and its compatibility with Matlab.

This method checks whether the provided SPM and Matlab paths are valid. If they are already configured correctly, it enables SPM and Matlab usage without further checks. Otherwise, it attempts to run an SPM command via Matlab to confirm the setup.

Parameters:
  • (str) (path) – The file path to the SPM installation.

  • (Config) (config) – The configuration object where validated paths and settings will be stored.

Return (bool):

True if the SPM path and Matlab path are valid, False otherwise.

validate_spm_standalone_path(path, config)[source]

Validates the SPM standalone path and its compatibility with Matlab standalone.

This method checks whether the provided paths for SPM standalone and Matlab standalone (if applicable) are valid. It also verifies system architecture compatibility and attempts to execute SPM standalone to confirm its functionality.

Parameters:
  • (str) (path) – The file path to the SPM standalone installation.

  • (Config) (config) – The configuration object where validated paths and settings will be stored.

Return (bool):

True if the SPM standalone and Matlab standalone paths are valid, False otherwise.

validate_tool_path(tool_name, path, cmd, config, config_name, set_in_use, set_path)[source]

Validates the specified tool’s path and checks its functionality.

This method checks if the given tool path exists and verifies that the tool is functional by running a command to check its version. It also handles tool-specific setup for FreeSurfer and FSL by setting environment variables and adjusting paths as necessary.

Parameters:
  • (str) (config_name) – The name of the tool to validate (e.g., “FreeSurfer”, “FSL”, “Matlab”, etc.).

  • (str) – The file path to the tool’s installation directory.

  • (str) – The command to execute within the tool’s directory to check its version.

  • (Config) (config) – The configuration object where validated paths and settings will be stored.

  • (str) – The name of the configuration setting for the tool.

  • (Callable) (set_path) – A function to set the tool’s “in use” status in the configuration.

  • (Callable) – A function to set the tool’s path in the configuration.

Return (bool):

True if the tool’s path is valid and functional, False otherwise.

wrong_path(path, tool, extra_mess='')[source]

Displays an error message for an invalid tool path.

This method restores the cursor, clears the status label, and shows a QMessageBox with an error message indicating that the provided path for a specified tool is invalid.

Parameters:
  • (str) (tool) – The invalid path entered by the user.

  • (str) – The name of the tool for which the path is being validated.

  • optional) (extra_mess (str,) – Additional context for the error message, such as specifying a configuration file.

Return (None):

This function does not return anything.

class populse_mia.user_interface.pop_ups.PopUpProperties(project, databrowser, old_tags)[source]

Bases: QDialog

Dialog for modifying project properties.

Allows users to change project settings, including visualized tags and information. Is called when the user wants to change the current project’s properties (File > properties).

__init__(project, databrowser, old_tags)[source]

Initialize the project properties dialog.

Parameters:
  • project – current project in the software

  • databrowser – data browser instance of the software

  • old_tags – visualized tags before opening this dialog

ok_clicked()[source]

Saves the modifications and updates the data browser.

signal_settings_change

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

class populse_mia.user_interface.pop_ups.PopUpQuit(project)[source]

Bases: QDialog

Dialog to handle unsaved project modifications when closing the software.

Provides options to save, discard, or cancel the exit process. Is called when the user closes the software and the current project has been modified.

__init__(project)[source]

Initialize the quit confirmation dialog.

Parameters:

project – Current project with unsaved modifications.

can_exit()[source]

Check if the application can exit.

Return (bool):

True if exit is allowed.

cancel_clicked()[source]

Handle cancel action by preventing exit.

cancel_signal

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

do_not_save_clicked()[source]

Handle ‘do not save’ action by allowing exit without saving.

do_not_save_signal

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

save_as_clicked()[source]

Handle save action by emitting save signal and allowing exit.

save_as_signal

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

class populse_mia.user_interface.pop_ups.PopUpRemoveScan(scan, size)[source]

Bases: QDialog

Dialog to confirm removal of a scan previously sent to the pipeline manager.

Provides options to remove or keep a scan, with additional ‘apply to all’ functionality when multiple scans are involved. Is called when the user wants to remove a scan that was previously sent to the pipeline manager.

__init__(scan, size)[source]

Initialize the remove scan confirmation dialog.

Parameters:
  • scan – Identifier of the scan to be potentially removed.

  • size – Total number of scans in the removal process.

cancel_clicked()[source]

Handle ‘Cancel’ action.

Sets stop flag to True and indicates no global action.

no_all_clicked()[source]

Handle ‘No to All’ action.

Sets stop flag to True and indicates a global ‘No’ action.

yes_all_clicked()[source]

Handle ‘Yes to All’ action.

Clears stop flag and indicates a global ‘Yes’ action.

yes_clicked()[source]

Handle ‘Yes’ action.

Clears both stop and repeat flags for a single item removal.

class populse_mia.user_interface.pop_ups.PopUpRemoveTag(databrowser, project)[source]

Bases: QDialog

Dialog for removing user-defined tags from a Populse MIA project.

Allows users to select and remove custom tags from the project’s database.

__init__(databrowser, project)[source]

Initialize the remove tag dialog.

Parameters:
  • databrowser – Data browser instance managing project data.

  • project – Current project containing tags to be removed.

ok_action()[source]

Process selected tags for removal and update the data browser.

Retrieves selected tags and passes them to the data browser for removal. Closes the dialog after processing.

search_str(search_pattern)[source]

Filter tags based on search pattern.

Parameters:

search_pattern – String to match against tag names.

signal_remove_tag

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

class populse_mia.user_interface.pop_ups.PopUpSaveProjectAs[source]

Bases: QDialog

Dialog for saving a project under a new name.

Provides a user interface to select and save a project with a new name, with options to browse existing projects and validate the new project name.

__init__()[source]

Initialize the save project as dialog.

Sets up the user interface with a scrollable list of existing projects, input field for new project name, and save/cancel buttons.

fill_input(name)[source]

Fill the project name input field with the selected project name.

Parameters:

name – Name of the project to fill in the input field.

return_value()[source]

Validate and process the selected project name.

Checks project name validity, handles potential naming conflicts, and emits a signal when a valid project name is selected.

Return (str):

Full path of the new project if successful, None otherwise.

signal_saved_project

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

class populse_mia.user_interface.pop_ups.PopUpSeeAllProjects(saved_projects, main_window)[source]

Bases: QDialog

A dialog window for displaying and managing saved projects.

This dialog allows users to view a list of saved projects, check their existence, and open a selected project.

__init__(saved_projects, main_window)[source]

Initialize the PopUpSeeAllProjects dialog.

Parameters:
  • saved_projects – Container with a list of project paths.

  • main_window – Main window.

checkState(path)[source]

Determine the icon based on project existence.

Parameters:

(str) (path) – Path to the project directory.

Returns:

QIcon: Green checkmark if project exists, red cross if not.

item_to_path()[source]

Returns the path of the first selected item.

Return (str):

Absolute path of the selected project, or empty string if no selection.

open_project()[source]

Attempt to switch to the selected project.

Opens the selected project in the main window if a valid project is chosen. Closes the dialog upon successful project switch.

class populse_mia.user_interface.pop_ups.PopUpSelectFilter(project, databrowser)[source]

Bases: PopUpFilterSelection

Popup window for selecting and opening a previously saved filter.

__init__(project, databrowser)[source]

Initializes the PopUpSelectFilter dialog

Parameters:
  • (Project) (project) – The current project instance.

  • (DataBrowser) (databrowser) – The data browser instance.

ok_clicked()[source]

Saves the selected filter as the current filter and updates the data browser.

class populse_mia.user_interface.pop_ups.PopUpSelectIteration(iterated_tag, tag_values)[source]

Bases: QDialog

Dialog for selecting values to iterate over when running an iterated pipeline.

__init__(iterated_tag, tag_values)[source]

Initializes the selection popup.

Parameters:
  • (str) (iterated_tag) – The name of the tag being iterated.

  • (list[str]) (tag_values) – The possible values for the iterated tag.

ok_clicked()[source]

Stores selected values and closes the dialog.

class populse_mia.user_interface.pop_ups.PopUpSelectTag(project)[source]

Bases: PopUpTagSelection

A dialog for selecting and updating the thumbnail tag in the mini viewer.

This class allows users to choose which tag will be displayed as the thumbnail in the application’s mini viewer. It presents a list of available tags and allows selecting a single tag to be used as the thumbnail.

__init__(project)[source]

Initialize the tag selection dialog.

Parameters:

project – The current project in the software context.

ok_clicked()[source]

Save the selected tag and update the mini viewer.

Finds the checked tag and sets it as the new thumbnail tag. Closes the dialog after selection.

class populse_mia.user_interface.pop_ups.PopUpSelectTagCountTable(project, tags_to_display, tag_name_checked=None)[source]

Bases: PopUpTagSelection

A pop-up dialog for selecting a tag from a count table.

Allows users to choose a single tag from a list of available tags, with an option to pre-select a specific tag.

__init__(project, tags_to_display, tag_name_checked=None)[source]

Initialize the tag selection pop-up.

Parameters:
  • project – The current project context.

  • (list) (tags_to_display) – List of tags to be displayed for selection.

  • (str) (tag_name_checked) – Optional tag to be pre-checked on initialization.

ok_clicked()[source]

Determine the selected tag and close the dialog.

Finds the first checked item and sets it as the selected tag, then closes the dialog.

class populse_mia.user_interface.pop_ups.PopUpShowHistory(project, brick_uuid, scan, databrowser, main_window)[source]

Bases: QDialog

A dialog for displaying the history of a document in a software pipeline.

This class creates a popup window that provides comprehensive information about a specific brick (processing node) in a pipeline, including: - Pipeline visualization - Input and output parameters - Initialization and execution details

The dialog allows users to: - View the pipeline structure - Inspect node details - Navigate between associated bricks - Select and highlight specific files

__init__(project, brick_uuid, scan, databrowser, main_window)[source]

Initialize the document history popup.

Parameters:
  • project – Current project in the software

  • (str) (scan) – Unique identifier of the brick

  • (str) – Filename of the scan

  • databrowser – Data browser instance

  • main_window – Main window of the software

adjust_size()[source]

Adjust the size of the dialog based on screen resolution.

file_clicked()[source]

Close the history window and select the file in the data browser.

find_associated_bricks(node_name)[source]

Find bricks associated with a given node name.

Parameters:

(str) (node_name) – The name of the node to find associated bricks for.

Return (dict):

A dictionary where the keys are the full brick names and the values are lists of associated UUIDs.

find_process_from_plug(plug)[source]

Find the process and plug name from a given plug.

Parameters:

(Plug) (plug) – The plug object to find the process and plug name from.

Return (tuple):

A tuple containing the process name (str) and plug name (str).

handle_pipeline_nodes(pipeline, full_brick_name)[source]

Handle pipeline nodes, set up the view, and initialize the pipeline visualization.

Parameters:
  • (Pipeline) (pipeline) – The pipeline object containing the nodes to handle.

  • (list) (full_brick_name) – The full name of the brick, split into parts.

highlight_selected_node(node_name)[source]

Highlight the selected node in the pipeline view.

Parameters:

(str) (node_name) – The name of the node to highlight.

initialize_pipeline(full_brick_name)[source]

Initialize the pipeline view using the given pipeline XML.

Parameters:

(list) (full_brick_name) – The full name of the brick, split into parts.

io_value_is_scan(value)[source]

Check if the I/O value is a scan.

Parameters:

value – I/O value

Returns:

The scan corresponding to the value if it exists, None otherwise

load_data(brick_uuid, scan)[source]

Load data from the project database and update the table with brick data.

Parameters:
  • (str) (scan) – The UUID of the brick to load.

  • (str) – The identifier of the scan associated with the brick.

load_pipeline_data(history_uuid, full_brick_name)[source]

Load pipeline data from the database based on the provided history UUID.

Parameters:
  • (str) (history_uuid) – The UUID of the history record to load pipeline data from.

  • (list) (full_brick_name) – The full name of the brick, split into parts.

node_selected(node_name, process)[source]

Handle node selection and update the table.

Parameters:
  • node_name – node name

  • process – process of the corresponding node

select_node(pipeline, bricks, full_brick_name)[source]

Select the node in the pipeline view based on the provided brick UUID.

Parameters:
  • (Pipeline) (pipeline) – The pipeline object containing the nodes to handle.

  • (dict) (bricks) – A dictionary of bricks with UUIDs as values.

  • (list) (full_brick_name) – The full name of the brick, split into parts.

setup_ui()[source]

Set up the user interface components.

update_table(inputs, outputs, brick_name, init='', init_time=None, exec='', exec_time=None)[source]

Updates the table with information about a brick’s execution state.

Parameters:
  • (dict) (outputs) – Dictionary containing input data.

  • (dict) – Dictionary containing output data.

  • (str) (brick_name) – Name of the brick.

  • optional) (exec_time (Any,) – Initialization status.

  • optional) – Initialization timestamp.

  • optional) – Execution status.

  • optional) – Execution timestamp.

Contains:
  • create_cell_widget: Creates a QWidget containing a vertically

    aligned QLabel

update_table_for_single_brick(bricks, node_name, full_node_name)[source]

Update the table for a single brick, using the provided brick data.

Parameters:
  • (dict) (bricks) – A dictionary of bricks with UUIDs as values.

  • (str) (node_name) – The name of the node associated with the brick.

  • (list) (full_node_name) – The full name of the node, split into parts.

update_table_for_subpipeline(bricks, process, full_node_name)[source]

Update the table for a subpipeline based on the given process and brick data.

Parameters:
  • (dict) (bricks) – A dictionary of bricks with UUIDs as values.

  • (PipelineNode) (process) – The process node associated with the subpipeline.

  • (list) (full_node_name) – The full name of the node, split into parts.

update_table_with_brick_data(brick_row, full_brick_name)[source]

Update the table with the brick’s input and output data after processing.

Parameters:
  • (list) (full_brick_name) – A list containing the brick data to update the table with.

  • (list) – The full name of the brick, split into parts.

class populse_mia.user_interface.pop_ups.PopUpTagSelection(project)[source]

Bases: QDialog

A dialog for selecting and filtering tags in a data browser.

This class provides a user interface for: - Displaying available tags - Searching through tags - Selecting a single tag

Is called when the user wants to update the tags that are visualized in

the data browser.

__init__(project)[source]

Initialize the tag selection dialog.

Parameters:

project – The current project containing the database with available tags

cancel_clicked()[source]

Close the dialog without selecting a tag.

item_clicked(item)[source]

Handle item selection by checking/unchecking tags.

Parameters:

(QListWidgetItem) – The clicked list item

ok_clicked()[source]

Placeholder method to be overridden by subclasses.

Defines actions to take when the OK button is clicked.

search_str(str_search)[source]

Filter tags based on search term.

Parameters:

(str) (str_search) – Text to search for in tag names

class populse_mia.user_interface.pop_ups.PopUpVisualizedTags(project, visualized_tags)[source]

Bases: QWidget

A widget for managing tag visualization preferences in a project.

This class provides an interface for users to select and unselect tags to be displayed in the project. It allows searching through available tags and moving them between available and visualized lists.

__init__(project, visualized_tags)[source]

Initialize the tag visualization management widget.

Parameters:
  • project – The current project in the software.

  • visualized_tags – Tags currently being visualized before opening this widget.

click_select_tag()[source]

Move selected tags from available to visualized list.

Removes selected tags from the left (available) list and adds them to the right (visualized) list.

click_unselect_tag()[source]

Remove selected tags from the visualized list and return them to the available tags list.

Moves selected tags from the right (visualized) list to the left (available) list, maintaining sorted order.

search_str(str_search)[source]

Filter tags based on search string.

Parameters:

(str) (str_search) – Search pattern to match against tags

signal_preferences_change

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

class populse_mia.user_interface.pop_ups.QLabel_clickable(parent=None)[source]

Bases: QLabel

A custom QLabel that emits a clicked signal when mouse pressed.

This class extends the standard QLabel to provide a signal that can be connected to other methods when the label is clicked, enabling more interactive label behaviors.

__init__(parent=None)[source]

Initialize the clickable label.

Parameters:

(QWidget) (parent) – Parent widget.

clicked

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

mousePressEvent(event)[source]

Override the default mouse press event to emit the clicked signal.

Parm event (QMouseEvent):

Mouse press event details.