populse_mia.user_interface package

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

Contains:
Module:
  • main_window

  • pipeline_manager

  • data_browser

  • pop_ups

Subpackages

Submodules

populse_mia.user_interface.main_window module

Module to define main window appearance, functions and settings.

Initialize the software appearance and defines interactions with the user.

Contains:
Class:
  • MainWindow

  • _ProcDeleter

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

Bases: QMainWindow

Initialize software appearance and define interactions with the user.

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

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

Parameter:
  • project:

    current project in the software

  • test:

    boolean if the widget is launched from unit tests or not

  • deleted_projects:

    projects that have been deleted

add_clinical_tags()[source]

Add the clinical tags to the database and the data browser

check_database()[source]

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

check_unsaved_modifications()[source]

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

Returns:

Boolean. True if there are unsaved modifications, False otherwise

closeEvent(event)[source]

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

Parameters:

event – closing event

create_project_pop_up()[source]

Create a new project.

create_tabs()[source]

Create the tabs and initializes the DataBrowser and PipelineManager classes.

create_view_actions()[source]

Create the actions and their shortcuts in each menu

create_view_menus()[source]

Create the menu-bar view.

create_view_window()[source]

Create the main window view.

credits()[source]

Open the credits in a web browser

del_clinical_tags()[source]

Remove the clinical tags to the database and the data browser

delete_project()[source]

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

static documentation()[source]

Open the documentation in a web browser.

get_controller_version()[source]

Gives the value of the controller_version_changed attribute.

Returns:

Boolean

import_data()[source]

Call the import software (MRI File Manager), reads the imported files and loads them into the database.

install_processes_pop_up(folder=False)[source]

Open the install processes pop-up.

Parameters:

folder – boolean, True if installing from a folder

static last_window_closed()[source]

Force exit the event loop after ipython console is closed.

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

open_project_pop_up()[source]

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

open_recent_project()[source]

Open a recent project.

open_shell()[source]

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

package_library_pop_up()[source]

Open the package library pop-up

project_properties_pop_up()[source]

Open the project properties pop-up

redo()[source]

Redo the last action made by the user.

remove_raw_files_useless()[source]

Remove the useless raw files of the current project, close the database connection. The project is not valid any longer after this call.

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

blabla

save()[source]

Save either the current project or the current pipeline

saveChoice()[source]

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

save_as()[source]

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

save_project_as()[source]

Open a pop-up to save the current project as

see_all_projects()[source]

Open a pop-up to show the recent projects.

set_controller_version()[source]

Reverses the value of the controller_version_changed attribute.

From False to True and vice versa

software_preferences_pop_up()[source]

Open the Mia preferences pop-up.

switch_project(file_path, name)[source]

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

Parameters:
  • file_path – raw file_path

  • name – project name

Returns:

Boolean

tab_changed()[source]

Update the window when the tab is changed.

undo()[source]

Undo the last action made by the user.

update_project(file_path, call_update_table=True)[source]

Update the project once the database has been updated. Update the database, the window title and the recent and saved projects menus.

Parameters:
  • file_path – File name of the new project

  • call_update_table – boolean, True if we need to call

update_recent_projects_actions()[source]

Update the list of recent projects.

populse_mia.user_interface.pop_ups module

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

Contains:
Class:
  • ClickableLabel

  • DefaultValueListCreation

  • DefaultValueQLineEdit

  • PopUpAddPath

  • PopUpAddTag

  • PopUpCloneTag

  • PopUpClosePipeline

  • PopUpDataBrowserCurrentSelection

  • PopUpDeletedProject

  • PopUpDeleteProject

  • PopUpFilterSelection

  • PopUpInformation

  • PopUpInheritanceDict

  • PopUpMultipleSort

  • PopUpNewProject

  • PopUpOpenProject

  • PopUpPreferences

  • PopUpProperties

  • PopUpQuit

  • PopUpRemoveScan

  • PopUpRemoveTag

  • PopUpSaveProjectAs

  • PopUpSeeAllProjects

  • PopUpSelectFilter

  • PopUpSelectIteration

  • PopUpTagSelection (must precede PopUpSelectTag)

  • PopUpSelectTag

  • PopUpSelectTagCountTable

  • PopUpShowHistory

  • PopUpVisualizedTags

  • QLabel_clickable

