Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.


3 changes: 3 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 7 additions & 7 deletions examples/TrimmedPointSetRegistrationExample.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -113,14 +113,14 @@ void runRegistration( PointSetType::Pointer fixedPoints,
PointType transformedMovingPoint =
affineInverseTransform->TransformPoint( movingPoints->GetPoint( n ) );
myfile << "Moving";
for(int i=0; i<PointType::PointDimension; i++)
for(unsigned int i=0; i<PointType::PointDimension; i++)
{
myfile << ", " << movingPoint[i];
}
myfile << std::endl;

myfile << "MovingTransformed";
for(int i=0; i<PointType::PointDimension; i++)
for(unsigned int i=0; i<PointType::PointDimension; i++)
{
myfile << ", " << transformedMovingPoint[i];
}
Expand All @@ -133,14 +133,14 @@ void runRegistration( PointSetType::Pointer fixedPoints,
PointType transformedFixedPoint =
affineSimple->GetModifiableTransform()->TransformPoint( fixedPoints->GetPoint( n ) );
myfile << "Fixed";
for(int i=0; i<PointType::PointDimension; i++)
for(unsigned int i=0; i<PointType::PointDimension; i++)
{
myfile << ", " << fixedPoint[i];
}
myfile << std::endl;

myfile << "FixedTransformed";
for(int i=0; i<PointType::PointDimension; i++)
for(unsigned int i=0; i<PointType::PointDimension; i++)
{
myfile << ", " << transformedFixedPoint[i];
}
Expand Down Expand Up @@ -178,7 +178,7 @@ int main( int argc, char *argv[] )

// Generate two noisy ellipses
unsigned int nSourcePoints= 4000;
for(int i=0; i< nSourcePoints; i++ )
for(unsigned int i=0; i< nSourcePoints; i++ )
{
float radius = 100.0;

Expand All @@ -190,7 +190,7 @@ int main( int argc, char *argv[] )
}

unsigned int nTargetPoints= 4200;
for(int i=0; i< nTargetPoints; i++ )
for(unsigned int i=0; i< nTargetPoints; i++ )
{
float radius = 100.0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -36,7 +36,7 @@ class ITK_TEMPLATE_EXPORT TrimmedEuclideanDistancePointSetToPointSetMetricv4
: public EuclideanDistancePointSetToPointSetMetricv4<TFixedPointSet, TMovingPointSet, TInternalComputationValueType>
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(TrimmedEuclideanDistancePointSetToPointSetMetricv4);
ITK_DISALLOW_COPY_AND_MOVE(TrimmedEuclideanDistancePointSetToPointSetMetricv4);

/** Standard class type aliases. */
using Self = TrimmedEuclideanDistancePointSetToPointSetMetricv4;
Expand Down Expand Up @@ -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 );
Expand All @@ -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 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -186,7 +186,7 @@ TrimmedEuclideanDistancePointSetToPointSetMetricv4<TFixedPointSet, TMovingPointS

//Collect derviatives at each point
std::vector< PointDerivativeStorage > 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<MeasureType>::max();
values[i].index = i;
Expand Down Expand Up @@ -223,7 +223,7 @@ TrimmedEuclideanDistancePointSetToPointSetMetricv4<TFixedPointSet, TMovingPointS
/* Verify the virtual point is in the virtual domain.
* If user hasn't defined a virtual space, and the active transform is not
* a displacement field transform type, then this will always return true. */
for(int index = ranges[rangeIndex].first; index<ranges[rangeIndex].second; index++)
for(PointIdentifier index = ranges[rangeIndex].first; index<ranges[rangeIndex].second; index++)
{

if(this->m_SamplingRate < 1.0 )
Expand Down Expand Up @@ -314,7 +314,7 @@ TrimmedEuclideanDistancePointSetToPointSetMetricv4<TFixedPointSet, TMovingPointS
const VirtualVectorContainer &virtualTransformedPointSet =
this->GetVirtualTransformedPointSet()->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;
Expand Down
8 changes: 4 additions & 4 deletions include/itkTrimmedPointSetToPointSetMetricv4.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -34,7 +34,7 @@ class ITK_TEMPLATE_EXPORT TrimmedPointSetToPointSetMetricv4
: public EuclideanDistancePointSetToPointSetMetricv4<TFixedPointSet, TMovingPointSet, TInternalComputationValueType>
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(TrimmedPointSetToPointSetMetricv4);
ITK_DISALLOW_COPY_AND_MOVE(TrimmedPointSetToPointSetMetricv4);

/** Standard class type aliases. */
using Self = TrimmedPointSetToPointSetMetricv4;
Expand Down Expand Up @@ -362,7 +362,7 @@ class ITK_TEMPLATE_EXPORT TrimmedPointSetToPointSetMetricv4
}
*/
itkSetObjectMacro(Metric, Superclass);
itkGetConstObjectMacro(Metric, Superclass)
itkGetConstObjectMacro(Metric, Superclass);


void SetFixedTransform( FixedTransformType *fixed) override
Expand Down Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion include/itkTrimmedPointSetToPointSetMetricv4.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -33,7 +33,7 @@ class ITK_TEMPLATE_EXPORT WeightedEuclideanDistancePointSetToPointSetMetricv4:
public PointSetToPointSetMetricv4<TFixedPointSet, TMovingPointSet, TInternalComputationValueType>
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(WeightedEuclideanDistancePointSetToPointSetMetricv4);
ITK_DISALLOW_COPY_AND_MOVE(WeightedEuclideanDistancePointSetToPointSetMetricv4);

/** Standard class type aliases. */
using Self = WeightedEuclideanDistancePointSetToPointSetMetricv4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ classifiers = [
]
requires-python = ">=3.8"
dependencies = [
"itk == 5.4.*",
"itk >= 5.4",
]

[project.urls]
Expand Down
6 changes: 3 additions & 3 deletions test/itkTrimmedEuclideanDistancePointSetRegistrationTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;

Expand All @@ -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;

Expand Down
Loading