Ash
Ash

Reputation: 59

DICOM: alignment

I am relatively new with working with dicom files.Thanks in advance.

I have 2 dicom files of the same patient taken at different intervals. They are not exactly the same dimensions.

The first one is: dimesions of cube1 104X163X140 and the second one is dimesions of cube2 107X164X140. I would like to align both cubes at the origin and compare them.

The ImagePositionPatient of the first file is: [-207.4748, -151.3715 -198.7500]

The ImagePositionPatient of the second file is: [-207.4500, -156.3500 -198.7500]

Both files have the same ImageOrientationPatient - [ 1 0 0 0 1 0]

Any chance someone could please show me an example? I am not sure how to map the physical plane back to the image plane?

Thanks a lot in advance,

Ash

===============================================================

Added: 23/2/17

I have used the matrix formula below based on the link where in my case :

IPP (Sxyz) of cube 1 = [-207.4748, -151.3715-198.7500]

Xxyz (IOP) = [1,0,0]

Yxyz (IOP) = [1,0,0]

delta_i = 2.5

delta_j = 2.5

enter image description here

So for values of i = 0: 103 and j = 0:162 of cube1, I should compute the values of Pxyz?

What is the next step? Sorry, I do not see how this will help me to align the two cubes with different IPP to the image plane?

Sorry for the newbie question ...

Upvotes: 1

Views: 544

Answers (1)

Markus Sabin
Markus Sabin

Reputation: 4013

I did not verify the matrix you built. But if it is calculated correctly, you can transform between the volume coordinate system (VCS) (x1,y1,z1), where x1 = column, y1 = row and z1 = slice number to the patient coordinate system (PCS) (x2, y2, z2) - these coordinates define the point within the patient in milimeters.

By inverting the matrix, you can transform back from PCS to VCS.

Let's say, the transformation matrix for volume 1 := M1 and the transformation matrix PCS -> VCS for volume 2 := M2. Then you can transform a point p1 from volume 1 to the corresponding point p2 in volume 2 by transforming it to the PCS using M1 and transforming from PCS to volume 2 using M2' (the inverted M2).

By multiplying M1 and M2', you can calculate a matrix transforming directly from volume1 to volume2.

So:

p2 = (M1 * M2') * p1

Upvotes: 1

Related Questions