Elastix 2d/3d Registration Incorrect Ray Cast

Good Evening,

I’m trying to use the general registration elastix module to register a 3d CT volume I have to an Xray. Before trying my data, I used the 2d/3d test data that comes with Elastix. I tried to register a volume of a head to an xray taken from the sagittal plane view. The module says that it has completed registration and then generates an xray to show the alignment is correct. However, when I compare Xrays, I can see that the volume has not been transformed at all. I’m not sure what’s going wrong here. The only red text I see in the python interactor says that “toVTKString is deprecated” and “‘returnNode’ argument is deprecated.Loaded node is now returned directly if returnNode is not specified.”

Volume to be registered:
image
Fixed “volume” Xray:
image
Resultant Xray:
image
View of the control panel setup:

2D/3D registration is a hard problem. You need to carefully set the initial pose close to the solution, but there may be other tricks, too. I would recommend to ask for help on the Elastix mailing list.

Hi Mr. Lasso,
Thank you for your suggestions. I did send an email to the mailing list and have yet to receive a reply. I should also mention I brought the same predicament to the elastix-imageregistration google group a month ago and didn’t receive a reply.
I understand that elastix is outside of your jurisdiction, but I’m hoping you might be able to help me anyway. I looked through the temporary folder and think I found the issue. The final transform parameters correctly register the 3d volume via rotations. Somehow, the rotation parameters of the transform are being lost. I think it might have something to do with the finalraycastinterpolator. My question is this, is it possible to extract the Transform parameters as a Slicer Transform (.h5 file)? I’ve copied the output of my final parameters.txt file:

(Transform “EulerTransform”)
(NumberOfParameters 6)
(TransformParameters 0.001208 -0.000358 0.000508 -0.349885 -0.072703 1.776385)
// This is the transform I’d like to extract
(InitialTransformParametersFileName “NoInitialTransform”)
(UseBinaryFormatForTransformationParameters “false”)
(HowToCombineTransforms “Compose”)

// Image specific
(FixedImageDimension 3)
(MovingImageDimension 3)
(FixedInternalImagePixelType “float”)
(MovingInternalImagePixelType “float”)
(Size 256 256 1)
(Index 0 0 0)
(Spacing 1.1453800000 1.1453800000 1.0000000000)
(Origin -145.4980000000 -146.8890000000 381.7660000000)
(Direction 1.0000000000 0.0000000000 0.0000000000 0.0000000000 1.0000000000 0.0000000000 0.0000000000 0.0000000000 1.0000000000)
(UseDirectionCosines “true”)

// EulerTransform specific
(CenterOfRotationPoint 0.0000000000 0.0000000000 0.0000000000)
(ComputeZYX “false”)

// ResampleInterpolator specific
(ResampleInterpolator “FinalRayCastInterpolator”)
(FocalPoint 0.540000 -0.850000 -813.234000 )
(PreParameters -0.009475 -0.006807 -0.030067 0.000000 0.000000 0.000000 )
(Threshold 1000.000000)

// Resampler specific
(Resampler “DefaultResampler”)
(DefaultPixelValue 0.000000)
(ResultImageFormat “mhd”)
(ResultImagePixelType “float”)
(CompressResultImage “false”)

Unfortunately, Elastix uses a custom transformation file format, but we have implemented a reader in Slicer that can handle linear and bspline transforms:

It should be able to read the computer Euler transform, but you can attach a debugger in the converter and see where things go wrong.