Dear All!
I have only been using ITK for a short time.
In my project the goal is to transform an input image with a displacement field.
For this I want to use the Python version.
My problems is/are (They are linked):
a) I cannot create the displacement field with the data type i want.
b) I cannot change the datatype of the displacement field.
I created a Displacement field with the following code:
field = itk.DisplacementFieldTransform[itk.D, 2].New()
a)
Double is the only allowed data type (-> checked it with itk.DisplacementFieldTransform.GetOutputs()).
I think my problem would be solved if the function would allow other data types.
To transform the image i followed the example:
https://itk.org/ITKExamples/src/Filtering/ImageGrid/WarpAnImageUsingADeformationField/Documentation.html
b)
To cast the displacement field to the right data type I wanted to use itk.CastImageFilter.
Because the C++ Function Itk.VectorCastImageFilter is not implemented in ITK python.
Which results in the Error:
"itk.CastImageFilter is not wrapped for input type itk.Image[itk.Vector[itk.D,2],2], itk.Image[itk.Vector[itk.F,2],2]
"
Summary:
itk.WarpImageFilter needs itk.Image[itk.Vector[itk.F,2],2] -> I can only create itk.Image[itk.Vector[itk.D,2],2] -> I havenot managed to cast it to the right dtype.
What can I do?
Best Regards Simon