From e06e20113ab22196eb029dafbd4152ef0324ca58 Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Wed, 13 Nov 2024 16:56:28 +0100 Subject: [PATCH] STYLE: Replace `T var; var = x` with `T var = x` Using Notepad++, Replace in Files, doing: Find what: ^( [ ]+)([^ ][^=\r\n]*)([ ]+)(\w+);[\r\n]+\1\4\ = Replace with: $1$2$3$4 = Filters: itk*.* !+\test Directory: D:\src\ITK\Modules [v] Match case (*) Regular expression Excluded ConceptChecking, ImageKmeansModelEstimator, MahalanobisDistanceThresholdImageFunction::SetCovariance, QuasiNewtonOptimizerv4Template, VariableSizeMatrix::operator* --- .../Common/include/itkAnnulusOperator.hxx | 4 +- ...tkConstNeighborhoodIteratorWithOnlyIndex.h | 6 +- .../Common/include/itkLaplacianOperator.hxx | 4 +- .../include/itkGPUInPlaceImageFilter.hxx | 4 +- .../GPUCommon/include/itkGPUKernelManager.h | 4 +- .../GPUCommon/src/itkGPUKernelManager.cxx | 27 +++--- Modules/Core/GPUCommon/src/itkOpenCLUtil.cxx | 4 +- .../include/itkNthElementPixelAccessor.h | 4 +- .../include/itkVectorImageToImageAdaptor.h | 4 +- .../include/itkMeanImageFunction.hxx | 4 +- .../itkNeighborhoodOperatorImageFunction.h | 6 +- .../include/itkSumOfSquaresImageFunction.hxx | 4 +- .../include/itkConnectedRegionsMeshFilter.hxx | 3 +- .../include/itkContourSpatialObject.hxx | 6 +- .../include/itkQuaternionRigidTransform.hxx | 4 +- .../include/itkBinaryPruningImageFilter.hxx | 3 +- ...kedFFTNormalizedCorrelationImageFilter.hxx | 6 +- ...tkBinaryMinMaxCurvatureFlowImageFilter.hxx | 3 +- .../include/itkCurvatureFlowImageFilter.hxx | 3 +- .../itkMinMaxCurvatureFlowFunction.hxx | 3 +- .../itkMinMaxCurvatureFlowImageFilter.hxx | 3 +- .../itkPatchBasedDenoisingBaseImageFilter.hxx | 3 +- .../include/itkFastMarchingImageFilter.hxx | 3 +- ...essian3DToVesselnessMeasureImageFilter.hxx | 4 +- .../itkMovingHistogramImageFilterBase.hxx | 4 +- .../itkVectorGradientMagnitudeImageFilter.h | 4 +- .../itkBSplineControlPointImageFilter.hxx | 3 +- .../itkBSplineResampleImageFilterBase.hxx | 12 +-- ...lineScatteredDataPointSetToImageFilter.hxx | 3 +- .../include/itkShrinkImageFilter.hxx | 3 +- .../include/itkAdaptImageFilter.h | 4 +- .../include/itkPolylineMaskImageFilter.hxx | 11 +-- .../include/itkScanlineFilterCommon.h | 6 +- .../include/itkLabelStatisticsImageFilter.hxx | 44 +++------- .../include/itkInPlaceLabelMapFilter.hxx | 4 +- ...tkGrayscaleConnectedClosingImageFilter.hxx | 6 +- ...tkGrayscaleConnectedOpeningImageFilter.hxx | 6 +- .../itkGrayscaleFillholeImageFilter.hxx | 3 +- .../itkGrayscaleGrindPeakImageFilter.hxx | 3 +- .../include/itkSharedMorphologyUtilities.hxx | 3 +- .../itkValuedRegionalExtremaImageFilter.hxx | 3 +- .../Path/include/itkParametricPath.hxx | 4 +- .../itkRecursiveGaussianImageFilter.hxx | 3 +- .../include/itkLabelGeometryImageFilter.hxx | 84 +++++-------------- ...phaseSparseFiniteDifferenceImageFilter.hxx | 3 +- .../itkScalarRegionBasedLevelSetFunction.hxx | 3 +- .../itkWarpHarmonicEnergyCalculator.hxx | 4 +- .../FEM/include/itkFEMRobustSolver.hxx | 6 +- .../itkFEMElement2DC0QuadraticTriangular.cxx | 4 +- .../src/itkFEMLinearSystemWrapperDenseVNL.cxx | 3 +- .../src/itkParticleSwarmOptimizerBase.cxx | 9 +- ...istrationParameterScalesFromIndexShift.hxx | 6 +- .../itkImageToNeighborhoodSampleAdaptor.hxx | 9 +- .../include/itkSampleClassifierFilter.hxx | 3 +- ...tkGradientDifferenceImageToImageMetric.hxx | 4 +- ...ocalSquareDifferenceImageToImageMetric.hxx | 4 +- .../FEM/include/itkFEMRegistrationFilter.hxx | 4 +- .../itkGPUDemonsRegistrationFilter.hxx | 4 +- .../itkCurvatureRegistrationFilter.hxx | 3 +- .../include/itkDemonsRegistrationFilter.hxx | 3 +- ...kDiffeomorphicDemonsRegistrationFilter.hxx | 3 +- ...ymmetricForcesDemonsRegistrationFilter.hxx | 3 +- .../itkLevelSetMotionRegistrationFilter.hxx | 3 +- ...ymmetricForcesDemonsRegistrationFilter.hxx | 3 +- ...tkConnectedComponentFunctorImageFilter.hxx | 4 +- .../include/itkKLMRegionGrowImageFilter.hxx | 3 +- .../itkExtensionVelocitiesImageFilter.hxx | 9 +- .../itkLevelSetNeighborhoodExtractor.hxx | 4 +- .../itkSparseFieldLevelSetImageFilter.hxx | 3 +- .../include/itkTobogganImageFilter.hxx | 6 +- .../include/itkWatershedSegmentTable.hxx | 3 +- 71 files changed, 136 insertions(+), 312 deletions(-) diff --git a/Modules/Core/Common/include/itkAnnulusOperator.hxx b/Modules/Core/Common/include/itkAnnulusOperator.hxx index abe3ff0fd88..d498eb3d085 100644 --- a/Modules/Core/Common/include/itkAnnulusOperator.hxx +++ b/Modules/Core/Common/include/itkAnnulusOperator.hxx @@ -30,9 +30,7 @@ template void AnnulusOperator::CreateOperator() { - CoefficientVector coefficients; - - coefficients = this->GenerateCoefficients(); + CoefficientVector coefficients = this->GenerateCoefficients(); this->Fill(coefficients); } diff --git a/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.h b/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.h index 043a4abb0fb..234b93a3dd6 100644 --- a/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.h +++ b/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.h @@ -409,8 +409,7 @@ inline ConstNeighborhoodIteratorWithOnlyIndex operator+(const ConstNeighborhoodIteratorWithOnlyIndex & it, const typename ConstNeighborhoodIteratorWithOnlyIndex::OffsetType & ind) { - ConstNeighborhoodIteratorWithOnlyIndex ret; - ret = it; + ConstNeighborhoodIteratorWithOnlyIndex ret = it; ret += ind; return ret; } @@ -428,8 +427,7 @@ inline ConstNeighborhoodIteratorWithOnlyIndex operator-(const ConstNeighborhoodIteratorWithOnlyIndex & it, const typename ConstNeighborhoodIteratorWithOnlyIndex::OffsetType & ind) { - ConstNeighborhoodIteratorWithOnlyIndex ret; - ret = it; + ConstNeighborhoodIteratorWithOnlyIndex ret = it; ret -= ind; return ret; } diff --git a/Modules/Core/Common/include/itkLaplacianOperator.hxx b/Modules/Core/Common/include/itkLaplacianOperator.hxx index a49496fb4ab..d2b9ac08423 100644 --- a/Modules/Core/Common/include/itkLaplacianOperator.hxx +++ b/Modules/Core/Common/include/itkLaplacianOperator.hxx @@ -35,9 +35,7 @@ template void LaplacianOperator::CreateOperator() { - CoefficientVector coefficients; - - coefficients = this->GenerateCoefficients(); + CoefficientVector coefficients = this->GenerateCoefficients(); this->Fill(coefficients); } diff --git a/Modules/Core/GPUCommon/include/itkGPUInPlaceImageFilter.hxx b/Modules/Core/GPUCommon/include/itkGPUInPlaceImageFilter.hxx index 5969b822298..d2e4fc16146 100644 --- a/Modules/Core/GPUCommon/include/itkGPUInPlaceImageFilter.hxx +++ b/Modules/Core/GPUCommon/include/itkGPUInPlaceImageFilter.hxx @@ -73,9 +73,7 @@ GPUInPlaceImageFilter::AllocateOu { // if we cannot cast the input to an output type, then allocate // an output usual. - OutputImagePointer outputPtr; - - outputPtr = this->GetOutput(0); + OutputImagePointer outputPtr = this->GetOutput(0); outputPtr->SetBufferedRegion(outputPtr->GetRequestedRegion()); outputPtr->Allocate(); } diff --git a/Modules/Core/GPUCommon/include/itkGPUKernelManager.h b/Modules/Core/GPUCommon/include/itkGPUKernelManager.h index 829ec07ee9d..1483e47dbfa 100644 --- a/Modules/Core/GPUCommon/include/itkGPUKernelManager.h +++ b/Modules/Core/GPUCommon/include/itkGPUKernelManager.h @@ -124,9 +124,7 @@ class GPUKernelManager : public LightObject return false; } - cl_int errid; - - errid = clSetKernelArg(m_KernelContainer[kernelIdx], argIdx, sizeof(cl_mem), manager->GetGPUBufferPointer()); + cl_int errid = clSetKernelArg(m_KernelContainer[kernelIdx], argIdx, sizeof(cl_mem), manager->GetGPUBufferPointer()); OpenCLCheckError(errid, __FILE__, __LINE__, ITK_LOCATION); m_KernelArgumentReady[kernelIdx][argIdx].m_IsReady = true; diff --git a/Modules/Core/GPUCommon/src/itkGPUKernelManager.cxx b/Modules/Core/GPUCommon/src/itkGPUKernelManager.cxx index e55249abf61..2e0e6d837f3 100644 --- a/Modules/Core/GPUCommon/src/itkGPUKernelManager.cxx +++ b/Modules/Core/GPUCommon/src/itkGPUKernelManager.cxx @@ -317,9 +317,7 @@ GPUKernelManager::SetKernelArg(int kernelIdx, cl_uint argIdx, size_t argSize, co return false; } - cl_int errid; - - errid = clSetKernelArg(m_KernelContainer[kernelIdx], argIdx, argSize, argVal); + cl_int errid = clSetKernelArg(m_KernelContainer[kernelIdx], argIdx, argSize, argVal); OpenCLCheckError(errid, __FILE__, __LINE__, ITK_LOCATION); m_KernelArgumentReady[kernelIdx][argIdx].m_IsReady = true; @@ -413,9 +411,7 @@ GPUKernelManager::SetKernelArgWithImage(int kernelIdx, cl_uint argIdx, GPUDataMa return false; } - cl_int errid; - - errid = clSetKernelArg(m_KernelContainer[kernelIdx], argIdx, sizeof(cl_mem), manager->GetGPUBufferPointer()); + cl_int errid = clSetKernelArg(m_KernelContainer[kernelIdx], argIdx, sizeof(cl_mem), manager->GetGPUBufferPointer()); OpenCLCheckError(errid, __FILE__, __LINE__, ITK_LOCATION); m_KernelArgumentReady[kernelIdx][argIdx].m_IsReady = true; @@ -624,16 +620,15 @@ GPUKernelManager::LaunchKernel(int kernelIdx, int dim, size_t * globalWorkSize, // localWorkSize[0] = localWorkSize[1] = localWorkSize[2] = 1; // - cl_int errid; - errid = clEnqueueNDRangeKernel(m_Manager->GetCommandQueue(m_CommandQueueId), - m_KernelContainer[kernelIdx], - (cl_uint)dim, - nullptr, - globalWorkSize, - localWorkSize, - 0, - nullptr, - nullptr); + cl_int errid = clEnqueueNDRangeKernel(m_Manager->GetCommandQueue(m_CommandQueueId), + m_KernelContainer[kernelIdx], + (cl_uint)dim, + nullptr, + globalWorkSize, + localWorkSize, + 0, + nullptr, + nullptr); OpenCLCheckError(errid, __FILE__, __LINE__, ITK_LOCATION); /* diff --git a/Modules/Core/GPUCommon/src/itkOpenCLUtil.cxx b/Modules/Core/GPUCommon/src/itkOpenCLUtil.cxx index cc2a6ab2d3a..79039806872 100644 --- a/Modules/Core/GPUCommon/src/itkOpenCLUtil.cxx +++ b/Modules/Core/GPUCommon/src/itkOpenCLUtil.cxx @@ -54,9 +54,7 @@ OpenCLGetAvailableDevices(cl_platform_id platform, cl_device_type devType, cl_ui cl_uint totalNumDevices; // get total # of devices - cl_int errid; - - errid = clGetDeviceIDs(platform, devType, 0, nullptr, &totalNumDevices); + cl_int errid = clGetDeviceIDs(platform, devType, 0, nullptr, &totalNumDevices); OpenCLCheckError(errid, __FILE__, __LINE__, ITK_LOCATION); auto * totalDevices = (cl_device_id *)malloc(totalNumDevices * sizeof(cl_device_id)); diff --git a/Modules/Core/ImageAdaptors/include/itkNthElementPixelAccessor.h b/Modules/Core/ImageAdaptors/include/itkNthElementPixelAccessor.h index 9ef242e27f6..e0cf8e6953d 100644 --- a/Modules/Core/ImageAdaptors/include/itkNthElementPixelAccessor.h +++ b/Modules/Core/ImageAdaptors/include/itkNthElementPixelAccessor.h @@ -156,9 +156,7 @@ class NthElementPixelAccessor(input[m_ElementNumber]); + ExternalType output = static_cast(input[m_ElementNumber]); return output; } diff --git a/Modules/Core/ImageAdaptors/include/itkVectorImageToImageAdaptor.h b/Modules/Core/ImageAdaptors/include/itkVectorImageToImageAdaptor.h index 6b838bf9f63..9ea7a74233d 100644 --- a/Modules/Core/ImageAdaptors/include/itkVectorImageToImageAdaptor.h +++ b/Modules/Core/ImageAdaptors/include/itkVectorImageToImageAdaptor.h @@ -74,9 +74,7 @@ class VectorImageToImagePixelAccessor : private DefaultVectorPixelAccessor auto MeanImageFunction::EvaluateAtIndex(const IndexType & index) const -> RealType { - RealType sum; - - sum = RealType{}; + RealType sum = RealType{}; const InputImageType * const image = this->GetInputImage(); diff --git a/Modules/Core/ImageFunction/include/itkNeighborhoodOperatorImageFunction.h b/Modules/Core/ImageFunction/include/itkNeighborhoodOperatorImageFunction.h index a6f42dabf67..504ad197f00 100644 --- a/Modules/Core/ImageFunction/include/itkNeighborhoodOperatorImageFunction.h +++ b/Modules/Core/ImageFunction/include/itkNeighborhoodOperatorImageFunction.h @@ -90,8 +90,7 @@ class ITK_TEMPLATE_EXPORT NeighborhoodOperatorImageFunction : public ImageFuncti Evaluate(const PointType &) const override { std::cout << "NeighborhoodOperatorImageFunction::Evaluate(): Not implemented!" << std::endl; - TOutput out; - out = 0; + TOutput out = 0; return out; } @@ -105,8 +104,7 @@ class ITK_TEMPLATE_EXPORT NeighborhoodOperatorImageFunction : public ImageFuncti EvaluateAtContinuousIndex(const ContinuousIndexType &) const override { std::cout << "NeighborhoodOperatorImageFunction::EvaluateAtContinuousIndex():Not implemented!" << std::endl; - TOutput out; - out = 0; + TOutput out = 0; return out; } diff --git a/Modules/Core/ImageFunction/include/itkSumOfSquaresImageFunction.hxx b/Modules/Core/ImageFunction/include/itkSumOfSquaresImageFunction.hxx index 734221a74c4..ed8bd90ec66 100644 --- a/Modules/Core/ImageFunction/include/itkSumOfSquaresImageFunction.hxx +++ b/Modules/Core/ImageFunction/include/itkSumOfSquaresImageFunction.hxx @@ -35,9 +35,7 @@ template auto SumOfSquaresImageFunction::EvaluateAtIndex(const IndexType & index) const -> RealType { - RealType sumOfSquares; - - sumOfSquares = RealType{}; + RealType sumOfSquares = RealType{}; const InputImageType * const image = this->GetInputImage(); diff --git a/Modules/Core/Mesh/include/itkConnectedRegionsMeshFilter.hxx b/Modules/Core/Mesh/include/itkConnectedRegionsMeshFilter.hxx index 266342ed2b0..7a6fff154d1 100644 --- a/Modules/Core/Mesh/include/itkConnectedRegionsMeshFilter.hxx +++ b/Modules/Core/Mesh/include/itkConnectedRegionsMeshFilter.hxx @@ -253,8 +253,7 @@ ConnectedRegionsMeshFilter::GenerateData() } // get the cells using the closest point and use them as seeds - InputMeshCellLinksContainerConstPointer cellLinks; - cellLinks = input->GetCellLinks(); + InputMeshCellLinksContainerConstPointer cellLinks = input->GetCellLinks(); auto links = cellLinks->ElementAt(minId); for (auto citer = links.cbegin(); citer != links.cend(); ++citer) diff --git a/Modules/Core/SpatialObjects/include/itkContourSpatialObject.hxx b/Modules/Core/SpatialObjects/include/itkContourSpatialObject.hxx index 3fe293d68df..7cf6f179ee5 100644 --- a/Modules/Core/SpatialObjects/include/itkContourSpatialObject.hxx +++ b/Modules/Core/SpatialObjects/include/itkContourSpatialObject.hxx @@ -105,8 +105,7 @@ ContourSpatialObject::SetControlPoints(const ContourPointListType & { m_ControlPoints.clear(); - typename ContourPointListType::const_iterator it; - it = points.begin(); + typename ContourPointListType::const_iterator it = points.begin(); while (it != points.end()) { m_ControlPoints.push_back(*it); @@ -219,8 +218,7 @@ ContourSpatialObject::Update() newPoint[d] = pnt[d] + i * step[d]; } } - typename Superclass::SpatialObjectPointType newSOPoint; - newSOPoint = (*it); + typename Superclass::SpatialObjectPointType newSOPoint = (*it); newSOPoint.SetSpatialObject(this); newSOPoint.SetPositionInObjectSpace(newPoint); this->m_Points.push_back(newSOPoint); diff --git a/Modules/Core/Transform/include/itkQuaternionRigidTransform.hxx b/Modules/Core/Transform/include/itkQuaternionRigidTransform.hxx index dddd42e0a4c..8183e19c225 100644 --- a/Modules/Core/Transform/include/itkQuaternionRigidTransform.hxx +++ b/Modules/Core/Transform/include/itkQuaternionRigidTransform.hxx @@ -198,9 +198,7 @@ QuaternionRigidTransform::ComputeMatrix() VnlQuaternionType conjugateRotation = m_Rotation.conjugate(); // this is done to compensate for the transposed representation // between VNL and ITK - MatrixType newMatrix; - - newMatrix = conjugateRotation.rotation_matrix_transpose(); + MatrixType newMatrix = conjugateRotation.rotation_matrix_transpose(); this->SetVarMatrix(newMatrix); } diff --git a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryPruningImageFilter.hxx b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryPruningImageFilter.hxx index 380692e5ed0..59b1f86ddbb 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryPruningImageFilter.hxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryPruningImageFilter.hxx @@ -111,8 +111,7 @@ BinaryPruningImageFilter::ComputePruneImage() { if (ot.GetCenterPixel()) { - PixelType genus; - genus = ot.GetPixel(offset1) + ot.GetPixel(offset2); + PixelType genus = ot.GetPixel(offset1) + ot.GetPixel(offset2); genus += ot.GetPixel(offset3) + ot.GetPixel(offset4); genus += ot.GetPixel(offset5) + ot.GetPixel(offset6); genus += ot.GetPixel(offset7) + ot.GetPixel(offset8); diff --git a/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.hxx b/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.hxx index 3c08daa34dc..9c94b8d7805 100644 --- a/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.hxx +++ b/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.hxx @@ -646,15 +646,13 @@ MaskedFFTNormalizedCorrelationImageFilter // is bigger than our input. // Cast away the constness so we can set the requested region. - InputImagePointer inputPtr; - inputPtr = const_cast(this->GetFixedImage()); + InputImagePointer inputPtr = const_cast(this->GetFixedImage()); inputPtr->SetRequestedRegion(this->GetFixedImage()->GetLargestPossibleRegion()); inputPtr = const_cast(this->GetMovingImage()); inputPtr->SetRequestedRegion(this->GetMovingImage()->GetLargestPossibleRegion()); - MaskImagePointer maskPtr; - maskPtr = const_cast(this->GetFixedImageMask()); + MaskImagePointer maskPtr = const_cast(this->GetFixedImageMask()); if (maskPtr) { maskPtr->SetRequestedRegion(this->GetFixedImageMask()->GetLargestPossibleRegion()); diff --git a/Modules/Filtering/CurvatureFlow/include/itkBinaryMinMaxCurvatureFlowImageFilter.hxx b/Modules/Filtering/CurvatureFlow/include/itkBinaryMinMaxCurvatureFlowImageFilter.hxx index 65811cad426..b2bc5d29424 100644 --- a/Modules/Filtering/CurvatureFlow/include/itkBinaryMinMaxCurvatureFlowImageFilter.hxx +++ b/Modules/Filtering/CurvatureFlow/include/itkBinaryMinMaxCurvatureFlowImageFilter.hxx @@ -28,8 +28,7 @@ BinaryMinMaxCurvatureFlowImageFilter::BinaryMinMaxCur { m_Threshold = 0.0; - typename BinaryMinMaxCurvatureFlowFunctionType::Pointer cffp; - cffp = BinaryMinMaxCurvatureFlowFunctionType::New(); + typename BinaryMinMaxCurvatureFlowFunctionType::Pointer cffp = BinaryMinMaxCurvatureFlowFunctionType::New(); this->SetDifferenceFunction(static_cast(cffp.GetPointer())); } diff --git a/Modules/Filtering/CurvatureFlow/include/itkCurvatureFlowImageFilter.hxx b/Modules/Filtering/CurvatureFlow/include/itkCurvatureFlowImageFilter.hxx index ec865c8946c..0eb7f023756 100644 --- a/Modules/Filtering/CurvatureFlow/include/itkCurvatureFlowImageFilter.hxx +++ b/Modules/Filtering/CurvatureFlow/include/itkCurvatureFlowImageFilter.hxx @@ -29,8 +29,7 @@ CurvatureFlowImageFilter::CurvatureFlowImageFilter() this->SetNumberOfIterations(0); m_TimeStep = 0.05f; - typename CurvatureFlowFunctionType::Pointer cffp; - cffp = CurvatureFlowFunctionType::New(); + typename CurvatureFlowFunctionType::Pointer cffp = CurvatureFlowFunctionType::New(); this->SetDifferenceFunction(static_cast(cffp.GetPointer())); } diff --git a/Modules/Filtering/CurvatureFlow/include/itkMinMaxCurvatureFlowFunction.hxx b/Modules/Filtering/CurvatureFlow/include/itkMinMaxCurvatureFlowFunction.hxx index f35b5d4ca81..8b96174608a 100644 --- a/Modules/Filtering/CurvatureFlow/include/itkMinMaxCurvatureFlowFunction.hxx +++ b/Modules/Filtering/CurvatureFlow/include/itkMinMaxCurvatureFlowFunction.hxx @@ -404,8 +404,7 @@ MinMaxCurvatureFlowFunction::ComputeUpdate(const NeighborhoodType & it, return update; } - PixelType threshold; - threshold = this->ComputeThreshold(Dispatch(), it); + PixelType threshold = this->ComputeThreshold(Dispatch(), it); NeighborhoodInnerProduct innerProduct; PixelType avgValue = innerProduct(it, m_StencilOperator); diff --git a/Modules/Filtering/CurvatureFlow/include/itkMinMaxCurvatureFlowImageFilter.hxx b/Modules/Filtering/CurvatureFlow/include/itkMinMaxCurvatureFlowImageFilter.hxx index b01de7ea389..6df75041b81 100644 --- a/Modules/Filtering/CurvatureFlow/include/itkMinMaxCurvatureFlowImageFilter.hxx +++ b/Modules/Filtering/CurvatureFlow/include/itkMinMaxCurvatureFlowImageFilter.hxx @@ -29,8 +29,7 @@ MinMaxCurvatureFlowImageFilter::MinMaxCurvatureFlowIm { m_StencilRadius = 2; - typename MinMaxCurvatureFlowFunctionType::Pointer cffp; - cffp = MinMaxCurvatureFlowFunctionType::New(); + typename MinMaxCurvatureFlowFunctionType::Pointer cffp = MinMaxCurvatureFlowFunctionType::New(); this->SetDifferenceFunction(static_cast(cffp.GetPointer())); } diff --git a/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingBaseImageFilter.hxx b/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingBaseImageFilter.hxx index 02e12d35d1b..a8e618ec339 100644 --- a/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingBaseImageFilter.hxx +++ b/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingBaseImageFilter.hxx @@ -211,8 +211,7 @@ PatchBasedDenoisingBaseImageFilter::GetPatchRadiusInV thisPtr->m_InputImage = this->GetInput(); } const typename InputImageType::SpacingType & spacing = this->m_InputImage->GetSpacing(); - typename InputImageType::SpacingValueType maxSpacing; - maxSpacing = spacing[0]; + typename InputImageType::SpacingValueType maxSpacing = spacing[0]; for (unsigned int dim = 1; dim < ImageDimension; ++dim) { if (spacing[dim] > maxSpacing) diff --git a/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilter.hxx b/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilter.hxx index 754d5887248..6b3e2b221df 100644 --- a/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilter.hxx +++ b/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilter.hxx @@ -136,8 +136,7 @@ FastMarchingImageFilter::Initialize(LevelSetImageType * // set all output value to infinity using OutputIterator = ImageRegionIterator; - PixelType outputPixel; - outputPixel = m_LargeValue; + PixelType outputPixel = m_LargeValue; for (OutputIterator outIt(output, output->GetBufferedRegion()); !outIt.IsAtEnd(); ++outIt) { diff --git a/Modules/Filtering/ImageFeature/include/itkHessian3DToVesselnessMeasureImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkHessian3DToVesselnessMeasureImageFilter.hxx index b879dfae3b3..c5725a7b6a7 100644 --- a/Modules/Filtering/ImageFeature/include/itkHessian3DToVesselnessMeasureImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkHessian3DToVesselnessMeasureImageFilter.hxx @@ -53,8 +53,8 @@ Hessian3DToVesselnessMeasureImageFilter::GenerateData() // walk the region of eigen values and get the vesselness measure EigenValueArrayType eigenValue; - ImageRegionConstIterator it; - it = ImageRegionConstIterator(eigenImage, eigenImage->GetRequestedRegion()); + ImageRegionConstIterator it = + ImageRegionConstIterator(eigenImage, eigenImage->GetRequestedRegion()); ImageRegionIterator oit; this->AllocateOutputs(); oit = ImageRegionIterator(output, output->GetRequestedRegion()); diff --git a/Modules/Filtering/ImageFilterBase/include/itkMovingHistogramImageFilterBase.hxx b/Modules/Filtering/ImageFilterBase/include/itkMovingHistogramImageFilterBase.hxx index ef679d04c16..b7c2f4a43ca 100644 --- a/Modules/Filtering/ImageFilterBase/include/itkMovingHistogramImageFilterBase.hxx +++ b/Modules/Filtering/ImageFilterBase/include/itkMovingHistogramImageFilterBase.hxx @@ -52,8 +52,8 @@ MovingHistogramImageFilterBase::SetKernel(co tmpSEImage->SetRegions(kernel.GetSize()); tmpSEImage->Allocate(); RegionType tmpSEImageRegion = tmpSEImage->GetRequestedRegion(); - ImageRegionIteratorWithIndex kernelImageIt; - kernelImageIt = ImageRegionIteratorWithIndex(tmpSEImage, tmpSEImageRegion); + ImageRegionIteratorWithIndex kernelImageIt = + ImageRegionIteratorWithIndex(tmpSEImage, tmpSEImageRegion); KernelIteratorType kernel_it = kernel.Begin(); OffsetListType kernelOffsets; diff --git a/Modules/Filtering/ImageGradient/include/itkVectorGradientMagnitudeImageFilter.h b/Modules/Filtering/ImageGradient/include/itkVectorGradientMagnitudeImageFilter.h index f7a36476071..a23b0b67080 100644 --- a/Modules/Filtering/ImageGradient/include/itkVectorGradientMagnitudeImageFilter.h +++ b/Modules/Filtering/ImageGradient/include/itkVectorGradientMagnitudeImageFilter.h @@ -318,9 +318,7 @@ class ITK_TEMPLATE_EXPORT VectorGradientMagnitudeImageFilter : public ImageToIma NonPCEvaluateAtNeighborhood(const ConstNeighborhoodIteratorType & it) const { unsigned int i, j; - TRealType dx, sum, accum; - - accum = TRealType{}; + TRealType dx, sum, accum = TRealType{}; for (i = 0; i < ImageDimension; ++i) { sum = TRealType{}; diff --git a/Modules/Filtering/ImageGrid/include/itkBSplineControlPointImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkBSplineControlPointImageFilter.hxx index 2c794ee18b3..bf0d58c296d 100644 --- a/Modules/Filtering/ImageGrid/include/itkBSplineControlPointImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkBSplineControlPointImageFilter.hxx @@ -114,8 +114,7 @@ BSplineControlPointImageFilter::SetSplineOrder(ArrayT if (this->m_DoMultilevel) { - typename KernelType::MatrixType C; - C = this->m_Kernel[i]->GetShapeFunctionsInZeroToOneInterval(); + typename KernelType::MatrixType C = this->m_Kernel[i]->GetShapeFunctionsInZeroToOneInterval(); vnl_matrix R; vnl_matrix S; diff --git a/Modules/Filtering/ImageGrid/include/itkBSplineResampleImageFilterBase.hxx b/Modules/Filtering/ImageGrid/include/itkBSplineResampleImageFilterBase.hxx index 5981ffd921f..ac579a4de83 100644 --- a/Modules/Filtering/ImageGrid/include/itkBSplineResampleImageFilterBase.hxx +++ b/Modules/Filtering/ImageGrid/include/itkBSplineResampleImageFilterBase.hxx @@ -348,8 +348,7 @@ BSplineResampleImageFilterBase::ReduceNDImage(OutputI // Initialize scratchImage space and allocate memory InitializeScratch(startSize); - typename TOutputImage::Pointer scratchImage; - scratchImage = TOutputImage::New(); + typename TOutputImage::Pointer scratchImage = TOutputImage::New(); scratchImage->CopyInformation(inputPtr); RegionType scratchRegion = inputPtr->GetBufferedRegion(); currentSize = startSize; @@ -378,8 +377,7 @@ BSplineResampleImageFilterBase::ReduceNDImage(OutputI * OutputImage for direct writing into the final variable. */ // The first time through the loop our input image is inputPtr - typename TInputImage::ConstPointer workingImage; - workingImage = inputPtr; + typename TInputImage::ConstPointer workingImage = inputPtr; unsigned int count = scratchRegion.GetNumberOfPixels() * ImageDimension; ProgressReporter progress(this, 0, count, 10); @@ -462,8 +460,7 @@ BSplineResampleImageFilterBase::ExpandNDImage(OutputI // Initialize scratchImage space and allocate memory InitializeScratch(startSize); - typename TOutputImage::Pointer scratchImage; - scratchImage = TOutputImage::New(); + typename TOutputImage::Pointer scratchImage = TOutputImage::New(); scratchImage->CopyInformation(inputPtr); RegionType scratchRegion = inputPtr->GetBufferedRegion(); currentSize = startSize; @@ -493,8 +490,7 @@ BSplineResampleImageFilterBase::ExpandNDImage(OutputI **/ // The first time through the loop our input image is m_Image - typename TInputImage::ConstPointer workingImage; - workingImage = inputPtr; + typename TInputImage::ConstPointer workingImage = inputPtr; RegionType workingRegion = validRegion; diff --git a/Modules/Filtering/ImageGrid/include/itkBSplineScatteredDataPointSetToImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkBSplineScatteredDataPointSetToImageFilter.hxx index df3c3e79921..d4472798ede 100644 --- a/Modules/Filtering/ImageGrid/include/itkBSplineScatteredDataPointSetToImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkBSplineScatteredDataPointSetToImageFilter.hxx @@ -93,8 +93,7 @@ BSplineScatteredDataPointSetToImageFilter::SetSpli if (this->m_DoMultilevel) { - typename KernelType::MatrixType C; - C = this->m_Kernel[i]->GetShapeFunctionsInZeroToOneInterval(); + typename KernelType::MatrixType C = this->m_Kernel[i]->GetShapeFunctionsInZeroToOneInterval(); vnl_matrix R; vnl_matrix S; diff --git a/Modules/Filtering/ImageGrid/include/itkShrinkImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkShrinkImageFilter.hxx index 67c1a8b7da0..c22aa3658a5 100644 --- a/Modules/Filtering/ImageGrid/include/itkShrinkImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkShrinkImageFilter.hxx @@ -310,8 +310,7 @@ ShrinkImageFilter::GenerateOutputInformation() outputPtr->TransformContinuousIndexToPhysicalPoint(outputCenterIndex, outputCenterPoint); const typename TOutputImage::PointType & inputOrigin = inputPtr->GetOrigin(); - typename TOutputImage::PointType outputOrigin; - outputOrigin = inputOrigin + (inputCenterPoint - outputCenterPoint); + typename TOutputImage::PointType outputOrigin = inputOrigin + (inputCenterPoint - outputCenterPoint); outputPtr->SetOrigin(outputOrigin); // Set region diff --git a/Modules/Filtering/ImageIntensity/include/itkAdaptImageFilter.h b/Modules/Filtering/ImageIntensity/include/itkAdaptImageFilter.h index ec25a037376..5ad9efd088b 100644 --- a/Modules/Filtering/ImageIntensity/include/itkAdaptImageFilter.h +++ b/Modules/Filtering/ImageIntensity/include/itkAdaptImageFilter.h @@ -165,9 +165,7 @@ class AdaptImageFilter void SetAccessor(AccessorType & accessor) { - FunctorType functor; - - functor = this->GetFunctor(); + FunctorType functor = this->GetFunctor(); if (accessor != functor.GetAccessor()) { functor.SetAccessor(accessor); diff --git a/Modules/Filtering/ImageIntensity/include/itkPolylineMaskImageFilter.hxx b/Modules/Filtering/ImageIntensity/include/itkPolylineMaskImageFilter.hxx index ad4afbb0ce9..a3f051f201a 100644 --- a/Modules/Filtering/ImageIntensity/include/itkPolylineMaskImageFilter.hxx +++ b/Modules/Filtering/ImageIntensity/include/itkPolylineMaskImageFilter.hxx @@ -92,17 +92,14 @@ PolylineMaskImageFilter::Generate itkDebugMacro("Normalized View vector" << nViewVector); // Orthogonalize nUpVector and nViewVector - TVector nOrthogonalVector; - - nOrthogonalVector = nUpVector - (nViewVector * (nUpVector * nViewVector)); + TVector nOrthogonalVector = nUpVector - (nViewVector * (nUpVector * nViewVector)); itkDebugMacro("Up vector component orthogonal to View vector " << nOrthogonalVector); // Perform the cross product and determine a third coordinate axis // orthogonal to both nOrthogonalVector and nViewVector. - TVector nThirdAxis; - nThirdAxis = itk::CrossProduct(nOrthogonalVector, nViewVector); + TVector nThirdAxis = itk::CrossProduct(nOrthogonalVector, nViewVector); itkDebugMacro("Third basis vector" << nThirdAxis); @@ -298,9 +295,7 @@ PolylineMaskImageFilter::Generate projectionStart[1] = 0; ProjectionImageSizeType projectionSize; - IndexValueType pad; - - pad = 5; + IndexValueType pad = 5; projectionSize[0] = (IndexValueType)(bounds[1] - bounds[0]) + pad; projectionSize[1] = (IndexValueType)(bounds[3] - bounds[2]) + pad; diff --git a/Modules/Filtering/ImageLabel/include/itkScanlineFilterCommon.h b/Modules/Filtering/ImageLabel/include/itkScanlineFilterCommon.h index 7f7cd0e583c..59eab160e82 100644 --- a/Modules/Filtering/ImageLabel/include/itkScanlineFilterCommon.h +++ b/Modules/Filtering/ImageLabel/include/itkScanlineFilterCommon.h @@ -399,8 +399,7 @@ class ScanlineFilterCommon using PretendIndexType = typename PretendImageType::RegionType::IndexType; using LineNeighborhoodType = ConstShapedNeighborhoodIterator; - typename PretendImageType::Pointer fakeImage; - fakeImage = PretendImageType::New(); + typename PretendImageType::Pointer fakeImage = PretendImageType::New(); typename PretendImageType::RegionType LineRegion; @@ -427,8 +426,7 @@ class ScanlineFilterCommon setConnectivityPrevious(&lnit, m_FullyConnected); } - typename LineNeighborhoodType::IndexListType ActiveIndexes; - ActiveIndexes = lnit.GetActiveIndexList(); + typename LineNeighborhoodType::IndexListType ActiveIndexes = lnit.GetActiveIndexList(); typename LineNeighborhoodType::IndexListType::const_iterator LI; diff --git a/Modules/Filtering/ImageStatistics/include/itkLabelStatisticsImageFilter.hxx b/Modules/Filtering/ImageStatistics/include/itkLabelStatisticsImageFilter.hxx index 90213f56b0d..2913cdd3088 100644 --- a/Modules/Filtering/ImageStatistics/include/itkLabelStatisticsImageFilter.hxx +++ b/Modules/Filtering/ImageStatistics/include/itkLabelStatisticsImageFilter.hxx @@ -271,9 +271,7 @@ template auto LabelStatisticsImageFilter::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 @@ -289,9 +287,7 @@ template auto LabelStatisticsImageFilter::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 @@ -307,9 +303,7 @@ template auto LabelStatisticsImageFilter::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 @@ -325,9 +319,7 @@ template auto LabelStatisticsImageFilter::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 @@ -343,9 +335,7 @@ template auto LabelStatisticsImageFilter::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 @@ -361,9 +351,7 @@ template auto LabelStatisticsImageFilter::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 @@ -379,9 +367,7 @@ template auto LabelStatisticsImageFilter::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; @@ -398,9 +384,7 @@ template auto LabelStatisticsImageFilter::GetRegion(LabelPixelType label) const -> RegionType { - MapConstIterator mapIt; - - mapIt = m_LabelStatistics.find(label); + MapConstIterator mapIt = m_LabelStatistics.find(label); if (mapIt == m_LabelStatistics.end()) { @@ -429,9 +413,7 @@ template auto LabelStatisticsImageFilter::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 @@ -448,9 +430,7 @@ auto LabelStatisticsImageFilter::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 @@ -486,9 +466,7 @@ template auto LabelStatisticsImageFilter::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 diff --git a/Modules/Filtering/LabelMap/include/itkInPlaceLabelMapFilter.hxx b/Modules/Filtering/LabelMap/include/itkInPlaceLabelMapFilter.hxx index b72510178be..bd21c803985 100644 --- a/Modules/Filtering/LabelMap/include/itkInPlaceLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkInPlaceLabelMapFilter.hxx @@ -75,9 +75,7 @@ InPlaceLabelMapFilter::AllocateOutputs() // If there are more than one outputs, allocate the remaining outputs for (unsigned int i = 1; i < this->GetNumberOfIndexedOutputs(); ++i) { - OutputImagePointer outputPtr; - - outputPtr = this->GetOutput(i); + OutputImagePointer outputPtr = this->GetOutput(i); outputPtr->SetBufferedRegion(outputPtr->GetRequestedRegion()); outputPtr->Allocate(); } diff --git a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleConnectedClosingImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleConnectedClosingImageFilter.hxx index 14cd24885f4..8056c582001 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleConnectedClosingImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleConnectedClosingImageFilter.hxx @@ -78,12 +78,10 @@ GrayscaleConnectedClosingImageFilter::GenerateData() calculator->SetImage(inputImage); calculator->ComputeMaximum(); - InputImagePixelType maxValue; - maxValue = calculator->GetMaximum(); + InputImagePixelType maxValue = calculator->GetMaximum(); // compare this maximum value to the value at the seed pixel. - InputImagePixelType seedValue; - seedValue = inputImage->GetPixel(m_Seed); + InputImagePixelType seedValue = inputImage->GetPixel(m_Seed); if (maxValue == seedValue) { diff --git a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleConnectedOpeningImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleConnectedOpeningImageFilter.hxx index 290b1432ff4..329ea03aa51 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleConnectedOpeningImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleConnectedOpeningImageFilter.hxx @@ -78,12 +78,10 @@ GrayscaleConnectedOpeningImageFilter::GenerateData() calculator->SetImage(inputImage); calculator->ComputeMinimum(); - InputImagePixelType minValue; - minValue = calculator->GetMinimum(); + InputImagePixelType minValue = calculator->GetMinimum(); // compare this minimum value to the value at the seed pixel. - InputImagePixelType seedValue; - seedValue = inputImage->GetPixel(m_Seed); + InputImagePixelType seedValue = inputImage->GetPixel(m_Seed); if (minValue == seedValue) { diff --git a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleFillholeImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleFillholeImageFilter.hxx index b4ca3f0bd17..98f2fa84147 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleFillholeImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleFillholeImageFilter.hxx @@ -75,8 +75,7 @@ GrayscaleFillholeImageFilter::GenerateData() calculator->SetImage(this->GetInput()); calculator->ComputeMaximum(); - InputImagePixelType maxValue; - maxValue = calculator->GetMaximum(); + InputImagePixelType maxValue = calculator->GetMaximum(); // allocate a marker image InputImagePointer markerPtr = InputImageType::New(); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGrindPeakImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGrindPeakImageFilter.hxx index 75550fa67fb..52960e16ff0 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGrindPeakImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGrindPeakImageFilter.hxx @@ -85,8 +85,7 @@ GrayscaleGrindPeakImageFilter::GenerateData() calculator->SetImage(this->GetInput()); calculator->ComputeMinimum(); - InputImagePixelType minValue; - minValue = calculator->GetMinimum(); + InputImagePixelType minValue = calculator->GetMinimum(); // allocate a marker image InputImagePointer markerPtr = InputImageType::New(); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkSharedMorphologyUtilities.hxx b/Modules/Filtering/MathematicalMorphology/include/itkSharedMorphologyUtilities.hxx index 5b26410bbea..16c501751fa 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkSharedMorphologyUtilities.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkSharedMorphologyUtilities.hxx @@ -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; diff --git a/Modules/Filtering/MathematicalMorphology/include/itkValuedRegionalExtremaImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkValuedRegionalExtremaImageFilter.hxx index 53cc1e3071b..8d54d0b2b0a 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkValuedRegionalExtremaImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkValuedRegionalExtremaImageFilter.hxx @@ -127,8 +127,7 @@ ValuedRegionalExtremaImageFilter auto ParametricPath::EvaluateDerivative(const InputType & input) const -> VectorType { - InputType inputStepSize; - - inputStepSize = m_DefaultInputStepSize; + InputType inputStepSize = m_DefaultInputStepSize; if ((input + inputStepSize) >= this->EndOfInput()) { inputStepSize = this->EndOfInput() - input; diff --git a/Modules/Filtering/Smoothing/include/itkRecursiveGaussianImageFilter.hxx b/Modules/Filtering/Smoothing/include/itkRecursiveGaussianImageFilter.hxx index 32a7eeafb62..c176aea86d7 100644 --- a/Modules/Filtering/Smoothing/include/itkRecursiveGaussianImageFilter.hxx +++ b/Modules/Filtering/Smoothing/include/itkRecursiveGaussianImageFilter.hxx @@ -185,8 +185,7 @@ RecursiveGaussianImageFilter::SetUp(ScalarRealType sp DN = DN2 + beta * DN0; EN = EN2 + beta * EN0; - ScalarRealType alpha2; - alpha2 = EN * SD * SD - ED * SN * SD - 2 * DN * DD * SD + 2 * DD * DD * SN; + ScalarRealType alpha2 = EN * SD * SD - ED * SN * SD - 2 * DN * DD * SD + 2 * DD * DD * SN; alpha2 /= SD * SD * SD; this->m_N0 *= across_scale_normalization / alpha2; diff --git a/Modules/Nonunit/Review/include/itkLabelGeometryImageFilter.hxx b/Modules/Nonunit/Review/include/itkLabelGeometryImageFilter.hxx index cb2ef6e797f..513753981e6 100644 --- a/Modules/Nonunit/Review/include/itkLabelGeometryImageFilter.hxx +++ b/Modules/Nonunit/Review/include/itkLabelGeometryImageFilter.hxx @@ -569,9 +569,7 @@ template auto LabelGeometryImageFilter::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 @@ -589,9 +587,7 @@ template SizeValueType LabelGeometryImageFilter::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 @@ -607,9 +603,7 @@ template auto LabelGeometryImageFilter::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 @@ -625,9 +619,7 @@ template auto LabelGeometryImageFilter::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 @@ -645,9 +637,7 @@ auto LabelGeometryImageFilter::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 @@ -664,9 +654,7 @@ template auto LabelGeometryImageFilter::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 @@ -683,9 +671,7 @@ template auto LabelGeometryImageFilter::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 @@ -702,9 +688,7 @@ template auto LabelGeometryImageFilter::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 @@ -739,9 +723,7 @@ template auto LabelGeometryImageFilter::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 @@ -757,9 +739,7 @@ template auto LabelGeometryImageFilter::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 @@ -775,9 +755,7 @@ template auto LabelGeometryImageFilter::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 @@ -793,9 +771,7 @@ template auto LabelGeometryImageFilter::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{}; @@ -812,9 +788,7 @@ template auto LabelGeometryImageFilter::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 @@ -830,9 +804,7 @@ template auto LabelGeometryImageFilter::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 @@ -871,9 +843,7 @@ auto LabelGeometryImageFilter::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 @@ -890,9 +860,7 @@ auto LabelGeometryImageFilter::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 @@ -913,9 +881,7 @@ auto LabelGeometryImageFilter::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 @@ -932,9 +898,7 @@ template auto LabelGeometryImageFilter::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 @@ -951,9 +915,7 @@ template auto LabelGeometryImageFilter::GetRegion(LabelPixelType label) const -> RegionType { - MapConstIterator mapIt; - - mapIt = m_LabelGeometryMapper.find(label); + MapConstIterator mapIt = m_LabelGeometryMapper.find(label); if (mapIt == m_LabelGeometryMapper.end()) { @@ -986,9 +948,7 @@ template TLabelImage * LabelGeometryImageFilter::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 @@ -1004,9 +964,7 @@ template TIntensityImage * LabelGeometryImageFilter::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 diff --git a/Modules/Nonunit/Review/include/itkMultiphaseSparseFiniteDifferenceImageFilter.hxx b/Modules/Nonunit/Review/include/itkMultiphaseSparseFiniteDifferenceImageFilter.hxx index f080f248d40..70ceeab46bc 100644 --- a/Modules/Nonunit/Review/include/itkMultiphaseSparseFiniteDifferenceImageFilter.hxx +++ b/Modules/Nonunit/Review/include/itkMultiphaseSparseFiniteDifferenceImageFilter.hxx @@ -1293,8 +1293,7 @@ MultiphaseSparseFiniteDifferenceImageFilter 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()) diff --git a/Modules/Nonunit/Review/include/itkScalarRegionBasedLevelSetFunction.hxx b/Modules/Nonunit/Review/include/itkScalarRegionBasedLevelSetFunction.hxx index 3171ab4aec9..3b1f329765b 100644 --- a/Modules/Nonunit/Review/include/itkScalarRegionBasedLevelSetFunction.hxx +++ b/Modules/Nonunit/Review/include/itkScalarRegionBasedLevelSetFunction.hxx @@ -37,8 +37,7 @@ ScalarRegionBasedLevelSetFunction::Comp product = 1.; - ListPixelType L; - L = this->m_SharedData->m_NearestNeighborListImage->GetPixel(globalIndex); + ListPixelType L = this->m_SharedData->m_NearestNeighborListImage->GetPixel(globalIndex); InputPixelType hVal; InputIndexType otherIndex; diff --git a/Modules/Nonunit/Review/include/itkWarpHarmonicEnergyCalculator.hxx b/Modules/Nonunit/Review/include/itkWarpHarmonicEnergyCalculator.hxx index 78ec7600aac..8f828683409 100644 --- a/Modules/Nonunit/Review/include/itkWarpHarmonicEnergyCalculator.hxx +++ b/Modules/Nonunit/Review/include/itkWarpHarmonicEnergyCalculator.hxx @@ -97,8 +97,8 @@ WarpHarmonicEnergyCalculator::Compute() typename NeighborhoodAlgorithm::ImageBoundaryFacesCalculator::FaceListType faceList = bC(m_Image, m_Region, m_NeighborhoodRadius); - typename NeighborhoodAlgorithm::ImageBoundaryFacesCalculator::FaceListType::iterator fIt; - fIt = faceList.begin(); + typename NeighborhoodAlgorithm::ImageBoundaryFacesCalculator::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 diff --git a/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx b/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx index 3342a89c95c..f79e0de4e16 100644 --- a/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx +++ b/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx @@ -487,8 +487,7 @@ RobustSolver::UnselectLandmarks(unsigned int nUnselected) LoadVectorType & loadVector = container->CastToSTLContainer(); - LoadVectorType::iterator it; - it = loadVector.begin(); + LoadVectorType::iterator it = loadVector.begin(); std::advance(it, nUnselected - 1); auto nth = it; @@ -522,8 +521,7 @@ RobustSolver::DeleteFromLandmarkBeginning(unsigned int nDeleted) LoadVectorType & loadVector = container->CastToSTLContainer(); - LoadVectorType::iterator it; - it = loadVector.begin(); + LoadVectorType::iterator it = loadVector.begin(); std::advance(it, nDeleted); auto nth = it; loadVector.erase(loadVector.begin(), nth); diff --git a/Modules/Numerics/FEM/src/itkFEMElement2DC0QuadraticTriangular.cxx b/Modules/Numerics/FEM/src/itkFEMElement2DC0QuadraticTriangular.cxx index a7634b9b08c..e0cbcb72246 100644 --- a/Modules/Numerics/FEM/src/itkFEMElement2DC0QuadraticTriangular.cxx +++ b/Modules/Numerics/FEM/src/itkFEMElement2DC0QuadraticTriangular.cxx @@ -169,9 +169,7 @@ Element2DC0QuadraticTriangular::GetLocalFromGlobalCoordinates(const VectorType & VectorType tempWeights(3); VectorType closest(3); - itk::fem::Element2DC0LinearTriangularMembrane::Pointer e1; - - e1 = itk::fem::Element2DC0LinearTriangularMembrane::New(); + itk::fem::Element2DC0LinearTriangularMembrane::Pointer e1 = itk::fem::Element2DC0LinearTriangularMembrane::New(); // four linear triangles are used for (i = 0; i < 4; ++i) { diff --git a/Modules/Numerics/FEM/src/itkFEMLinearSystemWrapperDenseVNL.cxx b/Modules/Numerics/FEM/src/itkFEMLinearSystemWrapperDenseVNL.cxx index 10b70129939..fc972c89211 100644 --- a/Modules/Numerics/FEM/src/itkFEMLinearSystemWrapperDenseVNL.cxx +++ b/Modules/Numerics/FEM/src/itkFEMLinearSystemWrapperDenseVNL.cxx @@ -199,8 +199,7 @@ LinearSystemWrapperDenseVNL::SwapMatrices(unsigned int MatrixIndex1, unsigned in void LinearSystemWrapperDenseVNL::SwapVectors(unsigned int VectorIndex1, unsigned int VectorIndex2) { - vnl_vector tmp; - tmp = *(*m_Vectors)[VectorIndex1]; + vnl_vector tmp = *(*m_Vectors)[VectorIndex1]; *(*m_Vectors)[VectorIndex1] = *(*m_Vectors)[VectorIndex2]; *(*m_Vectors)[VectorIndex2] = tmp; } diff --git a/Modules/Numerics/Optimizers/src/itkParticleSwarmOptimizerBase.cxx b/Modules/Numerics/Optimizers/src/itkParticleSwarmOptimizerBase.cxx index 7ab87520c67..4a0cd87818a 100644 --- a/Modules/Numerics/Optimizers/src/itkParticleSwarmOptimizerBase.cxx +++ b/Modules/Numerics/Optimizers/src/itkParticleSwarmOptimizerBase.cxx @@ -152,8 +152,7 @@ ParticleSwarmOptimizerBase::PrintSelf(std::ostream & os, Indent indent) const os << indent << "Maximal number of iterations: " << this->m_MaximalNumberOfIterations << '\n'; os << indent << "Number of generations with minimal improvement: "; os << this->m_NumberOfGenerationsWithMinimalImprovement << '\n'; - ParameterBoundsType::const_iterator it, end; - end = this->m_ParameterBounds.end(); + ParameterBoundsType::const_iterator it, end = this->m_ParameterBounds.end(); os << indent << "Parameter bounds: ["; for (it = this->m_ParameterBounds.begin(); it != end; ++it) { @@ -180,8 +179,7 @@ ParticleSwarmOptimizerBase::PrintSelf(std::ostream & os, Indent indent) const void ParticleSwarmOptimizerBase::PrintSwarm(std::ostream & os, Indent indent) const { - std::vector::const_iterator it, end; - end = this->m_Particles.end(); + std::vector::const_iterator it, end = this->m_Particles.end(); os << indent << "[\n"; for (it = this->m_Particles.begin(); it != end; ++it) { @@ -427,8 +425,7 @@ ParticleSwarmOptimizerBase::Initialize() void ParticleSwarmOptimizerBase::RandomInitialization() { - unsigned int i, j, n; - n = GetInitialPosition().Size(); + unsigned int i, j, n = GetInitialPosition().Size(); ParameterBoundsType parameterBounds(this->m_ParameterBounds); ParametersType mean = GetInitialPosition(); itk::Statistics::MersenneTwisterRandomVariateGenerator::Pointer randomGenerator = diff --git a/Modules/Numerics/Optimizersv4/include/itkRegistrationParameterScalesFromIndexShift.hxx b/Modules/Numerics/Optimizersv4/include/itkRegistrationParameterScalesFromIndexShift.hxx index 2c2c3adc6ef..1713f586a7f 100644 --- a/Modules/Numerics/Optimizersv4/include/itkRegistrationParameterScalesFromIndexShift.hxx +++ b/Modules/Numerics/Optimizersv4/include/itkRegistrationParameterScalesFromIndexShift.hxx @@ -94,16 +94,14 @@ RegistrationParameterScalesFromIndexShift::TransformPointToContinuousIn if (this->GetTransformForward()) { - MovingPointType mappedPoint; - mappedPoint = this->m_Metric->GetMovingTransform()->TransformPoint(point); + MovingPointType mappedPoint = this->m_Metric->GetMovingTransform()->TransformPoint(point); mappedIndex = this->m_Metric->GetMovingImage()->template TransformPhysicalPointToContinuousIndex( mappedPoint); } else { - FixedPointType mappedPoint; - mappedPoint = this->m_Metric->GetFixedTransform()->TransformPoint(point); + FixedPointType mappedPoint = this->m_Metric->GetFixedTransform()->TransformPoint(point); mappedIndex = this->m_Metric->GetFixedImage()->template TransformPhysicalPointToContinuousIndex( mappedPoint); diff --git a/Modules/Numerics/Statistics/include/itkImageToNeighborhoodSampleAdaptor.hxx b/Modules/Numerics/Statistics/include/itkImageToNeighborhoodSampleAdaptor.hxx index efacdd3e3c7..36dfee7b164 100644 --- a/Modules/Numerics/Statistics/include/itkImageToNeighborhoodSampleAdaptor.hxx +++ b/Modules/Numerics/Statistics/include/itkImageToNeighborhoodSampleAdaptor.hxx @@ -126,8 +126,7 @@ ImageToNeighborhoodSampleAdaptor::SetImage(const TIm { m_Region = m_Image->GetLargestPossibleRegion(); } - NeighborhoodIteratorType neighborIt; - neighborIt = NeighborhoodIteratorType(m_Radius, m_Image, m_Region); + NeighborhoodIteratorType neighborIt = NeighborhoodIteratorType(m_Radius, m_Image, m_Region); neighborIt.GoToBegin(); m_NeighborIndexInternal = neighborIt.GetBeginIndex(); m_MeasurementVectorInternal.clear(); @@ -159,8 +158,7 @@ ImageToNeighborhoodSampleAdaptor::SetRadius(const Ne m_Radius = radius; if (m_Image.IsNotNull()) { - NeighborhoodIteratorType neighborIt; - neighborIt = NeighborhoodIteratorType(m_Radius, m_Image, m_Region); + NeighborhoodIteratorType neighborIt = NeighborhoodIteratorType(m_Radius, m_Image, m_Region); neighborIt.GoToBegin(); m_NeighborIndexInternal = neighborIt.GetBeginIndex(); m_MeasurementVectorInternal.clear(); @@ -188,8 +186,7 @@ ImageToNeighborhoodSampleAdaptor::SetRegion(const Re m_UseImageRegion = false; if (m_Image.IsNotNull()) { - NeighborhoodIteratorType neighborIt; - neighborIt = NeighborhoodIteratorType(m_Radius, m_Image, m_Region); + NeighborhoodIteratorType neighborIt = NeighborhoodIteratorType(m_Radius, m_Image, m_Region); neighborIt.GoToBegin(); m_NeighborIndexInternal = neighborIt.GetBeginIndex(); m_MeasurementVectorInternal.clear(); diff --git a/Modules/Numerics/Statistics/include/itkSampleClassifierFilter.hxx b/Modules/Numerics/Statistics/include/itkSampleClassifierFilter.hxx index 9a8e76ffac2..54b33f313d9 100644 --- a/Modules/Numerics/Statistics/include/itkSampleClassifierFilter.hxx +++ b/Modules/Numerics/Statistics/include/itkSampleClassifierFilter.hxx @@ -160,8 +160,7 @@ SampleClassifierFilter::GenerateData() while (iter != end) { - typename TSample::MeasurementVectorType measurements; - measurements = iter.GetMeasurementVector(); + typename TSample::MeasurementVectorType measurements = iter.GetMeasurementVector(); for (unsigned int i = 0; i < this->m_NumberOfClasses; ++i) { discriminantScores[i] = membershipFunctionsWeightsArray[i] * membershipFunctions[i]->Evaluate(measurements); diff --git a/Modules/Registration/Common/include/itkGradientDifferenceImageToImageMetric.hxx b/Modules/Registration/Common/include/itkGradientDifferenceImageToImageMetric.hxx index b0aee655b80..bd98066d239 100644 --- a/Modules/Registration/Common/include/itkGradientDifferenceImageToImageMetric.hxx +++ b/Modules/Registration/Common/include/itkGradientDifferenceImageToImageMetric.hxx @@ -395,9 +395,7 @@ GradientDifferenceImageToImageMetric::GetDerivative( const TransformParametersType & parameters, DerivativeType & derivative) const { - TransformParametersType testPoint; - - testPoint = parameters; + TransformParametersType testPoint = parameters; const unsigned int numberOfParameters = this->GetNumberOfParameters(); derivative = DerivativeType(numberOfParameters); diff --git a/Modules/Registration/Common/include/itkMeanReciprocalSquareDifferenceImageToImageMetric.hxx b/Modules/Registration/Common/include/itkMeanReciprocalSquareDifferenceImageToImageMetric.hxx index e251fb5af07..9f1aea6b7a1 100644 --- a/Modules/Registration/Common/include/itkMeanReciprocalSquareDifferenceImageToImageMetric.hxx +++ b/Modules/Registration/Common/include/itkMeanReciprocalSquareDifferenceImageToImageMetric.hxx @@ -112,9 +112,7 @@ MeanReciprocalSquareDifferenceImageToImageMetric::Get const TransformParametersType & parameters, DerivativeType & derivative) const { - TransformParametersType testPoint; - - testPoint = parameters; + TransformParametersType testPoint = parameters; const unsigned int numberOfParameters = this->GetNumberOfParameters(); derivative = DerivativeType(numberOfParameters); diff --git a/Modules/Registration/FEM/include/itkFEMRegistrationFilter.hxx b/Modules/Registration/FEM/include/itkFEMRegistrationFilter.hxx index 802eed062e6..7582b32ef7d 100644 --- a/Modules/Registration/FEM/include/itkFEMRegistrationFilter.hxx +++ b/Modules/Registration/FEM/include/itkFEMRegistrationFilter.hxx @@ -1436,9 +1436,7 @@ FEMRegistrationFilter::GetLandmark(unsign PointType & target) { Element::VectorType localSource; - Element::VectorType localTarget; - - localTarget = m_LandmarkArray[index]->GetTarget(); + Element::VectorType localTarget = m_LandmarkArray[index]->GetTarget(); localSource = m_LandmarkArray[index]->GetSource(); for (unsigned int i = 0; i < ImageDimension; ++i) { diff --git a/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFilter.hxx b/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFilter.hxx index 88556ac4cbe..7a369decaf7 100644 --- a/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFilter.hxx +++ b/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFilter.hxx @@ -25,9 +25,7 @@ template :: GPUDemonsRegistrationFilter() { - typename GPUDemonsRegistrationFunctionType::Pointer drfp; - - drfp = GPUDemonsRegistrationFunctionType::New(); + typename GPUDemonsRegistrationFunctionType::Pointer drfp = GPUDemonsRegistrationFunctionType::New(); this->SetDifferenceFunction(drfp); diff --git a/Modules/Registration/PDEDeformable/include/itkCurvatureRegistrationFilter.hxx b/Modules/Registration/PDEDeformable/include/itkCurvatureRegistrationFilter.hxx index d23632a0968..c98b53518ab 100644 --- a/Modules/Registration/PDEDeformable/include/itkCurvatureRegistrationFilter.hxx +++ b/Modules/Registration/PDEDeformable/include/itkCurvatureRegistrationFilter.hxx @@ -33,8 +33,7 @@ template :: CurvatureRegistrationFilter() { - typename RegistrationFunctionType::Pointer drfp; - drfp = RegistrationFunctionType::New(); + typename RegistrationFunctionType::Pointer drfp = RegistrationFunctionType::New(); this->SetDifferenceFunction(static_cast(drfp.GetPointer())); diff --git a/Modules/Registration/PDEDeformable/include/itkDemonsRegistrationFilter.hxx b/Modules/Registration/PDEDeformable/include/itkDemonsRegistrationFilter.hxx index 18aedf8f700..3854588d643 100644 --- a/Modules/Registration/PDEDeformable/include/itkDemonsRegistrationFilter.hxx +++ b/Modules/Registration/PDEDeformable/include/itkDemonsRegistrationFilter.hxx @@ -24,8 +24,7 @@ namespace itk template DemonsRegistrationFilter::DemonsRegistrationFilter() { - typename DemonsRegistrationFunctionType::Pointer drfp; - drfp = DemonsRegistrationFunctionType::New(); + typename DemonsRegistrationFunctionType::Pointer drfp = DemonsRegistrationFunctionType::New(); this->SetDifferenceFunction(static_cast(drfp.GetPointer())); diff --git a/Modules/Registration/PDEDeformable/include/itkDiffeomorphicDemonsRegistrationFilter.hxx b/Modules/Registration/PDEDeformable/include/itkDiffeomorphicDemonsRegistrationFilter.hxx index a28ca82337d..d7ca6a2164c 100644 --- a/Modules/Registration/PDEDeformable/include/itkDiffeomorphicDemonsRegistrationFilter.hxx +++ b/Modules/Registration/PDEDeformable/include/itkDiffeomorphicDemonsRegistrationFilter.hxx @@ -28,8 +28,7 @@ DiffeomorphicDemonsRegistrationFilterSetDifferenceFunction(drfp); diff --git a/Modules/Registration/PDEDeformable/include/itkFastSymmetricForcesDemonsRegistrationFilter.hxx b/Modules/Registration/PDEDeformable/include/itkFastSymmetricForcesDemonsRegistrationFilter.hxx index ec0e4c83121..8bb31a0354c 100644 --- a/Modules/Registration/PDEDeformable/include/itkFastSymmetricForcesDemonsRegistrationFilter.hxx +++ b/Modules/Registration/PDEDeformable/include/itkFastSymmetricForcesDemonsRegistrationFilter.hxx @@ -26,8 +26,7 @@ template :: FastSymmetricForcesDemonsRegistrationFilter() { - typename DemonsRegistrationFunctionType::Pointer drfp; - drfp = DemonsRegistrationFunctionType::New(); + typename DemonsRegistrationFunctionType::Pointer drfp = DemonsRegistrationFunctionType::New(); this->SetDifferenceFunction(drfp); diff --git a/Modules/Registration/PDEDeformable/include/itkLevelSetMotionRegistrationFilter.hxx b/Modules/Registration/PDEDeformable/include/itkLevelSetMotionRegistrationFilter.hxx index f06147689b2..7ea985349f1 100644 --- a/Modules/Registration/PDEDeformable/include/itkLevelSetMotionRegistrationFilter.hxx +++ b/Modules/Registration/PDEDeformable/include/itkLevelSetMotionRegistrationFilter.hxx @@ -24,8 +24,7 @@ namespace itk template LevelSetMotionRegistrationFilter::LevelSetMotionRegistrationFilter() { - typename LevelSetMotionFunctionType::Pointer drfp; - drfp = LevelSetMotionFunctionType::New(); + typename LevelSetMotionFunctionType::Pointer drfp = LevelSetMotionFunctionType::New(); this->SetDifferenceFunction(static_cast(drfp.GetPointer())); diff --git a/Modules/Registration/PDEDeformable/include/itkSymmetricForcesDemonsRegistrationFilter.hxx b/Modules/Registration/PDEDeformable/include/itkSymmetricForcesDemonsRegistrationFilter.hxx index 95204491612..1f6afc67891 100644 --- a/Modules/Registration/PDEDeformable/include/itkSymmetricForcesDemonsRegistrationFilter.hxx +++ b/Modules/Registration/PDEDeformable/include/itkSymmetricForcesDemonsRegistrationFilter.hxx @@ -25,8 +25,7 @@ template :: SymmetricForcesDemonsRegistrationFilter() { - typename DemonsRegistrationFunctionType::Pointer drfp; - drfp = DemonsRegistrationFunctionType::New(); + typename DemonsRegistrationFunctionType::Pointer drfp = DemonsRegistrationFunctionType::New(); this->SetDifferenceFunction(static_cast(drfp.GetPointer())); } diff --git a/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentFunctorImageFilter.hxx b/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentFunctorImageFilter.hxx index 9bcfad8e3af..594a0ec7289 100644 --- a/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentFunctorImageFilter.hxx +++ b/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentFunctorImageFilter.hxx @@ -109,8 +109,8 @@ ConnectedComponentFunctorImageFilterGetMaskImage(); if (mask) { - ImageRegionConstIterator mit; - mit = ImageRegionConstIterator(mask, output->GetRequestedRegion()); + ImageRegionConstIterator mit = + ImageRegionConstIterator(mask, output->GetRequestedRegion()); mit.GoToBegin(); oit.GoToBegin(); diff --git a/Modules/Segmentation/KLMRegionGrowing/include/itkKLMRegionGrowImageFilter.hxx b/Modules/Segmentation/KLMRegionGrowing/include/itkKLMRegionGrowImageFilter.hxx index 2a6f54943c0..2fb260ccfdf 100644 --- a/Modules/Segmentation/KLMRegionGrowing/include/itkKLMRegionGrowImageFilter.hxx +++ b/Modules/Segmentation/KLMRegionGrowing/include/itkKLMRegionGrowImageFilter.hxx @@ -740,8 +740,7 @@ KLMRegionGrowImageFilter::ResolveRegions() UnsignedIntVectorType remapLabelsVec(m_InitialNumberOfRegions, 0); - UnsignedIntVectorType::iterator uniqueLabelsVecIterator; - uniqueLabelsVecIterator = uniqueLabelsVec.begin(); + UnsignedIntVectorType::iterator uniqueLabelsVecIterator = uniqueLabelsVec.begin(); RegionLabelType newLabelValue = 1; diff --git a/Modules/Segmentation/LevelSets/include/itkExtensionVelocitiesImageFilter.hxx b/Modules/Segmentation/LevelSets/include/itkExtensionVelocitiesImageFilter.hxx index 9e9458d0994..a96ace5d9a2 100644 --- a/Modules/Segmentation/LevelSets/include/itkExtensionVelocitiesImageFilter.hxx +++ b/Modules/Segmentation/LevelSets/include/itkExtensionVelocitiesImageFilter.hxx @@ -37,8 +37,7 @@ ExtensionVelocitiesImageFilter::ExtensionVe for (unsigned int k = 0; k < VAuxDimension; ++k) { - AuxImagePointer ptr; - ptr = AuxImageType::New(); + AuxImagePointer ptr = AuxImageType::New(); this->ProcessObject::SetNthOutput(k + 1, ptr.GetPointer()); } } @@ -187,8 +186,7 @@ ExtensionVelocitiesImageFilter::GenerateDat for (unsigned int k = 0; k < VAuxDimension; ++k) { - AuxImagePointer ptr; - ptr = m_Marcher->GetAuxiliaryImage(k); + AuxImagePointer ptr = m_Marcher->GetAuxiliaryImage(k); auxTempIt[k] = AuxIteratorType(ptr, ptr->GetBufferedRegion()); } @@ -321,8 +319,7 @@ ExtensionVelocitiesImageFilter::GenerateDat } // set all auxiliary images to zero - TAuxValue zeroPixel; - zeroPixel = 0.0; + TAuxValue zeroPixel = 0.0; using AuxIteratorType = ImageRegionIterator; diff --git a/Modules/Segmentation/LevelSets/include/itkLevelSetNeighborhoodExtractor.hxx b/Modules/Segmentation/LevelSets/include/itkLevelSetNeighborhoodExtractor.hxx index 5db971a13f0..be20bdf338c 100644 --- a/Modules/Segmentation/LevelSets/include/itkLevelSetNeighborhoodExtractor.hxx +++ b/Modules/Segmentation/LevelSets/include/itkLevelSetNeighborhoodExtractor.hxx @@ -193,9 +193,7 @@ LevelSetNeighborhoodExtractor::CalculateDistance(IndexType & index) m_LastPointIsInside = false; typename LevelSetImageType::PixelType centerValue; - PixelType inputPixel; - - inputPixel = m_InputLevelSet->GetPixel(index); + PixelType inputPixel = m_InputLevelSet->GetPixel(index); centerValue = static_cast(inputPixel); centerValue -= m_LevelSetValue; diff --git a/Modules/Segmentation/LevelSets/include/itkSparseFieldLevelSetImageFilter.hxx b/Modules/Segmentation/LevelSets/include/itkSparseFieldLevelSetImageFilter.hxx index ae3641674e8..092898a43b3 100644 --- a/Modules/Segmentation/LevelSets/include/itkSparseFieldLevelSetImageFilter.hxx +++ b/Modules/Segmentation/LevelSets/include/itkSparseFieldLevelSetImageFilter.hxx @@ -668,8 +668,7 @@ SparseFieldLevelSetImageFilter::ConstructActiveLayer( ValueType value; StatusType layer_number; - typename OutputImageType::IndexType upperBounds, lowerBounds; - lowerBounds = this->m_OutputImage->GetRequestedRegion().GetIndex(); + typename OutputImageType::IndexType upperBounds, lowerBounds = this->m_OutputImage->GetRequestedRegion().GetIndex(); upperBounds = this->m_OutputImage->GetRequestedRegion().GetIndex() + this->m_OutputImage->GetRequestedRegion().GetSize(); diff --git a/Modules/Segmentation/Watersheds/include/itkTobogganImageFilter.hxx b/Modules/Segmentation/Watersheds/include/itkTobogganImageFilter.hxx index d4cdb995670..eb03ac59c99 100644 --- a/Modules/Segmentation/Watersheds/include/itkTobogganImageFilter.hxx +++ b/Modules/Segmentation/Watersheds/include/itkTobogganImageFilter.hxx @@ -119,8 +119,7 @@ TobogganImageFilter::GenerateData() // ignore // If NeighborClass > 1 -> Found a new neighbor, but only if // it's minimum - OutputImagePixelType NeighborClass; - NeighborClass = outputImage->GetPixel(NeighborIndex); + OutputImagePixelType NeighborClass = outputImage->GetPixel(NeighborIndex); // See if we've already touched it if (NeighborClass != 1) { @@ -180,8 +179,7 @@ TobogganImageFilter::GenerateData() Visited.push_back(SeedIndex); itkDebugMacro("Flood fill, looking at " << SeedIndex); // Look at the neighbors - InputImagePixelType SeedValue; - SeedValue = inputImage->GetPixel(SeedIndex); + InputImagePixelType SeedValue = inputImage->GetPixel(SeedIndex); for (Dimension = 0; Dimension < ImageDimension; ++Dimension) { for (t = -1; t <= 1; t = t + 2) diff --git a/Modules/Segmentation/Watersheds/include/itkWatershedSegmentTable.hxx b/Modules/Segmentation/Watersheds/include/itkWatershedSegmentTable.hxx index 050ecb9f783..f4e1e7e6544 100644 --- a/Modules/Segmentation/Watersheds/include/itkWatershedSegmentTable.hxx +++ b/Modules/Segmentation/Watersheds/include/itkWatershedSegmentTable.hxx @@ -60,8 +60,7 @@ template bool SegmentTable::Add(IdentifierType a, const segment_t & t) { - std::pair result; - result = m_HashMap.insert(ValueType(a, t)); + std::pair result = m_HashMap.insert(ValueType(a, t)); if (result.second == false) { return false;