Open iyerkrithika21 opened 2 weeks ago
Great observations! Indeed when I try the translation transform, I get:
[2024-08-27 16:19:20.250] [error] Exception Caught: TypeError: Wrong number or type of arguments for overloaded function 'new_TranslationTransform'.
Possible C/C++ prototypes are:
itk::simple::TranslationTransform::TranslationTransform(unsigned int,std::vector< double,std::allocator< double > > const &)
itk::simple::TranslationTransform::TranslationTransform(itk::simple::TranslationTransform const &)
itk::simple::TranslationTransform::TranslationTransform(itk::simple::Transform const &)
At:
/home/amorris/miniconda3/envs/shapeworks/lib/python3.9/site-packages/SimpleITK/SimpleITK.py(6597): __init__
/home/amorris/sci/shapeworks/Python/DeepSSMUtilsPackage/DeepSSMUtils/image_utils.py(31): get_image_registration_transform
/home/amorris/sci/shapeworks/Python/DeepSSMUtilsPackage/DeepSSMUtils/__init__.py(72): get_image_registration_transform
/home/amorris/sci/shapeworks/Python/DeepSSMUtilsPackage/DeepSSMUtils/run_utils.py(400): groom_val_test_images
if transform_type == 'rigid':
itk_transform = SimpleITK.Euler3DTransform()
elif transform_type == 'similarity':
itk_transform = SimpleITK.Similarity3DTransform()
else:
print("Error: " + transform_type + " transform unimplemented.")
Won't your changes always error out on "translation"?
Fixed the if statement.
Don't we need to combine the 3 registrations? They are each done on different croppings of the reference image. Translation on full size, rigid on medium and then similarity on the smallest?
However, the rigid and similarity transforms are applying translation and rotation in both of them. The only difference is similarity also applies scaling.
So, we are repeating rotation and translation in all three calls.
we are repeating rotation and translation in all three calls.
I agree, but they are successive refinements, right?
I was unsure about the logic used to apply the different transforms with different padding values. If the goal is refinement, then okay.
There are few issues to the image-based registration (because we are assuming we don't have access to ground truth surfaces during inference) process followed for evaluation:
Function:
get_image_registration_transform
itk_transform = SimpleITK.TranslationTransform()
Should we expose other parameters for image registration to the users? This registration might require some parameter tuning for other complex anatomies.
'rigid' is hardcoded here, so it always applies 'rigid' transformation even when others transform types are passed.
As per ITK documentation: