Fmriprep fails on freesurfer call: ERROR! FOV=282.000 > 256

This is happening for some subjects with a single session, does not seem to happen when multiple sessions are available.

The available T1w is below 256mm in size, but a conversion is happening by freesurfer and size is changed.

Original image header:

 Size : 208 256  256

  Image Dimensions   : [208, 256, 256]
  Bounding Box       : {[115.751 127.057 -134.726], [344.551 409.057 147.274]}
  Voxel Spacing      : [1.1, 1.10156, 1.10156]
  Intensity Range    : [0, 1138]
  Mean Intensity     : 61.593
  Direction Cos Mtx. :
-1 0 0
0 -1 0
0 0 1

fmriprep call:

/usr/local/miniconda/bin/fmriprep /DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5/bids /DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5 participant --participant-label 123456 --nthreads 4 --omp-nthreads 3 --fs-license-file /DATA/DAPPS/freesurfer/2019_08_05/freesurfer//license.txt --work-dir /DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5/work_sub-123456 --longitudinal --cifti-output --resource-monitor --notrack --no-submm-recon --use-aroma --skip_bids_validation --write-graph --force-syn --low-mem --output-spaces MNI152NLin2009cAsym:res-02 HDSTUDY160v1:res-02 OASIS30ANTs:res-02 fsaverage fsaverage5 T1w func

Error log:

RuntimeError: Command:
recon-all -autorecon1 -i /DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5/bids/sub-123456/ses-01/anat/sub-123456_ses-01_run-02_T1w.nii.gz -noskullstrip -openmp 3 -subjid sub-123456 -sd /DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5/freesurfer
Standard output:
Subject Stamp: freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1-f53a55a
Current Stamp: freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1-f53a55a
INFO: SUBJECTS_DIR is /DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5/freesurfer
Actual FREESURFER_HOME /opt/freesurfer
Linux mri 3.10.0-1062.9.1.el7.x86_64 #1 SMP Fri Dec 6 15:49:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
'/opt/freesurfer/bin/recon-all' -> '/DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5/freesurfer/sub-123456/scripts/recon-all.local-copy'
/DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5/freesurfer/sub-123456

 mri_convert /DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5/bids/sub-123456/ses-01/anat/sub-123456_ses-01_run-02_T1w.nii.gz /DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5/freesurfer/sub-123456/mri/orig/001.mgz 

mri_convert.bin /DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5/bids/sub-123456/ses-01/anat/sub-123456_ses-01_run-02_T1w.nii.gz /DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5/freesurfer/sub-123456/mri/orig/001.mgz 
$Id: mri_convert.c,v 1.226 2016/02/26 16:15:24 mreuter Exp $
reading from /DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5/bids/sub-123456/ses-01/anat/sub-123456_ses-01_run-02_T1w.nii.gz...
TR=2200.00, TE=0.00, TI=0.00, flip angle=0.00
i_ras = (1, 0, 0)
j_ras = (0, 1, 0)
k_ras = (0, 0, 1)
writing to /DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5/freesurfer/sub-123456/mri/orig/001.mgz...
#--------------------------------------------
#@# MotionCor Wed Jan 22 06:10:03 EST 2020
Found 1 runs
/DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5/freesurfer/sub-123456/mri/orig/001.mgz
Checking for (invalid) multi-frame inputs...
WARNING: only one run found. This is OK, but motion
correction cannot be performed on one run, so I'll
copy the run to rawavg and continue.

 cp /DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5/freesurfer/sub-123456/mri/orig/001.mgz /DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5/freesurfer/sub-123456/mri/rawavg.mgz 

/DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5/freesurfer/sub-123456

 mri_convert /DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5/freesurfer/sub-123456/mri/rawavg.mgz /DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5/freesurfer/sub-123456/mri/orig.mgz --conform 

mri_convert.bin /DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5/freesurfer/sub-123456/mri/rawavg.mgz /DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5/freesurfer/sub-123456/mri/orig.mgz --conform 
WARNING ==================++++++++++++++++++++++++=======================================
The physical sizes are (228.80 mm, 282.00 mm, 282.00 mm), which cannot fit in 256^3 mm^3 volume.
The resulting volume will have 282 slices.
If you find problems, please let us know (freesurfer@nmr.mgh.harvard.edu).
==================================================++++++++++++++++++++++++===============

$Id: mri_convert.c,v 1.226 2016/02/26 16:15:24 mreuter Exp $
reading from /DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5/freesurfer/sub-123456/mri/rawavg.mgz...
TR=2200.00, TE=0.00, TI=0.00, flip angle=0.00
i_ras = (1, 0, 0)
j_ras = (0, 1, 0)
k_ras = (0, 0, 1)
changing data type from float to uchar (noscale = 0)...
MRIchangeType: Building histogram 
Reslicing using trilinear interpolation 
writing to /DATA/dorian/fmriprepdata/STUDY1/data/processed/fmriprep-1.5.5/freesurfer/sub-123456/mri/orig.mgz...

****************************************
ERROR! FOV=282.000 > 256
Include the flag -cw256 with recon-all!
Inspect orig.mgz to ensure the head is fully visible.
****************************************

Inspection of the image is fine. I can crop the bottom to remove some of the neck, which might resolve the issue, but this is a standard BIDS dataset and I don’t like to mess the raw data to create ad-hoc data to overcome the problem.

From the data you provide:

  Image Dimensions   : [208, 256, 256]
  ...
  Voxel Spacing      : [1.1, 1.10156, 1.10156]

It looks like you have a FoV of (228.80 mm, 282.00 mm, 282.00 mm), as described by mri_convert.

Right. What is the solution to make fmriprep work with these data? Is there a way to get fmriprep to pass -cw256 to the freesurfer call to resolve the problem?

We’ll probably need to update fMRIPrep to detect this case.

The place to do it will be here:

I am using a singularity container which I built myself from your docker image. Any chance you can push a fix in the docker image (i.e. 1.5.7) so I don’t attempt hacks on the singularity image myself?

Thank you.

Looks like we can do this without changing the API, so we should be able to put out a bug-fix release in the next couple days.

1 Like

@dorianps 1.5.7 is out. Let us know how that goes.

I am waiting to finish the current processing for another week or so (using 1.5.5), then will go back to run 1.5.7 on the cases with the above fail error. Will report here how it goes.

Many thanks for the quick fix.

Excellent. The changes from 1.5.5 to 1.5.7 are small enough that you should be able to reuse working directories and minimize recomputation.

@effigies This is fixed now in v1.5.7. I confirmed on two subjects that had this issue.

Thank you.

Hi,

I just got this error on fmriprep v23.0.2!

Using singularity container and fmriprep v23.0.2.

Command used:

singularity run -B /scratch/jsein/BIDS:/work,$HOME/.templateflow:/opt/templateflow --cleanenv /scratch/jsein/my_images/fmriprep-23.0.2.simg \
		 --fs-license-file /work/freesurfer/license.txt /work/$study /work/$study/derivatives/fmriprep  \
		 participant --participant-label $sub \
		 -w /work/temp_data_${study}\
		 --mem-mb 50000 --omp-nthreads 10 --nthreads 12  \
		 --anat-only --cifti-output 91k  \
		 --output-spaces MNI152NLin2009cAsym T1w fsLR fsaverage  --fs-subjects-dir /work/$study/derivatives/fmriprep/sourcedata/freesurfer --debug compcor

T1w image dimensions:

    dimensions: 192 x 288 x 288
   voxel sizes: 0.900000, 0.895833, 0.895833

T2w image dimensions:

    dimensions: 192 x 320 x 320
   voxel sizes: 0.900000, 0.900000, 0.900000

Error reported:

240214-00:18:49,466 nipype.workflow ERROR:
	 could not run node: fmriprep_23_0_wf.single_subject_01_wf.anat_preproc_wf.surface_recon_wf.autorecon1
240214-00:18:49,569 nipype.workflow CRITICAL:
	 fMRIPrep failed: Traceback (most recent call last):
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node autorecon1.

Cmdline:
	recon-all -autorecon1 -i /work/TractoUF/sub-01/ses-01/anat/sub-01_ses-01_T1w.nii.gz -T2 /work/TractoUF/sub-01/ses-01/anat/sub-01_ses-01_T2w.nii.gz -noskullstrip -noT2pial -noFLAIRpial -cw256 -hires -openmp 10 -subjid sub-01 -sd /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer -expert /work/temp_data_TractoUF_mapmixed/fmriprep_23_0_wf/single_subject_01_wf/anat_preproc_wf/surface_recon_wf/autorecon1/expert.opts
