Error of itk.DemonsRegistrationFilter[ImageType, ImageType].New()

Hi all,

I meet an error that there will always be an error of

itk.support.extras.TemplateTypeError: itk.DemonsRegistrationFilter is not wrapped for input type `itk.Image[itk.F,3], itk.Image[itk.F,3]`.
To limit the size of the package, only a limited number of
types are available in ITK Python. To print the supported
types, run the following command in your python environment:
    itk.DemonsRegistrationFilter.GetTypes()
Possible solutions:
* If you are an application user:
** Convert your input image into a supported format (see below).
** Contact developer to report the issue.
* If you are an application developer, force input images to be
loaded in a supported pixel type.
    e.g.: instance = itk.DemonsRegistrationFilter[itk.Image[itk.SS,2], itk.Image[itk.SS,2], itk.Image[itk.Vector[itk.F,2],2]].New(my_input)
* (Advanced) If you are an application developer, build ITK Python yourself and
turned to `ON` the corresponding CMake option to wrap the pixel type or image
dimension you need. When configuring ITK with CMake, you can set
`ITK_WRAP_${type}` (replace ${type} with appropriate pixel type such as
`double`). If you need to support images with 4 or 5 dimensions, you can add
these dimensions to the list of dimensions in the CMake variable
`ITK_WRAP_IMAGE_DIMS`.
Supported input types:
itk.Image[itk.SS,2]
itk.Image[itk.UC,2]
itk.Image[itk.US,2]
itk.Image[itk.F,2]
itk.Image[itk.D,2]
itk.Image[itk.SS,3]
itk.Image[itk.UC,3]
itk.Image[itk.US,3]
itk.Image[itk.F,3]
itk.Image[itk.D,3]
itk.Image[itk.SS,4]
itk.Image[itk.UC,4]
itk.Image[itk.US,4]
itk.Image[itk.F,4]
itk.Image[itk.D,4]"

when I try to build a demonsregistrationfilter (Demons = itk.DemonsRegistrationFilter[ImageType, ImageType].New()).
The ImageType that I used is itk.Image[itk.F,3], and it seems support this kind of image type.
Could anyone know the reason why it will report an error?

Best regards,
Chen

This works: Demons = itk.DemonsRegistrationFilter[ImageType, ImageType, itk.Image[itk.Vector[itk.F,3],3]].New()

The third template parameter is the type of the deformation field. I assume that if you omit it, a wrong one is chosen automatically. Perhaps something in the wrapping specification could be improved.

Thanks! I realized it was a stupid question since I am pretty a rookie in this, now it has been solved, thank you very much.

1 Like