Unable to Find Separate M0 Scan

Summary of what happened:

Hello,

I am using ASLprep to process PASL data. I have a separate M0 scan to my asl scan, but I am getting this error: File "/opt/conda/envs/aslprep/lib/python3.11/site-packages/aslprep/utils/bids.py", line 100, in collect_run_data raise FileNotFoundError(f'M0 file for {asl_file} not found.') FileNotFoundError: M0 file for /(includes whole pathway)/sub-003S4288/ses-init/perf/sub-003S4288_ses-init_acq-2000_asl.nii.gz not found.

Command used

# --- Pathways ---
sASL="singularity run --cleanenv \
    -B (rest of pathway) \
    -B /(rest of pathway)/templateflow:/templateflow \
    --env TEMPLATEFLOW_HOME=/templateflow \
    /(pathway)/mycontainers/aslprep-0.7.5.sif"
freesurfer_license="/(pathway)/freesurfer_license/license.txt"
input_dir="/(rest of pathway)/BIDS"
output_dir="/(rest of pathway)/BIDS/derivatives"

# --- Participant ID ---
participant_id=$1

# --- ASLprep call ---
$sASL \
    $input_dir \
    $output_dir \
    participant \
    --participant-label ${participant_id} \
    --fs-license-file $freesurfer_license \
    --skip-bids-validation \
    --basil \
    --scorescrub \
    -w /(rest of pathway)/work/aslprep/sub-${participant_id} \
    --omp-nthreads 2 --nthreads 4

Version:

aslprep-0.7.5

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

Singularity, downloaded on bash.

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

Passes validator. This is the tree:

sub-003S4288
└── ses-init
    ├── anat
    │   ├── sub-003S4288_ses-init_T1w.json
    │   └── sub-003S4288_ses-init_T1w.nii.gz
    ├── dwi
    │   ├── sub-003S4288_ses-init_dwi.bval
    │   ├── sub-003S4288_ses-init_dwi.bvec
    │   ├── sub-003S4288_ses-init_dwi.json
    │   └── sub-003S4288_ses-init_dwi.nii.gz
    └── perf
        ├── sub-003S4288_ses-init_acq-2000_aslcontext.tsv
        ├── sub-003S4288_ses-init_acq-2000_asl.json
        ├── sub-003S4288_ses-init_acq-2000_asl.nii.gz
        ├── sub-003S4288_ses-init_acq-2000_m0scan.json
        └── sub-003S4288_ses-init_acq-2000_m0scan.nii.gz

Relevant information:

In the asl json it includes:

- "M0Scan": "/(rest ofpathway)/BIDS/sub-003S4288/ses-init/perf/sub-003S4288_ses-init_acq-2000_m0scan.nii.gz",
- "InformedBy": "/(rest ofpathway)/BIDS/sub-003S4288/ses-init/perf/sub-003S4288_ses-init_acq-2000_m0scan.nii.gz",
- "M0Type": "Separate"

And for the M0 json it includes:

"M0Type": "Separate",
"InformedBy": ["bids::/BIDS/sub-003S4288/ses-init/perf/sub-003S4288/ses-init/perf/sub-003S4288_ses-init_acq-2000_asl.nii.gz"],
"IntendedFor": ["bids::sub-003S4288/ses-init/perf/sub-003S4288_ses-init_acq-2000_asl.nii.gz"]

I have tried different formatting, such as with the [bids::], without, etc. I also have tried with and without the ‘Informedby’ for both the asl and m0 json, as I saw it was in the /opt/conda/envs/aslprep/lib/python3.11/site-packages/aslprep/utils/bids.py script, which is apart of the error.

Are there any other things I could try to fix this error?

Thanks!
Claire


Your M0 scan’s IntendedFor is BIDS-valid, but ASLPrep doesn’t support BIDS URIs in IntendedFors yet. The fields InformedBy and M0Scan aren’t part of BIDS, so ASLPrep won’t use them.

I would recommend replacing the BIDS URI with a relative path for now. ASLPrep should be able to use that.

Okay, I updated the json files so now the asl json just has:

"M0Type": "Separate"

and the M0 json has:

"IntendedFor": "sub-003S4900_ses-init_acq-2000_asl.nii.gz"

But I am still getting the same error…

Hi @Claire_Illeck,

The IntendedFor field has to relative to the subject folder, which begins with ses-init level. For example:

"IntendedFor": "ses-init/perf/sub-003S4288_ses-init_acq-2000_asl.nii.gz"

Best,
Steven

Hi Steven,

Thank you for letting me know, it’s running now!

Best,
Claire