Stdout:
	INFO: hi-res volumes are conformed to the min voxel size
	fs-check-version --s sub-01 --o /tmp/tmp.iXvNpg
	Wed Feb 14 00:00:29 CET 2024

	setenv SUBJECTS_DIR /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer
	cd /work/temp_data_TractoUF_mapmixed/fmriprep_23_0_wf/single_subject_01_wf/anat_preproc_wf/surface_recon_wf/autorecon1
	/opt/freesurfer/bin/fs-check-version --s sub-01 --o /tmp/tmp.iXvNpg
	-rwxrwxr-x 1 root root 18565 Aug  4  2022 /opt/freesurfer/bin/fs-check-version

	freesurfer-linux-ubuntu22_x86_64-7.3.2-20220804-6354275
	$Id$
	Linux skylake017.cluster 3.10.0-1160.83.1.el7.x86_64 #1 SMP Wed Jan 25 16:41:43 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
	pid 20695
	Current FS Version freesurfer-linux-ubuntu22_x86_64-7.3.2-20220804-6354275
	Subject does not have a bstampfile, copying /opt/freesurfer/build-stamp.txt
	Subject FS Version: freesurfer-linux-ubuntu22_x86_64-7.3.2-20220804-6354275
	No constraints on version because REQ=UnSet and FsVerFile=NotThere
	#@#% fs-check-version match = 1
	fs-check-version Done
	INFO: SUBJECTS_DIR is /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer
	Actual FREESURFER_HOME /opt/freesurfer
	Linux skylake017.cluster 3.10.0-1160.83.1.el7.x86_64 #1 SMP Wed Jan 25 16:41:43 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
	-cw256 option is now persistent (remove with -clean-cw256)
	/work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01

	 mri_convert /work/TractoUF/sub-01/ses-01/anat/sub-01_ses-01_T1w.nii.gz /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/mri/orig/001.mgz 

	mri_convert /work/TractoUF/sub-01/ses-01/anat/sub-01_ses-01_T1w.nii.gz /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/mri/orig/001.mgz 
	reading from /work/TractoUF/sub-01/ses-01/anat/sub-01_ses-01_T1w.nii.gz...
	TR=2300.00, TE=0.00, TI=0.00, flip angle=0.00
	i_ras = (0.998718, 0.0494727, -0.0106922)
	j_ras = (-0.0500847, 0.99645, -0.0676631)
	k_ras = (0.00730674, 0.0681119, 0.997651)
	writing to /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/mri/orig/001.mgz...
	#--------------------------------------------
	#@# T2/FLAIR Input Wed Feb 14 00:00:46 CET 2024
	/work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01

	 mri_convert --no_scale 1 /work/TractoUF/sub-01/ses-01/anat/sub-01_ses-01_T2w.nii.gz /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/mri/orig/T2raw.mgz 

	mri_convert --no_scale 1 /work/TractoUF/sub-01/ses-01/anat/sub-01_ses-01_T2w.nii.gz /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/mri/orig/T2raw.mgz 
	reading from /work/TractoUF/sub-01/ses-01/anat/sub-01_ses-01_T2w.nii.gz...
	TR=3200.00, TE=0.00, TI=0.00, flip angle=0.00
	i_ras = (0.998718, 0.0494727, -0.0106922)
	j_ras = (-0.0500847, 0.99645, -0.0676631)
	k_ras = (0.00730674, 0.0681119, 0.997651)
	writing to /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/mri/orig/T2raw.mgz...
	#--------------------------------------------
	#@# MotionCor Wed Feb 14 00:00:54 CET 2024
	Found 1 runs
	/work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/mri/orig/001.mgz
	Checking for (invalid) multi-frame inputs...
	Only one run found so motion
	correction will not be performed. I'll
	copy the run to rawavg and continue.

	 cp /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/mri/orig/001.mgz /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/mri/rawavg.mgz 


	 mri_info /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/mri/rawavg.mgz 

	rawavg.mgz ========================================
	Volume information for /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/mri/rawavg.mgz
	          type: MGH
	    dimensions: 192 x 288 x 288
	   voxel sizes: 0.900000, 0.895833, 0.895833
	          type: FLOAT (3)
	           fov: 258.000
	           dof: 1
	        xstart: -86.4, xend: 86.4
	        ystart: -129.0, yend: 129.0
	        zstart: -129.0, zend: 129.0
	            TR: 2300.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees
	       nframes: 1
	       PhEncDir: UNKNOWN
	       FieldStrength: 0.000000
	ras xform present
	    xform info: x_r =   0.9987, y_r =  -0.0501, z_r =   0.0073, c_r =     0.9221
	              : x_a =   0.0495, y_a =   0.9965, z_a =   0.0681, c_a =    27.0464
	              : x_s =  -0.0107, y_s =  -0.0677, z_s =   0.9977, c_s =   -47.9925

	talairach xfm : 
	Orientation   : RAS
	Primary Slice Direction: axial

	voxel to ras transform:
	                0.8988  -0.0449   0.0065   -79.8488
	                0.0445   0.8927   0.0610  -114.5565
	               -0.0096  -0.0606   0.8937  -167.0371
	                0.0000   0.0000   0.0000     1.0000

	voxel-to-ras determinant 0.722266

	ras to voxel transform:
	                1.1097   0.0550  -0.0119    92.9198
	               -0.0559   1.1123  -0.0755   110.3425
	                0.0082   0.0760   1.1137   195.3833
	                0.0000   0.0000   0.0000     1.0000
	/work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01

	 mri_convert /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/mri/rawavg.mgz /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/mri/orig.mgz --conform_min 

	mri_convert /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/mri/rawavg.mgz /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/mri/orig.mgz --conform_min 
	reading from /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/mri/rawavg.mgz...
	TR=2300.00, TE=0.00, TI=0.00, flip angle=0.00
	i_ras = (0.998718, 0.0494727, -0.0106922)
	j_ras = (-0.0500847, 0.99645, -0.0676631)
	k_ras = (0.00730674, 0.0681119, 0.997651)
	changing data type from float to uchar (noscale = 0)...
	MRIchangeType: Building histogram 0 2103 1000, flo=0, fhi=0.999, dest_type=0
	Reslicing using trilinear interpolation 
	writing to /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/mri/orig.mgz...

	 mri_add_xform_to_header -c /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/mri/transforms/talairach.xfm /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/mri/orig.mgz /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/mri/orig.mgz 

	INFO: extension is mgz

	 mri_info /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/mri/orig.mgz 

	orig.mgz ========================================
	Volume information for /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/mri/orig.mgz
	          type: MGH
	    dimensions: 288 x 288 x 288
	   voxel sizes: 0.895833, 0.895833, 0.895833
	          type: UCHAR (0)
	           fov: 258.000
	           dof: 1
	        xstart: -129.0, xend: 129.0
	        ystart: -129.0, yend: 129.0
	        zstart: -129.0, zend: 129.0
	            TR: 2300.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees
	       nframes: 1
	       PhEncDir: UNKNOWN
	       FieldStrength: 0.000000
	ras xform present
	    xform info: x_r =  -1.0000, y_r =   0.0000, z_r =  -0.0000, c_r =     0.9221
	              : x_a =  -0.0000, y_a =   0.0000, z_a =   1.0000, c_a =    27.0464
	              : x_s =   0.0000, y_s =  -1.0000, z_s =   0.0000, c_s =   -47.9925

	talairach xfm : /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/mri/transforms/talairach.xfm
	Orientation   : LIA
	Primary Slice Direction: coronal

	voxel to ras transform:
	               -0.8958   0.0000  -0.0000   129.9221
	               -0.0000   0.0000   0.8958  -101.9536
	                0.0000  -0.8958   0.0000    81.0075
	                0.0000   0.0000   0.0000     1.0000

	voxel-to-ras determinant -0.718922

	ras to voxel transform:
	               -1.1163  -0.0000  -0.0000   145.0293
	               -0.0000   0.0000  -1.1163    90.4270
	               -0.0000   1.1163   0.0000   113.8086
	               -0.0000  -0.0000  -0.0000     1.0000

	****************************************
	ERROR! FOV=258.000 > 256
	Include the flag -cw256 with recon-all!
	Inspect orig.mgz to ensure the head is fully visible.
	****************************************

	Linux skylake017.cluster 3.10.0-1160.83.1.el7.x86_64 #1 SMP Wed Jan 25 16:41:43 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

	recon-all -s sub-01 exited with ERRORS at Wed Feb 14 00:01:09 CET 2024

	For more details, see the log file /work/TractoUF/derivatives/fmriprep/sourcedata/freesurfer/sub-01/scripts/recon-all.log
	To report a problem, see http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting

