Skip to content

ASLPrep crashes when using sMRIPrep derivatives #573

@araikes

Description

@araikes

Summary

I am attempting to run ASLPrep (v. 25.0.0rc1; latest tag pulled from Dockerhub yesterday) with sMRIPrep outputs (unstable tag from Dockerhub pulled yesterday). I have two sessions of data that were collected on the same day but different scanners.

I ran sMRIPrep as follows:

export APPTAINERENV_TEMPLATEFLOW_HOME=/opt/templateflow

apptainer run --containall \
  -B $PWD/nifti:/data:ro \
  -B $PWD/derivatives/smriprep_latest:/output \
  -B /groups/adamraikes/license.txt:/license.txt \
  -B /groups/adamraikes/templateflow:/opt/templateflow \
  -B /tmp:/tmp \
  /groups/adamraikes/singularity_images/smriprep_unstable.sif \
  /data /output participant \
  --participant-label 106 \
  --sub-anatomical-reference sessionwise \
  --output-spaces MNI152NLin6Asym:res-native MNI152NLin2009cAsym:res-1 fsaverage:den-10k \
  --fs-license-file /license.txt \
  --cifti-output 170k \
  -w /output/scratch

Everything outputs, no issues. Here's the call for ASLPrep

apptainer run --containall \
  -B $PWD/derivatives/smriprep_latest:/smriprep \
  -B /groups/adamraikes/templateflow:/opt/templateflow \
  -B $PWD/nifti:/data:ro \
  -B $PWD/derivatives/aslprep:/output \
  -B /tmp:/tmp \
  -B /groups/adamraikes/license.txt:/license.txt \
  /groups/adamraikes/singularity_images/aslprep_latest.sif \
  /data /output participant \
  --participant-label 106 \
  --fs-license-file /license.txt \
  --level full \
  -w /output/scratch \
  --derivatives smriprep=/smriprep \
  --output-spaces MNI152NLin2009cAsym:res-1 \
  --cifti-output 170k

Which yields:

250814-10:02:22,595 nipype.workflow IMPORTANT:
	 Running ASLPrep version 25.0.0rc1

         License NOTICE ##################################################
         ASLPrep 25.0.0rc1
         Copyright 2023 The PennLINC Team and the NiPreps Developers.
         
         This product is primarily developed by the PennLINC team,
         but it is also a part of the NiPreps community.
         
         This product includes software developed by
         the NiPreps Community (https://nipreps.org/).
         
         Portions of this software were developed at the Department of
         Psychology at Stanford University, Stanford, CA, US.
         
         This software is also distributed as a Docker container image.
         The bootstrapping file for the image ("Dockerfile") is licensed
         under the MIT License.
         
         This software may be distributed through an add-on package called
         "Docker Wrapper" that is under the BSD 3-clause License.
         #################################################################
250814-10:02:23,110 nipype.workflow IMPORTANT:
	 Building ASLPrep's workflow:
           * BIDS dataset path: /data.
           * Participant list: ['106'].
           * Run identifier: 20250814-100207_117153e0-e4da-4027-ba0e-bdd36d7d8ef5.
           * Output spaces: MNI152NLin2009cAsym:res-1.
           * Searching for derivatives: {'smriprep': PosixPath('/smriprep')}.
           * Pre-run FreeSurfer's SUBJECTS_DIR: /output/sourcedata/freesurfer.
250814-10:02:30,69 nipype.workflow INFO:
	 ANAT Found preprocessed T1w - skipping Stage 1
Process Process-2:
Traceback (most recent call last):
  File "/opt/conda/envs/aslprep/lib/python3.11/site-packages/nipype/interfaces/base/traits_extension.py", line 129, in validate
    value = Path(value)  # Use pathlib's validation
            ^^^^^^^^^^^
  File "/opt/conda/envs/aslprep/lib/python3.11/pathlib.py", line 871, in __new__
    self = cls._from_parts(args)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/aslprep/lib/python3.11/pathlib.py", line 509, in _from_parts
    drv, root, parts = self._parse_args(args)
                       ^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/aslprep/lib/python3.11/pathlib.py", line 493, in _parse_args
    a = os.fspath(a)
        ^^^^^^^^^^^^
TypeError: expected str, bytes or os.PathLike object, not list

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/aslprep/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/opt/conda/envs/aslprep/lib/python3.11/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/conda/envs/aslprep/lib/python3.11/site-packages/aslprep/cli/workflow.py", line 101, in build_workflow
    retval['workflow'] = init_aslprep_wf()
                         ^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/aslprep/lib/python3.11/site-packages/aslprep/workflows/base.py", line 69, in init_aslprep_wf
    single_subject_wf = init_single_subject_wf(subject_id)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/aslprep/lib/python3.11/site-packages/aslprep/workflows/base.py", line 277, in init_single_subject_wf
    anat_fit_wf = init_anat_fit_wf(
                  ^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/aslprep/lib/python3.11/site-packages/niworkflows/engine/splicer.py", line 21, in _tag
    node = func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/aslprep/lib/python3.11/site-packages/smriprep/workflows/anatomical.py", line 818, in init_anat_fit_wf
    anat_validate.inputs.in_file = precomputed['t1w_preproc']
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/aslprep/lib/python3.11/site-packages/nipype/interfaces/base/traits_extension.py", line 330, in validate
    value = super(File, self).validate(objekt, name, value, return_pathlike=True)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/aslprep/lib/python3.11/site-packages/nipype/interfaces/base/traits_extension.py", line 131, in validate
    self.error(objekt, name, str(value))
  File "/opt/conda/envs/aslprep/lib/python3.11/site-packages/traits/base_trait_handler.py", line 74, in error
    raise TraitError(
traits.trait_errors.TraitError: The 'in_file' trait of a _ValidateImageInputSpec instance must be a pathlike object or string representing an existing file, but a value of "['/smriprep/smriprep/sub-106/ses-CIMA/anat/sub-106_ses-CIMA_run-001_desc-preproc_T1w.nii.gz', '/smriprep/smriprep/sub-106/ses-SKYRA/anat/sub-106_ses-SKYRA_run-001_desc-preproc_T1w.nii.gz']" <class 'str'> was specified.

I tried using a BIDS filter (perhaps I didn't specify it correctly) but got the same error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions