From 32ddcdde2fd00a80ece2c8fffe3035c9287c4a37 Mon Sep 17 00:00:00 2001 From: "Hans J. Johnson" Date: Mon, 21 Sep 2026 10:18:28 -0500 Subject: [PATCH 1/4] COMP: Build against ITK 6 Four changes, all of which keep the module building against ITK 5.4 as well. ITK 6 turns ITK_DISALLOW_COPY_AND_ASSIGN into a static assertion asking for ITK_DISALLOW_COPY_AND_MOVE, which ITK 5.4 defines as well. Three itkExceptionMacro and itkGetConstObjectMacro invocations were written without a terminating semicolon. The ITK 6 expansions end in a declaration rather than a statement, so the semicolon is now required. The example read the module's own headers, which only reach the compiler by accident when the module is built inside an ITK source tree. Name the include directory on the target so the example also builds against an installed ITK. The packaged wheel pinned itk == 5.4.*, which would make it uninstallable against the ITK 6 it now also builds against. Open the floor to itk >= 5.4. --- examples/CMakeLists.txt | 3 +++ .../itkTrimmedEuclideanDistancePointSetToPointSetMetricv4.h | 6 +++--- include/itkTrimmedPointSetToPointSetMetricv4.h | 6 +++--- ...itkWeightedEuclideanDistancePointSetToPointSetMetricv4.h | 2 +- pyproject.toml | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index d81cda3..2b8e9cd 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -2,6 +2,9 @@ add_executable( TrimmedPointSetRegistrationExample TrimmedPointSetRegistrationEx target_link_libraries( TrimmedPointSetRegistrationExample ${ITK_LIBRARIES}) +target_include_directories( TrimmedPointSetRegistrationExample PRIVATE + "${CMAKE_CURRENT_SOURCE_DIR}/../include" ) + set_target_properties( TrimmedPointSetRegistrationExample PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/examples" diff --git a/include/itkTrimmedEuclideanDistancePointSetToPointSetMetricv4.h b/include/itkTrimmedEuclideanDistancePointSetToPointSetMetricv4.h index 8af5014..2021454 100644 --- a/include/itkTrimmedEuclideanDistancePointSetToPointSetMetricv4.h +++ b/include/itkTrimmedEuclideanDistancePointSetToPointSetMetricv4.h @@ -36,7 +36,7 @@ class ITK_TEMPLATE_EXPORT TrimmedEuclideanDistancePointSetToPointSetMetricv4 : public EuclideanDistancePointSetToPointSetMetricv4 { public: - ITK_DISALLOW_COPY_AND_ASSIGN(TrimmedEuclideanDistancePointSetToPointSetMetricv4); + ITK_DISALLOW_COPY_AND_MOVE(TrimmedEuclideanDistancePointSetToPointSetMetricv4); /** Standard class type aliases. */ using Self = TrimmedEuclideanDistancePointSetToPointSetMetricv4; @@ -206,7 +206,7 @@ class ITK_TEMPLATE_EXPORT TrimmedEuclideanDistancePointSetToPointSetMetricv4 } else { - itkExceptionMacro( "Percentile value must belong to (0;100]." ) + itkExceptionMacro( "Percentile value must belong to (0;100]." ); } } itkGetMacro( Percentile, unsigned int ); @@ -222,7 +222,7 @@ class ITK_TEMPLATE_EXPORT TrimmedEuclideanDistancePointSetToPointSetMetricv4 } else { - itkExceptionMacro( "Sampling percentage value must belong to (0;1]." ) + itkExceptionMacro( "Sampling percentage value must belong to (0;1]." ); } } itkGetMacro( SamplingRate, unsigned int ); diff --git a/include/itkTrimmedPointSetToPointSetMetricv4.h b/include/itkTrimmedPointSetToPointSetMetricv4.h index 17e2fea..c9613a2 100644 --- a/include/itkTrimmedPointSetToPointSetMetricv4.h +++ b/include/itkTrimmedPointSetToPointSetMetricv4.h @@ -34,7 +34,7 @@ class ITK_TEMPLATE_EXPORT TrimmedPointSetToPointSetMetricv4 : public EuclideanDistancePointSetToPointSetMetricv4 { public: - ITK_DISALLOW_COPY_AND_ASSIGN(TrimmedPointSetToPointSetMetricv4); + ITK_DISALLOW_COPY_AND_MOVE(TrimmedPointSetToPointSetMetricv4); /** Standard class type aliases. */ using Self = TrimmedPointSetToPointSetMetricv4; @@ -362,7 +362,7 @@ class ITK_TEMPLATE_EXPORT TrimmedPointSetToPointSetMetricv4 } */ itkSetObjectMacro(Metric, Superclass); - itkGetConstObjectMacro(Metric, Superclass) + itkGetConstObjectMacro(Metric, Superclass); void SetFixedTransform( FixedTransformType *fixed) override @@ -393,7 +393,7 @@ class ITK_TEMPLATE_EXPORT TrimmedPointSetToPointSetMetricv4 } else { - itkExceptionMacro( "Percentile value must belong to (0;100]." ) + itkExceptionMacro( "Percentile value must belong to (0;100]." ); } } itkGetMacro( Percentile, unsigned int ); diff --git a/include/itkWeightedEuclideanDistancePointSetToPointSetMetricv4.h b/include/itkWeightedEuclideanDistancePointSetToPointSetMetricv4.h index d3902ca..b8c0850 100644 --- a/include/itkWeightedEuclideanDistancePointSetToPointSetMetricv4.h +++ b/include/itkWeightedEuclideanDistancePointSetToPointSetMetricv4.h @@ -33,7 +33,7 @@ class ITK_TEMPLATE_EXPORT WeightedEuclideanDistancePointSetToPointSetMetricv4: public PointSetToPointSetMetricv4 { public: - ITK_DISALLOW_COPY_AND_ASSIGN(WeightedEuclideanDistancePointSetToPointSetMetricv4); + ITK_DISALLOW_COPY_AND_MOVE(WeightedEuclideanDistancePointSetToPointSetMetricv4); /** Standard class type aliases. */ using Self = WeightedEuclideanDistancePointSetToPointSetMetricv4; diff --git a/pyproject.toml b/pyproject.toml index fdbc4fe..c4f17af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ classifiers = [ ] requires-python = ">=3.8" dependencies = [ - "itk == 5.4.*", + "itk >= 5.4", ] [project.urls] From 64629a18689c5223297c29f8e0ab1cb63c8aa5d3 Mon Sep 17 00:00:00 2001 From: "Hans J. Johnson" Date: Thu, 24 Sep 2026 09:48:41 -0500 Subject: [PATCH 2/4] STYLE: Fix Apache License URL missing its scheme letter Every source file's line 9 read http://www.apache.org, one letter short of the https:// KWStyle's ITKHeader.h template requires, so TrimmedPointSetRegistrationKWStyleTest failed on every file. Present since the module's initial commit. --- examples/TrimmedPointSetRegistrationExample.cxx | 2 +- include/itkTrimmedEuclideanDistancePointSetToPointSetMetricv4.h | 2 +- .../itkTrimmedEuclideanDistancePointSetToPointSetMetricv4.hxx | 2 +- include/itkTrimmedPointSetToPointSetMetricv4.h | 2 +- include/itkTrimmedPointSetToPointSetMetricv4.hxx | 2 +- .../itkWeightedEuclideanDistancePointSetToPointSetMetricv4.h | 2 +- .../itkWeightedEuclideanDistancePointSetToPointSetMetricv4.hxx | 2 +- test/itkTrimmedEuclideanDistancePointSetRegistrationTest.cxx | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/TrimmedPointSetRegistrationExample.cxx b/examples/TrimmedPointSetRegistrationExample.cxx index 70f157a..6133702 100644 --- a/examples/TrimmedPointSetRegistrationExample.cxx +++ b/examples/TrimmedPointSetRegistrationExample.cxx @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0.txt + * https://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/include/itkTrimmedEuclideanDistancePointSetToPointSetMetricv4.h b/include/itkTrimmedEuclideanDistancePointSetToPointSetMetricv4.h index 2021454..af634ce 100644 --- a/include/itkTrimmedEuclideanDistancePointSetToPointSetMetricv4.h +++ b/include/itkTrimmedEuclideanDistancePointSetToPointSetMetricv4.h @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0.txt + * https://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/include/itkTrimmedEuclideanDistancePointSetToPointSetMetricv4.hxx b/include/itkTrimmedEuclideanDistancePointSetToPointSetMetricv4.hxx index 24a2e41..141769e 100644 --- a/include/itkTrimmedEuclideanDistancePointSetToPointSetMetricv4.hxx +++ b/include/itkTrimmedEuclideanDistancePointSetToPointSetMetricv4.hxx @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0.txt + * https://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/include/itkTrimmedPointSetToPointSetMetricv4.h b/include/itkTrimmedPointSetToPointSetMetricv4.h index c9613a2..bda0b5d 100644 --- a/include/itkTrimmedPointSetToPointSetMetricv4.h +++ b/include/itkTrimmedPointSetToPointSetMetricv4.h @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0.txt + * https://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/include/itkTrimmedPointSetToPointSetMetricv4.hxx b/include/itkTrimmedPointSetToPointSetMetricv4.hxx index 841eb19..bcf1329 100644 --- a/include/itkTrimmedPointSetToPointSetMetricv4.hxx +++ b/include/itkTrimmedPointSetToPointSetMetricv4.hxx @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0.txt + * https://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/include/itkWeightedEuclideanDistancePointSetToPointSetMetricv4.h b/include/itkWeightedEuclideanDistancePointSetToPointSetMetricv4.h index b8c0850..2ef23a2 100644 --- a/include/itkWeightedEuclideanDistancePointSetToPointSetMetricv4.h +++ b/include/itkWeightedEuclideanDistancePointSetToPointSetMetricv4.h @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0.txt + * https://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/include/itkWeightedEuclideanDistancePointSetToPointSetMetricv4.hxx b/include/itkWeightedEuclideanDistancePointSetToPointSetMetricv4.hxx index 3099a30..a098322 100644 --- a/include/itkWeightedEuclideanDistancePointSetToPointSetMetricv4.hxx +++ b/include/itkWeightedEuclideanDistancePointSetToPointSetMetricv4.hxx @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0.txt + * https://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/test/itkTrimmedEuclideanDistancePointSetRegistrationTest.cxx b/test/itkTrimmedEuclideanDistancePointSetRegistrationTest.cxx index 4ce4b70..4728fa2 100644 --- a/test/itkTrimmedEuclideanDistancePointSetRegistrationTest.cxx +++ b/test/itkTrimmedEuclideanDistancePointSetRegistrationTest.cxx @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0.txt + * https://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, From c2e70aa55b3d6b9917ed85756077741638103061 Mon Sep 17 00:00:00 2001 From: "Hans J. Johnson" Date: Thu, 24 Sep 2026 09:48:49 -0500 Subject: [PATCH 3/4] DOC: Fix a bullet-list indent that broke the packaged README's rendering The last bullet in the TODO list used three leading spaces where every sibling used two, so docutils read it as starting a new nested list with no closing blank line. twine check failed the wheel on every platform with "Bullet list ends without a blank line; unexpected unindent." --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index e8914cf..e825153 100644 --- a/README.rst +++ b/README.rst @@ -47,6 +47,6 @@ TODO - Add a real world example. - Investigate Jensen unexpected behaviour in simple example. - Currently the point set metrics are not symmetric since the iterations is only over one fo the point sets. Consider adding symmetric versions. Or document the assymetric behaviour well. - - A decorator to the PointSetToPointSetMetricv4 that overrides the accumulation of the value and derivative computation to use a trimmed number of points is in the module as well, but is as of yet not functional. The issue is access to protected members in the base class that I think would need to be fixed in the base class. + - A decorator to the PointSetToPointSetMetricv4 that overrides the accumulation of the value and derivative computation to use a trimmed number of points is in the module as well, but is as of yet not functional. The issue is access to protected members in the base class that I think would need to be fixed in the base class. From 2bb4edcfbed22d4376bfa813423783950eeb7f8d Mon Sep 17 00:00:00 2001 From: "Hans J. Johnson" Date: Thu, 24 Sep 2026 11:19:01 -0500 Subject: [PATCH 4/4] COMP: Fix signed/unsigned loop-index mismatches MSVC's C4018 flagged four of these as build warnings, which ci_completed_successfully treats as fatal; the other three compile without warning here but are the identical mismatch and would surface the same way once the reported ones are fixed. All eight loop indices now match the unsigned type they are compared against. --- examples/TrimmedPointSetRegistrationExample.cxx | 12 ++++++------ ...edEuclideanDistancePointSetToPointSetMetricv4.hxx | 6 +++--- ...mmedEuclideanDistancePointSetRegistrationTest.cxx | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/TrimmedPointSetRegistrationExample.cxx b/examples/TrimmedPointSetRegistrationExample.cxx index 6133702..adeeeb0 100644 --- a/examples/TrimmedPointSetRegistrationExample.cxx +++ b/examples/TrimmedPointSetRegistrationExample.cxx @@ -113,14 +113,14 @@ void runRegistration( PointSetType::Pointer fixedPoints, PointType transformedMovingPoint = affineInverseTransform->TransformPoint( movingPoints->GetPoint( n ) ); myfile << "Moving"; - for(int i=0; iGetModifiableTransform()->TransformPoint( fixedPoints->GetPoint( n ) ); myfile << "Fixed"; - for(int i=0; i values( this->GetFixedTransformedPointSet()->GetNumberOfPoints() ); - for(int i=0; i < values.size(); i++) + for(size_t i=0; i < values.size(); i++) { values[i].value = NumericTraits::max(); values[i].index = i; @@ -223,7 +223,7 @@ TrimmedEuclideanDistancePointSetToPointSetMetricv4m_SamplingRate < 1.0 ) @@ -314,7 +314,7 @@ TrimmedEuclideanDistancePointSetToPointSetMetricv4GetVirtualTransformedPointSet()->GetPoints()->CastToSTLConstContainer(); unsigned int nValidDistances = 0; - for( int valueIndex=0; valueIndex < last_index; valueIndex++) + for( size_t valueIndex=0; valueIndex < last_index; valueIndex++) { PointDerivativeStorage &el = values[valueIndex]; PointIdentifier pointIndex = el.index; diff --git a/test/itkTrimmedEuclideanDistancePointSetRegistrationTest.cxx b/test/itkTrimmedEuclideanDistancePointSetRegistrationTest.cxx index 4728fa2..44480ae 100644 --- a/test/itkTrimmedEuclideanDistancePointSetRegistrationTest.cxx +++ b/test/itkTrimmedEuclideanDistancePointSetRegistrationTest.cxx @@ -99,7 +99,7 @@ int itkTrimmedEuclideanDistancePointSetRegistrationTest( int argc, char *argv[] // Generate two noisy ellipses unsigned int nSourcePoints= 1000; - for(int i=0; i< nSourcePoints; i++ ) + for(unsigned int i=0; i< nSourcePoints; i++ ) { float radius = 100.0; @@ -111,7 +111,7 @@ int itkTrimmedEuclideanDistancePointSetRegistrationTest( int argc, char *argv[] } unsigned int nTargetPoints= 1200; - for(int i=0; i< nTargetPoints; i++ ) + for(unsigned int i=0; i< nTargetPoints; i++ ) { float radius = 100.0;