File Exchange

image thumbnail


version (1.46 KB) by Alper Yaman
This code calculates the transform matrix between two image coordinates.


Updated 11 Jan 2019

View License

It first transforms to patient coordinates and then to the second coordinates. Both dicom image sets should have the same localizer while scanning.
It takes two inputs: dicominfo structures (taken by dicominfo mmand) of two image sets. The outputs are 4x4 transform matrix and 3x3 rotation matrix.
The code is developed with the help of the document written by David Atkinson (
This code is developed by BUMIL (Bogazici University Medical Imaging Lab) in Istanbul, Turkey.

Cite As

Alper Yaman (2019). GetTransformMatrix (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

Hi, thank you for this easy yet very useful function.

One remark; the SliceThickness in the third row of Scaling should be set to SpacingBetweenSlices. If not, the scaling can be off and will result in a false M.

very useful function


Scaling matrix has been updated, only SpacingBetweenSlices has been used anymore.

Lab info

MATLAB Release Compatibility
Created with R2018b
Compatible with any release
Platform Compatibility
Windows macOS Linux