cmp.stages.diffusion.diffusion module

Definition of config and stage classes for diffusion reconstruction and tractography.

class cmp.stages.diffusion.diffusion.DiffusionConfig[source]

Bases: traits.has_traits.HasTraits

Class used to store configuration parameters of a DiffusionStage instance.

diffusion_imaging_model_editor

Available diffusion imaging models

Type

[‘DSI’, ‘DTI’, ‘HARDI’, ‘multishell’]

diffusion_imaging_model

Selected diffusion imaging model (Default: ‘DTI’)

Type

traits.Str

dilate_rois

Dilate parcellation regions-of-interest (Default: True)

Type

traits.Bool

dilation_kernel

Type of dilation kernel to used

Type

traits.Enum([‘Box’, ‘Gauss’, ‘Sphere’])

dilation_radius

Radius of the dilation kernel

Type

traits.Enum([1, 2, 3, 4])

recon_processing_tool_editor

List of processing tools available for diffusion signal reconstruction

Type

[‘Dipy’, ‘MRtrix’]

tracking_processing_tool_editor

List of processing tools available for tractography

Type

[‘Dipy’, ‘MRtrix’]

processing_tool_editor

List of processing tools available for diffusion signal reconstruction and tractography

Type

[‘Dipy’, ‘MRtrix’]

recon_processing_tool

Processing tool to use for diffusion signal modeling (Default: ‘MRtrix’)

Type

traits.Str

tracking_processing_tool

Processing tool to use for tractography (Default: ‘MRtrix’)

Type

traits.Str

custom_track_file

Custom tractogram file to used as input to the connectome stage (obsolete)

Type

traits.File

dipy_recon_config

Configuration instance of the Dipy reconstruction stage

Type

Instance(HasTraits)

mrtrix_recon_config

Configuration instance of the MRtrix3 reconstruction stage

Type

Instance(HasTraits)

dipy_tracking_config

Configuration instance of the Dipy tracking (tractography) stage

Type

Instance(HasTraits)

mrtrix_tracking_config

Configuration instance of the MRtrix3 tracking (tractography) stage

Type

Instance(HasTraits)

diffusion_model_editor

List of types of available local tractography algorithms.

Type

[‘Deterministic’, ‘Probabilistic’]

diffusion_model

Type of local tractography algorithm to use. (Default: ‘Probabilistic’)

Type

traits.Str

update_dipy_tracking_SD(new)[source]

Update SD of dipy_tracking_config when local_model is updated.

Parameters

new (string) – New value of local_model

update_dipy_tracking_sh_order(new)[source]

Update sh_order of dipy_tracking_config when lmax_order is updated.

Parameters

new (int) – New value of lmax_order

update_mrtrix_tracking_SD(new)[source]

Update SD of mrtrix_tracking_config when local_model is updated.

Parameters

new (string) – New value of local_model

class cmp.stages.diffusion.diffusion.DiffusionStage(bids_dir, output_dir)[source]

Bases: cmp.stages.common.Stage

Class that represents the diffusion stage of a DiffusionPipeline.

The diffusion stage workflow is composed of two sub-workflows: 1. recon_flow that estimates tensors or fiber orientation distribution functions from dMRI, 2. track_flow that runs tractography from the output of recon_flow.

create_workflow()[source]

Create the workflow of the DiffusionStage

create_workflow(flow, inputnode, outputnode)[source]

Create the stage worflow.

Parameters
  • flow (nipype.pipeline.engine.Workflow) – The nipype.pipeline.engine.Workflow instance of the Diffusion pipeline

  • inputnode (nipype.interfaces.utility.IdentityInterface) – Identity interface describing the inputs of the stage

  • outputnode (nipype.interfaces.utility.IdentityInterface) – Identity interface describing the outputs of the stage

define_inspect_outputs()[source]

Update the `inspect_outputs’ class attribute.

It contains a dictionary of stage outputs with corresponding commands for visual inspection.

has_run()[source]

Function that returns True if the stage has been run successfully.

Returns

Return type

True if the stage has been run successfully

cmp.stages.diffusion.diffusion.strip_suffix(file_input, prefix)[source]

Extract path of file_input and add prefix to generate a prefix path for outputs.

Parameters
  • file_input (os.path.abspath) – Absolute path to an input file

  • prefix (os.path) – Prefix to used in the generation of the output prefix path.

Returns

out_prefix_path – The generated prefix path

Return type

os.path