Qsiprep problems with connectivity matrix

Hi, everyone. I using qsiprep with dsi studio pipeline, but fail the connectivity matrix in every register atlas. The log file indicated that not exist the parameters like the numbers of tracks, max length, fa threshold, etc. How I can define these values?

Example
220629-01:34:02,796 nipype.workflow INFO:
[Node] Finished “schaefer100x7”, elapsed time 68.144192s.
220629-01:34:02,802 nipype.workflow WARNING:
[Node] Error on “dsistudio_atlasgraph.schaefer100x7” (/tmp/work/qsirecon_wf/sub-PSL00051_dsistudio_pipeline/sub_PSL00051_space_T1w_desc_preproc_recon_wf/streamline_connectivity/calc_connectivity/dsistudio_atlasgraph/schaefer100x7)

thanks in advance
Raul

Hello,

May you please answer:

  1. What is the full log error output?
  2. What version are you using? (try 0.16RC3 if you are using an earlier version)
  3. How are you running QSIPrep (docker/singularity vs. python)
  4. What command you are using to run qsiprep/qsirecon
  5. Did preprocessing (that is, before QSIRecon) finish without errors?
  6. Is this error subject specific?

Best,
Steven

Hi, Steve thank you for your feedback.
I had used qsiprep-docker, installed this week, and this one calls a previous version of the container. However, when I use this version 0.16.0RC3, without qsiprep-docker, I have some problems again.

1-the log error full

IMPORTANT:nipype.workflow:
Running qsirecon version 0.16.0RC3:
* BIDS dataset path: /data.
* Participant list: [‘PSL00076’].
* Run identifier: 20220629-235927_b1d12a7c-5441-4027-934b-20150f7bcc2b.

220629-23:59:28,484 nipype.workflow INFO:
found [’/out/qsiprep/sub-PSL00076/dwi/sub-PSL00076_space-T1w_desc-preproc_dwi.nii.gz’] in /out/qsiprep
INFO:nipype.workflow:found [’/out/qsiprep/sub-PSL00076/dwi/sub-PSL00076_space-T1w_desc-preproc_dwi.nii.gz’] in /out/qsiprep
220629-23:59:28,489 nipype.workflow INFO:
Missing T1w QSIPrep outputs found: /out/qsiprep/sub-PSL00076/anat/sub-PSL00076_desc-brain_mask.nii.gz /out/qsiprep/sub-PSL00076/anat/sub-PSL00076_desc-preproc_T1w.nii.gz
INFO:nipype.workflow:Missing T1w QSIPrep outputs found: /out/qsiprep/sub-PSL00076/anat/sub-PSL00076_desc-brain_mask.nii.gz /out/qsiprep/sub-PSL00076/anat/sub-PSL00076_desc-preproc_T1w.nii.gz
220629-23:59:28,492 nipype.workflow INFO:
Missing T1w QSIPrep outputs found: /out/qsiprep/sub-PSL00076/anat/sub-PSL00076_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5 /out/qsiprep/sub-PSL00076/anat/sub-PSL00076_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5
INFO:nipype.workflow:Missing T1w QSIPrep outputs found: /out/qsiprep/sub-PSL00076/anat/sub-PSL00076_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5 /out/qsiprep/sub-PSL00076/anat/sub-PSL00076_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5
220629-23:59:28,492 nipype.workflow INFO:
No FreeSurfer inputs available for PSL00076
INFO:nipype.workflow:No FreeSurfer inputs available for PSL00076
220629-23:59:28,492 nipype.workflow INFO:
Anatomical (T1w) available for recon: {‘has_qsiprep_5tt_fast’: False, ‘has_qsiprep_5tt_hsvs’: False, ‘has_freesurfer_5tt_hsvs’: False, ‘has_freesurfer’: False, ‘has_qsiprep_t1w’: False, ‘has_qsiprep_t1w_transforms’: False}
INFO:nipype.workflow:Anatomical (T1w) available for recon: {‘has_qsiprep_5tt_fast’: False, ‘has_qsiprep_5tt_hsvs’: False, ‘has_freesurfer_5tt_hsvs’: False, ‘has_freesurfer’: False, ‘has_qsiprep_t1w’: False, ‘has_qsiprep_t1w_transforms’: False}
Process Process-12:
Traceback (most recent call last):
File “/usr/local/miniconda/lib/python3.8/multiprocessing/process.py”, line 315, in _bootstrap
self.run()
File “/usr/local/miniconda/lib/python3.8/multiprocessing/process.py”, line 108, in run
self._target(*self._args, **self._kwargs)
File “/usr/local/miniconda/lib/python3.8/site-packages/qsiprep/cli/run.py”, line 1169, in build_recon_workflow
retval[‘workflow’] = init_qsirecon_wf(
File “/usr/local/miniconda/lib/python3.8/site-packages/qsiprep/workflows/recon/base.py”, line 89, in init_qsirecon_wf
single_subject_wf = init_single_subject_wf(
File “/usr/local/miniconda/lib/python3.8/site-packages/qsiprep/workflows/recon/base.py”, line 244, in init_single_subject_wf
workflow.connect([(anat_ingress_wf, dwi_recon_wfs[dwi_file], to_connect)])
File “/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/workflows.py”, line 239, in connect
raise Exception("\n".join([“Some connections were not found”] + infostr))
Exception: Some connections were not found
Module anat_ingress_wf has no output called outputnode.orig_to_t1_mode_forward_transform

Module anat_ingress_wf has no output called outputnode.t1_2_mni_forward_transform

Module anat_ingress_wf has no output called outputnode.t1_2_mni_reverse_transform

Module anat_ingress_wf has no output called outputnode.t1_aparc

Module anat_ingress_wf has no output called outputnode.t1_aseg

Module anat_ingress_wf has no output called outputnode.t1_brain_mask

Module anat_ingress_wf has no output called outputnode.t1_csf_probseg

Module anat_ingress_wf has no output called outputnode.t1_gm_probseg

Module anat_ingress_wf has no output called outputnode.t1_preproc

Module anat_ingress_wf has no output called outputnode.t1_seg

Module anat_ingress_wf has no output called outputnode.t1_wm_probseg

Module anat_ingress_wf has no output called outputnode.brain

Module anat_ingress_wf has no output called outputnode.aseg

Module anat_ingress_wf has no output called outputnode.fs_5tt_hsvs

Module anat_ingress_wf has no output called outputnode.qsiprep_5tt_hsvs

Module anat_ingress_wf has no output called outputnode.qsiprep_5tt_fast

Module anat_ingress_wf has no output called outputnode.fs_to_qsiprep_transform_itk

Module anat_ingress_wf has no output called outputnode.fs_to_qsiprep_transform_mrtrix

2- this version is 0.16.0RC3
3 I am using docker version
4. I used the following command
docker run --rm -it -v C:\Users\Alumnos\Ra\ReDLat\examples\data1\license.txt:/opt/freesurfer/license.txt:ro -v C:\Users\Alumnos\Ra\ReDLat\examples\data1\bids3:/data:ro -v C:\Users\Alumnos\Ra\ReDLat\examples\data1\out5:/out pennbbl/qsiprep:0.16.0RC3 /data /out participant --dwi-only --skip_bids_validation --output-resolution 2.0 --recon-spec dsi_studio_gqi
5-Preprocesing look fine, exeptep for this warning
WARNING:py.warnings:TemplateFlow: repository not found at /home/qsiprep/.cache/templateflow. Populating a new TemplateFlow stub.
If the path reported above is not the desired location for TemplateFlow, please set the TEMPLATEFLOW_HOME environment variable.
WARNING:py.warnings:TemplateFlow: repository not found at /home/qsiprep/.cache/templateflow. Populating a new TemplateFlow stub.
If the path reported above is not the desired location for TemplateFlow, please set the TEMPLATEFLOW_HOME environment variable.

  1. This error is not subject specific

Looking at the error, the problem is with the T1w, for than reason I run the same command without --dwi-only

docker run --rm -it -v C:\Users\Alumnos\Ra\ReDLat\examples\data1\license.txt:/opt/freesurfer/license.txt:ro -v C:\Users\Alumnos\Ra\ReDLat\examples\data1\bids3:/data:ro -v C:\Users\Alumnos\Ra\ReDLat\examples\data1\out4:/out pennbbl/qsiprep:0.16.0RC3 /data /out participant --recon-spec dsi_studio_gqi --skip_bids_validation --output-resolution 2.0

This time reconstruction was complete, however only create .txt with the name of the ROIs for every atlas.

IMPORTANT:nipype.workflow:
Running qsirecon version 0.16.0RC3:
* BIDS dataset path: /data.
* Participant list: [‘PSL00076’].
* Run identifier: 20220629-214517_af147cf5-2b93-466a-b06b-8bcf54960791.

220629-21:45:19,923 nipype.workflow INFO:
found [’/out/qsiprep/sub-PSL00076/dwi/sub-PSL00076_space-T1w_desc-preproc_dwi.nii.gz’] in /out/qsiprep
INFO:nipype.workflow:found [’/out/qsiprep/sub-PSL00076/dwi/sub-PSL00076_space-T1w_desc-preproc_dwi.nii.gz’] in /out/qsiprep
220629-21:45:19,934 nipype.workflow INFO:
Found usable QSIPrep-preprocessed T1w image and mask.
INFO:nipype.workflow:Found usable QSIPrep-preprocessed T1w image and mask.
220629-21:45:19,944 nipype.workflow INFO:
Found T1w-to-template transforms
INFO:nipype.workflow:Found T1w-to-template transforms
220629-21:45:19,944 nipype.workflow INFO:
No FreeSurfer inputs available for PSL00076
INFO:nipype.workflow:No FreeSurfer inputs available for PSL00076
220629-21:45:19,945 nipype.workflow INFO:
Anatomical (T1w) available for recon: {‘has_qsiprep_5tt_fast’: False, ‘has_qsiprep_5tt_hsvs’: False, ‘has_freesurfer_5tt_hsvs’: False, ‘has_freesurfer’: False, ‘has_qsiprep_t1w’: True, ‘has_qsiprep_t1w_transforms’: True}
INFO:nipype.workflow:Anatomical (T1w) available for recon: {‘has_qsiprep_5tt_fast’: False, ‘has_qsiprep_5tt_hsvs’: False, ‘has_freesurfer_5tt_hsvs’: False, ‘has_freesurfer’: False, ‘has_qsiprep_t1w’: True, ‘has_qsiprep_t1w_transforms’: True}
220629-21:45:19,959 nipype.workflow INFO:
Transforming ODF ROIs into DWI space for visual report.
INFO:nipype.workflow:Transforming ODF ROIs into DWI space for visual report.

Thanks for the help
Best
Raul

I’ve never done --recon-spec dsi_studio_gqi, I mainly do the MRtrix workflows, so I cannot speak to what the outputs are supposed to look like, but what are in the text files? Do the HTML files (if they exist) indicate any errors?

Thanks for your answer Steven.

Well, in the case when T1w was included de log was

interpolation =
max_length =
method = 0
min_length =
num_threads = 7
random_seed =
seed_count =
seed_file =
seed_plan =
smoothing =
step_size =
thread_count = 1
to_export =
trk_file =
turning_angle =

Traceback (most recent call last):
File “/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/plugins/multiproc.py”, line 67, in run_node
result[“result”] = node.run(updatehash=updatehash)
File “/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py”, line 524, in run
result = self._run_interface(execute=True)
File “/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py”, line 642, in _run_interface
return self._run_command(execute)
File “/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py”, line 750, in _run_command
raise NodeExecutionError(
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node calc_connectivity.

Traceback (most recent call last):
File “/usr/local/miniconda/lib/python3.8/site-packages/nipype/interfaces/base/core.py”, line 398, in run
runtime = self._run_interface(runtime)
File “/usr/local/miniconda/lib/python3.8/site-packages/qsiprep/interfaces/dsi_studio.py”, line 432, in _run_interface
wf_result = workflow.run(**plugin_settings)
File “/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/workflows.py”, line 638, in run
runner.run(execgraph, updatehash=updatehash, config=self.config)
File “/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/plugins/base.py”, line 166, in run
self._clean_queue(jobid, graph, result=result)
File “/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/plugins/base.py”, line 244, in _clean_queue
raise RuntimeError("".join(result[“traceback”]))
RuntimeError: Traceback (most recent call last):
File “/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/plugins/multiproc.py”, line 67, in run_node
result[“result”] = node.run(updatehash=updatehash)
File “/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py”, line 524, in run
result = self._run_interface(execute=True)
File “/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py”, line 642, in _run_interface
return self._run_command(execute)
File “/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py”, line 750, in _run_command
raise NodeExecutionError(
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node schaefer100.

RuntimeError: subprocess exited with code 137.

For every atlas was two file *.txt, wait I just see that one file has the name of the ROIs, but the other have values not expect like

2001 Precentral_L
2002 Precentral_R
2101 Frontal_Sup_L
2102 Frontal_Sup_R
2111 Frontal_Sup_Orb_L
2112 Frontal_Sup_Orb_R
2201 Frontal_Mid_L
2202 Frontal_Mid_R
2211 Frontal_Mid_Orb_L
2212 Frontal_Mid_Orb_R
2301 Frontal_Inf_Oper_L
2302 Frontal_Inf_Oper_R
2311 Frontal_Inf_Tri_L
2312 Frontal_Inf_Tri_R
2321 Frontal_Inf_Orb_L
2322 Frontal_Inf_Orb_R
2331 Rolandic_Oper_L
2332 Rolandic_Oper_R
2401 Supp_Motor_Area_L
2402 Supp_Motor_Area_R
2501 Olfactory_L
2502 Olfactory_R
2601 Frontal_Sup_Medial_L
2602 Frontal_Sup_Medial_R
2611 Frontal_Med_Orb_L
2612 Frontal_Med_Orb_R
2701 Rectus_L
2702 Rectus_R
3001 Insula_L
3002 Insula_R
4001 Cingulum_Ant_L
4002 Cingulum_Ant_R
4011 Cingulum_Mid_L
4012 Cingulum_Mid_R
4021 Cingulum_Post_L
4022 Cingulum_Post_R
4101 Hippocampus_L
4102 Hippocampus_R
4111 ParaHippocampal_L
4112 ParaHippocampal_R
4201 Amygdala_L
4202 Amygdala_R
5001 Calcarine_L
5002 Calcarine_R
5011 Cuneus_L
5012 Cuneus_R
5021 Lingual_L
5022 Lingual_R
5101 Occipital_Sup_L
5102 Occipital_Sup_R
5201 Occipital_Mid_L
5202 Occipital_Mid_R
5301 Occipital_Inf_L
5302 Occipital_Inf_R
5401 Fusiform_L
5402 Fusiform_R
6001 Postcentral_L
6002 Postcentral_R
6101 Parietal_Sup_L
6102 Parietal_Sup_R
6201 Parietal_Inf_L
6202 Parietal_Inf_R
6211 SupraMarginal_L
6212 SupraMarginal_R
6221 Angular_L
6222 Angular_R
6301 Precuneus_L
6302 Precuneus_R
6401 Paracentral_Lobule_L
6402 Paracentral_Lobule_R
7001 Caudate_L
7002 Caudate_R
7011 Putamen_L
7012 Putamen_R
7021 Pallidum_L
7022 Pallidum_R
7101 Thalamus_L
7102 Thalamus_R
8101 Heschl_L
8102 Heschl_R
8111 Temporal_Sup_L
8112 Temporal_Sup_R
8121 Temporal_Pole_Sup_L
8122 Temporal_Pole_Sup_R
8201 Temporal_Mid_L
8202 Temporal_Mid_R
8211 Temporal_Pole_Mid_L
8212 Temporal_Pole_Mid_R
8301 Temporal_Inf_L
8302 Temporal_Inf_R
9001 Cerebelum_Crus1_L
9002 Cerebelum_Crus1_R
9011 Cerebelum_Crus2_L
9012 Cerebelum_Crus2_R
9021 Cerebelum_3_L
9022 Cerebelum_3_R
9031 Cerebelum_4_5_L
9032 Cerebelum_4_5_R
9041 Cerebelum_6_L
9042 Cerebelum_6_R
9051 Cerebelum_7b_L
9052 Cerebelum_7b_R
9061 Cerebelum_8_L
9062 Cerebelum_8_R
9071 Cerebelum_9_L
9072 Cerebelum_9_R
9081 Cerebelum_10_L
9082 Cerebelum_10_R
9100 Vermis_1_2
9110 Vermis_3
9120 Vermis_4_5
9130 Vermis_6
9140 Vermis_7
9150 Vermis_8
9160 Vermis_9
9170 Vermis_10

These consecutive values can’t be connectivity values

In any case, I will trait with the MRtrix workflows, and I’ll tell you how it was.
thanks again
best regards
Raul

This is a memory issue. What CPU/RAM are you allowing docker?

Hi, Steven. I just checked, and the CPU/RAM is 8/12G. Is that fine?

If you have more RAM I would try to do at least 16GB (if not more). If you still get memory issues, you can lower the CPU count to 4.

Hello Steve, Thank you for your help. I can run the processing of the data, including the T1w. However, I obtain files *.mif or *.nii when I need a connectivity matrix. Can you recommend me how to produce this matrix?
best regards
Raul

Depending on the pipeline you used for reconstruction, the connectivity matrices may be stored in a .mat file.

Yes, I obtained the .mat file. However, I can open it, In Matlab appear the following error

Error using load
Number of columns on line 2 of ASCII file
F:\processing\out3\qsirecon\sub-PSL00063\dwi\sub-PSL00063_space-T1w_desc-preproc_gqinetwork.mat
must be the same as previous lines.

Error in uiimport/runImportdata (line 461)
datastruct = load(’-ascii’, fileAbsolutePath);

Error in uiimport/gatherFilePreviewData (line 429)
[datastruct, textDelimiter, headerLines]= runImportdata(fileAbsolutePath, type);

Error in uiimport (line 246)
gatherFilePreviewData(fileAbsolutePath);

Notepad is not working either.
what do you think?
very thankful for your help

I’ve always used Python scipy.io.loadmat, haven’t tried it with MATLAB. I also do not know if that error is specific to the GQI workflows, as I have only worked with MRtrix connectivity matrices.

Thanks, Steve is working now :slight_smile:
Best regards