From 74bd407c75e2c116b8ba5c0a9d681fab6239c8b5 Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Wed, 20 Nov 2024 23:46:23 +0100 Subject: [PATCH] STYLE: Replace `Iterator it = Iterator(x)` with `Iterator it(x)` Small style improvement to the previous commit. - Following pull request https://github.com/InsightSoftwareConsortium/ITK/pull/3959 commit ef24b65d020d700d8bebf0cb086695322acb0404 "STYLE: Construct local variables by passing arguments directly (part 2)", 11 March, 2023 --- .../include/itkMovingHistogramImageFilterBase.hxx | 7 +++---- .../include/itkImageToNeighborhoodSampleAdaptor.hxx | 6 +++--- .../include/itkConnectedComponentFunctorImageFilter.hxx | 3 +-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Modules/Filtering/ImageFilterBase/include/itkMovingHistogramImageFilterBase.hxx b/Modules/Filtering/ImageFilterBase/include/itkMovingHistogramImageFilterBase.hxx index b7c2f4a43ca..e91052e0098 100644 --- a/Modules/Filtering/ImageFilterBase/include/itkMovingHistogramImageFilterBase.hxx +++ b/Modules/Filtering/ImageFilterBase/include/itkMovingHistogramImageFilterBase.hxx @@ -52,10 +52,9 @@ MovingHistogramImageFilterBase::SetKernel(co tmpSEImage->SetRegions(kernel.GetSize()); tmpSEImage->Allocate(); RegionType tmpSEImageRegion = tmpSEImage->GetRequestedRegion(); - ImageRegionIteratorWithIndex kernelImageIt = - ImageRegionIteratorWithIndex(tmpSEImage, tmpSEImageRegion); - KernelIteratorType kernel_it = kernel.Begin(); - OffsetListType kernelOffsets; + ImageRegionIteratorWithIndex kernelImageIt(tmpSEImage, tmpSEImageRegion); + KernelIteratorType kernel_it = kernel.Begin(); + OffsetListType kernelOffsets; // create a center index to compute the offset IndexType centerIndex; diff --git a/Modules/Numerics/Statistics/include/itkImageToNeighborhoodSampleAdaptor.hxx b/Modules/Numerics/Statistics/include/itkImageToNeighborhoodSampleAdaptor.hxx index 36dfee7b164..3d043a54da7 100644 --- a/Modules/Numerics/Statistics/include/itkImageToNeighborhoodSampleAdaptor.hxx +++ b/Modules/Numerics/Statistics/include/itkImageToNeighborhoodSampleAdaptor.hxx @@ -126,7 +126,7 @@ ImageToNeighborhoodSampleAdaptor::SetImage(const TIm { m_Region = m_Image->GetLargestPossibleRegion(); } - NeighborhoodIteratorType neighborIt = NeighborhoodIteratorType(m_Radius, m_Image, m_Region); + NeighborhoodIteratorType neighborIt(m_Radius, m_Image, m_Region); neighborIt.GoToBegin(); m_NeighborIndexInternal = neighborIt.GetBeginIndex(); m_MeasurementVectorInternal.clear(); @@ -158,7 +158,7 @@ ImageToNeighborhoodSampleAdaptor::SetRadius(const Ne m_Radius = radius; if (m_Image.IsNotNull()) { - NeighborhoodIteratorType neighborIt = NeighborhoodIteratorType(m_Radius, m_Image, m_Region); + NeighborhoodIteratorType neighborIt(m_Radius, m_Image, m_Region); neighborIt.GoToBegin(); m_NeighborIndexInternal = neighborIt.GetBeginIndex(); m_MeasurementVectorInternal.clear(); @@ -186,7 +186,7 @@ ImageToNeighborhoodSampleAdaptor::SetRegion(const Re m_UseImageRegion = false; if (m_Image.IsNotNull()) { - NeighborhoodIteratorType neighborIt = NeighborhoodIteratorType(m_Radius, m_Image, m_Region); + NeighborhoodIteratorType neighborIt(m_Radius, m_Image, m_Region); neighborIt.GoToBegin(); m_NeighborIndexInternal = neighborIt.GetBeginIndex(); m_MeasurementVectorInternal.clear(); diff --git a/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentFunctorImageFilter.hxx b/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentFunctorImageFilter.hxx index 594a0ec7289..7f92909038e 100644 --- a/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentFunctorImageFilter.hxx +++ b/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentFunctorImageFilter.hxx @@ -109,8 +109,7 @@ ConnectedComponentFunctorImageFilterGetMaskImage(); if (mask) { - ImageRegionConstIterator mit = - ImageRegionConstIterator(mask, output->GetRequestedRegion()); + ImageRegionConstIterator mit(mask, output->GetRequestedRegion()); mit.GoToBegin(); oit.GoToBegin();