Problem: Multi-session subjects — only one session reconstructs successfully (others fail at get_atlases / missing MNI→T1w transform), even when running QSIPrep + recon in a single command
Hi,
I’m running QSIPrep (v0.19.0) on the ABCD dataset with multi-session (longitudinal) subjects (e.g., ses-baselineYear1Arm1, ses-2YearFollowUpYArm1, sometimes more). For each subject, QSIPrep preprocessing completes, but during reconstruction, only one session succeeds, and the other session(s) fail consistently.
This happens even when I run preprocessing + reconstruction in the same QSIPrep command (--recon_spec mrtrix_multishell_msmt_ACT-hsvs) with a fresh work directory.
Workflow and command
I run QSIPrep in a Singularity container on an HPC cluster. Typical command (single command, preproc + recon):
singularity run qsiprep.sif \
<BIDS_DIR> <DERIV_DIR> participant \
--participant-label <SUBJECT> \
--fs-license-file <license.txt> \
-w <WORK_DIR> \
--skip-bids-validation \
--output-resolution 1.2 \
--nthreads 8 --omp-nthreads 4 \
--recon_spec mrtrix_multishell_msmt_ACT-hsvs \
--freesurfer-input <freesurfer_derivatives_root>
The subject has multiple sessions with valid multishell DWI (bvals look normal across sessions), and QSIPrep produces per-session space-T1w_desc-preproc_dwi.nii.gz outputs.
Symptom
In the qsirecon outputs, only one session is present (e.g., only ses-2YearFollowUpYArm1), while the other session(s) do not produce recon outputs.
Looking at the logs, the failing session crashes in:
qsirecon_anat_wf.get_atlases- followed by downstream nodes like
odf_rois/resample_maskfailing due to missing mandatory inputs (transforms/in_file) - eventually
result_*.pklzfiles are missing, producingFileNotFoundErrorin Nipype callbacks
Representative crash message
For a failing session (baseline), the crash looks like:
Node: qsirecon_wf.sub-NDARINV2CVG2YBY_mrtrix_multishell_msmt_hsvs.sub_NDARINV2CVG2YBY_ses_baselineYear1Arm1_run_01_space_T1w_desc_preproc_recon_wf.qsirecon_anat_wf.get_atlases
Working directory: /proj/grwulab/projects/ABCD_process/dwi_bid_work_missing_jiaqi/qsirecon_wf/sub-NDARINV2CVG2YBY_mrtrix_multishell_msmt_hsvs/sub_NDARINV2CVG2YBY_ses_baselineYear1Arm1_run_01_space_T1w_desc_preproc_recon_wf/qsirecon_anat_wf/get_atlases
Node inputs:
atlas_names = ['schaefer100', 'schaefer200', 'schaefer400', 'brainnetome246', 'aicha384', 'gordon333', 'aal116']
forward_transform = <undefined>
reference_image = /proj/grwulab/projects/ABCD_process/dwi_bid_out_missing_jiaqi/qsiprep/sub-NDARINV2CVG2YBY/ses-baselineYear1Arm1/dwi/sub-NDARINV2CVG2YBY_ses-baselineYear1Arm1_run-01_space-T1w_desc-preproc_dwi.nii.gz
space = T1w
Traceback (most recent call last):
File "/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/plugins/multiproc.py", line 344, in _send_procs_to_workers
self.procs[jobid].run(updatehash=updatehash)
File "/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
result = self._run_interface(execute=True)
File "/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
return self._run_command(execute)
File "/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node get_atlases.
Traceback:
Traceback (most recent call last):
File "/usr/local/miniconda/lib/python3.8/site-packages/nipype/interfaces/base/core.py", line 397, in run
runtime = self._run_interface(runtime)
File "/usr/local/miniconda/lib/python3.8/site-packages/qsiprep/interfaces/utils.py", line 50, in _run_interface
raise Exception("No MNI to T1w transform found in anatomical directory")
Exception: No MNI to T1w transform found in anatomical directory
So, forward_transform is undefined, and get_atlases errors with:
No MNI to T1w transform found in anatomical directory
Then downstream nodes fail (e.g., ApplyTransforms requires transforms, Resample requires in_file).
Key diagnostic finding
I inspected the Nipype node inputs (_inputs.pklz) for get_atlases:
-
For the successful session,
_inputs.pklzincludes a validforward_transformpointing to the subject-level transform:forward_transform: <DERIV_DIR>/qsiprep/sub-<SUB>/anat/sub-<SUB>_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5 -
For the failing session,
_inputs.pklzdoes not includeforward_transformat all (onlyatlas_names,reference_image,space). This suggests the failing session’sget_atlasesnode is not being wired with the MNI→T1w transform input in the workflow graph.
Importantly, the MNI→T1w transform file exists on disk. In fact, I can see:
sub-<SUB>/anat/sub-<SUB>_from-MNI...to-T1w...xfm.h5- and also session-level copies like
sub-<SUB>/ses-*/anat/sub-<SUB>_from-MNI...to-T1w...xfm.h5
Yet the failing session still has forward_transform = <undefined> in get_atlases.
Question
Is this a known issue in QSIRecon reconstruction for multi-session subjects, where only one session gets a valid MNI→T1w forward_transform connection for atlas projection? If so:
- Is there a recommended approach to run recon per-session robustly (e.g., isolate derivatives per session, or a specific flag/parameter)?
- Is there a fix/workaround to ensure all sessions’
get_atlasesnodes receive the correctforward_transform?
I’m happy to provide additional logs, directory trees, or a minimal example if helpful.
Thanks!