Stderr:

Traceback:
	RuntimeError: subprocess exited with code 1.

240214-00:18:50,123 cli ERROR:
	 Preprocessing did not finish successfully. Errors occurred while processing data from participants: 01 (1). Check the HTML reports for details.
240214-00:18:50,123 cli ERROR:
	 Preprocessing did not finish successfully. Errors occurred while processing data from participants: 01 (1). Check the HTML reports for details.

Thank you for your help!

Is it possible you had a pre-existing orig.mgz? Otherwise I’m not sure why the -cw256 is not conforming the width as expected.

I think it was the first exception for this subject, but you are right, I will double check this point.

Thank you again @effigies for your fast answer.
I tried again to launch a fmriprep execution with a fresh working directory and a fresh freesurfer output directory with my native images (with big FOV) but the same error occurs.
I launched another execution for which I cropped my T1w image (and the T2w image) and in that case the execution was successful. Is it possible that one of the option I used (such as --anat-only) bypassed certain parts of the workflow where the case with big FOV should have been taken care of?

I really don’t think so. What happens if you run the command directly?

SUBJECTS_DIR=/some/new/directory
recon-all -autorecon1 \
    -i /work/TractoUF/sub-01/ses-01/anat/sub-01_ses-01_T1w.nii.gz \
    -T2 /work/TractoUF/sub-01/ses-01/anat/sub-01_ses-01_T2w.nii.gz \
    -noskullstrip -noT2pial -noFLAIRpial -cw256 -hires -openmp 10 \
    -subjid sub-01

