Skip to content

ENH: Ingest ITKThickness3D into Modules/Filtering/Thickness3D#6268

Merged
hjmjohnson merged 45 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:ingest-Thickness3D
May 15, 2026
Merged

ENH: Ingest ITKThickness3D into Modules/Filtering/Thickness3D#6268
hjmjohnson merged 45 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:ingest-Thickness3D

Conversation

@hjmjohnson
Copy link
Copy Markdown
Member

Ingest the ITKThickness3D remote module into Modules/Filtering/Thickness3D (group: Filtering). Source upstream: InsightSoftwareConsortium/ITKThickness3D. Tracking issue: #6160.

Ingest stats
  • Commits: 38 (including 7 merge commits -- Mode A topology preserved per Utilities/Maintenance/RemoteModuleIngest/INGESTION_STRATEGY.md)
  • Files installed under Modules/Filtering/Thickness3D/: 14
  • Approx. content size: 201 KiB
  • Tip SHA: 9a625a6daf2f3f81eaf713372294fe715a41393b
External-data fixtures

CID / .sha512 content-links present in this ingest:

  • Modules/Filtering/Thickness3D/test/Baseline/medial_thickness.tiff.cid
  • Modules/Filtering/Thickness3D/test/Baseline/skeleton.tiff.cid

If any fixtures resolve via ITKTestingData, that repo must contain the matching content-link before this PR can merge cleanly.

Follow-on commits (on top of the unrelated-histories merge)
  • 9a625a6 ENH: Enable Module_Thickness3D in configure-ci pyproject task
  • b2f9fae COMP: Remove Thickness3D.remote.cmake after ingest into Modules/Filtering
  • 1f21519 ENH: Convert from md5 to .cid tags.
  • 8760765 STYLE: Replace itkStaticConstMacro with static constexpr
  • aee8e8e STYLE: Add itkVirtualGetNameOfClassMacro + itkOverrideGetNameOfClassMacro

T4mmi and others added 30 commits February 5, 2019 10:49
Include ITKBinaryThinning3D into the ITKThickness3D module.

Add BinaryThinningImageFilter3D as a native filter.
Merge ITKBinaryThinning3D into master
Conform to function naming coding guidelines: functions names should start
with a capital letter and be written in camel case as per the `C.6.6
Naming Methods and Functions` ITK Software Guide section.
Conform to ITK coding style guidelines:
- Use the `this` keyword to call to member functions.
- Document the methods when being declared.
- Use braces for flow control loops, even if they consist of a single
  line.
- Use `unsigned int` types for indexing.
- Make flow control loop variables have a local scope.
- Use pre-increment in recursive control loops.
- Use the appropriate indentation.
- Start comments with capitals.
- Make `PrintSelf` be the last method of the implementation body.
- Remove uninformative `PrintSelf` `std::cout` message.
- Remove `itkDebugMacro` messages.
…lines

STYLE: Conform to ITK coding style guidelines.
Make the tests quantitative: add baseline image comparison.
Improve tests:
- Use the `TRY_EXPECT_NO_EXCEPTION` macro to update filters and avoid
  boilerplate code.
- Exercise the basic object methods using the
  `EXERCISE_BASIC_OBJECT_METHODS` macro.
