cmp.pipelines.functional.fMRI module

Functional pipeline Class definition.

class cmp.pipelines.functional.fMRI.GlobalConfig[source]

Bases: traits.has_traits.HasTraits

Global pipeline configurations.

process_type

Processing pipeline type

Type

‘fMRI’

imaging_model

Imaging model used by RegistrationStage

Type

‘fMRI’

class cmp.pipelines.functional.fMRI.fMRIPipeline(project_info)[source]

Bases: cmp.pipelines.common.Pipeline

Class that extends a Pipeline and represents the processing pipeline for structural MRI.

It is composed of:
  • the preprocessing stage that can perform slice timing correction, deskiping and motion correction

  • the registration stage that co-registered the anatomical T1w scan to the mean BOLD image and projects the parcellations to the native fMRI space

  • the extra-preprocessing stage (FunctionalMRIStage) that can perform nuisance regression and bandpass filtering

  • the connectome stage that extracts the time-series of each parcellation ROI and computes the Pearson’s correlation coefficient between ROI time-series to create the functional connectome.

check_config()[source]

Check if the fMRI pipeline parameters is properly configured.

Returns

message – String that is empty if success, otherwise it contains the error message

Return type

string

check_input(layout, gui=True)[source]

Check if input of the diffusion pipeline are available.

Parameters
  • layout (bids.BIDSLayout) – Instance of BIDSLayout

  • gui (traits.Bool) – Boolean used to display different messages but not really meaningful anymore since the GUI components have been migrated to cmp.bidsappmanager

Returns

valid_inputs – True if inputs are available

Return type

traits.Bool

create_datagrabber_node(base_directory, bids_atlas_label)[source]

Create the appropriate Nipype DataGrabber node depending on the parcellation_scheme

Parameters
  • base_directory (Directory) – Main CMP output directory of a subject e.g. /output_dir/cmp/sub-XX/(ses-YY)

  • bids_atlas_label (string) – Parcellation atlas label

Returns

datasource – Output Nipype Node with DataGrabber interface

Return type

Output Nipype DataGrabber Node

create_datasinker_node(base_directory, bids_atlas_label)[source]

Create the appropriate Nipype DataSink node depending on the parcellation_scheme

Parameters
  • base_directory (Directory) – Main CMP output directory of a subject e.g. /output_dir/cmp/sub-XX/(ses-YY)

  • bids_atlas_label (string) – Parcellation atlas label

Returns

sinker – Output Nipype Node with DataSink interface

Return type

Output Nipype DataSink Node

create_pipeline_flow(cmp_deriv_subject_directory, nipype_deriv_subject_directory)[source]

Create the pipeline workflow.

Parameters
  • cmp_deriv_subject_directory (Directory) – Main CMP output directory of a subject e.g. /output_dir/cmp/sub-XX/(ses-YY)

  • nipype_deriv_subject_directory (Directory) – Intermediate Nipype output directory of a subject e.g. /output_dir/nipype/sub-XX/(ses-YY)

Returns

fMRI_flow – An instance of nipype.pipeline.engine.Workflow

Return type

nipype.pipeline.engine.Workflow

define_custom_mapping(custom_last_stage)[source]

Define the pipeline to be executed until a specific stages.

Not used yet by CMP3.

Parameters

custom_last_stage (string) – Last stage to execute. Valid values are: “Preprocessing”, “Registration”, “FunctionalMRI” and “Connectome”.

global_conf = <cmp.pipelines.functional.fMRI.GlobalConfig object>
init_subject_derivatives_dirs()[source]

Return the paths to Nipype and CMP derivatives folders of a given subject / session.

Notes

self.subject is updated to “sub-<participant_label>_ses-<session_label>” when subject has multiple sessions.

input_folders = ['anat', 'func']
now = '20221025_1359'
ordered_stage_list = ['Preprocessing', 'Registration', 'FunctionalMRI', 'Connectome']
process()[source]

Executes the fMRI pipeline workflow and returns True if successful.

update_nuisance_requirements()[source]

Update nuisance requirements.

Configure the registration to apply the estimated transformation to multiple segmentation masks depending on the Nuisance correction steps performed.

update_registration()[source]

Configure the list of registration tools.

update_scrubbing()[source]

Update to precompute or inputs for scrubbing during the FunctionalMRI stage.