diff --git a/include/itkConfidenceConnectedSegmentationModule.hxx b/include/itkConfidenceConnectedSegmentationModule.hxx index f1ffce8..0c57a4d 100644 --- a/include/itkConfidenceConnectedSegmentationModule.hxx +++ b/include/itkConfidenceConnectedSegmentationModule.hxx @@ -74,11 +74,9 @@ ConfidenceConnectedSegmentationModule::GenerateData() const LandmarkPointListType & points = inputSeeds->GetPoints(); - IndexType index; - for (unsigned int i = 0; i < numberOfPoints; i++) { - featureImage->TransformPhysicalPointToIndex(points[i].GetPositionInObjectSpace(), index); + const IndexType index = featureImage->TransformPhysicalPointToIndex(points[i].GetPositionInObjectSpace()); filter->AddSeed(index); } diff --git a/include/itkConnectedThresholdSegmentationModule.hxx b/include/itkConnectedThresholdSegmentationModule.hxx index ed48c03..b247668 100644 --- a/include/itkConnectedThresholdSegmentationModule.hxx +++ b/include/itkConnectedThresholdSegmentationModule.hxx @@ -74,11 +74,9 @@ ConnectedThresholdSegmentationModule::GenerateData() const LandmarkPointListType & points = inputSeeds->GetPoints(); - IndexType index; - for (unsigned int i = 0; i < numberOfPoints; i++) { - featureImage->TransformPhysicalPointToIndex(points[i].GetPositionInObjectSpace(), index); + const IndexType index = featureImage->TransformPhysicalPointToIndex(points[i].GetPositionInObjectSpace()); filter->AddSeed(index); } diff --git a/include/itkFastMarchingSegmentationModule.hxx b/include/itkFastMarchingSegmentationModule.hxx index 85b9395..2a1a66e 100644 --- a/include/itkFastMarchingSegmentationModule.hxx +++ b/include/itkFastMarchingSegmentationModule.hxx @@ -101,11 +101,10 @@ FastMarchingSegmentationModule::GenerateData() const LandmarkPointListType & points = inputSeeds->GetPoints(); - IndexType index; for (unsigned int i = 0; i < numberOfPoints; i++) { - featureImage->TransformPhysicalPointToIndex(points[i].GetPositionInObjectSpace(), index); + const IndexType index = featureImage->TransformPhysicalPointToIndex(points[i].GetPositionInObjectSpace()); NodeType node; diff --git a/src/itkImageReadRegionOfInterestAroundSeedWrite.cxx b/src/itkImageReadRegionOfInterestAroundSeedWrite.cxx index 633ba1e..f5a433c 100644 --- a/src/itkImageReadRegionOfInterestAroundSeedWrite.cxx +++ b/src/itkImageReadRegionOfInterestAroundSeedWrite.cxx @@ -114,9 +114,7 @@ main(int argc, char ** argv) const InputImageType * inputImage = reader->GetOutput(); - InputImageType::IndexType centralIndex; - - inputImage->TransformPhysicalPointToIndex(seedPoint, centralIndex); + InputImageType::IndexType centralIndex = inputImage->TransformPhysicalPointToIndex(seedPoint); InputImageType::SpacingType spacing = inputImage->GetSpacing();