From edb7b08ff5ed6828c5eba0c12078509606fe4cd2 Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Thu, 21 Nov 2024 15:29:57 +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 ++--- .../itkMinMaxCurvatureFlowFunction.hxx | 3 +-- .../itkPatchBasedDenoisingBaseImageFilter.hxx | 3 +-- .../include/itkFastMarchingImageFilter.hxx | 3 +-- ...essian3DToVesselnessMeasureImageFilter.hxx | 4 +-- .../itkVectorGradientMagnitudeImageFilter.h | 4 +-- .../itkBSplineControlPointImageFilter.hxx | 3 +-- .../itkBSplineResampleImageFilterBase.hxx | 6 ++--- ...lineScatteredDataPointSetToImageFilter.hxx | 3 +-- .../include/itkShrinkImageFilter.hxx | 3 +-- .../include/itkAdaptImageFilter.h | 4 +-- .../include/itkPolylineMaskImageFilter.hxx | 11 +++----- .../include/itkScanlineFilterCommon.h | 3 +-- .../include/itkInPlaceLabelMapFilter.hxx | 4 +-- ...tkGrayscaleConnectedClosingImageFilter.hxx | 6 ++--- ...tkGrayscaleConnectedOpeningImageFilter.hxx | 6 ++--- .../itkGrayscaleFillholeImageFilter.hxx | 3 +-- .../itkGrayscaleGrindPeakImageFilter.hxx | 3 +-- .../itkValuedRegionalExtremaImageFilter.hxx | 3 +-- .../Path/include/itkParametricPath.hxx | 4 +-- .../itkRecursiveGaussianImageFilter.hxx | 3 +-- .../itkScalarRegionBasedLevelSetFunction.hxx | 3 +-- .../FEM/include/itkFEMRobustSolver.hxx | 6 ++--- .../src/itkFEMLinearSystemWrapperDenseVNL.cxx | 3 +-- .../src/itkParticleSwarmOptimizerBase.cxx | 9 +++---- ...istrationParameterScalesFromIndexShift.hxx | 6 ++--- .../include/itkSampleClassifierFilter.hxx | 3 +-- ...tkGradientDifferenceImageToImageMetric.hxx | 4 +-- ...ocalSquareDifferenceImageToImageMetric.hxx | 4 +-- .../FEM/include/itkFEMRegistrationFilter.hxx | 4 +-- .../include/itkKLMRegionGrowImageFilter.hxx | 3 +-- .../itkExtensionVelocitiesImageFilter.hxx | 9 +++---- .../itkLevelSetNeighborhoodExtractor.hxx | 4 +-- .../itkSparseFieldLevelSetImageFilter.hxx | 3 +-- .../include/itkTobogganImageFilter.hxx | 6 ++--- .../include/itkWatershedSegmentTable.hxx | 3 +-- 52 files changed, 79 insertions(+), 170 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/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/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/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 7c3bf0db149..5c6fd0cb682 100644 --- a/Modules/Filtering/ImageGrid/include/itkBSplineResampleImageFilterBase.hxx +++ b/Modules/Filtering/ImageGrid/include/itkBSplineResampleImageFilterBase.hxx @@ -377,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); @@ -491,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 0b5b0a593c3..7c9f7b05509 100644 --- a/Modules/Filtering/ImageLabel/include/itkScanlineFilterCommon.h +++ b/Modules/Filtering/ImageLabel/include/itkScanlineFilterCommon.h @@ -426,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/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 176e333f781..42a6585c76d 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleConnectedClosingImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleConnectedClosingImageFilter.hxx @@ -77,12 +77,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 e076a7a407e..c0eba26517f 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleConnectedOpeningImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleConnectedOpeningImageFilter.hxx @@ -77,12 +77,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 10e0b8773ef..abff526750a 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleFillholeImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleFillholeImageFilter.hxx @@ -74,8 +74,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 38a277706ec..177b98a2f2d 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGrindPeakImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGrindPeakImageFilter.hxx @@ -84,8 +84,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/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/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/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/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/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/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 eb24a306505..f1595cda00b 100644 --- a/Modules/Segmentation/LevelSets/include/itkSparseFieldLevelSetImageFilter.hxx +++ b/Modules/Segmentation/LevelSets/include/itkSparseFieldLevelSetImageFilter.hxx @@ -667,8 +667,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;