Plastimatch warp convert using transformation matrix

202 views
Skip to first unread message

Plastidoc

unread,
Feb 9, 2021, 8:20:17 PM2/9/21
to Plastimatch
Hi all, 

Just wondering if someone could help with this problem as I cannot seem to find the documentation for this function/problem.

I have PET and MRI scans which are registered to a CT image. In the dicom header there is a 4x4 transformation matrix that describes the x,y,z, tilt, rotation etc of the PET or MRI in relation to the CT image. 

I want to resample the PET/MRI using plastimatch so that they are centered on the same point. This will mean that the mask/structure sets that are now referencing the CT will also reference the same area on the MRI/PET

I have been told by a colleague that it is possible to achieve this in plastimatch. 

Using something along the lines of

plastimatch warp  - - input  image_1.mha - - fixed image_2.mha - - output-img image_3.mha - - xf rigid.txt

where the rigid.text file contains some parameters

However I can't find any documentation on how exactly this works and how i can resample beyond simple x y z changes (i want to include rotation/tilt etc). 

Anyone have any ideas?

Cheers

Plastidoc

Dylan Hsu

unread,
Feb 12, 2021, 8:55:19 AM2/12/21
to Plastimatch
Dear so-called Plastidoc,

If you've got a rigid registration, the 4x4 transformation matrix contains six degrees of freedom (rotation and translation). You will need to read those matrix parameters from Registration Sequence > MatrixRegistrationSequence > MatrixSequence > FrameOfReferenceTransformationMatrix, then write an ITK transform file for the --xf flag. I am not sure if Plastimatch can accept an Euler ITK transform, so I use a Versor ITK transform. See below my signature for an example of a Versor transform file. If you succeed with an Euler file, please report back.

best regards,
Dylan Hsu
-------------------------------------------------
#Insight Transform File V1.0
#Transform 0
Transform: VersorRigid3DTransform_double_3_3
Parameters: 0.1256246694 0.0243880900 -0.0120767956 -16.9966919342 31.7129159848 -458.8087225364
FixedParameters: 0 0 0

Plastidoc

unread,
Feb 13, 2021, 1:15:03 AM2/13/21
to Plastimatch

Hi Dylan,

Sorry for the uncreative name and thank you for your help! 

Sorry for my ignorance but how does one get from a 4x4 matrix as given in the DICOM header and change that to the 6 numbers that you place within the -xf file after 'Parameters'. As a medical doctor my expertise unfortunately does not lie in this area.  Any help would be much appreciated

Cheers

Dylan Hsu

unread,
Feb 15, 2021, 12:42:28 PM2/15/21
to Plastimatch
Consult the Dicom standard (C.20.2.1.1):

The 4x4 transformation matrix contains the rotation matrix Mij and translation vector Ti.
Reply all
Reply to author
Forward
0 new messages