Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add groupwise registration class #34

Open
wants to merge 68 commits into
base: main
Choose a base branch
from

Conversation

dzenanz
Copy link
Member

@dzenanz dzenanz commented Sep 30, 2024

This PR adds group-wise registration class, along with Python wrapping, unit tests, and unit test data.

When invoked from Python, it causes:

swig/python detected a memory leak of type 'itkImageUC2_Pointer *', no destructor found.
include/itkANTsGroupwiseRegistration.h:136:3: error: 'DataObjectPointer' does not name a type; did you mean 'DataObjectIterator'?
Using just affine transforms cannot get us to the perfect result.
This changes the procedural interface name from
itk.an_ts_groupwise_registration() into itk.ants_groupwise_registration()
The original code was unintentionally reducing intensity contribution
of images with lower list indices by repeatedly weighting them by (1-w),
where w is per image weight (usually 1/N, e.g. 0.1 for 10 input images).
Build error from CI, which sets `ITK_WRAP_IMAGE_DIMS` to `2;3;4`:

itkANTSGroupwiseRegistrationPython.cpp
D:\a\im\build\cp38-cp38-win_amd64\_deps\ants_inner-src\Utilities\itkAverageAffineTransformFunction.h(184,32): error C2027: use of undefined type 'itk::AverageAffineTransformFunctionHelperNameSpace::HelperType<itk::AverageAffineTransformFunctionHelperNameSpace::Dispatcher<4>,float>' [D:\a\im\build\cp38-cp38-win_amd64\Wrapping\Modules\ANTsWasm\ANTsWasmPython.vcxproj]
  (compiling source file 'itkANTSGroupwiseRegistrationPython.cpp')
      D:\a\im\build\cp38-cp38-win_amd64\_deps\ants_inner-src\Utilities\itkAverageAffineTransformFunction.h(59,7):
      see declaration of 'itk::AverageAffineTransformFunctionHelperNameSpace::HelperType<itk::AverageAffineTransformFunctionHelperNameSpace::Dispatcher<4>,float>'
      D:\a\im\build\cp38-cp38-win_amd64\_deps\ants_inner-src\Utilities\itkAverageAffineTransformFunction.h(184,32):
      the template instantiation context (the oldest one first) is
          C:\P\IPP\ITK-win_38-x64\Wrapping\Typedefs\itkANTSGroupwiseRegistrationSwigInterface.h(61,145):
          see reference to class template instantiation 'itk::ANTSGroupwiseRegistration<itk::Image<short,4>,itk::Image<float,4>,float>' being compiled
          D:\a\im\include\itkANTSGroupwiseRegistration.hxx(303,1):
          while compiling class template member function 'void itk::ANTSGroupwiseRegistration<itk::Image<short,4>,itk::Image<float,4>,float>::GenerateData(void)'
          D:\a\im\include\itkANTSGroupwiseRegistration.hxx(428,18):
          see reference to class template instantiation 'itk::AverageAffineTransformFunction<itk::ANTSGroupwiseRegistration<itk::Image<short,4>,itk::Image<float,4>,float>::GenerateData::AffineType>' being compiled
@dzenanz dzenanz requested a review from jcfr September 30, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant