PennLINC / qsirecon

Reconstruction of preprocessed q-space images (dMRI)
https://qsirecon.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

—infant results in pipeline flagging missing adult T1w QSIPrep outputs #124

Closed chiuhoward closed 3 weeks ago

chiuhoward commented 1 month ago

Summary

I am trying to run qsirecon with the infant pipeline, but nipype.workflow flags the adult MNI anatomical outputs as missing.

I suspect it’s related to https://github.com/PennLINC/qsirecon/issues/44?

Additional details

What were you trying to do?

Run qsirecon with one of the built-in reconstruction workflows.

What did you expect to happen?

QSIrecon to run, since https://github.com/PennLINC/qsirecon/blob/7b29424d55f3b13bb12865e9a51184f5f0358873/qsirecon/workflows/base.py#L249 suggests that there is a switch built in for —infant with the MNI Infant template.

What actually happened?

241017-15:24:19,696 nipype.workflow INFO:
     found ['/scratch/groups/jyeatman/howard/DBPFullwT1derivOct24/sub-16001/dwi/sub-16001_acq-b700_dir-PA_space-T1w_desc-preproc_dwi.nii.gz'] in /scratch/groups/jyeatman/howard/DBPFullwT1derivOct24
241017-15:24:19,698 nipype.workflow INFO:
     CHECKING /scratch/groups/jyeatman/howard/DBPFullwT1derivOct24/sub-16001/anat/sub-16001_desc-brain_mask.nii.gz: True
241017-15:24:19,698 nipype.workflow INFO:
     CHECKING /scratch/groups/jyeatman/howard/DBPFullwT1derivOct24/sub-16001/anat/sub-16001_desc-preproc_T1w.nii.gz: True
241017-15:24:19,698 nipype.workflow INFO:
     Found usable QSIPrep-preprocessed T1w image and mask.
241017-15:24:19,698 nipype.workflow INFO:
     CHECKING /scratch/groups/jyeatman/howard/DBPFullwT1derivOct24/sub-16001/anat/sub-16001_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5: False
241017-15:24:19,698 nipype.workflow INFO:
     CHECKING /scratch/groups/jyeatman/howard/DBPFullwT1derivOct24/sub-16001/anat/sub-16001_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5: False
241017-15:24:19,698 nipype.workflow INFO:
     CHECKING /scratch/groups/jyeatman/howard/DBPFullwT1derivOct24/sub-16001/anat/sub-16001_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5: False
241017-15:24:19,698 nipype.workflow INFO:
     CHECKING /scratch/groups/jyeatman/howard/DBPFullwT1derivOct24/sub-16001/anat/sub-16001_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5: False
241017-15:24:19,698 nipype.workflow INFO:
     Missing T1w QSIPrep outputs: /scratch/groups/jyeatman/howard/DBPFullwT1derivOct24/sub-16001/anat/sub-16001_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5 /scratch/groups/jyeatman/howard/DBPFullwT1derivOct24/sub-16001/anat/sub-16001_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5
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/qsirecon/cli/workflow.py", line 139, in build_workflow
    retval["workflow"] = init_qsirecon_wf()
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/qsirecon/workflows/base.py", line 43, in init_qsirecon_wf
    single_subject_wf = init_single_subject_recon_wf(subject_id=subject_id)
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/qsirecon/workflows/base.py", line 130, in init_single_subject_recon_wf
    anat_ingress_node, available_anatomical_data = init_highres_recon_anatomical_wf(
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/qsirecon/workflows/recon/anatomical.py", line 87, in init_highres_recon_anatomical_wf
    raise Exception("Cannot compute to-template")
Exception: Cannot compute to-template

Reproducing the bug

export APPTAINERENV_FS_LICENSE=$GROUP_HOME/freesurferlicense.txt
singularity run --containall --writable-tmpfs --cleanenv \
/home/groups/jyeatman/software/singularity_images/qsirecon-0.23.2.sif \
/scratch/groups/jyeatman/howard/DBPFullwT1derivOct24 \
/scratch/groups/jyeatman/howard/DBPFullwT1derivOct24-recon/ participant --participant-label sub-$SLURM_ARRAY_TASK_ID \
-w /scratch/groups/jyeatman/howard/DBPFullwT1derivOct24-work \
--infant \
--recon-spec mrtrix_singleshell_ss3t_noACT \
--fs-license-file $GROUP_HOME/freesurferlicense.txt \
--nthreads 10 \
--omp-nthreads 8 \
--output-resolution 2 \
-v -v
tsalo commented 1 month ago

AFAICT the infant_mode parameter is not being used in QSIPrepAnatomicalIngress, which is what actually collects the structural data, so even in infant mode it's looking for transforms to and from MNI152NLin2009cAsym. #123 will fix this, but I think we should push a fix ahead of time because that PR is massive.