New version on new Mac not running

Summary of what happened:

New Mac in the lab, required new installation of fMRIprep. Installation is done by IT people and this is a managed computer if it makes any difference.

The initial installation was a little messy… maybe it’s still not installed right.

Running with Dockers on a Mac M2, 16gb

on my former computer, I was able to preprocess my files using -no-reconall but I would like to run it this time.

Can you please tell me if it’s an installation issue, missing paths, or a command issue?

Also, reading what I can understand from the output, this folder /Volumes/NENS01/BIDS/derivativesTest/sourcedata/freesurfer. does not exist… should it?

Thank you!

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

fmriprep /Volumes/NENS01/BIDS/raw /Volumes/NENS01/BIDS/derivativesTest participant --participant-label sub-004 --fs-license-file /Volumes/NENS01/fsl_license/license.txt --skip-bids-validation --dummy-scans 1 --output-spaces MNI152NLin2009cAsym:res-2 -w /Volumes/NENS01/BIDS/Testfolder

Version:

fMRIPrep v23.1.4. (I know there is a newer version but knowing what the issue is here might help me get everything fixed when I the IT people come help again).

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

Docker v24.0.7 (is it important to update it as well?)

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

Files are Bids and were already preprocessed on an older computer with an older version of fMRIprep

Relevant log outputs (up to 20 lines):

You are using fMRIPrep-23.1.4,...

240205-14:28:58,33 cli WARNING:
	 Telemetry disabled because sentry_sdk is not installed.

240205-14:29:10,693 nipype.workflow IMPORTANT:
	 Running fMRIPrep version 23.1.4

         License NOTICE ##################################################
         -cut this out for space here, I don't think it's important-
         #################################################################
240205-14:29:10,909 nipype.workflow IMPORTANT:
	 Building fMRIPrep's workflow:
           * BIDS dataset path: /Volumes/NENS01/BIDS/raw.
           * Participant list: ['004'].
           * Run identifier: 20240205-142857_a83af3a8-c8dd-435c-8158-ce0de9573d90.
           * Output spaces: MNI152NLin2009cAsym:res-2.
           * Pre-run FreeSurfer's SUBJECTS_DIR: /Volumes/NENS01/BIDS/derivativesTest/sourcedata/freesurfer.      
Process Process-2:
Traceback (most recent call last):
  File "/Users/nens.lab/miniconda3/lib/python3.11/site-packages/nipype/interfaces/base/traits_extension.py", line 129, in validate
    value = Path(value)  # Use pathlib's validation
            ^^^^^^^^^^^
  File "/Users/nens.lab/miniconda3/lib/python3.11/pathlib.py", line 871, in __new__
    self = cls._from_parts(args)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nens.lab/miniconda3/lib/python3.11/pathlib.py", line 509, in _from_parts
    drv, root, parts = self._parse_args(args)
                       ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nens.lab/miniconda3/lib/python3.11/pathlib.py", line 493, in _parse_args
    a = os.fspath(a)
        ^^^^^^^^^^^^
