Freesurfer License Issue in fmriprep 1.1.4

Hello,

I can’t get this code to work for me:

export FS_LICENSE=$HOME/license.txt

singularity run --cleanenv --contain $HOME/fmriprep_1.1.4.img \
/N/dc2/scratch/dlevitas/fMRI_data/$subj /N/dc2/scratch/dlevitas/fMRI_data/ \
participant \
--participant-label sub-${subj} \
--verbose \
--anat-only \
--fs-no-reconall \
--fs-license-file $HOME/license.txt \
--ignore fieldmaps \
--write-graph \
-w $work_dir

The error I’m getting is:

WARNING: Could not chdir to home: /N/u/dlevitas/Karst
/usr/local/miniconda/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  return f(*args, **kwds)
/usr/local/miniconda/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  return f(*args, **kwds)
Traceback (most recent call last):
  File "/usr/local/miniconda/bin/fmriprep", line 11, in <module>
    sys.exit(main())
  File "/usr/local/miniconda/lib/python3.6/site-packages/fmriprep/cli/run.py", line 263, in main
    'ERROR: a valid license file is required for FreeSurfer to run. '
RuntimeError: ERROR: a valid license file is required for FreeSurfer to run. FMRIPREP looked for an existing license file at several paths, in this order: 1) command line argument ``--fs-license-file``; 2) ``$FS_LICENSE`` environment variable; and 3) the ``$FREESURFER_HOME/license.txt`` path. Get it (for free) by registering at https://surfer.nmr.mgh.harvard.edu/registration.html

I just downloaded a new Freesurfer license file and placed it in my home directory, but that hasn’t helped so far.

Thank you for the help.

Please try without --clearenv or provide full path in FMRIPREP argument instead of $HOME/license.txt. You might also need to skip the --contain flag or mount HOME explicitly.

Thanks Chris,

I tried removing the --clearenv and--contain options and specifying the full path instead of just using $HOME but the error remains. To “mount HOME explicitly”, do you mean bind the points using the -B option?

1 Like

Yes this should help.

I’m a little unfamiliar with bind points in Singularity, but the .img container and freesurfer license.txt file are in my home directory, and the root of my BIDS data is /N/dc2/scratch/dlevitas/fMRI_data/$subj so do I need to bind both these directories, and is there a specific place they need to be binded to in the container?

I was actually able to resolve my issue by placing the fmriprep_1.1.4.img in the same directory as the data.

Thanks again.