MRIimage
MRIimage is our in-house format for storing MRI data and is used as the underlying file format for most of what we do in the Diffusion MRI project. It is manipulated by the gg/mri_g++-* library and its header is <gg/mri/image.H>. A number of Matlab scripts have also been written to interact with this file format.
In MRIimage, an image volume is represented by a directory containing a number of files:
- resolution: a text file indicating the resolution of the image in voxels. Images are 4-D; a single DWI will have resolution 1 in the fourth dimension, while a DTI will have resolution 6.
- i.n: a raw 2-D image slice, stored in fixed-point format as little-endian uint16. n corresponds to the X-Y slice number, which increases sequentially as the index in the fourth dimension increases, and is formatted as a string in the filename like
printf("%03d",n); hence numbers <1000 are zero-padded to three digits. Since the fourth dimension is of unit size in a DWI, n increases sequentially as the index in Z increases. For a DTI, however:- i.001 stores the slice for Z=0 and the first tensor component
- i.002 stores the slice for Z=0 and the second tensor component
- ...
- i.006 stores the slice for Z=0 and the sixth tensor component
- i.007 stores the slice for Z=1 and the first tensor component
- ...
- i.012 stores the slice for Z=1 and the sixth tensor component
- ..
- i.n stores the slice for and the -th tensor component
- vsize: a text file indicating the voxel size in millimeters
- parameters: a text file indicating the fixed-point parameters (scaleIntensity and offsetIntensity) and imaging parameters such as TR, TE, and data-to-lab-frame translation