populse_mia.user_interface.pop_ups

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

Classes

ClickableLabel()

A QLabel subclass that emits a signal when clicked.

DefaultValueListCreation(parent, type)

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

DefaultValueQLineEdit(parent)

A QLineEdit override for handling default values.

PopUpAddPath(project, databrowser)

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

PopUpAddTag(databrowser, project)

Dialog for adding a new tag to the project.

PopUpCloneTag(databrowser, project)

Dialog for cloning an existing tag with a new name.

PopUpClosePipeline(pipeline_name)

Dialog displayed when closing a modified pipeline editor.

PopUpDataBrowserCurrentSelection(project, ...)

Dialog to display and confirm the current data browser selection.

PopUpDeleteProject(main_window)

Dialog for deleting selected projects.

PopUpDeletedProject(deleted_projects)

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

PopUpFilterSelection(project)

Dialog for selecting a previously saved filter.

PopUpInformation(project)

Popup window displaying the current project's information.

PopUpInheritanceDict(values, node_name, ...)

Dialog for selecting tag inheritance between input and output plugs.

PopUpMultipleSort(project, table_data_browser)

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

PopUpNewProject()

Dialog for creating a new project.

PopUpOpenProject()

Dialog for opening an existing Mia project.

PopUpPreferences(main_window)

Dialog for changing software preferences.

PopUpProperties(project, databrowser, old_tags)

Dialog for modifying project properties.

PopUpQuit(project)

Dialog to handle unsaved project modifications when closing the software.

PopUpRemoveScan(scan, size)

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

PopUpRemoveTag(databrowser, project)

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

PopUpSaveProjectAs()

Dialog for saving a project under a new name.

PopUpSeeAllProjects(saved_projects, main_window)

A dialog window for displaying and managing saved projects.

PopUpSelectFilter(project, databrowser)

Popup window for selecting and opening a previously saved filter.

PopUpSelectIteration(iterated_tag, ...)

Dialog allowing the user to choose which values of a tag should be used during an iterated pipeline run.

PopUpSelectTag(project)

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

PopUpSelectTagCountTable(project, ...[, ...])

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

PopUpShowHistory(project, brick_uuid, scan, ...)

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

PopUpTagSelection(project)

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

PopUpVisualizedTags(project, visualized_tags)

A widget for managing tag visualization preferences in a project.

QLabel_clickable([parent])

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

class populse_mia.user_interface.pop_ups.ClickableLabel[source]

Bases: QLabel

A QLabel subclass that emits a signal when clicked.

Contains:

Methods:

  • mousePressEvent: Overrides the mousePressEvent method by emitting the clicked signal.

Signals:

  • clicked: Emitted when the label is clicked.

__init__()[source]

Initializes the ClickableLabel.

mousePressEvent(event)[source]

Handles the mouse press event by emitting the clicked signal.

Parameters:

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

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.).

Contains:

Methods:

  • add_element(): Adds one more element to the list.

  • default_init_table(): Initializes the table with a default value when no previous value exists.

  • remove_element(): Removes the last element from the list.

  • resize_table(): Adjusts the popup size based on the table content.

  • update_default_value(): Validates user input and updates the parent’s default value.

__init__(parent, type)[source]

Initializes the DefaultValueListCreation dialog.

Parameters:
  • parent – (DefaultValueQLineEdit) 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.

Contains:

Methods:

  • mousePressEvent: Mouse pressed on the QLineEdit.

__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:

event – (QMouseEvent) 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).

Contains:

Methods:

  • file_to_choose: Opens a file dialog to choose a document.

  • find_type: Determines the document type when the file path changes.

  • save_path: Adds the file path to the database and updates the UI.

__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.

Contains:

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.

Signals:

  • signal_add_tag: Signal emitted when a new tag is successfully added.

__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

_connect_signals()[source]

Connect signals to slots.

_setup_layouts()[source]

Set up the layout of UI elements.

_setup_ui()[source]

Set up the dialog UI elements.

_show_error(text, informative_text)[source]

Display an error message box.

Parameters:
  • text – The main error message text.

  • informative_text – The additional informative text.

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

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.

Contains:

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.

Signals:

  • signal_clone_tag: Signal emitted when a tag is successfully cloned.

