M0 file not found for ASLPrep

Hi, I’m trying to run ASLPrep but it keeps failing to identify the m0 file, even though I’ve ensured the ‘IntendedFor’ file points to it. My m0 is separate, and I even added ‘M0Type = Separate’, but I keep receiving the same error.

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

apptainer run --cleanenv \
  -B $PWD:/data \
  -B $HOME/aslprep_out:/out \
  $HOME/aslprep/aslprep-25.1.0.sif \
  /data /out participant \
  --participant-label 4028 \
  --fs-license-file /home/cic/murrub/aslprep/license.txt \
  --skip_bids_validation #used this later thinking it might help 

Version:

25.1.0

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

Apptainer

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

BIDS Validated 

Relevant log outputs (up to 20 lines):

         Running ASLPrep version 25.1.0

         License NOTICE ##################################################
         ASLPrep 25.1.0
         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.
         #################################################################
251125-23:04:24,50 nipype.workflow IMPORTANT:
         Building ASLPrep's workflow:
           * BIDS dataset path: /data.
           * Participant list: ['4028'].
           * Run identifier: 20251125-230416_76be52db-d863-42c5-b1ba-90511e7b1c98.
           * Output spaces: MNI152NLin2009cAsym:res-native.
           * Pre-run FreeSurfer's SUBJECTS_DIR: /out/sourcedata/freesurfer.
251125-23:04:24,219 nipype.workflow INFO:
         ANAT Stage 1: Adding template workflow
251125-23:04:24,528 nipype.workflow INFO:
         ANAT Stage 2: Preparing brain extraction workflow
251125-23:04:24,581 nipype.workflow INFO:
         ANAT Stage 3: Preparing segmentation workflow
251125-23:04:24,583 nipype.workflow INFO:
         ANAT Stage 4: Preparing normalization workflow for ['MNI152NLin2009cAsym']
251125-23:04:24,590 nipype.workflow INFO:
         ANAT Stage 5: Preparing surface reconstruction workflow
251125-23:04:24,600 nipype.workflow INFO:
         ANAT Stage 6: Preparing mask refinement workflow
251125-23:04:24,601 nipype.workflow INFO:
         ANAT Stage 7: Creating T2w template
251125-23:04:24,604 nipype.workflow INFO:
         ANAT Stage 8: Creating GIFTI surfaces for ['white', 'pial', 'midthickness', 'sphere_reg', 'sphere']
251125-23:04:24,613 nipype.workflow INFO:
         ANAT Stage 8: Creating GIFTI metrics for ['thickness', 'sulc']
251125-23:04:24,616 nipype.workflow INFO:
         ANAT Stage 8a: Creating cortical ribbon mask
251125-23:04:24,618 nipype.workflow INFO:
         ANAT Stage 9: Creating fsLR registration sphere
251125-23:04:24,620 nipype.workflow INFO:
         ANAT Stage 10: MSM-Sulc disabled
251125-23:04:24,620 nipype.workflow INFO:
         ANAT Stage 11: Creating cortical surface mask
Process Process-2:
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 798, in init_single_subject_wf
    asl_wf = init_asl_wf(
             ^^^^^^^^^^^^
  File "/opt/conda/envs/aslprep/lib/python3.11/site-packages/aslprep/workflows/asl/base.py", line 211, in init_asl_wf
    run_data = collect_run_data(layout, asl_file)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/aslprep/lib/python3.11/site-packages/aslprep/utils/bids.py", line 106, in collect_run_data
    raise FileNotFoundError(f'M0 file for {asl_file} not found.')
FileNotFoundError: M0 file for /data/sub-4028/ses-01/perf/sub-4028_ses-01_asl.nii.gz not found.

Screenshots / relevant information:


Hi @Rubana and welcome to neurostars!

You specified IntendedFor incorrectly. The relative path version of it should begin from within the subject folder, e.g., with ses-01/ in your screenshot.

Best,
Steven

1 Like

aha!! thank you so much Steven

1 Like