TypeError: expected str, bytes or os.PathLike object, not NoneType

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/nens.lab/miniconda3/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/Users/nens.lab/miniconda3/lib/python3.11/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/nens.lab/miniconda3/lib/python3.11/site-packages/fmriprep/cli/workflow.py", line 115, in build_workflow
    retval["workflow"] = init_fmriprep_wf()
                         ^^^^^^^^^^^^^^^^^^
  File "/Users/nens.lab/miniconda3/lib/python3.11/site-packages/fmriprep/workflows/base.py", line 80, in init_fmriprep_wf
    BIDSFreeSurferDir(
  File "/Users/nens.lab/miniconda3/lib/python3.11/site-packages/nipype/interfaces/base/core.py", line 563, in __init__
    super(SimpleInterface, self).__init__(
  File "/Users/nens.lab/miniconda3/lib/python3.11/site-packages/nipype/interfaces/base/core.py", line 202, in __init__
    self.inputs.trait_set(**inputs)
  File "/Users/nens.lab/miniconda3/lib/python3.11/site-packages/traits/has_traits.py", line 1520, in trait_set
    setattr(self, name, value)
  File "/Users/nens.lab/miniconda3/lib/python3.11/site-packages/nipype/interfaces/base/traits_extension.py", line 131, in validate
    self.error(objekt, name, str(value))
  File "/Users/nens.lab/miniconda3/lib/python3.11/site-packages/traits/base_trait_handler.py", line 74, in error
    raise TraitError(
traits.trait_errors.TraitError: The 'freesurfer_home' trait of a _BIDSFreeSurferDirInputSpec instance must be a pathlike object or string representing an existing directory, but a value of 'None' <class 'str'> was specified.

Screenshots / relevant information:


Hi @ilaria,

May you please share the full command, including the Docker preamble?

Mind expanding on this point? What was messy? Docker or fMRIPrep (and if you are using Docker, what did you have to install for fMRIPrep?)?

This, by default, is where fMRIPrep looks for FreeSurfer data (and places outputs if they have to be made). It can be changed either by using --output-layout legacy (which changes the default to be derivatives/freesurfer) or by explicitly defining --fs-subjects-dir in the fmriprep command.

Best,
Steven

Hello Steven:

thanks for your prompt reply.

What is the Docker preamble?
This is the full command line I type in my terminal:
fmriprep /Volumes/NENS01/BIDS/raw /Volumes/NENS01/BIDS/derivativesTest participant --participant-label sub-004 --fs-license-file /Volumes/NENS01/fsl_license/license.txt --skip-bids-validation --dummy-scans 1 --output-spaces MNI152NLin2009cAsym:res-2 -w /Volumes/NENS01/BIDS/Testfolder

The first installation of fMRIPrep in Dockers did not work (not sure I can give you more details, alas). The IT person came back and installed fMRIprep in Dockers again. I think the IT person installed all the dependencies that are required (I see FreeSurfer, Python, etc. in the app folder).

Last point, I created the /derivatesTest folder but not the /sourcedata/freesurfer one. Considering your comment, I trust that it will be created once the script runs successfully.

Thanks,

Hi @ilaria,

You mentioned that you used Docker in your first post, but now it seems like when you ran fMRIPrep you did not. The advantage of using something like Docker is that you do not have to worry about software dependencies or environment variables being wrong. Without knowing how you installed fMRIPrep it is hard to identify the precise problems. I suppose you can try to explicitly state the the --fs-subjects-dir as I recommended earlier, but I think you should focus on trying to get Docker running as a more sustainable way to run fMRIPrep. Are there any details you can provide about the installation?

Best,
Steven

Well, the IT person told me that I have to start Dockers to run fMRIprep. On my old computer I had to write fmriperp-dockers and now apparently he told me I don’t have to. When I open Dockers, I see an fMRIprep image.

Sounds like the installation was not done properly…

You have to use docker run ..... to run containers.

Sorry for posting while you are writing. I just closed Dockers and was able to run fmriprep -h … this should not happen if the installation was with Dockers… right?

Try:

bids=/Volumes/NENS01/BIDS/raw
work=/Volumes/NENS01/BIDS/work
license=/Volumes/NENS01/fsl_license/license.txt
docker run -ti --rm \
    -v $bids:/data:ro \
    -v $bids/derivatives:/out \
    -v $license:/opt/freesurfer/license.txt \
    -v $work:/work
    nipreps/fmriprep:latest \
    /data /out participant \
    -w /work \
    --participant-label sub-004 \
    --dummy-scans 1 \
    --output-spaces MNI152NLin2009cAsym:res-2

If you have the python version also installed (which is not recommended for running as I mentioned earlier), then terminal will find it even without Docker.

I’ll try your code and if it does not work, I’ll ask the IT person to start from scratch and make sure it’s only through Dockers. thx.