DWI processing only - existing anat derivatives

42 views
Skip to first unread message

Alexandre Cionca

unread,
Oct 10, 2022, 8:47:24 AM10/10/22
to cmtk-users
Dear contributors,

I was wondering if it would be possible to run the DWI pipeline "alone" and re-using anatomical derivatives of the dataset that have already been pre-processed (with fMRIprep for example). The idea would be to denoise and register DWI data into the common space of the study (MNI152NLin2009cAsym) and later do the reconstruction of tracts to build the connectoms.

Many thanks - cheers,
Alex Cionca

Sebastien Tourbier

unread,
Oct 25, 2022, 5:15:01 AM10/25/22
to cmtk-users
Dear Alex,

The DWI pipeline cannot be run without the anatomical pipeline, as it needs to have a number of its outputs to later build the connectomes in the DWI pipeline.

However, the good news is that if you already have the freesurfer folder in the derivatives folder of your BIDS dataset, the whole recon-all would not run again, and so it should not take so long to perform the anatomical pipeline. You can find an example of structure here in the documentation: https://connectome-mapper-3.readthedocs.io/en/latest/usage.html#already-have-freesurfer-outputs

There is no option to skip a particular stage of the DWI pipeline but after execution, you are free to use any of the outputs produced by the pipeline such as the preprocessed DWI data (output of the preprocessing stage). If you wish, you can have an overview of the different files produced here in the documentation: https://connectome-mapper-3.readthedocs.io/en/latest/outputs.html#diffusion-derivatives

But, please note that CMP3 is working in the native MRI space and is registering the T1w to the DWI space such that there is no need to update the bvecs. If you would like to work in a common space, the only way I see I would be to have in your BIDS dataset T1w and DWI data that have already been transformed into your common space.

Please let me know if something is unclear.

Cheers,
Seb

Alexandre Cionca

unread,
Oct 26, 2022, 4:40:58 AM10/26/22
to cmtk-users
Dear Seb,

Many thanks for your answer - As you suggest, it would be easier to run the anatomical and diffusion pipelines in the subjects' native space and then, either have the pipeline generate the connectome using my custom parcellation (parcellation will have to be spatially normalized to each subjects' space) or register the tracktogram to the common space manually do the connectome later.

Does it seem relevant to you?

Also, while running the CMP3 (v3.0.4) pipeline on a HPC using singularity, I came accross an issue in the diffusion part of the process:

f"Exception raised while executing Node {self.name}.\n\n{result.runtime.traceback}"
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node compute_matrice.

Traceback (most recent call last):
  File "/opt/conda/envs/py37cmp-core/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 398, in run
    runtime = self._run_interface(runtime)
  File "/opt/conda/envs/py37cmp-core/lib/python3.7/site-packages/cmtklib/connectome.py", line 765, in _run_interface
    output_types=self.inputs.output_types,
  File "/opt/conda/envs/py37cmp-core/lib/python3.7/site-packages/cmtklib/connectome.py", line 311, in cmat
    np.mean(np.where(roiData == int(d["dn_multiscaleID"])), axis=1)
KeyError: 'dn_multiscaleID'

I believe it is a pandas DataFrame issue were it is trying to access the "dn_multiscaleID" column (or key) but it appears to not exist.

Do you have any idea of what might the issue? Should I open another threat here or issues on GH ?

 Here's the parcellation part of my anatomical config for some context:

    "parcellation_stage": {
        "pipeline_mode": "Diffusion",
        "parcellation_scheme": "NativeFreesurfer",
        "include_thalamic_nuclei_parcellation": true,
        "ants_precision_type": "double",
        "segment_hippocampal_subfields": true,
        "segment_brainstem": true,
        "atlas_info": {}


I did not specify any particular parcellation as I initially wanted to build the connectome myself from the tracktogram. It might be a better idea to specify a custom parcellation and let CMP3 do the magics.

Thank you again for your time and answers,

Cheers,
  Alex

Reply all
Reply to author
Forward
0 new messages