Skip to content

Refactor FunctorImageFilter with neighborhood

Cédric Traizet requested to merge functor_image_filter_neighborhood into develop

Summary

FunctorImageFilter now takes const itk::ConstNeighborhoodIterator<Image<T>> & instead of itk::neighborhood<T>. The localRxDetection application now uses a FunctorImageFilter.

Rationale

Currently, it is possible to use itk::Neighborhood<T> as input of the functor of a FunctorImageFilter. This functionality has two problems :

  • There is a bug with the boundaryCondition (see #1802 (closed))

  • Internally a ConstNeighborhoodIterator is used to run through this image and at each pixel location the underlying neighborhood is copied (via the GetNeighborhood() method) and passed to the functor which is not efficient.

In this merge request the (const) itk::neighborhood<T> (&) parameter is replaced by a const itk::ConstNeighborhoodIterator<Image<T>> &. This signature is less elegant, but it solves the two problems mentioned above. Note that we can only use a const reference as parameter. The const prevents the user (the creator of the functor) to increment the iterator.

Also this merge request replaces the LocalRxDetectorFilter by a functorImageFilter in the localRxDetection application (recently merge, see !353 (merged))

With this modification, we will be able to move forward with the functorImageFilter refactoring (see #1821 (closed)).

Copyright

The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.


Check before merging:

  • All discussions are resolved
  • At least 2 👍 votes from core developers, no 👎 vote.
  • The feature branch is (reasonably) up-to-date with the base branch
  • Dashboard is green
  • Copyright owner has signed the ORFEO ToolBox Contributor License Agreement

Merge request reports