Skip to content

Commit

Permalink
STYLE: Replace Iterator it = Iterator(x) with Iterator it(x)
Browse files Browse the repository at this point in the history
Small style improvement to the previous commit.

- Following pull request #3959
commit ef24b65
"STYLE: Construct local variables by passing arguments directly (part 2)",
11 March, 2023
  • Loading branch information
N-Dekker authored and hjmjohnson committed Nov 21, 2024
1 parent 89b5bd0 commit c35278c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ MovingHistogramImageFilterBase<TInputImage, TOutputImage, TKernel>::SetKernel(co
tmpSEImage->SetRegions(kernel.GetSize());
tmpSEImage->Allocate();
RegionType tmpSEImageRegion = tmpSEImage->GetRequestedRegion();
ImageRegionIteratorWithIndex<BoolImageType> kernelImageIt =
ImageRegionIteratorWithIndex<BoolImageType>(tmpSEImage, tmpSEImageRegion);
KernelIteratorType kernel_it = kernel.Begin();
OffsetListType kernelOffsets;
ImageRegionIteratorWithIndex<BoolImageType> kernelImageIt(tmpSEImage, tmpSEImageRegion);
KernelIteratorType kernel_it = kernel.Begin();
OffsetListType kernelOffsets;

// create a center index to compute the offset
IndexType centerIndex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ ImageToNeighborhoodSampleAdaptor<TImage, TBoundaryCondition>::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();
Expand Down Expand Up @@ -158,7 +158,7 @@ ImageToNeighborhoodSampleAdaptor<TImage, TBoundaryCondition>::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();
Expand Down Expand Up @@ -186,7 +186,7 @@ ImageToNeighborhoodSampleAdaptor<TImage, TBoundaryCondition>::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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ ConnectedComponentFunctorImageFilter<TInputImage, TOutputImage, TFunctor, TMaskI
typename TMaskImage::ConstPointer mask = this->GetMaskImage();
if (mask)
{
ImageRegionConstIterator<MaskImageType> mit =
ImageRegionConstIterator<MaskImageType>(mask, output->GetRequestedRegion());
ImageRegionConstIterator<MaskImageType> mit(mask, output->GetRequestedRegion());

mit.GoToBegin();
oit.GoToBegin();
Expand Down

0 comments on commit c35278c

Please sign in to comment.