Open phflot opened 2 years ago
Hello Philipp,
To compute the image gradients, instead of:
fixed_grad = itk.GradientImageFilter(fixed)
use:
fixed_grad = itk.gradient_image_filter(fixed)
However, this will produce an image of covariant vectors. You may have intended,
fixed_grad = itk.gradient_magnitude_image_filter(fixed)
or
fixed_grad = itk.gradient_magnitude_recursive_gaussian_image_filter(fixed, sigma=2.0)
(less noisy)
I am trying to use the GradientDifference and NormalizedGradientCorrelation metrics but could not quite figure out how to prepare the input. I am following the ITK_Example07_MultimetricMultiImageRegistration example and use a parameters_Bspline_Multimetric.txt where I have only changed the metric. When I am using the NormalizedGradientCorrelation metric alone with 2D float32 images in the same way as in the example, I get the error
So I figured that it probably needs the two gradient channels as input. When I run the following code
it throws
itk.support.extras.TemplateTypeError: itk.ElastixRegistrationMethod is not wrapped for input type None.
The images from the gradient filter have vector pixel type so, combining the two error messages, the next thing I have tried is to convert the gradient filter to 3D float images. But then I end up with the following error:Do you have any idea what I am missing or could point me to resources that I could check out? Ideally, could you consider adding an example for the gradient-based metrics? Thanks and best wishes, Philipp