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 (http://cmic.cs.ucl.ac.uk/fileadmin/cmic/Documents/DavidAtkinson/DICOM_6up.pdf).
This code is developed by BUMIL (Bogazici University Medical Imaging Lab) in Istanbul, Turkey.
Alper Yaman (2019). GetTransformMatrix (https://www.mathworks.com/matlabcentral/fileexchange/24277-gettransformmatrix), MATLAB Central File Exchange. Retrieved .
Scaling matrix has been updated, only SpacingBetweenSlices has been used anymore.