nipreps / fmriprep

fMRIPrep is a robust and easy-to-use pipeline for preprocessing of diverse fMRI data. The transparent workflow dispenses of manual intervention, thereby ensuring the reproducibility of the results.
https://fmriprep.org
Apache License 2.0
638 stars 294 forks source link

Binding file paths to avoid the freesurfer _midthickness0 error resulting in a relative vs absolute filepath issue #3128

Closed katseitz closed 1 year ago

katseitz commented 1 year ago

What happened?

We have long file paths and were originally getting this error. After binding the file paths in the command, a new error has cropped up (see the error code below). I have bound the file paths successfully in the past and so I'm wondering what is going on here.

Thanks for your help!!

What command did you use?

#WITHOUT FMAP
singularity run --cleanenv -B /projects/b1108:/projects/b1108 \
-B /projects/b1108/studies/foundations2/data/processed/neuroimaging/23_fmriprep_nodc:/out \
-B /projects/b1108/studies/foundations2/data/raw/neuroimaging/bids:/data \
-B /projects/b1108/studies/foundations2/data/processed/neuroimaging/23_fmriprep_nodc/work:/work \
/projects/b1108/software/singularity_images/fmriprep-23.0.1.simg \
/data /out participant \
--participant-label ${1}  \
--fs-license-file /projects/b1108/software/freesurfer_license/license.txt \
-w /work --ignore fieldmaps

What version of fMRIPrep are you running?

23.0.1

How are you running fMRIPrep?

Singularity

Is your data BIDS valid?

Yes

Are you reusing any previously computed results?

Work directory

Please copy and paste any relevant log output.

nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node raw_sources.

Traceback:
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 398, in run
        runtime = self._run_interface(runtime)
      File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/utility/wrappers.py", line 142, in _run_interface
        out = function_handle(**args)
      File "<string>", line 6, in _bids_relative
      File "<string>", line 6, in <listcomp>
      File "/opt/conda/lib/python3.9/pathlib.py", line 939, in relative_to
        raise ValueError("{!r} is not in the subpath of {!r}"
    ValueError: '/projects/b1108/studies/foundations2/data/raw/neuroimaging/bids/sub-f10012/ses-1/anat/sub-f10012_ses-1_run-1_T1w.nii.gz' is not in the subpath of '/data' OR one path is relative and the other is absolute.

Additional information / screenshots

No response

effigies commented 1 year ago

I'm not sure what you mean by aliasing, but at a guess you're reusing a working directory that has the dataset root as /projects/b1108/studies/foundations2/data/raw/neuroimaging/bids instead of /data, and some node isn't getting rerun.

Working my way back through the workflow, you can probably delete a directory called anat_preproc_wf/anat_template_wf/anat_ref_dimensions inside your working directory, and that should force a rerun of anat_preproc_wf/anat_derivatives_wf/raw_sources, which is the node that's calling a function called _bids_relative.

katseitz commented 1 year ago

Okay! Will give that a go and report back. Thank you!

katseitz commented 1 year ago

Worked like a dream. Thank you!