Indices of Transformix's outputpoints.txt exceeds image dimensions

Hi all,

I’m encountering an unexpected output from Transformix. I have two images after reading in two series of DICOMs:

FixedIm Dtype = 32-bit float
MovingIm Dtype = 32-bit float

FixedIm Size = (212, 256, 30)
MovingIm Size = (192, 256, 35)

FixedIm Spacing = (0.8984375, 0.8984375, 5.0)
MovingIm Spacing = (0.9375, 0.9375, 5.0)

FixedIm Origin = (-104.92378234863281, -152.4906463623047, -9.22148609161377)
MovingIm Origin = (-115.14457702636719, -124.83148193359375, -10.8151273727417)

I also have a DICOM-RTSTRUCT file containing contour points belonging to FixedIm. I registered MovingIm to FixedIm and I’m satisfied with the results. I wanted to then transform the contour points belonging to FixedIm so they can be overlaid onto MovingIm.

I created a file called inputpoints.pcs with the contour points in the required format:

point
number_of_points
point1_x point1_y point1_z
point2_x point2_y point2_z

Then I transformed the contour points:

TransformixImFilt = sitk.TransformixImageFilter()
TransformixImFilt.SetTransformParameterMap(ElastixImFilt.GetTransformParameterMap())
TransformixImFilt.SetFixedPointSetFileName(FixedContourPtsFname)
# Need to explicitely tell elastix that the image is 3D since by default it will
# only transform to 2D:
TransformixImFilt.SetMovingImage(MovingIm)
TransformixImFilt.Execute()

But when I opened the outputpoints.txt file it became apparent that something is wrong (including perhaps my interpretation) - the x and y indices exceed the dimensions of the images themselves. Following was the first line of outputpoints.txt:

Point 0 ; InputIndex = [ 252 359 14 ] ; InputPoint = [ 126.344037 171.830275 -54.501356 ] ; OutputIndexFixed = [ 248 353 26 ] ; OutputPoint = [ 126.638100 184.489069 3.193988 ] ; Deformation = [ 0.294064 12.658794 57.695343 ] ; OutputIndexMoving = [ 220 356 4 ]

As for the z indices, although they do not exceed the z-dimension, the input and output indices differ by ~10, whereas the reality is much closer to 1-2.

Does anyone have any idea what might have happened? Or have I completely misinterpretted the indices and points in outputpoints.txt?

Thanks.

This sounds like a question for the elastix group.

1 Like

Thanks for pointing me in the right direction.

Regards,
Cristiano