ENH: Increase pixel type alias consistency in common operators#2550
Conversation
Make `PixelType` alias be `public` in `itk::AnnulusOperator`. This will allow using the appropriate types for the `m_InteriorValue`, `m_AnnulusValue`, and `m_ExteriorValue` members for an instance of the class.
Prefer aliasing template pixel type in `common` operator classes over aliasing the superclass pixel type, which is earlier set to the template pixel type.
Leengit
left a comment
There was a problem hiding this comment.
Is the use of of typename Superclass::PixelType in the replaced code supposed to be a way to tell the programmer that these classes inherit their type aliases from the superclass ... kind of paralleling how these classes inherit methods from the superclass?
Does the ITK style guide say anything about this? If not, should it?
|
@Leengit Not sure about the intention of using the Superclass type for the pixel, although it is exactly the same as the current classes'. Maybe it was more consistent with the rest of the aliases. I'd say that the SW Guide does not propose or encourage a practice here. If you feel like it should, please do a PR. If you think that the former solution should be used, I'd happy to delete the relevant commit in this PR. |
Leengit
left a comment
There was a problem hiding this comment.
I see value in both the typename Superclass::PixelType and TPixel approaches. I have a slight preference for the former, but nothing significant. Either way ... looks good to me.
Increase pixel type alias consistency in common operators:
PixelTypealias be public initk::AnnulusOperatorcommonoperator classesPR Checklist