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
615 stars 288 forks source link

Error relating to freesurfer path #2711

Open KarisColyerPatel opened 2 years ago

KarisColyerPatel commented 2 years ago

Hey, I am trying to run fmriprep on a HPC using singularity:

singularity run --cleanenv fmriprep-20.2.4.simg Cancul-BIDS Cancul-BIDS/derivatives participant --fs-license-file Cancul-BIDS/derivatives/license.txt

Currently, I have the following error:

Running fMRIPREP version 20.2.4:
      * BIDS dataset path: /home/kariscp/Cancul-BIDS.
      * Participant list: ['1001', '1002', '1003', '1004', '1005', '1006', '1007', '1008', '1009', '1010', '1011', '10110', '1012', '1013', '1014', '1015', '1016', '1017', '1018', '1019', '1020', '1021', '1022', '1023', '1024', '1025', '1026', '1027', '1028', '1029', '1030', '1031', '1032', '1033', '1034', '1035', '1036', '1037', '1038', '1039', '1040', '1041', '1042', '1043', '1044', '1045', '1046', '1047', '1048', '1049', '1050', '1051', '1052', '1054', '1055', '1056', '1057', '1058', '1059', '1060', '1061', '1063', '1065', '1066', '1067', '1068', '1069', '1070', '1071', '1072', '1073', '1074', '1075', '1076', '1077', '1079', '1080', '1081', '1082', '1083', '1084', '1085', '1086', '1087', '1088', '1089', '1090', '1092', '1093', '1094', '1095', '1096', '1097', '1098', '1099', '1100', '1101', '1102', '1103', '1104', '1105', '1106', '1107', '1110', '1111', '1112', '1113', '1114', '1115', '1117', '1118', '1119', '1120', '1121', '1122', '1123', '1124', '1125', '1126'].
      * Run identifier: 20220209-195436_c419470c-f534-42b7-8941-fd8e70cb5845.
      * Output spaces: MNI152NLin2009cAsym:res-native.
      * Pre-run FreeSurfer's SUBJECTS_DIR: /home/kariscp/Cancul-BIDS/derivatives/freesurfer.
Process Process-2:
Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
    self.run()
  File "/usr/local/miniconda/lib/python3.7/multiprocessing/process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/cli/workflow.py", line 82, in build_workflow
    retval["workflow"] = init_fmriprep_wf()
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/workflows/base.py", line 57, in init_fmriprep_wf
    spaces=config.workflow.spaces.get_fs_spaces()),
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 641, in __init__
    from_file=from_file, resource_monitor=resource_monitor, **inputs
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 191, in __init__
    self.inputs.trait_set(**inputs)
  File "/usr/local/miniconda/lib/python3.7/site-packages/traits/has_traits.py", line 1543, in trait_set
    setattr( self, name, value )
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/traits_extension.py", line 135, in validate
    self.error(objekt, name, str(value))
  File "/usr/local/miniconda/lib/python3.7/site-packages/traits/trait_handlers.py", line 172, in error
    value )
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 '/opt/freesurfer' <class 'str'> was specified
effigies commented 2 years ago

Thanks for the bug report!

This looks like it's probably an issue with your singularity image. If you run the following, you should be able to see what's in your image:

$ singularity shell --cleanenv fmriprep-20.2.4.simg
> ls /opt

You should see something like:

ICA-AROMA    ants   convert3d-1.0.0  fsl-6.0.5.1
afni-latest  conda  freesurfer       workbench
KarisColyerPatel commented 2 years ago

Thanks for the quick reply I currently see the following:

[kariscp@int1 ~]$ singularity shell --cleanenv fmriprep-20.2.4.simg Singularity> ls /opt IBM Mellanox adminenv confluent kafka knem-1.1.4.90mlnx1 mellanox Singularity>

effigies commented 2 years ago

It seems that the system /opt is overriding the container. We'll need to look into disabling that override. Do you want to have a look at the singularity docs? I can look tomorrow, if you can't find anything.

KarisColyerPatel commented 2 years ago

I see! I will take a look today and let you know how I get on. Thanks!

KarisColyerPatel commented 2 years ago

Hey, I was struggling to find any documents referring to how to override the home system. It would be great if I could get some help with this!

hfxcarl commented 2 years ago

It sounds like the environment variable "SINGULARITY_BINDPATH" might be set on your system. This tells singularity to auto-bind specific paths into your container. For example: export SINGULARITY_BINDPATH="/opt,/scratch" would mount /opt:/opt /scratch:/scratch. Check your environment with command: env | grep SING