class populse_mia.user_interface.pop_ups.ClickableLabel[source]

Bases: QLabel

QLabel with a clicked signal

__init__()[source]
clicked
mousePressEvent(event)[source]

Overrides the mousePressEvent method by emitting the clicked signal

Parameters:

event – clicked event

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

Bases: QDialog

Widget that is called when to create a list’s default value.

__init__(parent, type)[source]

Initialization.

Parameters:
  • parent – the DefaultValueQLineEdit parent object

  • type – type of the list (e.g. list of int, list of float, etc.)

add_element()[source]

One more element added to the list.

default_init_table()[source]

Default init table when no previous value

remove_element()[source]

Removes the last element of the list.

resize_table()[source]

To resize the pop up depending on the table.

update_default_value()[source]

Checks if the values are correct and updates the parent value.

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

Bases: QLineEdit

Overrides the QLineEdit for the default value.

We need to override the mousePressEvent.

__init__(parent)[source]
mousePressEvent(event)[source]

Mouse pressed on the QLineEdit.

Parameters:

event – used ?

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

Bases: QDialog

Is called when the user wants to add a document to the project

without importing from MRI Files Manager (File > Import).

__init__(project, databrowser)[source]

Initialization of the PopUp AddPath.

Parameters:
  • project – current project in the software

  • databrowser – data browser instance of the software

file_to_choose()[source]

Lets the user choose a file to import.

find_type()[source]

Tries to find the document type when the document is changed.

save_path()[source]

Adds the path to the database and the data browser.

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

Bases: QDialog

Is called when the user wants to add a tag to the project.

__init__(databrowser, project)[source]

Initialization.

Parameters:
  • project – current project in the software

  • databrowser – data browser instance of the software

  • type – type of the tag to add

ok_action()[source]

Verifies that each field is correct and send the new tag to the data browser.

on_activated(text)[source]

Type updated.

Parameters:

text – New type

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

Bases: QDialog

Is called when the user wants to clone a tag to the project.

__init__(databrowser, project)[source]

Initialization.

Parameters:
  • project – current project in the software

  • databrowser – data browser instance of the software

ok_action(project)[source]
Verifies the specified name is correct and send the

information to the data browser.

Parameters:

project – current project

search_str(project, str_search)[source]

Matches the searched pattern with the tags of the project.

Parameters:
  • project – current project

  • str_search – string pattern to search

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

Bases: QDialog

Is called when the user closes a pipeline editor that has been modified.

Parameters:
  • bool_save_as – boolean to True if the pipeline needs to be saved

  • bool_exit – boolean to True if we can exit the editor

  • save_as_signal – signal emitted to save the pipeline under another name

  • do_not_save_signal – signal emitted to close the editor

  • cancel_signal – signal emitted to cancel the action

__init__(pipeline_name)[source]

Initialization.

Parameters:

pipeline_name – name of the pipeline (basename)

can_exit()[source]

Returns the value of bool_exit.

Returns:

bool_exit value

cancel_clicked()[source]

Makes the actions to cancel the action.

cancel_signal
do_not_save_clicked()[source]

Makes the actions not to save the pipeline.

do_not_save_signal
save_as_clicked()[source]

Makes the actions to save the pipeline.

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

Bases: QDialog

Is called to display the current data_browser selection.

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

Initialization.

Parameters:
  • project – current project in the software

  • databrowser – data browser instance of the software

  • filter – list of the current documents in the data browser

  • main_window – main window of the software

ok_clicked()[source]

Updates the “scan_list” attribute of several widgets.

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

Bases: QDialog

Is called when the user wants to delete a project.

__init__(main_window)[source]

Initialization.

ok_clicked()[source]

Delete the selected projects after confirmation.

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

Bases: QMessageBox

Indicate the names of deleted project when the software starts.

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

Bases: QDialog

Is called when the user wants to open a filter that has already been

saved.

Methods:
  • cancel_clicked: closes the pop-up

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

  • search_str: matches the searched pattern with the saved filters

__init__(project)[source]

Initialization.

Parameters:

project – current project in the software

cancel_clicked()[source]

Closes the pop-up.

ok_clicked()[source]

Actions when the “OK” button is clicked.

search_str(str_search)[source]

Matches the searched pattern with the saved filters.

Parameters:

str_search – string pattern to search

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

Bases: QWidget

Is called when the user wants to display the current project’s information.

__init__(project)[source]

Initialization.

Parameters:

project – current project in the software

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

Bases: QDialog

Is called to select from which input the output will inherit the tags.

Methods:
  • on_clicked: event when radiobutton is clicked

  • ok_clicked: event when ok button is clicked

  • okall_clicked: event when Ok all button is clicked

  • ignore_clicked: event when ignore button is clicked

  • ignoreall_clicked:event when ignore all plugs button is clicked

  • ignore_node_clicked: event when ignore all nodes button is clicked

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

Initialization

Parameters:
  • values – A dictionary with input name as key and their paths as values

  • node_name – name of the current node

  • plug_name – name of the current output plug

  • iterate – boolean, iteration or not

ignore_clicked()[source]

Event when ignore button is clicked

ignore_node_clicked()[source]

Event when ignore all nodes button is clicked

ignoreall_clicked()[source]

Event when ignore all plugs button is clicked

ok_clicked()[source]

Event when ok button is clicked

okall_clicked()[source]

Event when Ok all button is clicked

on_clicked()[source]

Event when radiobutton is clicked

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

Bases: QDialog

Is called to sort the data browser’s table depending on multiple tags.

__init__(project, table_data_browser)[source]

Initialization.

Parameters:
  • project – current project in the software

  • table_data_browser – data browser’s table of the software

add_tag()[source]

Adds a push button.

fill_values(idx)[source]

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

Parameters:

idx – index of the pressed push button

refresh_layout()[source]

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

remove_tag()[source]

Removes a push buttons and makes the changesn in the list of values.

select_tag(idx)[source]

Calls a pop-up to choose a tag.

Parameters:

idx – index of the pressed push button

sort_scans()[source]

Collects the information and send them to the data browser.

class populse_mia.user_interface.pop_ups.PopUpNewProject[source]

Bases: QFileDialog

Is called when the user wants to create a new project.

__init__()[source]

Initialization.

get_filename(file_name_tuple)[source]

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

Parameters:

file_name_tuple – tuple obtained with the selectedFiles method

Returns:

real file name

signal_create_project
class populse_mia.user_interface.pop_ups.PopUpOpenProject[source]

Bases: QFileDialog

Is called when the user wants to open project.

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

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

Parameters:

file_name_tuple – tuple obtained with the selectedFiles method

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

Bases: QDialog

Is called when the user wants to change the software preferences.

__init__(main_window)[source]

Initialization.

Parameters:

main_window – main window object of the software

admin_mode_switch()[source]

Called when the admin mode checkbox is clicked.

browse_afni()[source]

Called when afni browse button is clicked.

browse_ants()[source]

Called when ants browse button is clicked.

browse_freesurfer()[source]

Called when freesurfer browse button is clicked.

browse_fsl()[source]

Called when fsl browse button is clicked.

browse_matlab()[source]

Called when matlab browse button is clicked.

browse_matlab_standalone()[source]

Called when matlab browse button is clicked.

browse_mri_conv_path()[source]

