Skip to content

Commit

Permalink
STYLE: Replace Iterator it; it = x with Iterator it = x
Browse files Browse the repository at this point in the history
Using Notepad++, Replace in Files, doing:

    Find what: ^( [ ]+)([^ ][^=\r\n]*[Ii]terator[^=\r\n]*)([ ]+)(\w+[Ii]t);[\r\n]+\1\4\ =
    Replace with: $1$2$3$4 =
    Filters: itk*.* !+\test
    Directory: D:\src\ITK\Modules
    [v] Match case
    (*) Regular expression

- Follow-up to pull request #4964
commit 4926511
"STYLE: Replace `Pointer var; var = x` with `Pointer var = x`"
  • Loading branch information
N-Dekker authored and hjmjohnson committed Nov 21, 2024
1 parent 26b0378 commit 89b5bd0
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 112 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ MovingHistogramImageFilterBase<TInputImage, TOutputImage, TKernel>::SetKernel(co
tmpSEImage->SetRegions(kernel.GetSize());
tmpSEImage->Allocate();
RegionType tmpSEImageRegion = tmpSEImage->GetRequestedRegion();
ImageRegionIteratorWithIndex<BoolImageType> kernelImageIt;
kernelImageIt = ImageRegionIteratorWithIndex<BoolImageType>(tmpSEImage, tmpSEImageRegion);
ImageRegionIteratorWithIndex<BoolImageType> kernelImageIt =
ImageRegionIteratorWithIndex<BoolImageType>(tmpSEImage, tmpSEImageRegion);
KernelIteratorType kernel_it = kernel.Begin();
OffsetListType kernelOffsets;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,7 @@ template <typename TInputImage, typename TLabelImage>
auto
LabelStatisticsImageFilter<TInputImage, TLabelImage>::GetMinimum(LabelPixelType label) const -> RealType
{
MapConstIterator mapIt;

mapIt = m_LabelStatistics.find(label);
MapConstIterator mapIt = m_LabelStatistics.find(label);
if (mapIt == m_LabelStatistics.end())
{
// label does not exist, return a default value
Expand All @@ -289,9 +287,7 @@ template <typename TInputImage, typename TLabelImage>
auto
LabelStatisticsImageFilter<TInputImage, TLabelImage>::GetMaximum(LabelPixelType label) const -> RealType
{
MapConstIterator mapIt;

mapIt = m_LabelStatistics.find(label);
MapConstIterator mapIt = m_LabelStatistics.find(label);
if (mapIt == m_LabelStatistics.end())
{
// label does not exist, return a default value
Expand All @@ -307,9 +303,7 @@ template <typename TInputImage, typename TLabelImage>
auto
LabelStatisticsImageFilter<TInputImage, TLabelImage>::GetMean(LabelPixelType label) const -> RealType
{
MapConstIterator mapIt;

mapIt = m_LabelStatistics.find(label);
MapConstIterator mapIt = m_LabelStatistics.find(label);
if (mapIt == m_LabelStatistics.end())
{
// label does not exist, return a default value
Expand All @@ -325,9 +319,7 @@ template <typename TInputImage, typename TLabelImage>
auto
LabelStatisticsImageFilter<TInputImage, TLabelImage>::GetSum(LabelPixelType label) const -> RealType
{
MapConstIterator mapIt;

mapIt = m_LabelStatistics.find(label);
MapConstIterator mapIt = m_LabelStatistics.find(label);
if (mapIt == m_LabelStatistics.end())
{
// label does not exist, return a default value
Expand All @@ -343,9 +335,7 @@ template <typename TInputImage, typename TLabelImage>
auto
LabelStatisticsImageFilter<TInputImage, TLabelImage>::GetSigma(LabelPixelType label) const -> RealType
{
MapConstIterator mapIt;

mapIt = m_LabelStatistics.find(label);
MapConstIterator mapIt = m_LabelStatistics.find(label);
if (mapIt == m_LabelStatistics.end())
{
// label does not exist, return a default value
Expand All @@ -361,9 +351,7 @@ template <typename TInputImage, typename TLabelImage>
auto
LabelStatisticsImageFilter<TInputImage, TLabelImage>::GetVariance(LabelPixelType label) const -> RealType
{
MapConstIterator mapIt;

mapIt = m_LabelStatistics.find(label);
MapConstIterator mapIt = m_LabelStatistics.find(label);
if (mapIt == m_LabelStatistics.end())
{
// label does not exist, return a default value
Expand All @@ -379,9 +367,7 @@ template <typename TInputImage, typename TLabelImage>
auto
LabelStatisticsImageFilter<TInputImage, TLabelImage>::GetBoundingBox(LabelPixelType label) const -> BoundingBoxType
{
MapConstIterator mapIt;

mapIt = m_LabelStatistics.find(label);
MapConstIterator mapIt = m_LabelStatistics.find(label);
if (mapIt == m_LabelStatistics.end())
{
BoundingBoxType emptyBox;
Expand All @@ -398,9 +384,7 @@ template <typename TInputImage, typename TLabelImage>
auto
LabelStatisticsImageFilter<TInputImage, TLabelImage>::GetRegion(LabelPixelType label) const -> RegionType
{
MapConstIterator mapIt;

mapIt = m_LabelStatistics.find(label);
MapConstIterator mapIt = m_LabelStatistics.find(label);

if (mapIt == m_LabelStatistics.end())
{
Expand Down Expand Up @@ -429,9 +413,7 @@ template <typename TInputImage, typename TLabelImage>
auto
LabelStatisticsImageFilter<TInputImage, TLabelImage>::GetCount(LabelPixelType label) const -> MapSizeType
{
MapConstIterator mapIt;

mapIt = m_LabelStatistics.find(label);
MapConstIterator mapIt = m_LabelStatistics.find(label);
if (mapIt == m_LabelStatistics.end())
{
// label does not exist, return a default value
Expand All @@ -448,9 +430,7 @@ auto
LabelStatisticsImageFilter<TInputImage, TLabelImage>::GetMedian(LabelPixelType label) const -> RealType
{
RealType median = 0.0;
MapConstIterator mapIt;

mapIt = m_LabelStatistics.find(label);
MapConstIterator mapIt = m_LabelStatistics.find(label);
if (mapIt == m_LabelStatistics.end() || !m_UseHistograms)
{
// label does not exist OR histograms not enabled, return the default value
Expand Down Expand Up @@ -486,9 +466,7 @@ template <typename TInputImage, typename TLabelImage>
auto
LabelStatisticsImageFilter<TInputImage, TLabelImage>::GetHistogram(LabelPixelType label) const -> HistogramPointer
{
MapConstIterator mapIt;

mapIt = m_LabelStatistics.find(label);
MapConstIterator mapIt = m_LabelStatistics.find(label);
if (mapIt == m_LabelStatistics.end())
{
// label does not exist, return a default value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,7 @@ MakeEnlargedFace(const typename TInputImage::ConstPointer itkNotUsed(input),
faceList.push_back(R2);
// std::cout << R1 << R2 << std::endl;
}
typename FaceListType::iterator fit;
fit = faceList.begin();
typename FaceListType::iterator fit = faceList.begin();

typename TInputImage::RegionType RelevantRegion;
bool foundFace = false;
Expand Down
84 changes: 21 additions & 63 deletions Modules/Nonunit/Review/include/itkLabelGeometryImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -569,9 +569,7 @@ template <typename TLabelImage, typename TIntensityImage>
auto
LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GetPixelIndices(LabelPixelType label) const -> LabelIndicesType
{
MapConstIterator mapIt;

mapIt = m_LabelGeometryMapper.find(label);
MapConstIterator mapIt = m_LabelGeometryMapper.find(label);
if (mapIt == m_LabelGeometryMapper.end())
{
// label does not exist, return a default value
Expand All @@ -589,9 +587,7 @@ template <typename TLabelImage, typename TIntensityImage>
SizeValueType
LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GetVolume(LabelPixelType label) const
{
MapConstIterator mapIt;

mapIt = m_LabelGeometryMapper.find(label);
MapConstIterator mapIt = m_LabelGeometryMapper.find(label);
if (mapIt == m_LabelGeometryMapper.end())
{
// label does not exist, return a default value
Expand All @@ -607,9 +603,7 @@ template <typename TLabelImage, typename TIntensityImage>
auto
LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GetIntegratedIntensity(LabelPixelType label) const -> RealType
{
MapConstIterator mapIt;

mapIt = m_LabelGeometryMapper.find(label);
MapConstIterator mapIt = m_LabelGeometryMapper.find(label);
if (mapIt == m_LabelGeometryMapper.end())
{
// label does not exist, return a default value
Expand All @@ -625,9 +619,7 @@ template <typename TLabelImage, typename TIntensityImage>
auto
LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GetCentroid(LabelPixelType label) const -> LabelPointType
{
MapConstIterator mapIt;

mapIt = m_LabelGeometryMapper.find(label);
MapConstIterator mapIt = m_LabelGeometryMapper.find(label);
if (mapIt == m_LabelGeometryMapper.end())
{
// label does not exist, return a default value
Expand All @@ -645,9 +637,7 @@ auto
LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GetWeightedCentroid(LabelPixelType label) const
-> LabelPointType
{
MapConstIterator mapIt;

mapIt = m_LabelGeometryMapper.find(label);
MapConstIterator mapIt = m_LabelGeometryMapper.find(label);
if (mapIt == m_LabelGeometryMapper.end())
{
// label does not exist, return a default value
Expand All @@ -664,9 +654,7 @@ template <typename TLabelImage, typename TIntensityImage>
auto
LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GetEigenvalues(LabelPixelType label) const -> VectorType
{
MapConstIterator mapIt;

mapIt = m_LabelGeometryMapper.find(label);
MapConstIterator mapIt = m_LabelGeometryMapper.find(label);
if (mapIt == m_LabelGeometryMapper.end())
{
// label does not exist, return a default value
Expand All @@ -683,9 +671,7 @@ template <typename TLabelImage, typename TIntensityImage>
auto
LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GetEigenvectors(LabelPixelType label) const -> MatrixType
{
MapConstIterator mapIt;

mapIt = m_LabelGeometryMapper.find(label);
MapConstIterator mapIt = m_LabelGeometryMapper.find(label);
if (mapIt == m_LabelGeometryMapper.end())
{
// label does not exist, return a default value
Expand All @@ -702,9 +688,7 @@ template <typename TLabelImage, typename TIntensityImage>
auto
LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GetAxesLength(LabelPixelType label) const -> AxesLengthType
{
MapConstIterator mapIt;

mapIt = m_LabelGeometryMapper.find(label);
MapConstIterator mapIt = m_LabelGeometryMapper.find(label);
if (mapIt == m_LabelGeometryMapper.end())
{
// label does not exist, return a default value
Expand Down Expand Up @@ -739,9 +723,7 @@ template <typename TLabelImage, typename TIntensityImage>
auto
LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GetEccentricity(LabelPixelType label) const -> RealType
{
MapConstIterator mapIt;

mapIt = m_LabelGeometryMapper.find(label);
MapConstIterator mapIt = m_LabelGeometryMapper.find(label);
if (mapIt == m_LabelGeometryMapper.end())
{
// label does not exist, return a default value
Expand All @@ -757,9 +739,7 @@ template <typename TLabelImage, typename TIntensityImage>
auto
LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GetElongation(LabelPixelType label) const -> RealType
{
MapConstIterator mapIt;

mapIt = m_LabelGeometryMapper.find(label);
MapConstIterator mapIt = m_LabelGeometryMapper.find(label);
if (mapIt == m_LabelGeometryMapper.end())
{
// label does not exist, return a default value
Expand All @@ -775,9 +755,7 @@ template <typename TLabelImage, typename TIntensityImage>
auto
LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GetOrientation(LabelPixelType label) const -> RealType
{
MapConstIterator mapIt;

mapIt = m_LabelGeometryMapper.find(label);
MapConstIterator mapIt = m_LabelGeometryMapper.find(label);
if (mapIt == m_LabelGeometryMapper.end())
{
// label does not exist, return a default value
Expand All @@ -793,9 +771,7 @@ template <typename TLabelImage, typename TIntensityImage>
auto
LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GetBoundingBox(LabelPixelType label) const -> BoundingBoxType
{
MapConstIterator mapIt;

mapIt = m_LabelGeometryMapper.find(label);
MapConstIterator mapIt = m_LabelGeometryMapper.find(label);
if (mapIt == m_LabelGeometryMapper.end())
{
BoundingBoxType emptyBox{};
Expand All @@ -812,9 +788,7 @@ template <typename TLabelImage, typename TIntensityImage>
auto
LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GetBoundingBoxVolume(LabelPixelType label) const -> RealType
{
MapConstIterator mapIt;

mapIt = m_LabelGeometryMapper.find(label);
MapConstIterator mapIt = m_LabelGeometryMapper.find(label);
if (mapIt == m_LabelGeometryMapper.end())
{
// label does not exist, return a default value
Expand All @@ -830,9 +804,7 @@ template <typename TLabelImage, typename TIntensityImage>
auto
LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GetBoundingBoxSize(LabelPixelType label) const -> LabelSizeType
{
MapConstIterator mapIt;

mapIt = m_LabelGeometryMapper.find(label);
MapConstIterator mapIt = m_LabelGeometryMapper.find(label);
if (mapIt == m_LabelGeometryMapper.end())
{
// label does not exist, return a default value
Expand Down Expand Up @@ -871,9 +843,7 @@ auto
LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GetOrientedBoundingBoxVolume(LabelPixelType label) const
-> RealType
{
MapConstIterator mapIt;

mapIt = m_LabelGeometryMapper.find(label);
MapConstIterator mapIt = m_LabelGeometryMapper.find(label);
if (mapIt == m_LabelGeometryMapper.end())
{
// label does not exist, return a default value
Expand All @@ -890,9 +860,7 @@ auto
LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GetOrientedBoundingBoxSize(LabelPixelType label) const
-> LabelPointType
{
MapConstIterator mapIt;

mapIt = m_LabelGeometryMapper.find(label);
MapConstIterator mapIt = m_LabelGeometryMapper.find(label);
if (mapIt == m_LabelGeometryMapper.end())
{
// label does not exist, return a default value
Expand All @@ -913,9 +881,7 @@ auto
LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GetOrientedBoundingBoxOrigin(LabelPixelType label) const
-> LabelPointType
{
MapConstIterator mapIt;

mapIt = m_LabelGeometryMapper.find(label);
MapConstIterator mapIt = m_LabelGeometryMapper.find(label);
if (mapIt == m_LabelGeometryMapper.end())
{
// label does not exist, return a default value
Expand All @@ -932,9 +898,7 @@ template <typename TLabelImage, typename TIntensityImage>
auto
LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GetRotationMatrix(LabelPixelType label) const -> MatrixType
{
MapConstIterator mapIt;

mapIt = m_LabelGeometryMapper.find(label);
MapConstIterator mapIt = m_LabelGeometryMapper.find(label);
if (mapIt == m_LabelGeometryMapper.end())
{
// label does not exist, return a default value
Expand All @@ -951,9 +915,7 @@ template <typename TLabelImage, typename TIntensityImage>
auto
LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GetRegion(LabelPixelType label) const -> RegionType
{
MapConstIterator mapIt;

mapIt = m_LabelGeometryMapper.find(label);
MapConstIterator mapIt = m_LabelGeometryMapper.find(label);

if (mapIt == m_LabelGeometryMapper.end())
{
Expand Down Expand Up @@ -986,9 +948,7 @@ template <typename TLabelImage, typename TIntensityImage>
TLabelImage *
LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GetOrientedLabelImage(LabelPixelType label) const
{
MapConstIterator mapIt;

mapIt = m_LabelGeometryMapper.find(label);
MapConstIterator mapIt = m_LabelGeometryMapper.find(label);
if (mapIt == m_LabelGeometryMapper.end())
{
// label does not exist, return a default value
Expand All @@ -1004,9 +964,7 @@ template <typename TLabelImage, typename TIntensityImage>
TIntensityImage *
LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GetOrientedIntensityImage(LabelPixelType label) const
{
MapConstIterator mapIt;

mapIt = m_LabelGeometryMapper.find(label);
MapConstIterator mapIt = m_LabelGeometryMapper.find(label);
if (mapIt == m_LabelGeometryMapper.end())
{
// label does not exist, return a default value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1293,8 +1293,7 @@ MultiphaseSparseFiniteDifferenceImageFilter<TInputImage, TFeatureImage, TOutputI
NeighborhoodIterator<StatusImageType> statusIt(
m_NeighborList.GetRadius(), sparsePtr->m_StatusImage, this->m_LevelSet[sparsePtr->m_Index]->GetRequestedRegion());

typename LayerType::ConstIterator fromIt;
fromIt = sparsePtr->m_Layers[from]->Begin();
typename LayerType::ConstIterator fromIt = sparsePtr->m_Layers[from]->Begin();

// For all indices in the "from" layer...
while (fromIt != sparsePtr->m_Layers[from]->End())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ WarpHarmonicEnergyCalculator<TInputImage>::Compute()
typename NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<ImageType>::FaceListType faceList =
bC(m_Image, m_Region, m_NeighborhoodRadius);

typename NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<ImageType>::FaceListType::iterator fIt;
fIt = faceList.begin();
typename NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<ImageType>::FaceListType::iterator fIt =
faceList.begin();

// Process each of the data set faces. The iterator is reinitialized on each
// face so that it can determine whether or not to check for boundary
Expand Down
Loading

0 comments on commit 89b5bd0

Please sign in to comment.