nipreps / mriqc

Automated Quality Control and visual reports for Quality Assessment of structural (T1w, T2w) and functional MRI of the brain
http://mriqc.readthedocs.io
Apache License 2.0
299 stars 132 forks source link

TraitError / FileNotFoundError in 23.1.0 but not 23.0.1 #1169

Closed dmd closed 10 months ago

dmd commented 11 months ago

What happened?

Using:

singularity exec -B /data/skohut/data /data/singularity-images/mriqc-23.1.0.sif mriqc /data/skohut/data/p50 /data/skohut/data/p50/quality participant --no-sub

mriqc immediately fails: 23.1.0.txt

Using the exact same command line but with 23.0.1:

singularity exec -B /data/skohut/data /data/singularity-images/mriqc-23.0.1.sif mriqc /data/skohut/data/p50 /data/skohut/data/p50/quality participant --no-sub

mriqc completes successfully.

What command did you use?

singularity exec -B /data/skohut/data /data/singularity-images/mriqc-23.1.0.sif mriqc /data/skohut/data/p50 /data/skohut/data/p50/quality participant --no-sub

What version of the software are you running?

23.1.0

How are you running this software?

Singularity

Is your data BIDS valid?

Yes

Are you reusing any previously computed results?

No

Please copy and paste any relevant log output.

No response

Additional information / screenshots

No response

WilliamFCB commented 10 months ago

Hi @dmd, did you figure it out? I am not a mriqc expert, but I could see in the error that your input file could not be found/identified

The 'in_file' trait of a _AddProvenanceInputSpec instance must be a pathlike object or string representing an existing file, but a value of '/data/skohut/data/p50/sub-ss102/ses-12baseline/func/sub-ss102_ses-12baseline_task-rest_bold.nii' <class 'str'> was specified.

Maybe 23.1.0 somehow evaluates relevant input differently than 23.0.1? I leave that up to the experts ...

Anyway, I typically run things in slurm using sbatch and loop through subjects. The call below using 23.1.0 works fine for me.

Cheers William

mriqc_sif="${SCRIPTS_DIR}/mriqc.23.1.0.sif"
mem=18 #gb sub_label=${sub/sub-} ses_label=${ses/ses-}

catch_error singularity run --cleanenv --contain \ -B ${TOOLS_DIR} \ -B ${SCRIPTS_DIR} \ -B ${BIDS_TMP_DIR}:/data_in \ -B ${DERIV_DIR}:/data_out \ -B ${WORK_DIR}:/work \ -B /tmp:/tmp \ ${mriqc_sif} \ /data_in \ /data_out \ participant \ -w /work \ --participant-label ${sub} \ --session-id ${ses_label} \ --mem_gb ${mem} \ --float32 \ --nprocs ${SLURM_CPUS_PER_TASK} \ --ants-nthreads ${SLURM_CPUS_PER_TASK} \ --verbose-reports \ --no-sub \ --write-graph \ --notrack \ -vv

dmd commented 10 months ago

No, I have not figured this out.

effigies commented 10 months ago

Is it possible that the file appears as a broken symlink inside the container?

$ singularity exec $OPTIONS $CONTAINER bash
> ls -AFl $FILE
dmd commented 10 months ago

I think I got it. /data/skohut/data/p50/quality had a previous analysis in it. Removing that allowed 23.1.0 to proceed.

I do not know why 23.0.1 had no problem rerunning, whereas 23.1.0 did, though.

effigies commented 10 months ago

There were some changes to configuring the BIDSLayout: https://github.com/nipreps/mriqc/compare/23.0.1...23.1.0

Even fixing bugs, it's hard to avoid creating new weird edge cases when doing that.