populse_mia package¶
MIA (Multiparametric Image Analysis) is a comprehensive image processing environment primarily designed for the analysis and visualization of large MRI datasets.
MRI data analysis often requires executing complex processing pipelines on datasets acquired during single or multiple MRI exams. In large-scale studies, where data processing must be repeated across numerous acquisition sessions, manually running processing modules or relying on simple ad-hoc scripts can become error-prone, cumbersome, and difficult to reproduce. Additionally, data processing pipelines are often distributed across various heterogeneous toolboxes, developed either in-house or by other researchers, further increasing the complexity of manually invoking these modules.
MIA (populse_mia) aims to simplify complex data processing by providing intuitive tools that define inputs and outputs at a conceptual level. It organizes data based on their roles in an analysis project, such as “scan type,” “subject,” or “subject group,” making it easier to structure and automate workflows.
Contents:
Packages
data_manager: Manages projects and their associated databases.
sources_images: Contains a collection of images used in MIA.
user_interface: Handles the graphical user interface of MIA.
utils: Provides various utility functions for MIA operations.
Modules
info.py: Defines software version, description, and requirements.
main.py: The primary module executed at runtime.
__main__.py: Allows populse_mia to be executed as a module.
software_properties.py: Manages the software’s configuration.
test.py: Contains unit tests.
Subpackages¶
- populse_mia.data_manager package
- Submodules
- populse_mia.data_manager.data_history_inspect module
- populse_mia.data_manager.data_loader module
- populse_mia.data_manager.database_mia module
DatabaseMIA
DatabaseMiaData
DatabaseMiaData.__init__()
DatabaseMiaData.add_document()
DatabaseMiaData.filter_documents()
DatabaseMiaData.get_collection_names()
DatabaseMiaData.get_document()
DatabaseMiaData.get_document_names()
DatabaseMiaData.get_field_attributes()
DatabaseMiaData.get_field_names()
DatabaseMiaData.get_primary_key_name()
DatabaseMiaData.get_shown_tags()
DatabaseMiaData.get_value()
DatabaseMiaData.has_collection()
DatabaseMiaData.has_document()
DatabaseMiaData.remove_document()
DatabaseMiaData.remove_value()
DatabaseMiaData.set_shown_tags()
DatabaseMiaData.set_value()
DatabaseMiaSchema
- populse_mia.data_manager.filter module
- populse_mia.data_manager.project module
Project
Project.__init__()
Project.add_clinical_tags()
Project.cleanup_orphan_bricks()
Project.cleanup_orphan_history()
Project.cleanup_orphan_nonexisting_files()
Project.del_clinical_tags()
Project.files_in_project()
Project.finished_bricks()
Project.getDate()
Project.getFilter()
Project.getFilterName()
Project.getName()
Project.getSortOrder()
Project.getSortedTag()
Project.get_data_history()
Project.get_finished_bricks_in_pipeline()
Project.get_finished_bricks_in_workflows()
Project.get_orphan_bricks()
Project.get_orphan_history()
Project.get_orphan_nonexisting_files()
Project.hasUnsavedModifications()
Project.init_filters()
Project.loadProperties()
Project.redo()
Project.reput_values()
Project.saveConfig()
Project.saveModifications()
Project.save_current_filter()
Project.setCurrentFilter()
Project.setDate()
Project.setName()
Project.setSortOrder()
Project.setSortedTag()
Project.undo()
Project.unsaveModifications()
Project.unsavedModifications
Project.update_db_for_paths()
- populse_mia.data_manager.project_properties module
- populse_mia.user_interface package
- Subpackages
- populse_mia.user_interface.data_browser package
- Submodules
- populse_mia.user_interface.data_browser.advanced_search module
- populse_mia.user_interface.data_browser.count_table module
- populse_mia.user_interface.data_browser.data_browser module
- populse_mia.user_interface.data_browser.mini_viewer module
- populse_mia.user_interface.data_browser.modify_table module
- populse_mia.user_interface.data_browser.rapid_search module
- populse_mia.user_interface.data_viewer package
- populse_mia.user_interface.pipeline_manager package
- Submodules
- populse_mia.user_interface.pipeline_manager.iteration_table module
- populse_mia.user_interface.pipeline_manager.node_controller module
- populse_mia.user_interface.pipeline_manager.pipeline_editor module
- populse_mia.user_interface.pipeline_manager.pipeline_manager_tab module
- populse_mia.user_interface.pipeline_manager.process_library module
- populse_mia.user_interface.pipeline_manager.process_mia module
- populse_mia.user_interface.pipeline_manager.type_editors module
- populse_mia.user_interface.data_browser package
- Submodules
- populse_mia.user_interface.main_window module
MainWindow
MainWindow.__init__()
MainWindow.add_clinical_tags()
MainWindow.check_database()
MainWindow.check_unsaved_modifications()
MainWindow.closeEvent()
MainWindow.create_project_pop_up()
MainWindow.create_tabs()
MainWindow.create_view_actions()
MainWindow.create_view_menus()
MainWindow.create_view_window()
MainWindow.credits()
MainWindow.del_clinical_tags()
MainWindow.delete_project()
MainWindow.documentation()
MainWindow.get_controller_version()
MainWindow.import_data()
MainWindow.install_processes_pop_up()
MainWindow.last_window_closed()
MainWindow.open_project_pop_up()
MainWindow.open_recent_project()
MainWindow.open_shell()
MainWindow.package_library_pop_up()
MainWindow.project_properties_pop_up()
MainWindow.redo()
MainWindow.remove_raw_files_useless()
MainWindow.run_ipconsole_kernel()
MainWindow.save()
MainWindow.saveChoice()
MainWindow.save_as()
MainWindow.save_project_as()
MainWindow.see_all_projects()
MainWindow.set_controller_version()
MainWindow.setup_menu_actions()
MainWindow.setup_window_size()
MainWindow.software_preferences_pop_up()
MainWindow.switch_project()
MainWindow.tab_changed()
MainWindow.undo()
MainWindow.update_project()
MainWindow.update_recent_projects_actions()
- populse_mia.user_interface.pop_ups module
ClickableLabel
DefaultValueListCreation
DefaultValueQLineEdit
PopUpAddPath
PopUpAddTag
PopUpCloneTag
PopUpClosePipeline
PopUpDataBrowserCurrentSelection
PopUpDeleteProject
PopUpDeletedProject
PopUpFilterSelection
PopUpInformation
PopUpInheritanceDict
PopUpMultipleSort
PopUpNewProject
PopUpOpenProject
PopUpPreferences
PopUpPreferences.__init__()
PopUpPreferences.admin_mode_switch()
PopUpPreferences.browse_afni()
PopUpPreferences.browse_ants()
PopUpPreferences.browse_freesurfer()
PopUpPreferences.browse_fsl()
PopUpPreferences.browse_matlab()
PopUpPreferences.browse_matlab_standalone()
PopUpPreferences.browse_mri_conv_path()
PopUpPreferences.browse_mrtrix()
PopUpPreferences.browse_projects_save_path()
PopUpPreferences.browse_resources_path()
PopUpPreferences.browse_spm()
PopUpPreferences.browse_spm_standalone()
PopUpPreferences.change_admin_psswd()
PopUpPreferences.control_checkbox_toggled()
PopUpPreferences.create_afni_group()
PopUpPreferences.create_ants_group()
PopUpPreferences.create_appearance_tab()
PopUpPreferences.create_capsul_group()
PopUpPreferences.create_freesurfer_group()
PopUpPreferences.create_fsl_group()
PopUpPreferences.create_global_preferences()
PopUpPreferences.create_horizontal_box()
PopUpPreferences.create_matlab_group()
PopUpPreferences.create_mrtrix_group()
PopUpPreferences.create_pipeline_tab()
PopUpPreferences.create_populse_preferences()
PopUpPreferences.create_projects_preferences()
PopUpPreferences.create_resources_preferences()
PopUpPreferences.create_spm_group()
PopUpPreferences.create_tools_tab()
PopUpPreferences.edit_capsul_config()
PopUpPreferences.edit_config_file()
PopUpPreferences.findChar()
PopUpPreferences.load_config()
PopUpPreferences.not_use_clinical_mode_signal
PopUpPreferences.ok_clicked()
PopUpPreferences.save_full_config()
PopUpPreferences.save_minimal_config()
PopUpPreferences.setup_ui()
PopUpPreferences.show_error_message()
PopUpPreferences.show_warning_message()
PopUpPreferences.signal_preferences_change
PopUpPreferences.update_gui_from_capsul_config()
PopUpPreferences.use_afni_changed()
PopUpPreferences.use_ants_changed()
PopUpPreferences.use_clinical_mode_signal
PopUpPreferences.use_current_mainwindow_size()
PopUpPreferences.use_freesurfer_changed()
PopUpPreferences.use_fsl_changed()
PopUpPreferences.use_matlab_changed()
PopUpPreferences.use_matlab_standalone_changed()
PopUpPreferences.use_mrtrix_changed()
PopUpPreferences.use_spm_changed()
PopUpPreferences.use_spm_standalone_changed()
PopUpPreferences.validate_and_save()
PopUpPreferences.validate_matlab_path()
PopUpPreferences.validate_matlab_standalone_path()
PopUpPreferences.validate_paths()
PopUpPreferences.validate_spm_path()
PopUpPreferences.validate_spm_standalone_path()
PopUpPreferences.validate_tool_path()
PopUpPreferences.wrong_path()
PopUpProperties
PopUpQuit
PopUpRemoveScan
PopUpRemoveTag
PopUpSaveProjectAs
PopUpSeeAllProjects
PopUpSelectFilter
PopUpSelectIteration
PopUpSelectTag
PopUpSelectTagCountTable
PopUpShowHistory
PopUpShowHistory.__init__()
PopUpShowHistory.adjust_size()
PopUpShowHistory.file_clicked()
PopUpShowHistory.find_associated_bricks()
PopUpShowHistory.find_process_from_plug()
PopUpShowHistory.handle_pipeline_nodes()
PopUpShowHistory.highlight_selected_node()
PopUpShowHistory.initialize_pipeline()
PopUpShowHistory.io_value_is_scan()
PopUpShowHistory.load_data()
PopUpShowHistory.load_pipeline_data()
PopUpShowHistory.node_selected()
PopUpShowHistory.select_node()
PopUpShowHistory.setup_ui()
PopUpShowHistory.update_table()
PopUpShowHistory.update_table_for_single_brick()
PopUpShowHistory.update_table_for_subpipeline()
PopUpShowHistory.update_table_with_brick_data()
PopUpTagSelection
PopUpVisualizedTags
QLabel_clickable
- Subpackages
- populse_mia.utils package
- Submodules
- populse_mia.utils.utils module
PackagesInstall
check_python_version()
check_value_type()
dict4runtime_update()
get_db_field_value()
get_document_names()
get_field_names()
get_shown_tags()
get_value()
launch_mia()
message_already_exists()
remove_document()
set_db_field_value()
set_filters_directory_as_default()
set_item_data()
set_projects_directory_as_default()
table_to_database()
type_name()
verCmp()
verify_processes()
verify_setup()
Submodules¶
populse_mia.info module¶
Define software version, description and requirements
- Contains:
- Function:
get_populse_mia_gitversion
populse_mia.main module¶
The first module used at the mia runtime.
Basically, this module is dedicated to the initialisation of the basic parameters and the various checks necessary for a successful launch of the mia’s GUI.
- Contains:
- Function:
add_to_sys_path
check_package
main
qt_message_handler
- populse_mia.main.add_to_sys_path(path, name, index=0)[source]¶
Adds the specified path to the system path if it’s a valid directory.
- Parameters:
(pathlib.Path) (path) – The directory path to be added to the system path.
(str) (name) – The name of the package being added.
optional) (index (int,) – The index at which to insert the path into sys.path. Defaults to 0.
- Return (bool):
True if the path is a valid directory and was added to sys.path, False otherwise.
- populse_mia.main.check_package(name)[source]¶
Attempts to import a package by its name, logs the location of the package if successful, and logs an error if the package is missing.
- Parameters:
(str) (name) – The name of the package to be imported.
- Return (bool):
True if the package is imported successfully; False if the package is missing.
- populse_mia.main.main(args)[source]¶
Make basic configuration check, then actual launch of Mia.
Checks if Mia is called from the site/dist packages (user mode) or from a cloned git repository (developer mode).
~/.populse_mia/configuration_path.yml is mandatory, if it doesn’t exist or is corrupted, try to create one with a valid properties path.
- If launched from a cloned git repository (developer mode):
the properties_path is the “properties_dev_path” parameter in ~/.populse_mia/configuration_path.yml
- If launched from the site/dist packages (user mode):
the properties_path is the “properties_user_path” parameter in ~/.populse_mia/configuration_path.yml
Launches the verify_processes() function, then the launch_mia() function (Mia’s real launch).
populse_mia.software_properties module¶
Module that handle the configuration of the software
Load and save the parameters from the miniviewer and the MIA preferences pop-up in the config.yml file.
- Contains:
- Class:
Config
- class populse_mia.software_properties.Config(properties_path=None)[source]¶
Bases:
object
Object that handles the configuration of the software
- Contains:
- Methods:
get_admin_hash: get the value of the hash of the admin password
get_afni_path: returns the path of AFNI
get_ants_path: returns the path of ANTS
getBackgroundColor: get background color
get_capsul_config: get CAPSUL config dictionary
- get_capsul_engine: get a global CapsulEngine object used for all
operations in MIA application
- getChainCursors: returns if the “chain cursors” checkbox of the
mini-viewer is activated
get_freesurfer_setup: get freesurfer path
get_fsl_config: returns the path of the FSL config file
get_mainwindow_maximized: get the maximized (full-screen) flag
get_mainwindow_size: get the main window size
get_matlab_command: returns Matlab command
get_matlab_path: returns the path of Matlab’s executable
- get_matlab_standalone_path: returns the path of Matlab Compiler
Runtime
- get_max_projects: returns the maximum number of projects
displayed in the “Saved projects” menu
- get_max_thumbnails: get max thumbnails number at the data
browser bottom
get_properties_path: returns the software’s properties path
get_mri_conv_path: returns the MRIManager.jar path
get_mrtrix_path: returns mrtrix path
- getNbAllSlicesMax: returns the maximum number of slices to
display in the mini viewer
get_opened_projects: returns the opened projects
- get_projects_save_path: returns the folder where the projects
are saved
- get_referential: returns boolean to indicate DataViewer
referential
get_resources_path: get the resources path
- getShowAllSlices: returns if the “show all slices” checkbox of
the mini viewer is activated
getSourceImageDir: get the source directory for project images
get_spm_path: returns the path of SPM12 (license version)
- get_spm_standalone_path: returns the path of SPM12 (standalone
version)
getTextColor: return the text color
- getThumbnailTag: returns the tag that is displayed in the mini
viewer
- get_use_afni: returns the value of “use afni” checkbox in the
preferences
- get_use_ants: returns the value of “use ants” checkbox in the
preferences
- get_use_clinical: returns the value of “clinical mode” checkbox
in the preferences
- get_use_freesurfer: returns the value of “use freesurfer”
checkbox in the preferences
- get_use_fsl: returns the value of “use fsl” checkbox in the
preferences
- get_use_matlab: returns the value of “use matlab” checkbox in
the preferences
- get_use_matlab_standalone: returns the value of “use matlab
standalone” checkbox in the preferences
- get_use_mrtrix: returns the value of “use mrtrix” checkbox in
the preferences
get_user_level: get the user level in the Capsul config
- get_user_mode: returns the value of “user mode” checkbox
in the preferences
- get_use_spm: returns the value of “use spm” checkbox in the
preferences
- get_use_spm_standalone: returns the value of “use spm standalone”
checkbox in the preferences
- getViewerConfig: returns the DataViewer configuration (neuro or
radio), by default neuro
- getViewerFramerate: returns the DataViewer framerate for
automatic time running images
isAutoSave: checks if auto-save mode is activated
- isControlV1: checks if the selected display of the controller is
of V1 type
- isRadioView: checks if miniviewer in radiological orientation (if
not, then it is in neurological orientation)
loadConfig: reads the config in the config.yml file
saveConfig: saves the config to the config.yml file
set_admin_hash: set the password hash
set_afni_path: set the path of the AFNI
set_ants_path: set the path of the ANTS
set_mrtrix_path: set the path of mrtrix
setAutoSave: sets the auto-save mode
setBackgroundColor: sets the background color
set_capsul_config: set CAPSUL configuration dict into MIA config
- setChainCursors: set the “chain cursors” checkbox of the mini
viewer
- set_clinical_mode: set the value of “clinical mode” in
the preferences
setControlV1: Set controller display mode (True if V1)
set_freesurfer_setup: set freesurfer path
set_fsl_config: set the path of the FSL config file
set_mainwindow_maximized: set the maximized (fullscreen) flag
set_mainwindow_size: set main window size
set_matlab_path: set the path of Matlab’s executable
- set_matlab_standalone_path: set the path of Matlab Compiler
Runtime
- set_max_projects: set the maximum number of projects displayed in
the “Saved projects” menu
- set_max_thumbnails: set max thumbnails number at the data browser
bottom
set_mri_conv_path: set the MRIManager.jar path
- setNbAllSlicesMax: set the maximum number of slices to display in
the mini viewer
set_opened_projects: set the opened projects
- set_projects_save_path: set the folder where the projects are
saved
- set_radioView: set the orientation in miniviewer (True for
radiological, False for neurological orientation)
set_referential: set the DataViewer referential
set_resources_path: Set the resources path
- setShowAllSlices: set the “show all slices” checkbox of the mini
viewer
setSourceImageDir: set the source directory for project images
set_spm_path: set the path of SPM12 (license version)
- set_spm_standalone_path: set the path of SPM12 (standalone
version)
setTextColor: set the text color
setThumbnailTag: set the tag that is displayed in the mini viewer
- set_use_afni: set the value of “use afni” checkbox in the
preferences
- set_use_ants: set the value of “use ants” checkbox in the
preferences
- set_use_freesurfer: set the value of “use freesurfer” checkbox
in the preferences
- set_use_fsl: set the value of “use fsl” checkbox in the
preferences
- set_use_matlab: set the value of “use matlab” checkbox in the
preferences
- set_use_matlab_standalone: set the value of “use matlab
standalone” checkbox in the preferences
- set_use_mrtrix: set the value of “use mrtrix” checkbox in the
preferences
- set_user_mode: set the value of “user mode” checkbox in
the preferences
- set_use_spm: set the value of “use spm” checkbox in the
preferences
- set_use_spm_standalone: set the value of “use spm standalone”
checkbox in the preferences
setViewerConfig: set the Viewer configuration neuro or radio
- setViewerFramerate: set the Viewer frame rate for automatic
running time images
- update_capsul_config: update a global CapsulEngine object used
for all operations in MIA application
- __init__(properties_path=None)[source]¶
Initialization of the Config class
- Parameters:
(str) (properties_path) – If provided, the configuration file will be loaded/saved from the given directory. Otherwise, the regular heuristics will be used to determine the config path. This option allows to use an alternative config directory (for tests for instance).
- capsul_engine = None¶
- getBackgroundColor()[source]¶
Get background color.
- Return (str):
Background color, or “” if unknown.
- getChainCursors()[source]¶
Get the value of the checkbox ‘chain cursor’ in miniviewer.
- Return (bool):
Value of the checkbox.
- getNbAllSlicesMax()[source]¶
Get number the maximum number of slices to display in the miniviewer.
- Return (int):
Maximum number of slices to display in miniviewer.
- getShowAllSlices()[source]¶
Get whether the show_all_slices parameters was enabled or not in the miniviewer.
- Return (bool):
True if the show_all_slices parameters was enabled.
- getThumbnailTag()[source]¶
Get the tag of the thumbnail displayed in the miniviewer.
- Return (str):
The tag of the thumbnail displayed in miniviewer.
- getViewerConfig()[source]¶
Get the viewer config “neuro” or “radio”, “neuro” by default.
- Return (str):
The viewer config (“neuro” or “radio”).
- getViewerFramerate()[source]¶
Get the Viewer framerate.
- Return (str):
The Viewer framerat (ex. “5”).
- get_admin_hash()[source]¶
Retrieves the hashed admin password from the configuration.
- Returns:
The hashed admin password if found in config, False if not present in config.
- get_capsul_config(sync_from_engine=True)[source]¶
Retrieve and construct the Capsul configuration dictionary.
This function builds a configuration dictionary for Capsul, incorporating settings for various neuroimaging tools and processing engines. It manages configurations for tools like SPM, FSL, FreeSurfer, MATLAB, AFNI, ANTs, and MRTrix.
The function first retrieves local settings for each tool from the Mia preferences, then constructs the appropriate configuration structure. If requested, it can synchronize the configuration with the current Capsul engine state.
- Parameters:
(bool) (sync_from_engine) – If True, synchronizes the configuration with the current Capsul engine settings after building the base configuration.
- Return (dict):
A nested dictionary containing the complete Capsul configuration, structured with the following main sections: - engine_modules: List of available processing modules - engine: Contains global and environment-specific
settings
tool-specific configurations (SPM, FSL, etc.)
- Private functions:
_configure_spm: Configure SPM settings.
_configure_tool:
- static get_capsul_engine()[source]¶
Get or create a global CapsulEngine singleton for Mia application operations.
The engine is created only once when first needed (lazy initialization). Subsequent calls return the same instance.
- Returns:
CapsulEngine: The global CapsulEngine instance.
- get_freesurfer_setup()[source]¶
Get the freesurfer path.
- Return (str):
Path to freesurfer, or “” if unknown.
- get_fsl_config()[source]¶
Get the FSL config file path.
- Return (str):
Path to the fsl/etc/fslconf/fsl.sh file.
- get_mainwindow_maximized()[source]¶
Get the maximized (fullscreen) flag.
- Return (bool):
Maximized (fullscreen) flag.
- get_matlab_command()[source]¶
Retrieves the appropriate Matlab command based on the configuration.
- Return (str):
The Matlab executable path or None if no path is specified.
- get_matlab_standalone_path()[source]¶
Get the path to matlab compiler runtime.
- Return (str):
A path.
- get_max_projects()[source]¶
Retrieves the maximum number of projects displayed in the “Saved projects” menu.
- Return (int):
The maximum number of projects. Defaults to 5 if not specified.
- get_max_thumbnails()[source]¶
Retrieves the maximum number of thumbnails displayed in the mini-viewer at the bottom of the data browser.
- Return (int):
The maximum number of thumbnails. Defaults to 5 if not specified.
- get_properties_path()[source]¶
Retrieves the path to the folder containing the “processes” and “properties” directories of Mia.
The properties path is defined in the configuration_path.yml file, located in ~/.populse_mia.
In user mode, the path is retrieved from the properties_user_path parameter.
In developer mode, the path is retrieved from the properties_dev_path parameter.
If outdated parameters (mia_path, mia_user_path) are found, they are automatically updated in the configuration file.
- Return (str):
The absolute path to the properties folder.
- get_referential()[source]¶
Retrieves the chosen referential from the anatomist_2 data viewer.
- Return (str):
“0” for World Coordinates, “1” for Image ref.
- get_spm_standalone_path()[source]¶
Get the path to the SPM12 standalone version.
- Return (str):
A path.
- get_use_afni()[source]¶
Get the value of “use afni” checkbox in the preferences.
- Return (bool):
The value of “use afni” checkbox.
- get_use_ants()[source]¶
Get the value of “use ants” checkbox in the preferences.
- Return (bool):
The value of “use ants” checkbox.
- get_use_clinical()[source]¶
Get the clinical mode in the preferences.
- Return (bool):
The clinical mode.
- get_use_freesurfer()[source]¶
Get the value of “use freesurfer” checkbox in the preferences.
- Return (bool):
The value of “use freesurfer” checkbox.
- get_use_fsl()[source]¶
Get the value of “use fsl” checkbox in the preferences.
- Return (bool):
The value of “use fsl” checkbox.
- get_use_matlab()[source]¶
Get the value of “use matlab” checkbox in the preferences.
- Return (bool):
The value of “use matlab” checkbox.
- get_use_matlab_standalone()[source]¶
Get the value of “use matlab standalone” checkbox in the preferences.
- Return (bool):
The value of “use matlab standalone” checkbox.
- get_use_mrtrix()[source]¶
Get the value of “use mrtrix” checkbox in the preferences.
- Return (bool):
The value of “use mrtrix” checkbox.
- get_use_spm()[source]¶
Get the value of “use spm” checkbox in the preferences.
- Return (bool):
The value of “use spm” checkbox.
- get_use_spm_standalone()[source]¶
Get the value of “use spm standalone” checkbox in the preferences.
- Return (bool):
The value of “use spm standalone” checkbox.
- get_user_level()[source]¶
Get the user level in the Capsul config.
- Return (int):
The user level in the Capsul config.
- get_user_mode()[source]¶
Get if user mode is disabled or enabled in the preferences.
- Return (bool):
If True, the user mode is enabled.
- isAutoSave()[source]¶
Get if the auto-save mode is enabled or not.
- Return (bool):
If True, auto-save mode is enabled.
- isControlV1()[source]¶
Gets whether the controller display is of type V1.
- Return (bool):
If True, V1 controller display.
- isRadioView()[source]¶
Get if the display in miniviewer is in radiological orientation.
- Return (bool):
If True, radiological orientation, otherwise neurological orientation.
- loadConfig()[source]¶
Read the config from config.yml file.
Attempts to read an encrypted YAML configuration file from the properties directory, decrypt it using Fernet encryption, and parse it as YAML.
- Return (dict):
Parsed configuration from the YAML file. Returns empty dict if parsing fails.
- saveConfig()[source]¶
Save the current parameters in the config.yml file.
Encrypts and writes the current configuration (self.config) to config.yml using Fernet encryption. Creates the necessary directory structure if it doesn’t exist. After saving, updates the capsul configuration.
- setBackgroundColor(color)[source]¶
Set background color and save configuration.
- Parameters:
color – Color string (‘Black’, ‘Blue’, ‘Green’, ‘Grey’, ‘Orange’, ‘Red’, ‘Yellow’, ‘White’)
- setChainCursors(chain_cursors)[source]¶
Set the value of the checkbox ‘chain cursor’ in the mini viewer.
- Parameters:
chain_cursors – A boolean.
- setControlV1(controlV1)[source]¶
Set controller display mode (True if V1).
- Parameters:
controlV1 – A boolean.
- setNbAllSlicesMax(nb_slices_max)[source]¶
Set the number of slices to display in the mini-viewer.
- Parameters:
(int) (nb_slices_max) – maximum number of slices to display.
- setShowAllSlices(show_all_slices)[source]¶
Set the show_all_slides setting in miniviewer.
- Parameters:
show_all_slices – A boolean.
- setSourceImageDir(source_image_dir)[source]¶
Set the source directory for project images.
- Parameters:
source_image_dir – A path (str).
- setTextColor(color)[source]¶
Set text color and save configuration.
- Parameters:
color – Color string (‘Black’, ‘Blue’, ‘Green’, ‘Grey’, ‘Orange’, ‘Red’, ‘Yellow’, ‘White’)
- setThumbnailTag(thumbnail_tag)[source]¶
Set the tag that is displayed in the mini-viewer.
- Parameters:
thumbnail_tag – A string.
- setViewerConfig(config_NeuRad)[source]¶
sets user’s configuration neuro or radio for data_viewer.
neuro: neurological
radio: radiological
- Parameters:
config_NeuRad – A string.
- setViewerFramerate(im_sec)[source]¶
sets user’s framerate for data_viewer.
- Parameters:
(int) (im_sec) – Number of images per second.
- set_capsul_config(capsul_config_dict)[source]¶
Update Mia configuration with Capsul settings and synchronize tools configuration.
Called after editing Capsul config (via File > Mia preferences > Pipeline tab > Edit CAPSUL config) to synchronize Capsul settings with Mia preferences. Configures various neuroimaging tools AFNI, ANTs, FSL, etc.) based on the Capsul engine configuration.
- Parameters:
(dict) (capsul_config_dict) –
- Dictionary containing Capsul
configuration with structure:
- {
- ‘engine’: {
‘environment_name’: {…configuration…}
}, ‘engine_modules’: […]
}
- Contains:
- Private function:
- _configure_standalone_spm: Configures standalone SPM and
MCR.
_configure_matlab_spm: Configures SPM and MATLAB.
_configure_matlab_only: Configures MATLAB without SPM.
_configure_mcr_only: Configures MCR without SPM.
- _disable_matlab_spm: Disables all MATLAB and SPM
configurations.
- _get_module_config: Extracts module configuration from the
global Capsul configuration.
- set_clinical_mode(clinical_mode)[source]¶
Enable or disable clinical mode.
- Parameters:
clinical_mode – A boolean.
- set_freesurfer_setup(path)[source]¶
Set the freesurfer config file.
- Parameters:
(str) (path) – Path to freesurfer/FreeSurferEnv.sh.
- set_fsl_config(path)[source]¶
Set the FSL config file.
- Parameters:
(str) (path) – Path to fsl/etc/fslconf/fsl.sh.
- set_mainwindow_maximized(enabled)[source]¶
Set the maximized (full-screen) flag.
- Parameters:
enabled – A boolean.
- set_matlab_path(path)[source]¶
Set the path of Matlab’s executable.
- Parameters:
path – A path (str).
- set_matlab_standalone_path(path)[source]¶
Set the path of Matlab Compiler Runtime.
- Parameters:
path – A path (str).
- set_max_projects(nb_max_projects)[source]¶
Set the maximum number of projects displayed in the “Saved projects” menu.
- Parameters:
nb_max_projects – An integer.
- set_max_thumbnails(nb_max_thumbnails)[source]¶
Set max thumbnails number at the data browser bottom.
- Parameters:
nb_max_thumbnails – An integer.
- set_opened_projects(new_projects)[source]¶
Set the list of opened projects and saves the modification.
- Parameters:
(list[str]) (new_projects) – A list of paths.
- set_projects_save_path(path)[source]¶
Set the folder where the projects are saved.
- Parameters:
path – A path (str).
- set_radioView(radio_view)[source]¶
Set the radiological/neurological orientation in mini viewer.
True for radiological
False for neurological
- Parameters:
radio_view – A boolean.
- set_referential(ref)[source]¶
Set the referential to “image Ref” or “World Coordinates” in anatomist_2 data viewer.
- Parameters:
(str) (ref) – “0” for World Coordinates, “1” for Image Ref.
- set_spm_standalone_path(path)[source]¶
Set the path of SPM (standalone version).
- Parameters:
path – A path (str).
- set_use_afni(use_afni)[source]¶
Set the value of “use_afni” checkbox in the preferences.
- Parameters:
use_afni – A boolean.
- set_use_ants(use_ants)[source]¶
Set the value of “use_ants” checkbox in the preferences.
- Parameters:
use_ants – A boolean.
- set_use_freesurfer(use_freesurfer)[source]¶
Set the value of “use_freesurfer” checkbox in the preferences.
- Parameters:
use_freesurfer – A boolean.
- set_use_fsl(use_fsl)[source]¶
Set the value of “use_fsl” checkbox in the preferences.
- Parameters:
use_fsl – A boolean.
- set_use_matlab(use_matlab)[source]¶
Set the value of “use matlab” checkbox in the preferences.
- Parameters:
use_matlab – A boolean.
- set_use_matlab_standalone(use_matlab_standalone)[source]¶
Set the value of “use_matlab_standalone” checkbox in the preferences.
- Parameters:
use_matlab – A boolean.
- set_use_mrtrix(use_mrtrix)[source]¶
Set the value of “use_mrtrix” checkbox in the preferences.
- Parameters:
use_mrtrix – A boolean.
- set_use_spm(use_spm)[source]¶
Set the value of “use spm” checkbox in the preferences.
- Parameters:
use_spm – A boolean.
- set_use_spm_standalone(use_spm_standalone)[source]¶
Set the value of “use spm standalone” checkbox in the preferences.
- Parameters:
use_spm_standalone – A boolean.
- update_capsul_config()[source]¶
Updates the global CapsulEngine object used for all operations in the Mia application.
The CapsulEngine is created once when needed and updated each time the configuration is saved. This method ensures that all necessary engine modules are loaded and configurations are properly imported from the saved settings.
- Return (capsul.engine.CapsulEngine):
The updated CapsulEngine object, or None if the engine is not initialized.