DICOM
Files ending in .ima of .dcm are in the DICOM medical image format. It is a widely used format that enjoyed great popularity but, in the diffusion MRI community at least, has been mostly superseded by NIfTI.
Matlab
Matlab has extensive built-in support for DICOM header and image data I/O with the dicominfo, dicomread, and dicomwrite functions. This is nice for quickly creating DICOM processing scripts to be run manually, but Matlab is relatively slow and difficult to call from non-interactive scripts. Therefore it's encouraged to port Matlab code into another language (preferably C++ or Python) for inclusion in the diffusion processing pipeline.
Mosaic
One unusual storage strategy for DICOM-formatted medical images is the so-called "mosaic" scheme, in which a three-dimensional voxel volume is represented as a two-dimensional flat image. The volume is divided up into X-Y slices which are then arranged in 2D like a tile floor, with Z increasing left to right, top to bottom.
Code
The following scripts to handle DICOM mosaic files can be found in /map/gfx0/common0/diffusion/Interface/bin/data/:
- processMosaics.m --- split all mosaic files matching a given pattern into DICOM and MRIimage files
- splitMosaic.m --- split a single mosaic file into a Matlab data array
- writeMosaicSlices.m --- write a collection of Matlab data volumes to DICOM and MRIimage files