cmp.bidsappmanager.project module

Connectome Mapper Controler for handling GUI and non GUI general events.

class cmp.bidsappmanager.project.CMP_BIDSAppWindowHandler[source]

Bases: traitsui.handler.Handler

Event handler of the BIDS App Interface window.

docker_process

Instance of subprocess.Popen where BIDS App docker image is run

Type

subprocess.Popen

check_settings(ui_info)[source]

Function that checks if all parameters are properly set before execution of the BIDS App.

Parameters

ui_info (QtView) – TraitsUI QtView associated with self

classmethod manage_bidsapp_procs(proclist)[source]

Function that managed the parallelized BIDS App Popen process.

Parameters

proclist – List of Popen processes running the BIDS App on a single subject

start_bids_app(ui_info)[source]

Main function that runs the BIDS App on a set or sub-set of participants.

Parameters

ui_info (QtView) – TraitsUI QtView associated with this handler

classmethod start_bidsapp_process(participant_label)[source]

Function that runs the BIDS App on a single subject.

Parameters
  • ui_info (QtView) – TraitsUI QtView associated with this handler

  • participant_label (string) – Label of the participant / subject (e.g. "01", no “sub-” prefix)

classmethod stop_bids_app()[source]

Function that stops the BIDS execution.

Parameters

ui_info (QtView) – TraitsUI QtView associated with this handler

class cmp.bidsappmanager.project.CMP_ConfigQualityWindowHandler[source]

Bases: traitsui.handler.Handler

Event handler of the Configurator and Inspector (Quality Control) windows.

project_loaded

Indicate if project has been successfully loaded (Default: False)

Type

traits.Bool

anat_pipeline

Instance of AnatomicalPipelineUI class

Type

Instance(HasTraits)

anat_inputs_checked

Indicate if anatomical pipeline inputs are available (Default: False)

Type

traits.Bool

anat_outputs_checked

Indicate if anatomical pipeline outputs are available (Default: False)

Type

traits.Bool

anatomical_processed

Indicate if anatomical pipeline was run (Default: False)

Type

traits.Bool

dmri_pipeline

Instance of DiffusionPipelineUI class

Type

Instance(HasTraits)

dmri_inputs_checked

Indicate if diffusion pipeline inputs are available (Default: False)

Type

traits.Bool

dmri_processed

Indicate if diffusion pipeline was run (Default: False)

Type

traits.Bool

fmri_pipeline

Instance of fMRIPipelineUI class

Type

Instance(HasTraits)

fmri_inputs_checked

Indicate if fMRI pipeline inputs are available (Default: False)

Type

traits.Bool

fmri_processed

Indicate if fMRI pipeline was run (Default: False)

Type

traits.Bool

load_anat_config_file(ui_info)[source]

Function that loads the anatomical pipeline configuration file.

Parameters

ui_info (QtView) – TraitsUI QtView associated with self

load_dmri_config_file(ui_info)[source]

Function that loads the diffusion pipeline configuration file.

Parameters

ui_info (QtView) – TraitsUI QtView associated with self

load_fmri_config_file(ui_info)[source]

Function that loads the fMRI pipeline configuration file.

Parameters

ui_info (QtView) – TraitsUI QtView associated with self

load_project(ui_info)[source]

Function that creates a new CMP_Project_InfoUI instance from an existing project.

Parameters

ui_info (QtView) – TraitsUI QtView associated with self

new_project(ui_info)[source]

Function that creates a new CMP_Project_InfoUI instance.

Parameters

ui_info (QtView) – TraitsUI QtView associated with self

classmethod save_anat_config_file(ui_info)[source]

Function that saves the anatomical pipeline configuration file.

Parameters

ui_info (QtView) – TraitsUI QtView associated with self

classmethod save_dmri_config_file(ui_info)[source]

Function that saves the diffusion pipeline configuration file.

Parameters

ui_info (QtView) – TraitsUI QtView associated with self

classmethod save_fmri_config_file(ui_info)[source]

Function that saves the fMRI pipeline configuration file.

Parameters

ui_info (QtView) – TraitsUI QtView associated with self

classmethod show_bidsapp_window()[source]

Function that shows the BIDS App Interface Window.

Parameters

ui_info (QtView) – TraitsUI QtView associated with this handler

update_subject_anat_pipeline(ui_info)[source]

Function that updates attributes of the AnatomicalPipelineUI instance.

Parameters

ui_info (QtView) – TraitsUI QtView associated with self

update_subject_dmri_pipeline(ui_info)[source]

