Qsiprep --recon-only: dsi_studio_gqi works but mrtrix_singleshell_ss3t_ACT-hsvs fails

Summary of what happened:

Hi All. I’m having trouble getting the mrtrix_singleshell_ss3t_ACT-hsvs reconstruction to run.

  1. Ran fmriprep on T1w and rs-func data, which generated sourcedata/freesurfer directory with subject sub-directories.

  2. Ran qsiprep preprocessing on single dwi/dti scan using singularity container, version v0.21.4 with cuda variant of eddy.

  3. Then attempted reconstruction (qsiprep --recon-only) with the mrtrix_singleshell_ss3t_ACT-hsvs workflow. As the software constructs the processing pipeline, before any actual computation, I get the following error:

Exception: Trying to connect anat_ingress_wf.register_fs_to_qsiprep_wf:outputnode.brain to anat_ingress_wf.outputnode:brain but input ‘brain’ of node ‘anat_ingress_wf.outputnode’ is already
connected.

Any help would be very much appreciated!

Command used (and if a helper script was used, a link to the helper script or the command generated):

  singularity run \                                                                                                                                                                           
              --cleanenv \                                                                                                                                                                    
              "${QSIPREP_SINGULARITY_IMAGE}" \                                                                                                                                                
              "${inpt_bids_dir}" "${outp_dir}" participant \                                                                                                                                  
              --verbose \                                                                                                                                                                     
              --verbose \                                                                                                                                                                     
              --stop-on-first-crash \                                                                                                                                                         
              --recon-only \                                                                                                                                                                  
              --recon-input-pipeline "qsiprep" \                                                                                                                                              
              --recon-input "${outp_dir}/qsiprep" \                                                                                                                                           
              --recon-spec "mrtrix_singleshell_ss3t_ACT-hsvs" \                                                                                                                               
              --fs-license-file "${FREESURFER_LICENSE}" \                                                                                                                                     
              --freesurfer-input "${outp_func_dir}/sourcedata/freesurfer" \                                                                                                                   
              --participant-label "${subj}" \                                                                                                                                                 
              --skip-bids-validation                                                                                                                                                          
 

Version: Running qsirecon version 0.21.5.dev0+g36b93fe.d20240504

Environment (Docker, Singularity / Apptainer, custom installation): Singularity

singularity build qsiprep-v0.21.4.sif docker://pennbbl/qsiprep:0.21.4

Data formatted according to a validatable standard? Please provide the output of the validator:

$ singularity run --cleanenv ../../singularity/bids-validator/bids-validator-1.14.6.sif bids_test                                                                      
bids-validator@1.14.6                                                                                                                                                                         
        1: [ERR] Files with such naming scheme are not part of BIDS specification. This error is most commonly caused by typos in file names that make them not BIDS compatible. Please consu 
