ITKElastix: External initial transform causes a failure in ConvertToItkTransform
elastix_object = itk.ElastixRegistrationMethod.New(fixed_image, moving_image)
elastix_object.SetExternalInitialTransform(initial_transform)
...
comb_transform = elastix_object.GetCombinationTransform()
itk_transform = elastix_object.ConvertToItkTransform(comb_transform) # error
produces:
RuntimeError: D:\a\im\_skbuild\win-amd64-3.9\cmake-build\_deps\elx-src\Core\Main\itkElastixRegistrationMethod.hxx:1019:
ITK ERROR: Failed to convert transform object SimilarityTransformElastix (000001A9A7B0E0B0)
RTTI typeinfo: class elastix::SimilarityTransformElastix<class elastix::ElastixTemplate<class itk::Image<float,3>,class itk::Image<float,3> > >
Reference Count: 12
Modified Time: 50477
Debug: Off
Object Name:
Observers:
none
The code does not crash if elastix_object.SetInitialTransform(initial_transform) or elastix_object.SetInitialTransformParameterFileName(initial_transform_txt_path) is invoked instead.
About this issue
- Original URL
- State: open
- Created 10 months ago
- Comments: 16 (8 by maintainers)
Thansk @dzenanz Looks like it can be further reduced to:
Right? Which produces:
Below is the code which triggers the error. To be used from a jupyter notebook or a script in examples directory. I based it on https://github.com/InsightSoftwareConsortium/ITKElastix/blob/4fbdc9c9ca32aa740d8842c0892b817cf8ef0f41/examples/ITK_Example04_InitialTransformAndMultiThreading.ipynb.
Thanks @dzenanz I made that an issue: