Fmriprep: FLAIR in BIDS input data not used for Freesurfer surface recon-all

fmriprep
freesurfer

#1

Dear fmriprep experts,

As stated in the documentation, T2 or FLAIR images in input BIDS directory should be used automatically in the Freesurfer recon-all pipeline to help define pial surface.

However, having a FLAIR image in my input BIDS directory, this wasn’t take into account when Freesurfer recon-all process was launched.

Is there anything to do to force the use of such data ?

Best,
Matthieu


#2

How are you running fMRIPrep? Docker/Singularity or manual python installation?

Without more details, I would be inclined to think that fMRIPrep is not finding the FLAIR images for some reason. Please, also double-check on logs under the freesurfer/ output folder to confirm that indeed, FLAIR were not used.

EDIT: also make sure you are not re-using pre-cached freesurfer results without FLAIRs.


#3

@oesteban I am running fMRIPrep with docker image.

I have checked the report in bidssrc/ working directory and have seen that FLAIR has been recognized as BIDS input:

Node: single_subject_207103M020130219_wf (bidssrc (bids)

Hierarchy : fmriprep_wf.single_subject_207103M020130219_wf.bidssrc
Exec ID : bidssrc

Original Inputs

  • subject_data : {‘fmap’: [], ‘bold’: [’/data/sub-207103M020130219/func/sub-207103M020130219_task-rest_run-01_bold.nii.gz’], ‘sbref’: [], ‘flair’: [’/data/sub-207103M020130219/anat/sub-207103M020130219_FLAIR.nii.gz’], ‘t2w’: [], ‘t1w’: [’/data/sub-207103M020130219/anat/sub-207103M020130219_T1w.nii.gz’], ‘roi’: []}
  • subject_id :

Execution Inputs

  • subject_data : {‘fmap’: [], ‘bold’: [’/data/sub-207103M020130219/func/sub-207103M020130219_task-rest_run-01_bold.nii.gz’], ‘sbref’: [], ‘flair’: [’/data/sub-207103M020130219/anat/sub-207103M020130219_FLAIR.nii.gz’], ‘t2w’: [], ‘t1w’: [’/data/sub-207103M020130219/anat/sub-207103M020130219_T1w.nii.gz’], ‘roi’: []}
  • subject_id :

Execution Outputs

  • bold : /data/sub-207103M020130219/func/sub-207103M020130219_task-rest_run-01_bold.nii.gz
  • flair : /data/sub-207103M020130219/anat/sub-207103M020130219_FLAIR.nii.gz
  • fmap :
  • out_dict :
  • roi :
  • sbref :
  • t1w : /data/sub-207103M020130219/anat/sub-207103M020130219_T1w.nii.gz
  • t2w :

Runtime info

  • duration : 0.00235
  • hostname : 30ad337e92c2
  • prev_wd : /tmp
  • working_dir : /scratch/fmriprep_wf/single_subject_207103M020130219_wf/bidssrc

Environment



* AFNI_IMSAVE_WARNINGS : NO
* AFNI_MODELPATH : /usr/lib/afni/models
* AFNI_PLUGINPATH : /usr/lib/afni/plugins
* AFNI_TTATLAS_DATASET : /usr/share/afni/atlases
* ANTSPATH : /usr/lib/ants
* CRN_SHARED_DATA : /niworkflows_data
* FIX_VERTEX_AREA : 
* FMRI_ANALYSIS_DIR : /opt/freesurfer/fsfast
* FREESURFER_HOME : /opt/freesurfer
* FSFAST_HOME : /opt/freesurfer/fsfast
* FSF_OUTPUT_FORMAT : nii.gz
* FSLDIR : /usr/share/fsl/5.0
* FSLMULTIFILEQUIT : TRUE
* FSLOUTPUTTYPE : NIFTI_GZ
* FSLTCLSH : /usr/bin/tclsh
* FSLWISH : /usr/bin/wish
* FSL_DIR : /usr/share/fsl/5.0
* FS_LICENSE : /opt/freesurfer/license.txt
* FS_OVERRIDE : 0
* FUNCTIONALS_DIR : /opt/freesurfer/sessions
* HOME : /root
* HOSTNAME : 30ad337e92c2
* LANG : C.UTF-8
* LC_ALL : C.UTF-8
* LD_LIBRARY_PATH : /usr/lib/fsl/5.0:
* LOCAL_DIR : /opt/freesurfer/local
* MINC_BIN_DIR : /opt/freesurfer/mni/bin
* MINC_LIB_DIR : /opt/freesurfer/mni/lib
* MKL_NUM_THREADS : 1
* MKL_THREADING_LAYER : INTEL
* MNI_DATAPATH : /opt/freesurfer/mni/data
* MNI_DIR : /opt/freesurfer/mni
* MNI_PERL5LIB : /opt/freesurfer/mni/lib/perl5/5.8.5
* OMP_NUM_THREADS : 1
* OS : Linux
* PATH : /usr/local/miniconda/bin:/opt/ICA-AROMA:/usr/lib/ants:/usr/lib/fsl/5.0:/usr/lib/afni/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
* PERL5LIB : /opt/freesurfer/mni/lib/perl5/5.8.5
* POSSUMDIR : /usr/share/fsl/5.0
* PYTHONNOUSERSITE : 1
* SUBJECTS_DIR : /opt/freesurfer/subjects
* TERM : xterm

However, when I look into freesurfer/scripts directory -autorecon1 doesn’t take into account FLAIR:

Mon Sep 10 14:46:48 UTC 2018
/out/freesurfer/sub-207103M020130219
/opt/freesurfer/bin/recon-all
-autorecon1 -i /data/sub-207103M020130219/anat/sub-207103M020130219_T1w.nii.gz -noskullstrip -openmp 7 -subjid sub-207103M020130219 -sd /out/freesurfer
subjid sub-207103M020130219
setenv SUBJECTS_DIR /out/freesurfer
FREESURFER_HOME /opt/freesurfer
Actual FREESURFER_HOME /opt/freesurfer
build-stamp.txt: freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1-f53a55a
Linux 30ad337e92c2 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
cputime unlimited
filesize unlimited
datasize unlimited
stacksize 8192 kbytes
coredumpsize 0 kbytes
memoryuse unlimited
vmemoryuse unlimited
descriptors 524288
memorylocked 64 kbytes
maxproc unlimited
maxlocks unlimited
maxsignal 257062
maxmessage 819200
maxnice 0
maxrtprio 0
maxrttime unlimited

          total        used        free      shared  buff/cache   available

Mem: 32926336 4473260 5627568 176236 22825508 27903628
Swap: 62699516 0 62699516

What could be wrong ?


#4

Hi Matthieu,

It seems like a problem on our side. I have opened the following bug report: https://github.com/poldracklab/fmriprep/issues/1277

Please follow up there.

Cheers,
Oscar


#5

One more thing to check is whether you are using pre-cached freesurfer results. Could it be that you ran it without FLAIR and now fMRIPrep is just reusing those results?


#6

Thank you for the link.

No I was running first with both T1 and FLAIR.


#7

Hi,

The syntax for using Flair in Freesurfer is not very intuitive. It is not enough with just writing
-FLAIR . You also need to include -FLAIRpial in the recon-all call.

Cheers


#8

Hi,

That’s right but it is similar with T2 images where both -T2 and -T2pial flags have to be specified in recon-all pipeline.

However concerning the automatic use of FLAIR images in the anatomical pipeline of fMRIPrep, it seems that BIDS FLAIR input is taken into account but not when launching recon-all process.