Where's grid spacing information in header of NIFTI image file?


There are two terms called grid and grid spacing, which makes me confused. I found it when using adwarp command with -dxyz option. Here are the situation:

anat+tlrc: voxel size=2x2x2, grid=91x109x91
epi+orig: voxel size=3.312x3.312x3.312, grid=64x64x48
epi+tlrc: voxel size=3.312x3.312x3.312, grid=64x64x48

As far as i know, grid spacing should be the spacing between grid lines in voxels, am i right?
However, it makes no difference on the grid of epi after using -dxyz=3 in adwarp command, would you mind giving me some idea?


Hi Peng,

Would you please include the actual command?


  • rick

Dear rick,

I think i’d better reexplain my question:

when i check the output from the following command, i found that the grid spacing specified by dxyz option make no difference on the grid of the input, which is also shown below. What’s the effect of this command and where’s the corresponding information?

adwarp -resam Cu -dxyz 3 -apar 10-anat-ns_shft_alBOLDEC_shft+tlrc \
-dpar 10-BOLD-EC-volreg-lp-dt_temp_shft+orig

10-anat-ns_shft_alBOLDEC_shft+tlrc: voxel size=2x2x2, grid=91x109x91
10-BOLD-EC-volreg-lp-dt_temp_shft+orig: voxel size=3.312x3.312x3.312, grid=64x64x48
10-BOLD-EC-volreg-lp-dt_temp_shft+tlrc: voxel size=3.312x3.312x3.312, grid=64x64x48


Hi Peng,

This seems odd. I ran that same command and it did result in 3mm voxels.
What is the output of:

3dinfo -prefix -d3 -n4 10-BOLD-EC-volreg*.HEAD

  • rick

Dear rick,

I’m quite sorry for my mistake, i confuse the output from several test, you are right, the output is exactly 3mm.

Then, can i take -dxyz option as the new voxel size for output specificed? and this is exactly what the grid spacing means? I don’t want to change the resolution, is it proper to specify -dxyz as the same resolution as input? for here, it’s 3.312mm.

Best regards,

Sure, it is fine to use 3.312 as the grid spacing of the output. Yes, “grid spacing” is talking about voxel size, while “grid” by itself might mean everything, where every voxel (center) is in space.

  • rick