Skip to content

Raise informative error if subject's Freesurfer derivatives do not exist when using --fs-no-resume #503

@tsalo

Description

@tsalo

Is your feature request related to a problem? Please describe.
I am working on copying over session-wise anatomical processing fMRIPrep to ASLPrep, and I noticed that some of my tests were failing with the following error message:

ERROR    nipype.workflow:tools.py:51 Node midthickness failed to run on host 46fd79a18ca1.
ERROR    nipype.workflow:tools.py:68 Saving crash info to /src/aslprep/.circleci/out/test_003_full/aslprep/sub-01/ses-1/log/20251029-163525_92d85f56-bcc3-419c-a427-bcb62247a866/crash-20251029-163633-root-midthickness-3c667ffd-8e51-4ecb-b65b-0904b32f018a.txt
Traceback (most recent call last):
  File "/opt/conda/envs/aslprep/lib/python3.12/site-packages/nipype/pipeline/plugins/multiproc.py", line 323, in _send_procs_to_workers
    num_subnodes = self.procs[jobid].num_subnodes()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/aslprep/lib/python3.12/site-packages/nipype/pipeline/engine/nodes.py", line 1312, in num_subnodes
    self._check_iterfield()
  File "/opt/conda/envs/aslprep/lib/python3.12/site-packages/nipype/pipeline/engine/nodes.py", line 1335, in _check_iterfield
    raise ValueError(
ValueError: Input in_file was not set but it is listed in iterfields.

After some digging, I realized that the error was stemming from the fact that I was passing in Freesurfer derivatives with just the subject ID, but now sMRIPrep is looking for ones with the subject and session. Unfortunately, the error message isn't very clear.

Describe the solution you'd like
A more informative error message - e.g., "No Freesurfer derivatives found at <path to subject's expected derivatives>" - would be great.

Describe alternatives you've considered
None

Additional context
n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions