1
votes

I have extracted a 3D surface from an MRI acquisition and the coordinates of the points describing this surface are (I believe) with respect to the reference system of the first image of the series (I mean that the origin corresponds to the Image Position(Patient) and the axes orientation to the Image Orientation(Patient)). I have another set of images with a different Image Position(Patient) and a different Image Orientation(Patient); I want to rotate and translate the surface extracted from the first set in order to have it match exactly the second set of images.

I'm having trouble with finding the correct 4x4 matrix that would do the job, once I get it, I know how to apply it to my surface.

Any kind of help would be greatly appreciated, thank you.

Simon

1
What exactly is your question? Finding the transformation matrices to compute world (=patient) coordinate system coordinates for the pixels in both of the stacks? Or calculating the matrix that transforms position vectors from one stack to the other? Or both?kritzel_sw
I want to calculate the matrix that transforms position vectors from one stack to the other.semions

1 Answers

3
votes

This page explains how to form a transformation matrix from the geometry information in the DICOM headers. These transformation matrices are used to transform from the volume coordinate system (pixel-x, pixel-y, slice number) to the patient/world coordinate system (in millimeters).

The basic idea to transform from volume 1 to volume 2 is to tranform from volume 1 to patient coordinates and from patient coordinates to volume 2 coordinate system. Multiplying both matrices yields the matrix to transform directly from volume 1 to volume 2.

Caution: Obviously, there can be no guarantee that every coordinate in v1 matches a coordinate in v2, i.e. the stacks may have different size and/or position.

So you have:

M1 - the matrix to transform from volume 1 to the world coordinate system and M2 - the matrix to transform from volume 2 to the world coordinate system

Then

M1 * (M2^(-1)) is the matrix to transform a position vector from volume 1 to volume 2 (input and output is pixel-x, pixel-y, slice number)

and

M2 * (M1^(-1)) is the matrix to transform a position vector from volume 1 to volume 2 (input and output is pixel-x, pixel-y, slice number)