Reputation: 11
I installed SimpleITK for medical image registration. It works very well for 3D CT/CT and 3D CT/MRI image registration. Now I want to implement model/image registration. The model is a sphere. In ITK there are Spatial Objects like Box, Ellipse which can be used for model/image registration. But I can't find those objects in SimpleITK. Should I create a fake image from the model and use image/image registration to simulate the model/image registration?
Thanks,
David Lau
Upvotes: 1
Views: 570
Reputation: 1431
SimpleITK currently does not have support for spacial objects, or spacial object registration. The last time I did spatial object to image registration it was rather slow and I ended up "rendering" the spacial object to an image to perform image to image registration. There are several C++ ITK examples (SpatialObjectToImage[0-3].cxx) which could be adopted to generate this image.
Alternatively in SimpleITK there is the PhysicalPointImageSource, which generate a image of points. Then using overloaded operators, and the equation of a sphere or hyper-ellipse can be used to generate an approximation to the implicit object desired. Here is an example of the Marschner Lobb function being generated:
def marschner_lobb(size=40, alpha=0.25, f_M=6.0):
img = sitk.PhysicalPointSource( sitk.sitkVectorFloat32, [size]*3, [-1]*3, [2.0/size]*3)
imgx = sitk.VectorIndexSelectionCast(img, 0)
imgy = sitk.VectorIndexSelectionCast(img, 1)
imgz = sitk.VectorIndexSelectionCast(img, 2)
del img
r = sitk.Sqrt(imgx**2 + imgy**2)
del imgx, imgy
pr = sitk.Cos((2.0*math.pi*f_M)*sitk.Cos((math.pi/2.0)*r))
return (1.0 - sitk.Sin((math.pi/2.0)*imgz) + alpha*(1.0+pr))/(2.0*(1.0+alpha))
A similar operation can be done for other implicit functions.
Upvotes: 0
Reputation: 3395
Converting spatial object to an image, and then using image-to-image registration is certainly one solution. Registration precision will somewhat depend on the resolution of the image grid for converting SpatialObject
->Image
. Same pixel spacing as the other image is a reasonable choice.
Upvotes: 0