Called when “MRIFileManager.jar” browse button is clicked.

browse_mrtrix()[source]

Called when mrtrix browse button is clicked.

browse_projects_save_path()[source]

Called when “Projects folder” browse button is clicked.

browse_resources_path()[source]

Called when “resources” browse button is clicked.

browse_spm()[source]

Called when spm browse button is clicked.

browse_spm_standalone()[source]

Called when spm standalone browse button is clicked.

change_admin_psswd(status)[source]

Method to change the admin password.

Parameters:

status – String

control_checkbox_toggled(main_window)[source]

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

Parameters:

main_window – main window object of the software

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’ when editing configuration.

not_use_clinical_mode_signal
ok_clicked()[source]

Blabla

signal_preferences_change
use_afni_changed()[source]

Called when the use_afni checkbox is changed.

use_ants_changed()[source]

Called when the use_ants checkbox is changed.

use_clinical_mode_signal
use_current_mainwindow_size(main_window)[source]

Blabla

use_freesurfer_changed()[source]

Called when the use_freesurfer checkbox is changed.

use_fsl_changed()[source]

Called when the use_fsl checkbox is changed.

use_matlab_changed()[source]

Called when the use_matlab checkbox is changed.

use_matlab_standalone_changed()[source]

Called when the use_matlab_standalone checkbox is changed.

use_mrtrix_changed()[source]

Called when the use_mrtrix checkbox is changed.

use_spm_changed()[source]

Called when the use_spm checkbox is changed.

use_spm_standalone_changed()[source]

Called when the use_spm_standalone checkbox is changed.

validate_and_save(OK_clicked=False)[source]

Saves the modifications to the config file and apply them.

Parameters:

OK_clicked – a boolean. If False, only make a minimal backup of the settings to allow synchronisation with capsul config. If True, should only correspond to the moment when we finally exit the Mia config, all parameters are saved and tested.

Returns:

True if all is fine, False if a problem has been encountered

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

Blabla

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

Bases: QDialog

Is called when the user wants to change the current project’s

properties (File > properties).

__init__(project, databrowser, old_tags)[source]

Initialization

Parameters:
  • project – current project in the software

  • databrowser – data browser instance of the software

  • old_tags – visualized tags before opening this dialog

ok_clicked()[source]

Saves the modifications and updates the data browser.

signal_settings_change
class populse_mia.user_interface.pop_ups.PopUpQuit(database)[source]

Bases: QDialog

Is called when the user closes the software and the current project has

been modified.

__init__(database)[source]

Initialization.

Parameters:

database – current database in the project

can_exit()[source]

Return the value of bool_exit.

Returns:

bool_exit value

cancel_clicked()[source]

Makes the actions to cancel the action.

cancel_signal
do_not_save_clicked()[source]

Makes the actions not to save the project.

do_not_save_signal
save_as_clicked()[source]

Makes the actions to save the project.

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

Bases: QDialog

Is called when the user wants to remove a scan that was previously sent

to the pipeline manager.

Parameters:
  • scan – The scan that may be removed

  • size

    The number of scan the user wants to remove

__init__(scan, size)[source]
cancel_clicked()[source]

Blabla

no_all_clicked()[source]

Blabla

yes_all_clicked()[source]

Blabla

yes_clicked()[source]

Blabla

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

Bases: QDialog

Is called when the user wants to remove a user tag from

populse_mia project.

__init__(databrowser, project)[source]

Initialization

Parameters:
  • databrowser – current project in the software

  • project – data browser instance of the software

ok_action()[source]

Verifies the selected tags and send the information to the data browser.

search_str(str_search)[source]

Matches the searched pattern with the tags of the project

Parameters:

str_search – string pattern to search

signal_remove_tag
class populse_mia.user_interface.pop_ups.PopUpSaveProjectAs[source]

Bases: QDialog

Is called when the user wants to save a project under another name.

__init__()[source]
fill_input(name)[source]

Fills the input field with the name of a project.

return_value()[source]

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

Returns:

new project’s file name

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

Bases: QDialog

Is called when the user wants to create a see all the projects.

__init__(saved_projects, main_window)[source]

Initialization.

Parameters:
  • saved_projects – List of saved projects

  • main_window – Main window

checkState(path)[source]
Checks if the project still exists and returns the corresponding

icon.

Parameters:

path – path of the project

Returns:

either a green “v” or a red cross depending on the existence of the project

item_to_path()[source]

Returns the path of the first selected item.

Returns:

the path of the first selected item

open_project()[source]

Switches to the selected project.

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

Bases: PopUpFilterSelection

Is called when the user wants to open a filter that has already been

saved.

__init__(project, databrowser)[source]

Initialization.

Parameters:
  • project – current project in the software

  • databrowser – data browser instance of the software

ok_clicked()[source]

Saves the modifications and updates the data browser.

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

Bases: QDialog

Is called when the user wants to run an iterated pipeline.

__init__(iterated_tag, tag_values)[source]

Initialization.

Parameters:
  • iterated_tag – name of the iterated tag

  • tag_values – values that can take the iterated tag

ok_clicked()[source]

Sends the selected values to the pipeline manager.

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

Bases: PopUpTagSelection

Is called when the user wants to update the tag to display in the mini

viewer.

__init__(project)[source]

Initialization.

Parameters:

project – current project in the software

ok_clicked()[source]

Saves the modifications and updates the mini viewer

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

Bases: PopUpTagSelection

Is called when the user wants to update a visualized tag of the count

table.

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

Initialization.

Parameters:
  • project – current project in the software

  • tags_to_display – the tags to display

  • tag_name_checked – the checked tags

ok_clicked()[source]

Updates the selected tag and closes the pop-up.

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

Bases: QDialog

Class to display the history of a document.

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

Prepares the brick history popup.

Parameters:
  • project – current project in the software

  • scan – filename of the scan

  • databrowser – data browser instance of the software

  • main_window – main window of the software

file_clicked()[source]

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

find_associated_bricks(node_name)[source]

Blabla

Parameters:

node_name – blabla

Returns:

blabla

find_process_from_plug(plug)[source]

Blabla

Parameters:

plug – blabla

Returns:

blabla

io_value_is_scan(value)[source]

Checks 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

node_selected(node_name, process)[source]

Emit a signal when a node is clicked.

Parameters:
  • node_name – node name

  • process – process of the corresponding node

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

Filling the table.

Parameters:
  • inputs – inputs dictionary

  • outputs – outputs dictionary

  • brick_name – name of the brick

  • init – initialisation status

  • init_time – init date / time

  • exec – execution status

  • exec_time – execution date / time

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

Bases: QDialog

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

the data browser.

__init__(project)[source]

Initialization.

Parameters:

project – current project in the software

cancel_clicked()[source]

Closes the pop-up.

item_clicked(item)[source]

Checks the checkbox of an item when the latter is clicked.

Parameters:

item – clicked item

ok_clicked()[source]

Actions when the “OK” button is clicked.

search_str(str_search)[source]

Matches the searched pattern with the tags of the project.

Parameters:

str_search – string pattern to search

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

Bases: QWidget

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

__init__(project, visualized_tags)[source]

Initialization.

Parameters:
  • project – current project in the software

  • visualized_tags – project’s visualized tags before opening this widget

click_select_tag()[source]

Puts the selected tags in the “selected tag” table.

click_unselect_tag()[source]

Removes the unselected tags from populse_mia table.

search_str(str_search)[source]

Matches the searched pattern with the tags of the project.

Parameters:

str_search – string pattern to search

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

Bases: QLabel

Custom class to click on a QLabel

__init__(parent=None)[source]
clicked
mousePressEvent(ev)[source]

Blabla