I have a set of fMRI images (.nii.gz). Now I want to infer the in-plane resolution and the slice thickness. Can this information and perhaps additional information be retrieved with FSL or Matlab? And yes, how?

Or can I calculate it somehow?


1 Answer 1


The information you seek is contained in the header of the image file. Matlab has open source tools for reading the header information. e.g., http://www.mathworks.com/matlabcentral/fileexchange/29344-read-medical-data-3d

If you want an even more open source option, NiBabel is an open source python library for reading .nii files (header and image). I think the command print(header.get_data_shape()) will return the image dimensions. See http://nipy.org/nibabel/nibabel_images.html#the-image-header for instructions.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.