cmp.bidsappmanager.gui module

Connectome Mapper GUI.

class cmp.bidsappmanager.gui.CMP_BIDSAppWindow(project_info=None, bids_root='', subjects=None, list_of_subjects_to_be_processed=None, anat_config='', dmri_config='', fmri_config='')[source]

Bases: traits.has_traits.HasTraits

Class that defines the Window of the BIDS App Interface.

project_info

Instance of CMP_Project_Info that represents the processing project

Type

CMP_Project_Info

bids_root

BIDS root dataset directory

Type

traits.Directory

output_dir

Output directory

Type

traits.Directory

subjects

List of subjects (in the form sub-XX) present in the dataset

Type

traits.List

number_of_participants_processed_in_parallel

Number of participants / subjects to be processed in parallel that takes values in the [1, # of CPUs - 1] range

Type

traits.Range

number_threads_max

Maximal number of threads to be used by OpenMP programs (4 by default)

Type

traits.Int

number_of_threads

Number of threads to be used by OpenMP programs that takes values in the [1, number_threads_max] range

Type

traits.Range

fs_file

Path to Freesurfer license file

Type

traits.File

list_of_subjects_to_be_processed

Selection of subjects to be processed from the subjects list

Type

List(Str)

dmri_inputs_checked

True if dMRI data is available in the dataset

Type

traits.Bool

fmri_inputs_checked

rue if fMRI data is available in the dataset

Type

traits.Bool

anat_config

Configuration file for the anatomical MRI pipeline

Type

traits.File

dmri_config

Configuration file for the diffusion MRI pipeline

Type

traits.File

fmri_config

Configuration file for the functional MRI pipeline

Type

traits.File

run_anat_pipeline

If True, run the anatomical pipeline

Type

traits.Bool

run_dmri_pipeline

If True, run the diffusion pipeline

Type

traits.Bool

run_fmri_pipeline

If True, run the functional pipeline

Type

traits.Bool

bidsapp_tag

Selection of BIDS App version to use

Type

traits.Enum

data_provenance_tracking

If set and if datalad_is_available is True run the BIDS App using datalad (False by default)

Type

traits.Bool

datalad_update_environment

If True and data_provenance_tracking is True, tell to datalad to update the BIDS App container image if there was a previous execution (True by default)

Type

traits.Bool

datalad_is_available

Boolean used to store if datalad is available in the computing environment (False by default)

Type

traits.Bool

check

Button to check if all parameters are properly set for execution of the BIDS App

Type

traits.ui.Button

start_bidsapp

Button to run the BIDS App

Type

traits.ui.Button

traits_view

TraitsUI QtView that describes the content of the window

Type

QtView

check_settings()[source]

Checks if all the parameters of the BIDS App run are properly set before execution.

classmethod manage_bidsapp_procs(proclist)[source]

Manage parallelized process at the participant level

Parameters

proclist (List of subprocess.Popen) – List of Popen processes

number_of_parallel_procs_updated(new)[source]

Callback function when number_of_parallel_procs is updated.

classmethod run(command, env=None, cwd='/home/docs/checkouts/readthedocs.org/user_builds/connectome-mapper-3/checkouts/latest/docs')[source]

Function to run datalad commands.

It runs the command specified as input via subprocess.run().

Parameters
  • command (string) – String containing the command to be executed (required)

  • env (os.environ) – Specify a custom os.environ

  • cwd (os.path) – Specify a custom current working directory

Examples

>>> cmd = 'datalad save -m my dataset change message'
>>> run(cmd) 
start_bids_app()[source]

Function executed when the Run BIDS App button is clicked.

It implements all steps in the creation and execution of the BIDS App with or without datalad.

start_bidsapp_participant_level_process(bidsapp_tag, participant_labels)[source]

Create and run the BIDS App command.

Parameters
  • bidsapp_tag (traits.Str) – Version tag of the CMP 3 BIDS App

  • participant_labels (traits.List) – List of participants labels in the form [“01”, “03”, “04”, …]

start_bidsapp_participant_level_process_with_datalad(bidsapp_tag, participant_labels)[source]

Create and run the BIDS App command with Datalad.

Parameters
  • bidsapp_tag (traits.Str) – Version tag of the CMP 3 BIDS App

  • participant_labels (traits.List) – List of participants labels in the form [“01”, “03”, “04”, …]

update_checksettings(new)[source]

Function that reset settings_checked attribute to False.

update_run_anat_pipeline(new)[source]

Callback function when run_anat_pipeline is updated.

update_run_dmri_pipeline(new)[source]

Callback function when run_dmri_pipeline is updated.

update_run_fmri_pipeline(new)[source]

Callback function when run_fmri_pipeline is updated.

class cmp.bidsappmanager.gui.CMP_ConfiguratorWindow(project_info=None, anat_pipeline=None, dmri_pipeline=None, fmri_pipeline=None, anat_inputs_checked=False, dmri_inputs_checked=False, fmri_inputs_checked=False)[source]

Bases: traits.has_traits.HasTraits

Class that defines the Configurator Window.

project_info

Instance of CMP_Project_Info that represents the processing project

Type

CMP_Project_Info

anat_pipeline

Instance of anatomical MRI pipeline UI

Type

Instance(HasTraits)

dmri_pipeline

Instance of diffusion MRI pipeline UI

Type

Instance(HasTraits)

fmri_pipeline

Instance of functional MRI pipeline UI

Type

Instance(HasTraits)

anat_inputs_checked

Boolean that indicates if anatomical pipeline inputs are available (Default: False)

dmri_inputs_checked =traits.Bool

Boolean that indicates if diffusion pipeline inputs are available (Default: False)

fmri_inputs_checkedtraits.Bool

Boolean that indicates if functional pipeline inputs are available (Default: False)

Type

traits.Bool

anat_save_config

TraitsUI Action to save the anatomical pipeline configuration

Type

traits.ui.Action

dmri_save_config

TraitsUI Action to save the diffusion pipeline configuration

Type

traits.ui.Action

fmri_save_config

TraitsUI Action to save the functional pipeline configuration

Type

traits.ui.Action

save_all_config

Button to save all configuration files at once

Type

traits.ui.Button

traits_view

TraitsUI QtView that describes the content of the window

Type

QtView

update_diffusion_imaging_model(new)[source]
class cmp.bidsappmanager.gui.CMP_InspectorWindow(project_info=None, anat_inputs_checked=False, dmri_inputs_checked=False, fmri_inputs_checked=False)[source]

Bases: traits.has_traits.HasTraits

Class that defines the Configurator Window.

project_info

Instance of CMP_Project_Info that represents the processing project

Type

CMP_Project_Info

anat_pipeline

Instance of anatomical MRI pipeline

Type

Instance(HasTraits)

dmri_pipeline

Instance of diffusion MRI pipeline

Type

Instance(HasTraits)

fmri_pipeline

Instance of functional MRI pipeline

Type

Instance(HasTraits)

anat_inputs_checked

Indicates if inputs of anatomical pipeline are available (Default: False)

Type

traits.Bool

dmri_inputs_checked

Indicates if inputs of diffusion pipeline are available (Default: False)

Type

traits.Bool

fmri_inputs_checked

Indicates if inputs of functional pipeline are available (Default: False)

Type

traits.Bool

output_anat_available

Indicates if outputs of anatomical pipeline are available (Default: False)

Type

traits.Bool

output_dmri_available

Indicates if outputs of diffusion pipeline are available (Default: False)

Type

traits.Bool

output_fmri_available

Indicates if outputs of functional pipeline are available (Default: False)

Type

traits.Bool

traits_view

TraitsUI QtView that describes the content of the window

Type

QtView

select_subject()[source]

Function to select the subject and session for which to inspect outputs.

update_diffusion_imaging_model(new)[source]

Function called when diffusion_imaging_model is updated.

class cmp.bidsappmanager.gui.CMP_MainWindow[source]

Bases: traits.has_traits.HasTraits

Class that defines the Main window of the Connectome Mapper 3 GUI.

project_info

Instance of CMP_Project_InfoUI that represents the processing project

Type

CMP_Project_InfoUI

anat_pipeline

Instance of anatomical MRI pipeline UI

Type

Instance(HasTraits)

dmri_pipeline

Instance of diffusion MRI pipeline UI

Type

Instance(HasTraits)

fmri_pipeline

Instance of functional MRI pipeline UI

Type

Instance(HasTraits)

bidsapp_ui

Instance of CMP_BIDSAppWindow

Type

CMP_Project_Info

load_dataset

TraitsUI Action to load a BIDS dataset

Type

traits.ui.Action

bidsapp

Button that displays the BIDS App Interface window

Type

traits.ui.Button

configurator

Button thats displays the pipeline Configurator window

Type

traits.ui.Button

quality_control

Button that displays the pipeline Quality Control / Inspector window

Type

traits.ui.Button

manager_group

TraitsUI View that describes the content of the main window

Type

traits.ui.View

traits_view

TraitsUI QtView that includes manager_group and parameterize the window with menu

Type

QtView

show_bidsapp_interface()[source]

Callback of the “BIDS App” button. This displays the BIDS App Interface Window.

view_mode = 1
class cmp.bidsappmanager.gui.CMP_Project_InfoUI[source]

Bases: cmp.project.CMP_Project_Info

Class that extends the CMP_Project_Info with graphical components.

It supports graphically the setting of all processing properties / attributes of an CMP_Project_Info instance.

creation_mode

Mode for loading the dataset. Valid values are ‘Load BIDS dataset’, ‘Install Datalad BIDS dataset’

Type

traits.Enum

install_datalad_dataset_via_ssh

If set to True install the datalad dataset from a remote server via ssh.(True by default)

Type

traits.Bool

ssh_user

Remote server username. (Required if install_datalad_dataset_via_ssh is True)

Type

traits.Str

ssh_pwd <traits.Password>

Remote server password. (Required if install_datalad_dataset_via_ssh is True)

ssh_remote

Remote server IP or URL. (Required if install_datalad_dataset_via_ssh is True)

Type

traits.Str

datalad_dataset_path

Path to the datalad dataset on the remote server. (Required if install_datalad_dataset_via_ssh is True)

Type

traits.Directory

summary_view_button

Button that shows the pipeline processing summary table

Type

traits.ui.Button

pipeline_processing_summary_view

TraitsUI VGroup that contains Item('pipeline_processing_summary')

Type

traits.ui.VGroup

dataset_view

TraitsUI View that shows a summary of project settings and modality available for a given subject

Type

traits.ui.View

traits_view

TraitsUI QtView that includes the View ‘dataset_view’

Type

QtView

create_view

Dialog view to create a BIDS Dataset

Type

traits.ui.View

subject_view

Dialog view to select of subject

Type

traits.ui.View

subject_session_view

Dialog view to select the subject session

Type

traits.ui.View

dmri_bids_acq_view

Dialog view to select the diffusion acquisition model

Type

traits.ui.View

anat_warning_view

View that displays a warning message regarding the anatomical T1w data

Type

traits.ui.View

anat_config_error_view

Error view that displays an error message regarding the configuration of the anatomical pipeline

Type

traits.ui.View

dmri_warning_view

View that displays a warning message regarding the diffusion MRI data

Type

traits.ui.View

dmri_config_error_view

View that displays an error message regarding the configuration of the diffusion pipeline

Type

traits.ui.View

fmri_warning_view

View that displays a warning message regarding the functional MRI data

Type

traits.ui.View

fmri_config_error_view

View that displays an error message regarding the configuration of the fMRI pipeline

Type

traits.ui.View

open_view

Dialog view to load a BIDS Dataset

Type

traits.ui.View

anat_select_config_to_load

Dialog view to load the configuration file of the anatomical pipeline

Type

traits.ui.View

diffusion_imaging_model_select_view

Dialog view to select the diffusion acquisition model

Type

traits.ui.View

dmri_select_config_to_load

Dialog view to load the configuration file of the diffusion MRI pipeline

Type

traits.ui.View

fmri_select_config_to_load

Dialog view to load the configuration file of the fMRI pipeline

Type

traits.ui.View

class cmp.bidsappmanager.gui.MultiSelectAdapter[source]

Bases: traitsui.tabular_adapter.TabularAdapter

This adapter is used by both the left and right tables.

cmp.bidsappmanager.gui.get_icon(path)[source]

Return an instance of ImageResource or None is there is not graphical backend.

Parameters

path (string) – Path to an image file

Returns

icon – Return an instance of ImageResource or None is there is not graphical backend.

Return type

ImageResource