Function that updates attributes of the DiffusionPipelineUI instance.

Parameters

ui_info (QtView) – TraitsUI QtView associated with self

update_subject_fmri_pipeline(ui_info)[source]

Function that updates attributes of the fMRIPipelineUI instance.

Parameters

ui_info (QtView) – TraitsUI QtView associated with self

class cmp.bidsappmanager.project.CMP_MainWindowHandler[source]

Bases: traitsui.handler.Handler

Event handler of the Configurator and Inspector (Quality Control) windows.

project_loaded

Indicate if project has been successfully loaded (Default: False)

Type

traits.Bool

anat_pipeline

Instance of AnatomicalPipelineUI class

Type

Instance(HasTraits)

anat_inputs_checked

Indicate if anatomical pipeline inputs are available (Default: False)

Type

traits.Bool

anat_outputs_checked

Indicate if anatomical pipeline outputs are available (Default: False)

Type

traits.Bool

anatomical_processed

Indicate if anatomical pipeline was run (Default: False)

Type

traits.Bool

dmri_pipeline

Instance of DiffusionPipelineUI class

Type

Instance(HasTraits)

dmri_inputs_checked

Indicate if diffusion pipeline inputs are available (Default: False)

Type

traits.Bool

dmri_processed

Indicate if diffusion pipeline was run (Default: False)

Type

traits.Bool

fmri_pipeline

Instance of fMRIPipelineUI class

Type

Instance(HasTraits)

fmri_inputs_checked

Indicate if fMRI pipeline inputs are available (Default: False)

Type

traits.Bool

fmri_processed

Indicate if fMRI pipeline was run (Default: False)

Type

traits.Bool

load_dataset(ui_info, debug=True)[source]

Function that creates a new CMP_Project_InfoUI instance from an existing project.

Parameters
  • ui_info (QtView) – TraitsUI QtView associated with self

  • debug (bool) – If True, print more information for debugging

cmp.bidsappmanager.project.clean_cache(bids_root)[source]

Clean cache stored in /tmp.

Target issue related to that a dataset directory is mounted into /tmp and used for caching by java/matlab/matplotlib/xvfb-run in the container image.

Parameters

bids_root (string) – BIDS root dataset directory

cmp.bidsappmanager.project.init_anat_project(project_info, is_new_project)[source]

Create and initialize a AnatomicalPipelineUI instance

Parameters
  • project_info (CMP_Project_InfoUI) – Instance of CMP_Project_InfoUI class

  • is_new_project (bool) – If True, this is a new project which has been never processed

cmp.bidsappmanager.project.init_dmri_project(project_info, bids_layout, is_new_project, gui=True)[source]

Create and initialize a DiffusionPipelineUI instance

Parameters
  • project_info (CMP_Project_InfoUI) – Instance of CMP_Project_InfoUI class

  • bids_layout (bids.BIDSLayout) – PyBIDS BIDS Layout object describing the BIDS dataset

  • is_new_project (bool) – If True, this is a new project which has been never processed

  • gui (bool) – If True, display messages in GUI

cmp.bidsappmanager.project.init_fmri_project(project_info, bids_layout, is_new_project, gui=True)[source]

Create and initialize a fMRIPipelineUI instance

Parameters
  • project_info (CMP_Project_InfoUI) – Instance of CMP_Project_InfoUI class

  • bids_layout (bids.BIDSLayout) – PyBIDS BIDS Layout object describing the BIDS dataset

  • is_new_project (bool) – If True, this is a new project which has been never processed

  • gui (bool) – If True, display messgae in GUI

cmp.bidsappmanager.project.is_tool(name)[source]

Check whether name is on PATH.

cmp.bidsappmanager.project.refresh_folder(derivatives_directory, subject, input_folders, session=None)[source]

Creates (if needed) the folder hierarchy.

Parameters
  • derivatives_directory (string) –

  • subject (string) – Subject label (sub-XX) for which we create the output folder hierarchy

  • session (string) – Subject session label (ses-YY)

  • input_folders (list of string) – List of folders to create in derivative_directory/sub-XX/(ses-YY)/ folder for the given subject

cmp.bidsappmanager.project.update_anat_last_processed(project_info, pipeline)[source]

Update anatomical pipeline processing information

Parameters
cmp.bidsappmanager.project.update_dmri_last_processed(project_info, pipeline)[source]

Update diffusion pipeline processing information

Parameters
cmp.bidsappmanager.project.update_fmri_last_processed(project_info, pipeline)[source]

Update functional MRI pipeline processing information

Parameters