The only difference with what you’ve got is the expert opts:

-expert /work/temp_data_TractoUF_mapmixed/fmriprep_23_0_wf/single_subject_01_wf/anat_preproc_wf/surface_recon_wf/autorecon1/expert.opts

You could try with and without that to see if that’s causing an issue.

Note that 23.0.x used FreeSurfer 7.3.2, in case the behavior varies by FreeSurfer version:

1 Like

Thank you for this advice.

I tried to run the following command locally on my Mac and got the same error! (note that I was using the development version of Freesurfer, newer than version 7.3.2)

Here is the command I ran:

recon-all -autorecon1 -i /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/sub-01/ses-01/anat/sub-01_ses-01_T1w.nii -T2 /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/sub-01/ses-01/anat/sub-01_ses-01_T2w.nii.gz -noskullstrip -noT2pial -noFLAIRpial -cw256 -hires -openmp 10  -subjid sub-01

Here is the output I got on the terminal:

INFO: hi-res volumes are conformed to the min voxel size
fs-check-version --s sub-01 --o /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/temp/tmp.Guls8d
Wed Feb 14 23:21:49 CET 2024

setenv SUBJECTS_DIR /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer
cd /Users/jsein
/Applications/freesurfer/dev/bin/fs-check-version --s sub-01 --o /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/temp/tmp.Guls8d
-rwxr-xr-x 1 root wheel 18565 Dec 15 06:26 /Applications/freesurfer/dev/bin/fs-check-version

