Skip to content

ENH: Increase coverage for ImageStatistics module classes#2991

Merged
dzenanz merged 2 commits intoInsightSoftwareConsortium:masterfrom
jhlegarreta:IncreaseImageStatisticsModuleCoverage
Dec 27, 2021
Merged

ENH: Increase coverage for ImageStatistics module classes#2991
dzenanz merged 2 commits intoInsightSoftwareConsortium:masterfrom
jhlegarreta:IncreaseImageStatisticsModuleCoverage

Conversation

@jhlegarreta
Copy link
Copy Markdown
Member

@jhlegarreta jhlegarreta commented Dec 24, 2021

  • ENH: Increase coverage for ImageStatistics module classes
  • BUG: Fix superclass name in itkTypeMacro

PR Checklist

@jhlegarreta
Copy link
Copy Markdown
Member Author

Only these few classes are included because all but itk::LabelOverlapMeasuresImageFilter inherit from ImageSink, but their RTTI has ImageToImageFilter as the superclass, so the the tests should catch the failure.

The only classes in the module that inherit from ImageSink are itk::LabelStatisticsImageFilter, itk::MinimumMaximumImageFilter, and itk::StatisticsImageFilter. Comment in the ITKv5 migration guide:
https://github.com/InsightSoftwareConsortium/ITK/pull/855/files#diff-2d43eb1ac60257c6bda5c589f292ac05fb0c13b7674aae9fd3ae6fe331b45efbR411

git blame points to this commit when looking at when the inheritance changed:
0efe8db
fdccea4
cbaddfa

Once the failure is demonstrated in CI builds, I will add a commit to fix the RTTIs.

@github-actions github-actions Bot added area:Filtering Issues affecting the Filtering module type:Coverage Code coverage impacts type:Enhancement Improvement of existing methods or implementation type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct labels Dec 24, 2021
@jhlegarreta jhlegarreta force-pushed the IncreaseImageStatisticsModuleCoverage branch from a201f2d to 134b46d Compare December 24, 2021 19:05
Increase coverage for `ImageStatistics` module classes:
- Exercise the basic object methods using the
  `ITK_EXERCISE_BASIC_OBJECT_METHODS` macro.
@jhlegarreta jhlegarreta force-pushed the IncreaseImageStatisticsModuleCoverage branch from 134b46d to 86deecf Compare December 24, 2021 21:58
Fix `ImageStatistics` module classes superclass name in `itkTypeMacro`.
@jhlegarreta
Copy link
Copy Markdown
Member Author

134b46d was succeeding because I anticipated to the error and provided the right superclass name, and also now I realize that itkTypeMacro in reality does not do anything with the superclass parameter itself, but rather omits the virtual specifier when providing GetNameOfClass.

86deecf should fail when checking the superclass names for itk::LabelStatisticsImageFilter, itk::MinimumMaximumImageFilter, and itk::StatisticsImageFilter.

@jhlegarreta
Copy link
Copy Markdown
Member Author

So the Windows build failed as expected:
https://open.cdash.org/viewTest.php?onlyfailed&buildid=7643234

Not sure why Linux and macOS did not fail, but I'm pushing the fix.

@dzenanz dzenanz merged commit 2d63eb0 into InsightSoftwareConsortium:master Dec 27, 2021
@jhlegarreta jhlegarreta deleted the IncreaseImageStatisticsModuleCoverage branch December 27, 2021 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Filtering Issues affecting the Filtering module type:Coverage Code coverage impacts type:Enhancement Improvement of existing methods or implementation type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants