Why are functional data files output by fmriprep in T1w space so much larger?

Sorry if this is basic, but I’m trying to figure out why the uncompressed functional files in space-T1w output by fmriprep are so much larger than those in the MNI space. For my data, the sizes are about 2.1GB vs 850MB.

Thanks

Because the functional time-series get resampled in a much higher resolution (corresponding to your T1w image). For the case of MNI outputs, FMRIPREP resamples the time-series in MNI coordinates, but keeping the resolution of the original BOLD dataset.

If you would need to resample in subject-anatomical space (your T1w image) BUT keeping the original BOLD resolution (and therefore, a filesize similar to the original data) please file an issue requesting it at https://github.com/poldracklab/fmriprep/issues

HTH

Oscar

As far as I know outputs in T1w space should have the same resolution (voxel size) as outputs in the MNI space. If they don’t (please check) that’s a bug that needs to be fixed. For reference this is where in code we use custom reference image to get maching voxel size: https://github.com/poldracklab/fmriprep/blob/master/fmriprep/workflows/bold.py#L899

If this is not a bug and indeed voxel sized in T1w and MNI outputs are the same there might be another explanation for the file size difference. The field of view of your T1w image might be larger than the field of view of the MNI template (thus leading to more voxels and larger size). Additionally it could be the case that due to yet another bug MNI outputs are in float64 and T1w outputs are in float32.

So help us debug this it would be great if you could share the following info for both MNI and T1w outputs: resolution (voxel size), field of view (number of voxels in each dimension) and data type. It’s easy to get this data using fslhd.

Oh, maybe it’s just a field-of-view thing. The output of fslhd is below, showing the T1w-space image as having many more voxels.

T1w:

filename sub-01_task-con_run-01_bold_space-T1w_preproc.nii.gz

sizeof_hdr 348
data_type FLOAT32
dim0 4
dim1 113
dim2 153
dim3 149
dim4 200
dim5 1
dim6 1
dim7 1
vox_units Unknown
time_units s
datatype 16
nbyper 4
bitpix 32
pixdim0 0.000000
pixdim1 2.000000
pixdim2 2.000000
pixdim3 2.000000
pixdim4 1.500000
pixdim5 1.000000
pixdim6 1.000000
pixdim7 1.000000
vox_offset 352
cal_max 2435.3250
cal_min -89.3829
scl_slope 1.000000
scl_inter 0.000000
phase_dim 0
freq_dim 0
slice_dim 0
slice_name Unknown
slice_code 0
slice_start 0
slice_end 0
slice_duration 0.000000
time_offset 0.000000
intent Unknown
intent_code 0
intent_name
intent_p1 0.000000
intent_p2 0.000000
intent_p3 0.000000
qform_name Aligned Anat
qform_code 2
qto_xyz:1 2.000000 0.000000 0.000000 -108.934708
qto_xyz:2 0.000000 2.000000 0.000000 -162.577057
qto_xyz:3 0.000000 0.000000 2.000000 -156.827377
qto_xyz:4 0.000000 0.000000 0.000000 1.000000
qform_xorient Left-to-Right
qform_yorient Posterior-to-Anterior
qform_zorient Inferior-to-Superior
sform_name Scanner Anat
sform_code 1
sto_xyz:1 2.000000 0.000000 -0.000000 -108.934708
sto_xyz:2 0.000000 2.000000 -0.000000 -162.577057
sto_xyz:3 0.000000 0.000000 2.000000 -156.827377
sto_xyz:4 0.000000 0.000000 0.000000 1.000000
sform_xorient Left-to-Right
sform_yorient Posterior-to-Anterior
sform_zorient Inferior-to-Superior
file_type NIFTI-1+
file_code 1
descrip
aux_file

MNI

filename sub-01_task-con_run-01_bold_space-MNI152NLin2009cAsym_preproc.nii.gz

sizeof_hdr 348
data_type FLOAT32
dim0 4
dim1 97
dim2 115
dim3 97
dim4 200
dim5 1
dim6 1
dim7 1
vox_units Unknown
time_units s
datatype 16
nbyper 4
bitpix 32
pixdim0 0.000000
pixdim1 2.000000
pixdim2 2.000000
pixdim3 2.000000
pixdim4 1.500000
pixdim5 1.000000
pixdim6 1.000000
pixdim7 1.000000
vox_offset 352
cal_max 2422.2417
cal_min -98.2647
scl_slope 1.000000
scl_inter 0.000000
phase_dim 0
freq_dim 0
slice_dim 0
slice_name Unknown
slice_code 0
slice_start 0
slice_end 0
slice_duration 0.000000
time_offset 0.000000
intent Unknown
intent_code 0
intent_name
intent_p1 0.000000
intent_p2 0.000000
intent_p3 0.000000
qform_name Aligned Anat
qform_code 2
qto_xyz:1 2.000000 0.000000 0.000000 -96.000000
qto_xyz:2 0.000000 2.000000 0.000000 -132.000000
qto_xyz:3 0.000000 0.000000 2.000000 -78.000000
qto_xyz:4 0.000000 0.000000 0.000000 1.000000
qform_xorient Left-to-Right
qform_yorient Posterior-to-Anterior
qform_zorient Inferior-to-Superior
sform_name Scanner Anat
sform_code 1
sto_xyz:1 2.000000 0.000000 -0.000000 -96.000000
sto_xyz:2 0.000000 2.000000 -0.000000 -132.000000
sto_xyz:3 0.000000 0.000000 2.000000 -78.000000
sto_xyz:4 0.000000 0.000000 0.000000 1.000000
sform_xorient Left-to-Right
sform_yorient Posterior-to-Anterior
sform_zorient Inferior-to-Superior
file_type NIFTI-1+
file_code 1
descrip
aux_file