- Remove the `using namespace std` as per ITK guidelines.
- Some style changes to conform to the ITK Software Guide.
MedialThicknessImageFilter3D (#13)

* BUG: Double the distance 'skeleton to shell' in the MedialThicknessImageFilter3D output

Thickness should be the equivalent *diameter* and not *radius* (i.e. double the distance from the medial axis to the outter shell)

- Filter code was fixed (add MultiplyImageFilter to the pipeline)
- Behavior was explicited in the README.rst
- Output test data were adjusted to the new behavior

* REL: Increment version number
Add the `override` keyword to overriding methods.

Fixes the dashboard errors:
```
include/itkBinaryThinningImageFilter3D.h:141:8: warning: 'PrintSelf'
overrides a member function but is not marked 'override'
[-Winconsistent-missing-override]
```

and
```
include/itkBinaryThinningImageFilter3D.h:144:8: warning: 'GenerateData'
overrides a member function but is not marked 'override'
[-Winconsistent-missing-override]
```

reported at:
http://testing.cdash.org/viewBuildError.php?type=1&buildid=5818150
Use the `ITK_DISALLOW_COPY_AND_ASSIGN` macro to enhance consistency across
the the toolkit when disallowing the copy constructor and the assign
operator.

Move the `ITK_DISALLOW_COPY_AND_ASSIGN` calls to public section following
the discussion in
https://discourse.itk.org/t/itk-disallow-copy-and-assign/648
…/AddOverrideKeywordToOverridenMeth

ods

COMP: Add the `override` keyword to overriding methods.
…/UseDisallowCopyAndAssignMacro

COMP: Use and move ITK_DISALLOW_COPY_AND_ASSIGN calls to public section.
This check replaces default bodies of special member functions with
`= default;`. The explicitly defaulted function declarations enable more
opportunities in optimization, because the compiler might treat
explicitly defaulted functions as trivial.

Additionally, the C++11 use of `= default` more clearly expresses the
intent for the special member functions.
…/PreferDefaultToExplicitTrivialImp

lementations

STYLE: Pefer = default to explicitly trivial implementations
changed the reference output image for quantitative tests
This allows compiling with disabled legacy code
The check converts the usage of typedef with using keyword.

SRCDIR= #My local SRC
BLDDIR= #My local BLD

cd
run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-use-using  -header-filter=.* -fix
# https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-using.html
Find and remove redundant void argument lists.
The check finds function parameters of a pointer type that could be changed to
point to a constant type instead.

When const is used properly, many mistakes can be avoided. Advantages when
using const properly:
 - prevent unintentional modification of data;
 - get additional warnings such as using uninitialized data;
 - make it easier for developers to see possible side effects.

This check is not strict about constness, it only warns when the constness will
make the function interface safer.
The mission of NumFOCUS is to promote open
practices in research, data, and scientific
computing.

https://numfocus.org
Fixes changes made in InsightSoftwareConsortium#2053. ITK_DISALLOW_COPY_AND_ASSIGN will be used if ITK_FUTURE_LEGACY_REMOVE=OFF.
The ability to include either .h or .hxx files as
header files required recursively reading the
.h files twice.  The added complexity is
unnecessary, costly, and can confuse static
analysis tools that monitor header guardes (due
to reaching the maximum depth of recursion
limits for nested #ifdefs in checking).
@github-actions github-actions Bot added the area:Remotes Issues affecting the Remote module label May 14, 2026
@hjmjohnson
Copy link
Copy Markdown
Member Author

@greptileai review this draft before I make it official

1 similar comment
@hjmjohnson
Copy link
Copy Markdown
Member Author

@greptileai review this draft before I make it official

@greptile-apps

This comment was marked as resolved.

Comment thread Modules/Filtering/Thickness3D/include/itkMedialThicknessImageFilter3D.hxx Outdated
Comment thread Modules/Filtering/Thickness3D/include/itkMedialThicknessImageFilter3D.hxx Outdated
Comment thread Modules/Filtering/Thickness3D/include/itkBinaryThinningImageFilter3D.hxx Outdated
@greptile-apps

This comment was marked as resolved.

Comment thread Modules/Filtering/Thickness3D/include/itkBinaryThinningImageFilter3D.hxx Outdated
Comment thread Modules/Filtering/Thickness3D/include/itkBinaryThinningImageFilter3D.hxx Outdated
Comment thread Modules/Filtering/Thickness3D/include/itkBinaryThinningImageFilter3D.hxx Outdated
Comment thread Modules/Filtering/Thickness3D/include/itkBinaryThinningImageFilter3D.h Outdated
Comment thread Modules/Filtering/Thickness3D/include/itkBinaryThinningImageFilter3D.h Outdated
Comment thread Modules/Filtering/Thickness3D/include/itkMedialThicknessImageFilter3D.hxx Outdated
Comment thread Modules/Filtering/Thickness3D/include/itkBinaryThinningImageFilter3D.hxx Outdated
Comment thread Modules/Filtering/Thickness3D/itk-module.cmake Outdated
…ncludes

Duplicate ReleaseDataFlagOn on m_ThinningFilter was a copy-paste error;
target m_MaskFilter so its output buffer is released, halving peak memory.
Unused itkImageRegionIterator* includes removed.
…code

Use double-quote includes (ITK convention), 'typename' template parameters,
NumericTraits OneValue()/ZeroValue() in place of deprecated One/Zero data
members, and remove commented-out SetNthOutput remnant.
@hjmjohnson
Copy link
Copy Markdown
Member Author

/azp run

@hjmjohnson
Copy link
Copy Markdown
Member Author

Addressed 11 P1+P2 Greptile findings in 3 append commits preserving merge topology (7 merges intact). CI rerun triggered.

Mirrors the annotation already carried by BinaryThinningImageFilter3D so
that Windows shared-library builds export the explicit template
instantiations produced by the Python wrapping layer when ENABLE_SHARED
is active for this module.
IsEulerInvariant and IsSimplePoint are invoked once per foreground voxel
per border pass.  Taking the 27-element neighborhood by const reference
removes the per-call copy without changing semantics; the bodies only
read neighbors.
@hjmjohnson
Copy link
Copy Markdown
Member Author

Addressed two outside-diff Greptile findings:

  • P1: Added ITK_TEMPLATE_EXPORT to MedialThicknessImageFilter3D (commit 7d1feb6) so Windows shared-library builds export the wrapped template instantiations.
  • P2: Changed IsEulerInvariant and IsSimplePoint to take const NeighborhoodType & (commit 7f9f486) — eliminates the per-voxel copy in the hot path; bodies are read-only on the neighborhood.

/azp run

@hjmjohnson
Copy link
Copy Markdown
Member Author

/azp run

The if(NOT ITK_SOURCE_DIR) branch (find_package(ITK) +
include(ITKModuleExternal)) only executes when building the module
standalone outside ITK. In-tree builds always take the
itk_module_impl() else branch. Drop the dead branch following the
cleanup pattern from InsightSoftwareConsortium#6272/InsightSoftwareConsortium#6279.
Replace the in-tree binary input.tiff with an ExternalData .sha512
content-link. The blob is already resolvable on data.kitware.com
(no upload required).

  Modules/Filtering/Thickness3D/test/Input/input.tiff (162358 bytes)
    sha512: f12b054803bd9745fce7e34f3e54bfa593e6adbe2a04d33d5d7483c36dc876252f9d48c89af7e99f4ac5b8fa8c54e6cba9a855aff6474bde79b86b636ca5a904
    status: already on data.kitware.com
@hjmjohnson
Copy link
Copy Markdown
Member Author

/azp run

@github-actions github-actions Bot added the type:Data Changes to testing data label May 14, 2026
@hjmjohnson
Copy link
Copy Markdown
Member Author

/azp run

@hjmjohnson hjmjohnson force-pushed the ingest-Thickness3D branch from 238c54b to 6ae191d Compare May 14, 2026 18:33
@hjmjohnson
Copy link
Copy Markdown
Member Author

Rewrote history with git filter-repo to scrub raw binary blobs from upstream merge ancestry while preserving merge topology. Pre-rewrite tip 238c54ba44; post-rewrite tip 6ae191de1d. Binary content remains accessible via .cid/.sha512 content-links at HEAD.

@hjmjohnson
Copy link
Copy Markdown
Member Author

/azp run

@hjmjohnson hjmjohnson marked this pull request as ready for review May 14, 2026 22:39
@hjmjohnson
Copy link
Copy Markdown
Member Author

@greptileai review

@hjmjohnson hjmjohnson merged commit 366ccd8 into InsightSoftwareConsortium:main May 15, 2026
20 of 21 checks passed
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 area:Python wrapping Python bindings for a class area:Remotes Issues affecting the Remote module type:Data Changes to testing data type:Enhancement Improvement of existing methods or implementation type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots 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.

7 participants