Conversion of SPM coregistration files to Aims transformations
Some SPM volumes (*.img/*.hdr) are completed by an optional registration file in matlab format (*.mat) with the same file name as the volume. It holds coregistration / realignment information, or simply an origin change, which replace the standard Analyze header information if it is provided. This process allows to read and convert such files which are normally only understandable by Matlab (and therefore not by Aims/Anatomist).
This process calls matlab (otherwise reading .mat files is impossible), therefore you must have Matlab installed and correctly setup on your system for this converter to work.
The process can woth in 2 modes: transformation between the initial volume and the "central referential" of SPM, or transformation from a volume to another one. The transformation between two volumes is actually the combination of two transformations to the central referential.
If the second volume is specified, the second transformation is combined to the first one. The second volume is not required to have an associated .mat file: in this case only the translation to its SPM origin will be taken into account.
Remarq: internal coordinates systems (referentials) used by SPM and Aims are completely different. So in addition to the matrix extraction itself, some coordinates conversions are done. This is why you don't find in the output .trm file the contents of the SPM matrix. For more information about referentials and transformations, see http://brainvisa.info/doc/html/aims/en/referentials.html.
read: Transformation matrix ( input )SPM registration file
write: Transformation matrix ( output )Aims transformation file
source_volume: 4D Volume ( input )Volume going with the SPM transformation (usually foo.img when the registration file is toto.mat)
registered_volume: 4D Volume ( optional, input )If you wish to get a transformation from a volume to another one, this is the destination volume. If this parameter is not specified, the extracted transformation stops in the "central referential" of SPM
central_to_registered: Transformation matrix ( optional, input )SPM registration file going with the second (destination) volume, if any
removeSource: Boolean ( input )If this parameter is set to True, the original matlab file is erased after conversion. This option is strongly unadvisable since it can lose some precious information. Use it only if you exactly know what you are doing.
Toolbox : Tools
User level : 1
Identifier :
SPMtransformToAims
File name :
brainvisa/toolboxes/tools/processes/converters/SPMtransformToAims.py
Supported file formats :
read :Matlab filewrite :Transformation matrixsource_volume :GIS image, VIDA image, NIFTI-1 image, MINC image, gz compressed MINC image, DICOM image, TIFF image, XBM image, PBM image, PGM image, BMP image, XPM image, PPM image, gz compressed NIFTI-1 image, TIFF(.tif) image, ECAT i image, PNG image, JPEG image, MNG image, GIF image, SPM image, ECAT v imageregistered_volume :GIS image, VIDA image, NIFTI-1 image, MINC image, gz compressed MINC image, DICOM image, TIFF image, XBM image, PBM image, PGM image, BMP image, XPM image, PPM image, gz compressed NIFTI-1 image, TIFF(.tif) image, ECAT i image, PNG image, JPEG image, MNG image, GIF image, SPM image, ECAT v imagecentral_to_registered :Matlab file