# Patches for ITK 5.2.1

**URL:** <https://discourse.itk.org/t/patches-for-itk-5-2-1/4323>\
**Category:** Community\
**Created:** [August 10, 2021, 12:16am UTC](https://discourse.itk.org/t/patches-for-itk-5-2-1/4323 "2021-08-10T00:16:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [August 10, 2021, 12:16am UTC](https://discourse.itk.org/t/patches-for-itk-5-2-1/4323/1 "2021-08-10T00:16:42Z")

</div>

Hi folks,

The next patch (bugfix) release, ITK 5.2.1, is coming up.

Patches currently staged on the Git `release` branch are:

```auto
Bradley Lowekamp (7):
      BUG: Register ComposeScaleSkewVersor3DTransform transform
      BUG: Add tests demonstration current behavior of histogram based median
      BUG: Fix StatisticsLabelMap median for even number of pixels
      ENH: StatisticsLabelMapFilter use improve integer histogram
      ENH: Add additional testing for zero sized label object
      BUG: Fix HDF5 installation with cmake targets
      BUG: Propagate usage of HDF5 find_package NO_MODULE arg to install

Dženan Zukić (5):
      Revert "COMP: Use CMake 3.18.4 in macOS CI builds"
      COMP: Update KWStyle to fix compile warnings on Ubuntu 20.04
      BUG: add support for long long pixel types in PyBuffer
      COMP: Restore generation of static runtime library on MSVC
      ENH: fix Python multi-processing hang on unix

Lee Newberg (3):
      BUG: Ellipsis is not iterable
      ENH: Propagate StatisticsLabelMapFilter's default NumberOfBins
      ENH: Wrap itkAdaptiveHistogramEqualizationImageFilter for Python.

Matt McCormick (12):
      BUG: Add vnl_vector_from_array to extras __all__
      ENH: Update CastXML source builds to v0.4.3, LLVM 11.1.0
      ENH: Add CastXML binary for macOS arm64
      ENH: Add Linux arm64 CastXML binaries
      COMP: Backport CastXML arm64 Eigen support
      COMP: Do not add IPO to Python wrapping if not supported
      COMP: Only use np.float128 when available
      COMP: Make floating point exceptions a no-op with MUSL, Linux, ARMv8
      BUG: Do not create global multiprocessing RLock
      BUG: Support double colons in Changelog commit summary
      STYLE: Apply black to AuthorsChangesSince.py script
      COMP: Use numpy==1.20.3 for CI testing

Stephen R. Aylward (3):
      BUG: SpatialObject writes object color
      BUG: TubeSpatialObject missing CopyInformation
      BUG: TubeSpatialObject didn't preserver Artery flag

```

We also have:

- [COMP: Update SpatialObjects to correct const-ness #2680](https://github.com/InsightSoftwareConsortium/ITK/pull/2680)

Are there other patches that are missing? Patches should be critical bugfixes, improved support for compilers, and documentation fixes.

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [August 10, 2021, 1:37pm UTC](https://discourse.itk.org/t/patches-for-itk-5-2-1/4323/2 "2021-08-10T13:37:04Z")

</div>

We should also consider these:

> <https://github.com/InsightSoftwareConsortium/ITK/pull/2636>
>
> The test file is produced by 3D Slicer, which is a saved
> segmentation of mouse …tibia (down-sampled for test).
> 
> \## PR Checklist
> \- \[x\] No \[API changes\](https://github.com/InsightSoftwareConsortium/ITK/blob/master/CONTRIBUTING.md#breaking-changes) were made (or the changes have been approved)
> \- \[x\] No \[major design changes\](https://github.com/InsightSoftwareConsortium/ITK/blob/master/CONTRIBUTING.md#design-changes) were made (or the changes have been approved)
> \- \[x\] Added test (or behavior not changed)
> \- \[\] Updated API documentation (or API not changed)
> \- \[x\] Added \[license\](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/KWStyle/ITKHeader.h) to new files (if any)
> \- \[x\] Added Python wrapping to new files (if any) as described in \[ITK Software Guide\](https://itk.org/ItkSoftwareGuide.pdf) Section 9.5
> \- \[\] Added \[ITK examples\](https://github.com/InsightSoftwareConsortium/ITKSphinxExamples) for all new major features (if any)

> <https://github.com/InsightSoftwareConsortium/ITK/pull/2662>
>
> To address https://open.cdash.org/viewBuildError.php?type=0&buildid=7354490:
> \`\`…\`text
> /Users/builder/externalModules/Nonunit/Review/test/itkStochasticFractalDimensionImageFilterTest.cxx:46:50: error: use of undeclared identifier 'StochasticFractalDimensionImageFilter'
> EXERCISE\_BASIC\_OBJECT\_METHODS(fractalFilter, StochasticFractalDimensionImageFilter, ImageToImageFilter);
> ^
> /Users/builder/externalModules/Nonunit/Review/test/itkStochasticFractalDimensionImageFilterTest.cxx:46:89: error: use of undeclared identifier 'ImageToImageFilter'
> EXERCISE\_BASIC\_OBJECT\_METHODS(fractalFilter, StochasticFractalDimensionImageFilter, ImageToImageFilter);
> ^
> 2 errors generated.
> \`\`\`

> <https://github.com/InsightSoftwareConsortium/ITK/pull/2658>
>
> Comparing an \`itk::FixedArray\` to an \`itk::Point\` appears to cause C++20
> compil…ation errors, as observed with Visual Studio 2019 ("/std:c++latest"),
> reported by @QuellaZhang, issue https://github.com/InsightSoftwareConsortium/ITK/issues/2640
> 
> \> itkMatrixOffsetTransformBaseGTest.i(390249): error C2666: 'itk::FixedArray\<double,2\>::operator ==': 2 overloads have similar conversions
> \> itkMatrixOffsetTransformBaseGTest.i(87990): note: could be 'bool itk::FixedArray\<double,2\>::operator ==(const itk::FixedArray\<double,2\> &) const'
> \> itkMatrixOffsetTransformBaseGTest.i(390240): note: or 'bool testing::internal::operator ==(testing::internal::faketype,testing::internal::faketype)'
> \> itkMatrixOffsetTransformBaseGTest.i(269102): note: or 'bool itk::Point\<TParametersValueType,2\>::operator ==(const itk::Point\<TParametersValueType,2\> &) const' \[synthesized expression 'y == x'\]

> <https://github.com/InsightSoftwareConsortium/ITK/pull/2643>
>
> Ref #2640.

> <https://github.com/InsightSoftwareConsortium/ITK/pull/2639>
>
> MeshFileWriter was erroneously wrapped for
> WRAP\_ITK\_REAL instead of WRAP\_ITK\_SC…ALAR.
> 
> \`\`\`text
> itk.meshwrite(mesh, file\_path)
> ...
> itk.support.extras.TemplateTypeError: itk.MeshFileWriter is not wrapped for input type \`itk.Mesh\[itk.UC,3\]\`.
> To limit the size of the package, only a limited number of
> types are available in ITK Python.
> ...
> Supported input types:
> itk.Mesh\[itk.F,2\]
> itk.Mesh\[itk.D,2\]
> itk.Mesh\[itk.F,3\]
> itk.Mesh\[itk.D,3\]
> \`\`\`
> 
> \## PR Checklist
> \- \[x\] No \[API changes\](https://github.com/InsightSoftwareConsortium/ITK/blob/master/CONTRIBUTING.md#breaking-changes) were made (or the changes have been approved)
> \- \[x\] No \[major design changes\](https://github.com/InsightSoftwareConsortium/ITK/blob/master/CONTRIBUTING.md#design-changes) were made (or the changes have been approved)
> \- \[\] Added test (or behavior not changed)
> \- \[\] Updated API documentation (or API not changed)
> \- \[\] Added \[license\](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/KWStyle/ITKHeader.h) to new files (if any)
> \- \[x\] Added Python wrapping to new files (if any) as described in \[ITK Software Guide\](https://itk.org/ItkSoftwareGuide.pdf) Section 9.5
> \- \[\] Added \[ITK examples\](https://github.com/InsightSoftwareConsortium/ITKSphinxExamples) for all new major features (if any)

> <https://github.com/InsightSoftwareConsortium/ITK/pull/2627>
>
> Closes #2629 "Similarity3DTransform::SetScale should recompute m\_Offset", which …said:
> 
> \> When \`Similarity3DTransform::SetScale\` is called, it does not compute
> \> \`m\_Offset\`, which appears to cause an incorrect result from
> \> \`similarity3DTransform.TransformPoint\` when \`TransformPoint\` is called
> \> directly after \`SetScale\`.
> 
> Included a unit test (GoogleTest) to ensure that the issue is fixed.

> <https://github.com/InsightSoftwareConsortium/ITK/pull/2589>
>
> \<!-- The text within this markup is a comment, and is intended to provide
> guide…lines to open a Pull Request for the ITK repository. This text will not
> be part of the Pull Request. --\>
> 
> 
> \<!-- See the CONTRIBUTING (CONTRIBUTING.md) guide. Specifically:
> 
> Start ITK commit messages with a standard prefix (and a space):
> 
> \* BUG: fix for runtime crash or incorrect result
> \* COMP: compiler error or warning fix
> \* DOC: documentation change
> \* ENH: new functionality
> \* PERF: performance improvement
> \* STYLE: no logic impact (indentation, comments)
> \* WIP: Work In Progress not ready for merge
> 
> Provide a short, meaningful message that describes the change you made.
> 
> When the PR is based on a single commit, the commit message is usually left as
> the PR message.
> 
> A reference to a related issue or pull request (https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests)
> in your repository. You can automatically
> close a related issues using keywords (https://help.github.com/articles/closing-issues-using-keywords/)
> 
> @mentions (https://help.github.com/articles/basic-writing-and-formatting-syntax/#mentioning-people-and-teams)
> of the person or team responsible for reviewing proposed changes. --\>
> 
> \## PR Checklist
> \- \[x\] No \[API changes\](https://github.com/InsightSoftwareConsortium/ITK/blob/master/CONTRIBUTING.md#breaking-changes) were made (or the changes have been approved)
> \- \[x\] No \[major design changes\](https://github.com/InsightSoftwareConsortium/ITK/blob/master/CONTRIBUTING.md#design-changes) were made (or the changes have been approved)
> \- \[x\] Added test (or behavior not changed)
> \- \[x\] Updated API documentation (or API not changed)
> \- \[\] Added \[license\](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/KWStyle/ITKHeader.h) to new files (if any)
> \- \[\] Added Python wrapping to new files (if any) as described in \[ITK Software Guide\](https://itk.org/ItkSoftwareGuide.pdf) Section 9.5
> \- \[\] Added \[ITK examples\](https://github.com/InsightSoftwareConsortium/ITKSphinxExamples) for all new major features (if any)
> 
> Refer to the \[ITK Software Guide\](https://itk.org/ItkSoftwareGuide.pdf) for
> further development details if necessary.

> <https://github.com/InsightSoftwareConsortium/ITK/pull/2614>
>
> With numpy 1.21.0, PythonMedianImageFilterTest fails with:
> 
> 2916: Traceback …(most recent call last):
> 2916: File "/home/matt/src/ITK/Modules/Filtering/Smoothing/wrapping/test/MedianImageFilterTest.py", line 56, in \<module\>
> 2916: type\_hints = get\_type\_hints(itk.median\_image\_filter, globalns= { 'itk': itk })
> 2916: File "/home/matt/bin/miniconda/lib/python3.8/typing.py", line 1266, in get\_type\_hints
> 2916: value = \_eval\_type(value, globalns, localns)
> 2916: File "/home/matt/bin/miniconda/lib/python3.8/typing.py", line 272, in \_eval\_type
> 2916: ev\_args = tuple(\_eval\_type(a, globalns, localns) for a in t.\_\_args\_\_)
> 2916: File "/home/matt/bin/miniconda/lib/python3.8/typing.py", line 272, in \<genexpr\>
> 2916: ev\_args = tuple(\_eval\_type(a, globalns, localns) for a in t.\_\_args\_\_)
> 2916: File "/home/matt/bin/miniconda/lib/python3.8/typing.py", line 272, in \_eval\_type
> 2916: ev\_args = tuple(\_eval\_type(a, globalns, localns) for a in t.\_\_args\_\_)
> 2916: File "/home/matt/bin/miniconda/lib/python3.8/typing.py", line 272, in \<genexpr\>
> 2916: ev\_args = tuple(\_eval\_type(a, globalns, localns) for a in t.\_\_args\_\_)
> 2916: File "/home/matt/bin/miniconda/lib/python3.8/typing.py", line 270, in \_eval\_type
> 2916: return t.\_evaluate(globalns, localns)
> 2916: File "/home/matt/bin/miniconda/lib/python3.8/typing.py", line 520, in \_evaluate
> 2916: eval(self.\_\_forward\_code\_\_, globalns, localns),
> 2916: File "\<string\>", line 1, in \<module\>
> 2916: NameError: name 'dtype' is not defined
> 2916: itkTestDriver: Process exited with return value: 1
> 
> Use 1.20.3 until this is addressed, issue is tracked in #2613.

> <https://github.com/InsightSoftwareConsortium/ITK/pull/2593>
>
> \<!-- The text within this markup is a comment, and is intended to provide
> guide…lines to open a Pull Request for the ITK repository. This text will not
> be part of the Pull Request. --\>
> 
> Adds \`float\` wrapping for \`itk::SymmetricSecondRankTensor\` as well as its usage in \`itk::Image\` and \`itk::ImageToImageFilter\`.
> 
> Motivated by updates in \[ITKStrain\](https://github.com/KitwareMedical/ITKStrain/pull/42).
> 
> \<!-- See the CONTRIBUTING (CONTRIBUTING.md) guide. Specifically:
> 
> Start ITK commit messages with a standard prefix (and a space):
> 
> \* BUG: fix for runtime crash or incorrect result
> \* COMP: compiler error or warning fix
> \* DOC: documentation change
> \* ENH: new functionality
> \* PERF: performance improvement
> \* STYLE: no logic impact (indentation, comments)
> \* WIP: Work In Progress not ready for merge
> 
> Provide a short, meaningful message that describes the change you made.
> 
> When the PR is based on a single commit, the commit message is usually left as
> the PR message.
> 
> A reference to a related issue or pull request (https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests)
> in your repository. You can automatically
> close a related issues using keywords (https://help.github.com/articles/closing-issues-using-keywords/)
> 
> @mentions (https://help.github.com/articles/basic-writing-and-formatting-syntax/#mentioning-people-and-teams)
> of the person or team responsible for reviewing proposed changes. --\>
> 
> \## PR Checklist
> \- \[x\] Added Python wrapping to new files (if any) as described in \[ITK Software Guide\](https://itk.org/ItkSoftwareGuide.pdf) Section 9.5

> <https://github.com/InsightSoftwareConsortium/ITK/pull/2587>
>
> \- ENH: Updated CI cached testing ExternalData to 5.2.0

> <https://github.com/InsightSoftwareConsortium/ITK/pull/2584>
>
> This is a follow-up to #2554, suggested in
> https://github.com/InsightSoftwareCo…nsortium/ITK/pull/2578#issuecomment-855014914
> 
> 
> \## PR Checklist
> \- \[x\] No \[API changes\](https://github.com/InsightSoftwareConsortium/ITK/blob/master/CONTRIBUTING.md#breaking-changes) were made (or the changes have been approved)
> \- \[x\] No \[major design changes\](https://github.com/InsightSoftwareConsortium/ITK/blob/master/CONTRIBUTING.md#design-changes) were made (or the changes have been approved)
> \- \[\] Added test (or behavior not changed)
> \- \[\] Updated API documentation (or API not changed)
> \- \[\] Added \[license\](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/KWStyle/ITKHeader.h) to new files (if any)
> \- \[x\] Added Python wrapping to new files (if any) as described in \[ITK Software Guide\](https://itk.org/ItkSoftwareGuide.pdf) Section 9.5
> \- \[\] Added \[ITK examples\](https://github.com/InsightSoftwareConsortium/ITKSphinxExamples) for all new major features (if any)

---

<div class="post-metadata">

**Author:** ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)\
**Post date:** [August 10, 2021, 1:41pm UTC](https://discourse.itk.org/t/patches-for-itk-5-2-1/4323/3 "2021-08-10T13:41:36Z")

</div>

We should also consider the update to GDCM done in this PR:  
[InsightSoftwareConsortium/ITK#2618](https://github.com/InsightSoftwareConsortium/ITK/pull/2618)

This may be the only patch needed to have ITK 5.2.1 work with GCC 11, but it should be tested to verified.

> <https://github.com/SimpleITK/SimpleITK/issues/1435>
>
> related log:
> \`\`\`text
> In file included from /build/python-simpleitk/src/python-…simpleitk-2.1.0/\_skbuild/linux-x86\_64-3.9/cmake-build/sitk-sb/ITK/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.cxx:14:
> /build/python-simpleitk/src/python-simpleitk-2.1.0/\_skbuild/linux-x86\_64-3.9/cmake-build/sitk-sb/ITK/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.h:67:32: error: no member named 'numeric\_limits' in namespace 'std'
> return v \< 0 ? 0 : (v \> std::numeric\_limits\<T\>::max() ? std::numeric\_limits\<T\>::max() : v);
> ~~~~~ ^
> /build/python-simpleitk/src/python-simpleitk-2.1.0/\_skbuild/linux-x86\_64-3.9/cmake-build/sitk-sb/ITK/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.h:67:47: error: 'T' does not refer to a value
> return v \< 0 ? 0 : (v \> std::numeric\_limits\<T\>::max() ? std::numeric\_limits\<T\>::max() : v);
> ^
> /build/python-simpleitk/src/python-simpleitk-2.1.0/\_skbuild/linux-x86\_64-3.9/cmake-build/sitk-sb/ITK/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.h:63:20: note: declared here
> template \<typename T\>
> ^
> \[70%\] Building CXX object Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/CMakeFiles/gdcmMSFF.dir/gdcmUIDGenerator.cxx.o
> /build/python-simpleitk/src/python-simpleitk-2.1.0/\_skbuild/linux-x86\_64-3.9/cmake-build/sitk-sb/ITK/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.h:67:51: error: no member named 'max' in the global namespace
> return v \< 0 ? 0 : (v \> std::numeric\_limits\<T\>::max() ? std::numeric\_limits\<T\>::max() : v);
> ~~^
> \[70%\] Building CXX object Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/CMakeFiles/gdcmMSFF.dir/gdcmUUIDGenerator.cxx.o
> /build/python-simpleitk/src/python-simpleitk-2.1.0/\_skbuild/linux-x86\_64-3.9/cmake-build/sitk-sb/ITK/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.h:67:64: error: no member named 'numeric\_limits' in namespace 'std'
> return v \< 0 ? 0 : (v \> std::numeric\_limits\<T\>::max() ? std::numeric\_limits\<T\>::max() : v);
> ~~~~~ ^
> /build/python-simpleitk/src/python-simpleitk-2.1.0/\_skbuild/linux-x86\_64-3.9/cmake-build/sitk-sb/ITK/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.h:67:79: error: 'T' does not refer to a value
> return v \< 0 ? 0 : (v \> std::numeric\_limits\<T\>::max() ? std::numeric\_limits\<T\>::max() : v);
> ^
> /build/python-simpleitk/src/python-simpleitk-2.1.0/\_skbuild/linux-x86\_64-3.9/cmake-build/sitk-sb/ITK/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.h:63:20: note: declared here
> template \<typename T\>
> ^
> /build/python-simpleitk/src/python-simpleitk-2.1.0/\_skbuild/linux-x86\_64-3.9/cmake-build/sitk-sb/ITK/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmImageChangePhotometricInterpretation.h:67:83: error: no member named 'max' in the global namespace
> return v \< 0 ? 0 : (v \> std::numeric\_limits\<T\>::max() ? std::numeric\_limits\<T\>::max() : v);
> \`\`\`
> this gdcm issue is fixed by upstream patch https://github.com/malaterre/GDCM/commit/4404b770be337bd0d5d3c2289abfd34426433db2. Upgrade gdcm src to this commit would fix it.

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [August 11, 2021, 8:06pm UTC](https://discourse.itk.org/t/patches-for-itk-5-2-1/4323/4 "2021-08-11T20:06:03Z")

</div>

Thanks, @dzenanz @blowekamp !

The GDCM patch was backported along with a VXL update for GCC 11 support.
