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. 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/examples/TrimmedPointSetRegistrationExample.cxx b/examples/TrimmedPointSetRegistrationExample.cxx index 70f157a..adeeeb0 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, @@ -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 { 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/itkTrimmedEuclideanDistancePointSetToPointSetMetricv4.hxx b/include/itkTrimmedEuclideanDistancePointSetToPointSetMetricv4.hxx index 24a2e41..10395bd 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, @@ -186,7 +186,7 @@ TrimmedEuclideanDistancePointSetToPointSetMetricv4 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/include/itkTrimmedPointSetToPointSetMetricv4.h b/include/itkTrimmedPointSetToPointSetMetricv4.h index 17e2fea..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, @@ -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/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 d3902ca..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, @@ -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/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/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] diff --git a/test/itkTrimmedEuclideanDistancePointSetRegistrationTest.cxx b/test/itkTrimmedEuclideanDistancePointSetRegistrationTest.cxx index 4ce4b70..44480ae 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, @@ -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;