freesurfer-macOS-darwin_x86_64-dev-20231215-e0e91a7
$Id$
Darwin MBP-de-julien-2 23.3.0 Darwin Kernel Version 23.3.0: Wed Dec 20 21:30:44 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6000 x86_64 i386 MacBookPro18,3 Darwin
pid 93233
Current FS Version freesurfer-macOS-darwin_x86_64-dev-20231215-e0e91a7
Subject does not have a bstampfile, copying /Applications/freesurfer/dev/build-stamp.txt
Subject FS Version: freesurfer-macOS-darwin_x86_64-dev-20231215-e0e91a7
No constraints on version because REQ=UnSet and FsVerFile=NotThere
#@#% fs-check-version match = 1
fs-check-version Done
INFO: SUBJECTS_DIR is /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer
Actual FREESURFER_HOME /Applications/freesurfer/dev
Darwin MBP-de-julien-2 23.3.0 Darwin Kernel Version 23.3.0: Wed Dec 20 21:30:44 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6000 x86_64 i386 MacBookPro18,3 Darwin
-cw256 option is now persistent (remove with -clean-cw256)
/Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01
\n mri_convert /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/sub-01/ses-01/anat/sub-01_ses-01_T1w.nii /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/orig/001.mgz \n
mri_convert /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/sub-01/ses-01/anat/sub-01_ses-01_T1w.nii /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/orig/001.mgz 
reading from /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/sub-01/ses-01/anat/sub-01_ses-01_T1w.nii...
TR=2300.00, TE=0.00, TI=0.00, flip angle=0.00
i_ras = (0.998718, 0.0494727, -0.0106922)
j_ras = (-0.0500847, 0.99645, -0.0676631)
k_ras = (0.00730674, 0.0681119, 0.997651)
writing to /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/orig/001.mgz...
#--------------------------------------------
#@# T2/FLAIR Input Wed Feb 14 23:23:06 CET 2024
/Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01
\n mri_convert --no_scale 1 /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/sub-01/ses-01/anat/sub-01_ses-01_T2w.nii.gz /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/orig/T2raw.mgz \n
mri_convert --no_scale 1 /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/sub-01/ses-01/anat/sub-01_ses-01_T2w.nii.gz /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/orig/T2raw.mgz 
reading from /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/sub-01/ses-01/anat/sub-01_ses-01_T2w.nii.gz...
TR=3200.00, TE=0.00, TI=0.00, flip angle=0.00
i_ras = (0.998718, 0.0494727, -0.0106922)
j_ras = (-0.0500847, 0.99645, -0.0676631)
k_ras = (0.00730674, 0.0681119, 0.997651)
writing to /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/orig/T2raw.mgz...
#--------------------------------------------
#@# MotionCor Wed Feb 14 23:23:13 CET 2024
Found 1 runs
/Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/orig/001.mgz
Checking for (invalid) multi-frame inputs...
Only one run found so motion
correction will not be performed. I'll
copy the run to rawavg and continue.
\n cp /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/orig/001.mgz /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/rawavg.mgz \n
\n mri_info /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/rawavg.mgz \n
rawavg.mgz ========================================
Volume information for /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/rawavg.mgz
          type: MGH
        intent: MRI (0)
    dimensions: 192 x 288 x 288
   voxel sizes: 0.900000, 0.895833, 0.895833
          type: FLOAT (3)
           fov: 258.000
           dof: 1
        xstart: -86.4, xend: 86.4
        ystart: -129.0, yend: 129.0
        zstart: -129.0, zend: 129.0
            TR: 2300.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees
       nframes: 1
       PhEncDir: UNKNOWN
       FieldStrength: 0.000000
ras xform present
    xform info: x_r =   0.9987, y_r =  -0.0501, z_r =   0.0073, c_r =     0.9221
              : x_a =   0.0495, y_a =   0.9965, z_a =   0.0681, c_a =    27.0464
              : x_s =  -0.0107, y_s =  -0.0677, z_s =   0.9977, c_s =   -47.9925

talairach xfm : 
Orientation   : RAS
Primary Slice Direction: axial

voxel to ras transform:
                0.8988  -0.0449   0.0065   -79.8488
                0.0445   0.8927   0.0610  -114.5565
               -0.0096  -0.0606   0.8937  -167.0371
                0.0000   0.0000   0.0000     1.0000

voxel-to-ras determinant 0.722266

ras to voxel transform:
                1.1097   0.0550  -0.0119    92.9198
               -0.0559   1.1123  -0.0755   110.3425
                0.0082   0.0760   1.1137   195.3833
                0.0000   0.0000   0.0000     1.0000
/Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01
\n mri_convert /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/rawavg.mgz /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/orig.mgz --conform_min \n
mri_convert /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/rawavg.mgz /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/orig.mgz --conform_min 
volume geometry:
valid   : 0
extent  : (288, 288, 288)
voxel   : ( 0.8958,  0.8958,  0.8958)
x_(ras) : (-1.0000,  0.0000,  0.0000)
y_(ras) : ( 0.0000,  0.0000, -1.0000)
z_(ras) : ( 0.0000,  1.0000,  0.0000)
c_(ras) : ( 0.9221, 27.0464, -47.9925)
file    : /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/rawavg.mgz
reading from /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/rawavg.mgz...
TR=2300.00, TE=0.00, TI=0.00, flip angle=0.00
i_ras = (0.998718, 0.0494727, -0.0106922)
j_ras = (-0.0500847, 0.99645, -0.0676631)
k_ras = (0.00730674, 0.0681119, 0.997651)
changing data type from float to uchar (noscale = 0)...
MRIchangeType: Building histogram 0 2103 1000, flo=0, fhi=0.999, dest_type=0
Reslicing using trilinear interpolation 
writing to /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/orig.mgz...
\n mri_add_xform_to_header -c /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/transforms/talairach.xfm /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/orig.mgz /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/orig.mgz \n
INFO: extension is mgz
\n mri_info /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/orig.mgz \n
orig.mgz ========================================
Volume information for /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/orig.mgz
          type: MGH
        intent: MRI (0)
    dimensions: 288 x 288 x 288
   voxel sizes: 0.895833, 0.895833, 0.895833
          type: UCHAR (0)
           fov: 258.000
           dof: 1
        xstart: -129.0, xend: 129.0
        ystart: -129.0, yend: 129.0
        zstart: -129.0, zend: 129.0
            TR: 2300.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees
       nframes: 1
       PhEncDir: UNKNOWN
       FieldStrength: 0.000000
ras xform present
    xform info: x_r =  -1.0000, y_r =   0.0000, z_r =  -0.0000, c_r =     0.9221
              : x_a =  -0.0000, y_a =   0.0000, z_a =   1.0000, c_a =    27.0464
              : x_s =   0.0000, y_s =  -1.0000, z_s =   0.0000, c_s =   -47.9925

talairach xfm : /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/mri/transforms/talairach.xfm
Orientation   : LIA
Primary Slice Direction: coronal

voxel to ras transform:
               -0.8958   0.0000  -0.0000   129.9221
               -0.0000   0.0000   0.8958  -101.9536
                0.0000  -0.8958   0.0000    81.0075
                0.0000   0.0000   0.0000     1.0000

voxel-to-ras determinant -0.718922

ras to voxel transform:
               -1.1163  -0.0000  -0.0000   145.0293
               -0.0000   0.0000  -1.1163    90.4270
               -0.0000   1.1163   0.0000   113.8086
               -0.0000  -0.0000  -0.0000     1.0000
\n****************************************
ERROR! FOV=258.000 > 256
Include the flag -cw256 with recon-all!
Inspect orig.mgz to ensure the head is fully visible.
****************************************\n
Darwin MBP-de-julien-2 23.3.0 Darwin Kernel Version 23.3.0: Wed Dec 20 21:30:44 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6000 x86_64 i386 MacBookPro18,3 Darwin

recon-all -s sub-01 exited with ERRORS at Wed Feb 14 23:23:24 CET 2024

For more details, see the log file /Users/jsein/Documents/Centre_IRMf/DATA/BIDS/TractoUF/derivatives/freesurfer/sub-01/scripts/recon-all.log
To report a problem, see http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting

It looks like a problem with FreeSurfer then. Interestingly, the same T1w image (not cropped) went smoothly through FastSurfer.

I saw a similar issue from another freesurfer user here:

https://www.mail-archive.com/freesurfer@nmr.mgh.harvard.edu/msg70337.html

But no solution posted there so far…

It may be possible that -hires is overwriting -cw256

https://www.mail-archive.com/freesurfer@nmr.mgh.harvard.edu/msg54351.html

I am trying right now without -hires but with -cw256 and it works!

Oh, I see. Yeah:

    if($ConformMin) then
      set cmd = ($cmd --conform_min)
    else
      set cmd = ($cmd --conform)
      if($DoConformWidth256 || -e $subjdir/tmp/cw256) then
        # force conform width to 256
        set cmd = ($cmd --cw256)
        # see note just below on when -cw256 is necessary (ie, when FOV > 256)
      endif
    endif

This seems like a FreeSurfer problem, if -hires does not have a way of handling large FOV (which appear to be more likely with hires). We allow you to disable -hires with --no-submm-recon, but it seems problematic to conditionally disable it based on FoV.

I think in the short term, cropping your input T1w image to a <256mm FOV is the simplest way to preserve high-resolution processing, or --no-submm-recon to make FreeSurfer do the right thing.

1 Like