InsightSoftwareConsortium / ITK

Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.
https://itk.org
Apache License 2.0
1.4k stars 662 forks source link

Use `true` as default member initializer for m_UseImageDirection and m_UseImageSpacing #4505

Closed N-Dekker closed 5 months ago

N-Dekker commented 5 months ago

Removed m_UseImageDirection = true and m_UseImageSpacing = true assignment from the function body of the corresponding constructors.

Following C++ Core Guidelines, "Prefer initialization to assignment in constructors"

Default member initializers also have the advantage that those default values will be shown in the API documentation. For example, https://itk.org/Doxygen/html/classitk_1_1GradientImageFilter.html now still says:

bool    m_UseImageDirection {}
bool    m_UseImageSpacing {}

But it will show the default value true for those member variables, once this pull request is processed.

N-Dekker commented 5 months ago

/azp run ITK.macOS.Python