lt the specification and make sure your files are named correctly. If this is not a file naming issue (for example when including files not yet covered by the BIDS specification) you should 
 include a ".bidsignore" file in your dataset (see https://github.com/bids-standard/bids-validator#bidsignore for details). Please note that derived (processed) data should be placed in /de 
rivatives folder and source data (such as DICOMS or behavioural logs in proprietary formats) should be placed in the /sourcedata folder. (code: 1 - NOT_INCLUDED)                             
                ./sub-AGWBAT/ses-01/fmap/sub-AGWBAT_ses-01_run-01_epi.json                                                                                                                    
                        Evidence: sub-AGWBAT_ses-01_run-01_epi.json                                                                                                                           
                ./sub-AGWBAT/ses-01/fmap/sub-AGWBAT_ses-01_run-01_epi.nii.gz                                                                                                                  
                        Evidence: sub-AGWBAT_ses-01_run-01_epi.nii.gz                                                                                                                         
                                                                                                                                                                                              
        Please visit https://neurostars.org/search?q=NOT_INCLUDED for existing conversations about this issue.                                                                                
                                                                                                                                                                                              
        1: [WARN] The recommended file /README is missing. See Section 03 (Modality agnostic files) of the BIDS specification. (code: 101 - README_FILE_MISSING)                              
                                                                                                                                                                                              
        Please visit https://neurostars.org/search?q=README_FILE_MISSING for existing conversations about this issue.                                                                         
                                                                                                                                                                                              
        2: [WARN] The Authors field of dataset_description.json should contain an array of fields - with one author per field. This was triggered because there are no authors, which will ma 
ke DOI registration from dataset metadata impossible. (code: 113 - NO_AUTHORS)                                                                                                                
                                                                                                                                                                                              
        Please visit https://neurostars.org/search?q=NO_AUTHORS for existing conversations about this issue.                                                                                  
                                                                                                                                                                                              
        Summary:                 Available Tasks:        Available Modalities:                                                                                                                
        23 Files, 154.1MB        Resting State           MRI                                                                                                                                  
        1 - Subject                                                                                                                                                                           
        1 - Session                                                                                                                                                                           
                                                                                                                                                                                              
                                                                                                                                                                                              
        If you have any questions, please post on https://neurostars.org/tags/bids.                                                                                                           

Relevant log outputs (up to 20 lines):

    Running qsirecon version 0.21.5.dev0+g36b93fe.d20240504:                                                                                                                                  
      * BIDS dataset path: /nfs/turbo/mbig-data/Rauh/5_mod3/bids.                                                                                                                             
      * Participant list: ['AGWBAT'].                                                                                                                                                         
      * Run identifier: 20240611-122435_1da18b38-2a2e-4815-8e21-01572b5b4603.                                                                                                                 
                                                                                                                                                                                              
240611-12:26:37,449 nipype.workflow INFO:                                                                                                                                                     
         found ['/scratch/fdbowman_root/fdbowman/dfdrake/proj/rauh/5_mod3/qsiprep/sub-AGWBAT/ses-01/dwi/sub-AGWBAT_ses-01_run-01_space-T1w_desc-preproc_dwi.nii.gz'] in /scratch/fdbowman_roo 
t/fdbowman/dfdrake/proj/rauh/5_mod3/qsiprep                                                                                                                                                   
240611-12:26:37,450 nipype.workflow INFO:                                                                                                                                                     
         CHECKING /scratch/fdbowman_root/fdbowman/dfdrake/proj/rauh/5_mod3/qsiprep/sub-AGWBAT/anat/sub-AGWBAT_desc-brain_mask.nii.gz: True                                                    
240611-12:26:37,450 nipype.workflow WARNING:                                                                                                                                                  
         A Non-gzipped input nifti file was found. Consider gzipping /scratch/fdbowman_root/fdbowman/dfdrake/proj/rauh/5_mod3/qsiprep/sub-AGWBAT/anat/sub-AGWBAT_desc-preproc_T1w.nii         
240611-12:26:37,451 nipype.workflow INFO:                                                                                                                                                     
         CHECKING /scratch/fdbowman_root/fdbowman/dfdrake/proj/rauh/5_mod3/qsiprep/sub-AGWBAT/anat/sub-AGWBAT_desc-preproc_T1w.nii.gz: True                                                   
240611-12:26:37,451 nipype.workflow INFO:                                                                                                                                                     
         Found usable QSIPrep-preprocessed T1w image and mask.                                                                                                                                
240611-12:26:37,451 nipype.workflow INFO:                                                                                                                                                     
         CHECKING /scratch/fdbowman_root/fdbowman/dfdrake/proj/rauh/5_mod3/qsiprep/sub-AGWBAT/anat/sub-AGWBAT_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5: True                         
240611-12:26:37,452 nipype.workflow INFO:                                                                                                                                                     
         CHECKING /scratch/fdbowman_root/fdbowman/dfdrake/proj/rauh/5_mod3/qsiprep/sub-AGWBAT/anat/sub-AGWBAT_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5: True                         
240611-12:26:37,455 nipype.workflow INFO:                                                                                                                                                     
         Found high-res anatomical data in preprocessed inputs for AGWBAT.                                                                                                                    
240611-12:26:37,456 nipype.workflow INFO:                                                                                                                                                     
         Freesurfer directory /scratch/fdbowman_root/fdbowman/dfdrake/proj/rauh/5_mod3/fmriprep/sourcedata/freesurfer/sub-AGWBAT exists for AGWBAT                                            
240611-12:26:37,462 nipype.workflow INFO:                                                                                                                                                     
         FreeSurfer data will be used to create a HSVS 5tt image.                                                                                                                             
240611-12:26:37,463 nipype.workflow INFO:                                                                                                                                                     
         HSVS 5tt imaged will be registered to the QSIPrep T1w image.                                                                                                                         
Process Process-2:                                                                                                                                                                            
Traceback (most recent call last):                                                                                                                                                            
  File "/opt/conda/envs/qsiprep/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap                                                                                           
    self.run()                                                                                                                                                                                
  File "/opt/conda/envs/qsiprep/lib/python3.10/multiprocessing/process.py", line 108, in run                                                                                                  
    self._target(*self._args, **self._kwargs)                                                                                                                                                 
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/qsiprep/cli/run.py", line 1330, in build_recon_workflow                                                                          
    retval["workflow"] = init_qsirecon_wf(                                                                                                                                                    
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/qsiprep/workflows/recon/base.py", line 130, in init_qsirecon_wf                                                                  
    single_subject_wf = init_single_subject_wf(                                                                                                                                               
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/qsiprep/workflows/recon/base.py", line 262, in init_single_subject_wf                                                            
    anat_ingress_node, available_anatomical_data = init_highres_recon_anatomical_wf(                                                                                                          
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/qsiprep/workflows/recon/anatomical.py", line 178, in init_highres_recon_anatomical_wf                                            
    workflow.connect([                                                                                                                                                                        
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/pipeline/engine/workflows.py", line 183, in connect                                                                       
    raise Exception(                                                                                                                                                                          
Exception: Trying to connect anat_ingress_wf.register_fs_to_qsiprep_wf:outputnode.brain to anat_ingress_wf.outputnode:brain but input 'brain' of node 'anat_ingress_wf.outputnode' is already 
connected.                                                                                                                                                                                    

Screenshots / relevant information:

  • The warning that about a non-gzipped sub-AGWBAT_desc-preproc_T1w.nii (apparently the preprocessing stage did not compress that particular file) goes away if I manually zip the file, but the results are the same.

An alternative workflow, dsi_studio_gqi, runs to completion.

The (external) bids validation doesn’t like the old fashioned way of naming the reverse phase encoded B0 in fmap (but it was the only way I could get the qsiprep preprocessing to run; the software doesn’t seem to have been updated to use the newer bids conventions). I don’t think this is an issue in the reconstruction phase.

Should I be using the latest release (0.21.4 at this time)? The docker installation instructions on readthedocs.io seem to say yes, but it’s not advised for singularity? The latest version listed on readthedocs.io (“Whats new”) is v0.19.0. Clearly, I’m a little confused.


Hi @silophophe,

This is an ongoing issue discussed here Error in connecting qsirecon nodes (0.20.1dev) · Issue #718 · PennLINC/qsiprep · GitHub. You can use QSIRecon with 0.19.1 in meantime.

Best,
Steven

Thanks Steven. I’d been googling the past couple of days and didn’t come across this for some reason. Sorry for the redundancy. And thanks for the alternative.

  • Daniel

On a potentially related subject: I ran fmriprep 23.2.2 on my fmri scans, which runs freesurfer 7. It looks like the qsiprep singularity container bundles freesurfer 6. Can qsiprep recon use the segmentations from freesurfer 7?

Yes it should work with FS7.

Thank you.

I bumped the entire qsiprep processing down to 0.19.1 in an effort to remain consistent across preprocessing and reconstruction. However, when using 0.19.1 for preprocessing, the eddy_cuda segment throws an error: “eddy_cuda: error while loading shared libraries: libcublas.so.10: cannot open shared object file: No such file or directory”. I found a thread [1] discussing a similar problem, which relates to a missing NVIDIA Container Toolkit. I searched the various modules we have installed on our cluster but did not find anything that fit that description.

In your opinion, since preprocessing and reconstruction are relatively decoupled, do you think it’s defensible to use qsiprep 0.21.4 for preprocessing and version 0.19.1 for reconstruction?

1: Qsiprep wirh cuda 12.2 - #5 by Ralf

Yes, that should be fine

1 Like

I agree- it’s totally fine to mix versions for preprocessing and recon. In fact, we will be splitting these two pipelines into two software packages, qsiprep and qsipost.

We’re continually running into issues where updating a software packages fixes a preprocessing bug, but breaks a recon workflow. Our group is currently also using 0.21.4 for preprocessing and 0.19.1 for recon

1 Like

Thanks, Matt, for the affirmation.

Reconstruction with 0.19.1 ran fine after I compressed the one file qsiprep/sub-AGWBAT/anat/sub-AGWBAT_desc-preproc_T1w.nii that came out of the 0.21.4 preprocessing pipeline as naked nifiti (i.e., not compressed with gzip).

Thank you all for your help!

  • Daniel
1 Like