QSIRecon template_name set to None

Summary of what happened:

First time qsiprep/recon user here. For this reason I’m not sure this belongs here or as a git issue…so I start here. I am running more or less default qsiprep (1.0.1) with apptainer. It completes without error, and all output seems ok (at least according to what I’ve seen on readthedocs/here). I then try to run qsirecon (1.1.0) with the hbcd recon (using an abcd dwi & fm). However it keeps throwing an error related to the template.

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

apptainer run --no-mount hostfs --cleanenv --containall -B ${bidsDir},${work},${subjdir},${TEMPLATEFL
OW_HOME} --env "TEMPLATEFLOW_HOME=$TEMPLATEFLOW_HOME" --env "SUBJECTS_DIR=$subjdir" qsiprep-1.0.1.sif
 ${bidsDir} ${bidsDir}/derivatives/dwi/qsiprep participant --output-resolution 1.7 --fs-license-file 
${fsLicense} --nprocs 190 --omp-nthreads 20 --participant-label sub-1115 --skip-bids-validation -w ${
work} --anatomical-template MNI152NLin2009cAsym

apptainer run --no-mount hostfs --cleanenv --containall -B ${bidsDir},${work},${subjdir} qsirecon-1.1
.0.sif ${bidsDir}/derivatives/dwi/qsiprep ${bidsDir}/derivatives/dwi/qsirecon participant --fs-licens
e-file ${fsLicense} --nprocs 190 --participant-label sub-1115 -w ${work} --recon-spec hbcd_scalar_map
s --fs-subjects-dir ${subjdir} --output-resolution 1.7 --input-type qsiprep --debug all -vvv

Version:

qsirecon: 1.0.1
qsiprep: 1.1.0

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

singularity/apptainer

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

I skip bids validation for now 

Relevant log outputs (up to 20 lines):

250626-23:45:19,922 nipype.workflow INFO:
	 Found 1 high-res anatomicals to process
Traceback (most recent call last):
  File "/opt/conda/envs/qsiprep/bin/qsirecon", line 8, in <module>
    sys.exit(main())
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/qsirecon/cli/run.py", line 84, in main
    retval = build_workflow(str(config_file), {})
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/qsirecon/cli/workflow.py", line 133, in 
build_workflow
    retval["workflow"] = init_qsirecon_wf()
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/qsirecon/workflows/base.py", line 44, 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 246, i
n init_single_subject_recon_wf
    dwi_anat_wfs[dwi_file], dwi_available_anatomical_data = init_dwi_recon_anatomical_workflow(
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/qsirecon/workflows/recon/anatomical.py",
 line 406, in init_dwi_recon_anatomical_workflow
    GetTemplate(
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 56
7, in __init__
    super().__init__(
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 20
4, in __init__
    self.inputs.trait_set(**inputs)
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/traits/has_traits.py", line 1520, in tra
it_set
    setattr(self, name, value)
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/traits/base_trait_handler.py", line 74, 
in error
    raise TraitError(
traits.trait_errors.TraitError: The 'template_name' trait of a _GetTemplateInputSpec instance must be
 a string, but a value of None <class 'NoneType'> was specified.

Screenshots / relevant information:

I have tried with several other (built-in) recon options, but they all give the same error. My apologies if I’m missing something very simple here.


Hi @muet0005 and welcome to neurostars!

May you please return the tree output of a subject’s qsiprep folder? E.g., ${bidsDir}/derivatives/dwi/qsiprep/sub-1115.

Best,
Steven

Dear Steven,
Thank you for the very quick reply! See the image here, I hope this is sufficient?

Another note: I just noticed:
Apptainer> qsiprep --version
QSIPrep v1.0.2.dev0+gfc89945.d20250405
Apptainer>

Despite using this to build the container:
apptainer build qsiprep-1.0.1.sif docker://pennlinc/qsiprep:1.0.1

The same goes for qsiprep, I requested 1.1.0 via the apptainer build, but get this:
Apptainer> qsirecon --version
QSIRecon v1.1.1.dev0+gaf43da9.d20250414
Apptainer>

hi @muet0005, you need to specify an --output-space argument if you’re using hbcd_scalar_maps. In your case it will have to be MNI152Nlin2009cAsym

Thanks for the fast reply @mattcieslak!

I indeed gave that a try, in a few ways (e.g., --output-space, and with the same command from qsiprep), but these flags are not recognized in qsirecon:

e.g,
qsirecon: error: unrecognized arguments: --output-space MNI152Nlin2009cAsym

I also saw the same error with other recons, not just the hbcd flavor.

I just had a look in qsirecon/cli/parser.py…lines ~443-447 (initialize --output-space if not defined) are commented out which maybe explains why if nothing is passed it fails. However, I do not see any other explicit references to --output-space…

let me know if there are other things I should try.

All the best,