Selecting only one session for ASLPrep Anat (T1w)

Summary of what happened:

I am trying to run aslprep only on the baseline sessions in participants with two sessions (ses-baseline, ses-followup). I have used the --bids-filter-file. This works for the ASL part but it still seems to grab the T1w images from both sessions for the anatomical template. Is there a way to only grab the baseline T1w images? I tried adding ‘anat’ to the filter file as I did with ‘asl’ but then aslprep did not run.

Version:

aslprep-25.0.0rc1

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

Singularity

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

IMG=$(pwd)/aslprep-25.0.0rc1.simg
FS_LICENSE=/sw/freesurfer/license.txt
filter_file=/zwork/elle/OHS/data/code/aslprep/bl_filter.json
outdir=/zwork/elle/OHS/data/derivatives/aslprep
scratch=/zwork/elle/OHS/workdir

cmd="singularity run \
  -B ${base}:/bids-root \
  -B ${outdir}:/output \
  -B ${scratch}:/workdir \
  -B ${FS_LICENSE}:/license \
  -B ${filter_file}:/bl_filter.json \
  $IMG /bids-root /output participant \
  --participant-label ${subject} \
  --bids-filter-file /bl_filter.json \
  --fs-license-file /license \
  --nthreads 4 --omp-nthreads 4 --mem_mb 40000 \
  --work-dir /workdir"

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

Summary
285 Files, 20.16GB
5 - Subjects
2 - Sessions
Available Tasks
nback
rest
Available Modalities
MRI

View 1 Error in 10 files

Error 1: [Code 176] ASLCONTEXT_TSV_INCONSISTENT

In the 'sub-<label>[_ses-<label>][_acq-<label>][_rec-<label>][_run-<index>]_aslcontext.tsv', the 'volume_type' can only be filled with volumes ['cbf' ,'m0scan', 'label', 'control', 'deltam'].

Data tree output:

data/
  sub-01/
    ses-baseline/
      perf
      anat
    ses-followup/
      perf
      anat

Screenshots / relevant information:

BIDS filter file:

{
    "asl": {
        "session": "baseline"
    }
}

Hi @ellem,

Please provide the information requested by the Software Support template. You can see I edited in for you this time. Also the BIDS filter file you are using would help, and the tree output for a subject.

If this is a bug with ASLPrep we can try to fix it, but in the meantime you can also create temporary single-subject single-session BIDS directories in scratch space, obviating the need for any filter file.

Best,
Steven

Hi @ellem,

I have re-added the prompt for you to provide your code and BIDS validator output, please do not delete it next time. Additionally, please format your code outputs as code with the tickmarks (or using the </> button in the text editor. You can see I edited it for you this time.

It would help to provide the full tree going into the data folders (that is, not stopping at anat/perf).

Your BIDS filter does not include any anatomical filtering, which you can add with an analogous t1w/t2w entity.

Best,
Steven

EDIT: Edited my response to add the correct t1w/t2w entity name, per next repsonse.

Sorry, I have a minor modification to @Steven’s response. In ASLPrep the fields you can use for your BIDS filter file can be seen in aslprep/aslprep/utils/bids.py at 08d7b77cc85766590d89165ec02af0ff22297756 · PennLINC/aslprep · GitHub. Rather than anat, you need to use t1w and t2w.

1 Like