When I try this:
# Here deformation_field is of type itk.Image[itk.Vector[itk.F, 2], 2].
deformation_field_d = itk.cast_image_filter(deformation_field, ttype=itk.Image[itk.Vector[itk.D, 2], 2])
I get this error:
File “...\Lib\site-packages\itk\itkCastImageFilterPython.py”, line 36927, in cast_image_filter
instance = itk.CastImageFilter.New(*args, **kwargs)
File “...\Lib\site-packages\itk\support\template_class.py”, line 703, in New
raise RuntimeError(
…<2 lines>…
)
RuntimeError: Expected 2 template parameters. 1 parameters given.
What is the correct way of using cast_image_filter
in this case? How can I cast from itk.itkImagePython.itkImageVF22
to itk.itkImagePython.itkImageVD22
please?