__init__(databrowser, project)[source]

Initialize the dialog for cloning a tag.

Parameters:
  • databrowser – The data browser instance

  • project – The current project in the software

_connect_signals(project)[source]

Connect signals to slots.

Parameters:

project – The current project.

_populate_tag_list(project)[source]

Populate the tag list with available tags from the project.

Parameters:

project – The current project.

_setup_ui()[source]

Set up the dialog UI elements.

_show_error(text, informative_text)[source]

Display an error message box.

Parameters:
  • text – The main error message text.

  • informative_text – The additional informative text.

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.

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.

Contains:

Methods:

  • _connect_signals: Connect button signals to their respective slots.

  • _setup_ui: Set up the dialog’s user interface.

  • can_exit: Returns the value of bool_exit.

  • cancel_clicked: Makes the actions to cancel the action.

  • do_not_save_clicked: Makes the actions not to save the pipeline.

  • save_as_clicked: Makes the actions to save the pipeline.

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.

__init__(pipeline_name)[source]

Initialize the dialog with the pipeline name.

Parameters:

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

_connect_signals()[source]

Connect button signals to their respective slots.

_setup_ui()[source]

Set up the dialog’s user interface.

can_exit()[source]

Check if the editor can be closed.

:Returns (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.

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.

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.

class populse_mia.user_interface.pop_ups.PopUpDataBrowserCurrentSelection(project, databrowser, filter, main_window, TableDataBrowser)[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.

Contains:

Methods:

  • _set_dialog_size: Set the dialog size based on screen resolution.

  • _setup_ui: Set up the dialog’s user interface.

  • ok_clicked: Updates the “scan_list” attribute of several widgets.

__init__(project, databrowser, filter, main_window, TableDataBrowser)[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.

  • TableDataBrowser – Class for displaying data in a table format.

_set_dialog_size()[source]

Set the dialog size based on screen resolution.

_setup_ui(TableDataBrowser)[source]

Set up the dialog’s user interface.

Parameters:

TableDataBrowser – Class for displaying data in a table format.

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.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.

Contains:

Methods:

  • _connect_signals: Connect button signals to their respective slots.

  • _setup_message_box: Configure the message box appearance and content.

__init__(deleted_projects)[source]

Initialize the message box with a list of inaccessible projects.

Parameters:

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

_connect_signals()[source]

Connect button signals to their respective slots.

_setup_message_box()[source]

Configure the message box appearance and content.

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.

Contains:

Methods:

  • _delete_project: Handles project deletion.

  • _setup_buttons: Creates and configures the dialog buttons.

  • _setup_layout: Configures the main layout of the dialog.

  • _setup_ui: Sets up the user interface components.

  • ok_clicked: delete the selected projects after confirmation.

__init__(main_window)[source]

Initializes the delete project dialog.

Parameters:

main_window – (QMainWindow) The main application window.

_delete_project(project_path, opened_projects)[source]

Handles project deletion, updating application state accordingly.

Parameters:
  • project_path – (str) The path of the project to delete.

  • opened_projects – (list) The list of currently opened projects.

_setup_buttons()[source]

Creates and configures the dialog buttons.

_setup_layout()[source]

Configures the main layout of the dialog.

_setup_ui()[source]

Sets up the user interface components.

ok_clicked()[source]

Deletes the selected projects after user confirmation.

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

Bases: QDialog

Dialog for selecting a previously saved filter.

Contains:

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:

project – (object) 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:

search_text – (str) 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.

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.

Contains:

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:
  • values – (dict) Dict mapping input names (keys) to their paths (values).

  • node_name – (str) Name of the current node.

  • plug_name – (str) Name of the current output plug.

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

_setup_buttons(node_name, plug_name, layout)[source]

Set up action buttons for the dialog.

Parameters:
  • node_name – Name of the current node.

  • plug_name – Name of the current output plug.

  • layout – Layout to add the buttons to.

_setup_radio_buttons(values, layout)[source]

Set up radio buttons for each input option.

Parameters:
  • values – Dict mapping input names to their paths.

  • layout – Layout to add the radio buttons to.

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.

ignoreall_clicked()[source]

Handle ‘Ignore for all output plugs’ button click.

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

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.

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.

Contains:

Methods:

  • _setup_ui_elements: Create and configure all UI elements.

  • add_tag: Adds a push button.

  • fill_values: Fills the values list when a tag is added or removed.

  • refresh_layout: Updates the layouts (especially when a tag push button is added or removed).

  • remove_tag: Removes a push buttons and makes the changes in the list of values.

  • select_tag: Calls a pop-up to choose a tag.

  • sort_scans: Collects the information and send them to the data browser.

__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.

_setup_ui_elements()[source]

Create and configure all UI elements.

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.

Contains:

Methods:

  • get_filename: Sets the widget’s attributes depending on the selected file name.

Signals:

  • signal_create_project: Emitted when a project has been successfully created.

__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:

file_name_tuple – (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.

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.

Contains:

Methods:

  • get_filename: Sets the widget’s attributes depending on the selected file name.

Signals:

  • signal_create_project: Signal emitted when a valid project is selected.

__init__()[source]

Initialize the dialog used to open an existing Mia project.

Creates a directory selection dialog configured to use the default projects directory as the initial location. The dialog is restricted to selecting directories and uses the Qt widget implementation instead of the platform-native file dialog.

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:

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

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.

Contains:

Methods:

  • admin_mode_switch: Called when the admin mode checkbox is clicked.

  • browse_afni: Called when afni browse button is clicked.

  • browse_ants: Called when ants browse button is clicked.

  • browse_freesurfer: Browse for the FreeSurfer env file.

  • browse_fsl: Called when fsl browse button is clicked.

  • browse_matlab: Called when matlab browse button is clicked.

  • browse_matlab_standalone: Called when matlab browse button is clicked.

  • browse_mri_conv_path: Called when “MRIManager.jar” browse button is clicked.

  • browse_mrtrix: Called when mrtrix browse button is clicked.

  • browse_projects_save_path: Called when “Projects folder” browse button is clicked.

  • browse_resources_path: Called when “resources” browse button is clicked.

  • browse_spm: Called when spm browse button is clicked.

  • browse_spm_standalone: Called when spm standalone browse button is clicked.

  • change_admin_psswd: Method to change the admin password.

  • control_checkbox_toggled: Check before changing controller version.

  • create_afni_group: Create the AFNI group box.

  • create_ants_group: Create the ANTS group box.

  • create_appearance_tab: Create the ‘Appearance’ tab.

  • create_capsul_group: Create the CAPSUL group box.

  • create_freesurfer_group: Create the FreeSurfer group box.

  • create_fsl_group: Create the FSL group box.

  • create_global_preferences: Create the global preferences group box.

  • create_horizontal_box: Create a horizontal box layout with the given widgets.

  • create_matlab_group: Create the Matlab group box.

  • create_mrtrix_group: Create the mrtrix group box.

  • create_pipeline_tab: Create the ‘Pipeline’ tab.

  • create_populse_preferences: Create the Populse third party preferences group box.

  • create_projects_preferences: Create the projects preferences group box.

  • create_resources_preferences: Create the external resources preferences group box.

  • create_spm_group: Create the SPM group box.

  • create_tools_tab: Create the ‘Tools’ tab.

  • edit_capsul_config: Capsul engine edition.

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

  • findChar: Highlights characters in red when using the Find button when editing configuration.

  • load_config: Load the configuration settings.

  • ok_clicked: Saves the modifications to the config file and apply them.

  • save_full_config: Save the full configuration and validate settings.

  • save_minimal_config: Save minimal configuration for CAPSUL config sync purposes.

  • setup_ui: Set up the user interface components.

  • show_error_message: Show an error message dialog.

  • show_warning_message: Show a warning message dialog.

  • update_gui_from_capsul_config: Update the GUI based on the CAPSUL configuration.

  • use_afni_changed: Called when the use_afni checkbox is changed.

  • use_ants_changed: Called when the use_ants checkbox is changed.

  • use_current_mainwindow_size: Use the current main window size.

  • use_freesurfer_changed: Handle the use_freesurfer checkbox change event.

  • use_fsl_changed: Called when the use_fsl checkbox is changed.

  • use_matlab_changed: Called when the use_matlab checkbox is changed.

  • use_matlab_standalone_changed: Called when the use_matlab_standalone checkbox is changed.

  • use_mrtrix_changed: Called when the use_mrtrix checkbox is changed.

  • use_spm_changed: Called when the use_spm checkbox is changed.

  • use_spm_standalone_changed: Called when the use_spm_standalone checkbox is changed.

  • validate_and_save: Validate and save the preferences.

  • validate_matlab_path: Validate the Matlab path.

  • validate_matlab_standalone_path: Validate the Matlab standalone path.

  • validate_paths: Validate the paths and settings.

  • validate_spm_path: Validate the SPM path.

  • validate_spm_standalone_path: Validate the SPM standalone path.

  • validate_tool_path: Validate the tool path.

  • wrong_path: Show a wrong path message.

Signals:

  • signal_preferences_change: Signal emitted when the preferences are successfully validated and saved.

  • use_clinical_mode_signal: Signal emitted when the clinical mode is enabled.

  • not_use_clinical_mode_signal: Signal emitted when the clinical mode is disabled.

__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:

status – (str) 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:

_translate – (callable): 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:

groupbox_capsul – (QGroupBox) 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.

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

:Returns (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:

_translate – (Callable) 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:

_translate – (Callable) 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.

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.

Returns:

(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:
  • title – (str) The title of the error message dialog.

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

show_warning_message(title, message)[source]

Displays a warning message dialog.

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

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

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:

conf – (software_properties.Config: The Mia 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_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:

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

Contains:

Inner functions:

  • 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:
  • path – (str) The path to the Matlab executable.

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

:Returns (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:
  • path – (str) The path to the Matlab standalone directory.

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

:Returns (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.

:Returns (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:
  • path – (str) The file path to the SPM installation.

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

:Returns (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:
  • path – (str) The file path to the SPM standalone installation.

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

:Returns (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:
  • tool_name – (str) The name of the tool to validate (e.g., “FreeSurfer”, “FSL”, “Matlab”, etc.).

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

  • cmd – (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.

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

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

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

Returns:

(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:
  • path – (str) The invalid path entered by the user.

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

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

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).

Contains:

Methods:

  • ok_clicked: saves the modifications and updates the data browser.

Signals:

  • signal_settings_change: Qt signal emitted when project settings are modified.

__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.

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.

Contains:

Methods:

  • can_exit: returns the value of _bool_exit.

  • cancel_clicked: makes the actions to cancel the action.

  • do_not_save_clicked: makes the actions not to save the project.

  • save_as_clicked: makes the actions to save the project.

Signals:

  • save_as_signal: Signal emitted when user chooses to save the project.

  • do_not_save_signal: Signal emitted when user chooses to exit without saving.

  • cancel_signal: Signal emitted when user cancels the exit process.

__init__(project)[source]

Initialize the quit confirmation dialog.

Parameters:

project – Current project with unsaved modifications.

can_exit()[source]

Check if the application can exit.

Returns:

(bool) True if exit is allowed.

cancel_clicked()[source]

Handle cancel action by preventing exit.

do_not_save_clicked()[source]

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

save_as_clicked()[source]

Handle save action by emitting save signal and allowing exit.

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.

Contains:

Methods:

  • cancel_clicked: Handle ‘Cancel’ action.

  • no_all_clicked: Handle ‘No to All’ action.

  • yes_all_clicked: Handle ‘Yes to All’ action.

  • yes_clicked: Handle ‘Yes’ action.

__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.

Contains:

Methods:

  • ok_action: Verifies the selected tags and send the information to the data browser.

  • search_str: Matches the searched pattern with the tags of the project.

Signals:

  • signal_remove_tag: Qt signal emitted when tags are removed.

__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.

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.

Contains:

Methods:

  • fill_input: Fills the input field when a project is clicked on.

  • return_value: Sets the widget’s attributes depending on the selected file name.

Signals:

  • signal_saved_project: Qt signal emitted when a new project name is selected.

__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.

Returns:

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

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.

Contains:

Methods:

  • checkState: Checks if the project still exists and returns the corresponding icon.

  • item_to_path: Returns the path of the first selected item.

  • open_project: Switches to the selected project.

__init__(saved_projects, main_window)[source]

Initialize the PopUpSeeAllProjects dialog.

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

  • main_window – MainWindow instance.

checkState(path)[source]

Determine the icon based on project existence.

Parameters:

path – (str) 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.

Returns:

(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.

Contains:

Methods:

  • ok_clicked: Saves the modifications and updates the data browser.

__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, selected_values)[source]

Bases: QDialog

Dialog allowing the user to choose which values of a tag should be used during an iterated pipeline run.

Contains:

Methods:

  • ok_clicked: Stores selected values and closes the dialog.

__init__(iterated_tag, tag_values, selected_values)[source]

Initializes the selection popup.

Parameters:
  • iterated_tag – (str) Name of the tag whose values can be iterated.

  • tag_values – (list[str]) Available values for the tag.

Selected_values:

(list[str]) Values initially selected when the dialog opens.

ok_clicked()[source]

Stores selected values and closes the dialog.

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.

Contains:

Methods:

  • _create_button: Create a standard button with text and click handler.

  • _setup_ui: Set up the user interface components.

  • cancel_clicked: closes the pop-up.

  • item_clicked: checks the checkbox of an item when the latter is clicked.

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

  • search_str: Matches the searched pattern with the tags of the project.

__init__(project)[source]

Initialize the tag selection dialog.

Parameters:

project – The current project containing the database with available tags.

_setup_ui(_translate)[source]

Set up the user interface components.

Param_translate:

(callable) Localization translation function.

_create_button(text, clicked_handler)[source]

Create a standard button with text and click handler.

Parameters:
  • text – (str) Button text.

  • clicked_handler – (callable) Function to call when button is clicked.

Returns:

(QPushButton) Configured button.

cancel_clicked()[source]

Close the dialog without selecting a tag.

item_clicked(item)[source]

Handle item selection by checking/unchecking tags.

Parameters:

item – (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_search – (str) Text to search for in tag names.

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.

Contains:

Methods:

  • _populate_tag_list: Populate the list widget with tags from the database.

  • ok_clicked: Saves the modifications and updates the mini viewer.

__init__(project)[source]

Initialize the tag selection dialog.

Parameters:

project – The current project in the software context.

_populate_tag_list(field_names)[source]

Populate the list widget with tags from the database.

Parameters:

field_names – (list) List of available field names/tags.

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.

Contains:

Methods:

  • ok_clicked: updates the selected tag and closes the pop-up.

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

Initialize the tag selection pop-up.

Parameters:
  • project – The current project context.

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

  • tag_name_checked – (str) 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

Contains:

Methods:

  • _updateio_table: Fill in the input and output sections of the table.

  • adjust_size: Adjust the size of the dialog based on screen resolution.

  • file_clicked: Close the history window and select the file in the data browser.

  • find_associated_bricks: Find bricks associated with a given node name.

  • find_process_from_plug: Find the process and plug name from a given plug.

  • handle_pipeline_nodes: Handle pipeline nodes and initialize the pipeline visualization

  • highlight_selected_node: Highlight the selected node in the pipeline view.

  • initialize_pipeline: Initialize the pipeline view using the given pipeline XML.

  • io_value_is_scan: Checks if the I/O value is a scan.

  • load_data: Load data from the project database.

  • load_pipeline_data: Load pipeline data from the database.

  • node_selected: Handle node selection and update the table.

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

  • setup_ui: Set up the user interface components.

  • update_table: Update the brick row at the bottom of the table.

  • update_table_for_single_brick: Update the table for a single brick.

  • update_table_for_subpipeline: Update the table for a subpipeline.

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

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

Initialize the document history popup.

Parameters:
  • project – Current project in the software.

  • brick_uuid – (str) Unique identifier of the brick.

:param scan (str) Filename of the scan. :param databrowser: Data browser instance. :param main_window: Main window of the software.

_updateio_table(io_dict, item_idx)[source]

Populate the table’s input and output sections with given dictionary data.

This method dynamically creates table headers and cell widgets based on the input dictionary, handling nested lists and detecting scanned file paths.

Parameters:

io_dict – (dict) Dictionary containing input or output data to be displayed. Keys represent column headers, and values can be strings,

lists, or nested lists. :param item_idx: (int) The starting column index for populating the

table.

Returns:

(int) The updated column index after processing the dictionary.

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:

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

Returns:

(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.

Returns:

(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.

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

highlight_selected_node(node_name)[source]

Highlight the selected node in the pipeline view.

Parameters:

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

initialize_pipeline(full_brick_name)[source]

Initialize the pipeline view using the given pipeline XML.

Parameters:

full_brick_name – (list) 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:
  • brick_uuid – (str) The UUID of the brick to load.

  • scan – (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:
  • history_uuid – (str) The UUID of the history record to load pipeline data from.

  • full_brick_name – (list) 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.

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

  • full_brick_name – (list) 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:
  • inputs – (dict) Dictionary containing input data.

  • outputs – (dict) Dictionary containing output data.

  • brick_name – (str) Name of the brick.

  • init – (str, optional) Initialization status.

  • init_time – (Any, optional) Initialization timestamp.

  • exec – (str, optional) Execution status.

  • exec_time – (Any, optional) Execution timestamp.

Contains:

Inner functions:

  • 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:
  • bricks – (dict) A dictionary of bricks with UUIDs as values.

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

  • full_node_name – (list) 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:
  • bricks – (dict) A dictionary of bricks with UUIDs as values.

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

  • full_node_name – (list) 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:
  • brick_row – (list) A list containing the brick data to update the table with.

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

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.

Contains:

Methods:

  • _create_button: Create a customized QPushButton with specified properties.

  • _create_button_layout: Create the layout for selection buttons.

  • _create_label: Create a customized QLabel with specified properties.

  • _create_left_layout: Create the layout for available tags.

  • _create_right_layout: Create the layout for visualized tags.

  • _create_search_bar: Create the search bar with placeholder and connection.

  • _create_tag_list: Create a QListWidget configured for multi-selection of tags.

  • _populate_tags: Populate the tags list from the project database.

  • _setup_ui: Create and layout the user interface components.

  • search_str: Matches the searched pattern with the tags of the project.

  • click_select_tag: Puts the selected tags in the “selected tag” table.

  • click_unselect_tag: removes the unselected tags from populse_mia “selected tag” table.

Signals:

  • signal_preferences_change: (QtCore.pyqtSignal) Emitted when tag visualization preferences are modified.

__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.

_create_button(object_name, text, click_handler)[source]

Create a customized QPushButton with specified properties.

This method instantiates a QPushButton, sets its object name, translates and sets its text, and connects a click event handler.

Parameters:
  • object_name – (str) The unique identifier name for the button.

  • text – (str) The text to be displayed on the button, will be translated.

  • click_handler – (callable) The function to be called when the button is clicked.

Returns:

(QPushButton) A configured button with the specified properties.

_create_button_layout()[source]

Create the layout for selection buttons.

_create_label(object_name, text)[source]

Create a customized QLabel with specified properties.

This method instantiates a QLabel, sets its text format, object name, and translates its text.

Parameters:
  • object_name – (str) The unique identifier name for the label.

  • text – (str) The text to be displayed on the label, will be translated.

Returns:

(QLabel) A configured label with the specified properties.

_create_left_layout()[source]

Create the layout for available tags.

_create_right_layout()[source]

Create the layout for visualized tags.

Create the search bar with placeholder and connection.

_create_tag_list(text='')[source]

Create a QListWidget configured for multi-selection of tags.

This method initializes a QListWidget with multi-selection mode enabled, allowing users to select multiple items simultaneously. The list widget is assigned a unique object name based on the optional text parameter.

Parameters:

text – (str) A prefix used to create a unique object name for the QListWidget.

:Returns (QListWidget) A configured QListWidget with multi-selection

mode enabled.

_populate_tags()[source]

Populate the tags list from the project database.

_setup_ui()[source]

Create and layout the user interface components.

search_str(str_search)[source]

Filter tags based on search string.

Parameters:

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

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.

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.

Contains:

Methods:

  • mousePressEvent: Override the default mouse press event to emit the clicked signal.

Signals:

  • clicked: (pyqtSignal) Signal emitted when the label is clicked.

__init__(parent=None)[source]

Initialize the clickable label.

Parameters:

parent – (QWidget) Parent widget.

mousePressEvent(event)[source]

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

Parameters:

event – (QMouseEvent) Mouse press event details.