A shape class for ShapedImageNeighborhoodRange and ShapedNeighborhoodIterator

@phcerdan Would it be OK to you if the identifiers HyperrectangularImageNeighborhoodShape and GenerateHyperrectangularImageNeighborhoodOffsets would be renamed to RectangularImageNeighborhoodShape and GenerateRectangularImageNeighborhoodOffsets, respectively?

I remember you suggested the term hyperrectangular:

Wikipedia explained to me that the term hyperrectangle is a “generalization of a rectangle for higher dimensions”.

Personally I feel that the “hyper” adjective is not really necessary, as the template argument VImageDimension already indicates that the rectangle may be generalized for higher dimensionalities.

Note that itk::Image<TPixel, VImageDimension> also supports dimensionalities higher than 2 (even though the ITK image class has not been named something like itk::Hyperimage<THyperpixel, VImageDimension>).

Note also that this shape class supports 1-D as well. Would that be a hypo rectangular shape?

So please tell me, what do you think by now?

1 Like

Hi @Niels_Dekker, it would be definitively ok for me. NRectangle, or HyperRectangle might be more explicit, but as you mentioned, if the image dimension is a required template parameter, that can be inferred. I would just recommend to avoid the temptation of providing a default template parameter (= 2) for ImageDimension because the name (which I am sure is not in your plans).


Thanks, @phcerdan! I realize it’s very much a subjective issue. And it’s not a big issue to me. But anyway, please check my proposed patch: STYLE: Replaced “Hyperrect…” by “Rect…” in class + function names

P.S. I swear, I did not add a default template parameter :smiley:

1 Like