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/itkImageRegionExclusionConstIteratorWithIndex.hxx b/Modules/Core/Common/include/itkImageRegionExclusionConstIteratorWithIndex.hxx index 14426890673..eddc78c49b8 100644 --- a/Modules/Core/Common/include/itkImageRegionExclusionConstIteratorWithIndex.hxx +++ b/Modules/Core/Common/include/itkImageRegionExclusionConstIteratorWithIndex.hxx @@ -63,9 +63,7 @@ template void ImageRegionExclusionConstIteratorWithIndex::SetExclusionRegionToInsetRegion() { - RegionType excludeRegion; - - excludeRegion = this->m_Region; + RegionType excludeRegion = this->m_Region; for (unsigned int i = 0; i < TImage::ImageDimension; ++i) { if (excludeRegion.GetSize()[i] >= 2) 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/FiniteDifference/include/itkFiniteDifferenceImageFilter.hxx b/Modules/Core/FiniteDifference/include/itkFiniteDifferenceImageFilter.hxx index e2603d90bc6..9f4e778ef09 100644 --- a/Modules/Core/FiniteDifference/include/itkFiniteDifferenceImageFilter.hxx +++ b/Modules/Core/FiniteDifference/include/itkFiniteDifferenceImageFilter.hxx @@ -134,8 +134,7 @@ FiniteDifferenceImageFilter::GenerateInputRequestedRe // get a copy of the input requested region (should equal the output // requested region) - typename TInputImage::RegionType inputRequestedRegion; - inputRequestedRegion = inputPtr->GetRequestedRegion(); + typename TInputImage::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // pad the input requested region by the operator radius inputRequestedRegion.PadByRadius(radius); 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/GPUFiniteDifference/include/itkGPUFiniteDifferenceImageFilter.hxx b/Modules/Core/GPUFiniteDifference/include/itkGPUFiniteDifferenceImageFilter.hxx index f84c3cae966..9ba2e5551af 100644 --- a/Modules/Core/GPUFiniteDifference/include/itkGPUFiniteDifferenceImageFilter.hxx +++ b/Modules/Core/GPUFiniteDifference/include/itkGPUFiniteDifferenceImageFilter.hxx @@ -144,8 +144,7 @@ GPUFiniteDifferenceImageFilter::G // get a copy of the input requested region (should equal the output // requested region) - typename TInputImage::RegionType inputRequestedRegion; - inputRequestedRegion = inputPtr->GetRequestedRegion(); + typename TInputImage::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // pad the input requested region by the operator radius inputRequestedRegion.PadByRadius(radius); 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::EvaluateAtIndex(const IndexType } // first direction - typename InternalImageType::IndexType ind; - ind = index; + typename InternalImageType::IndexType ind = index; // Define the region of the iterator typename InternalImageType::RegionType region; diff --git a/Modules/Core/ImageFunction/include/itkMeanImageFunction.hxx b/Modules/Core/ImageFunction/include/itkMeanImageFunction.hxx index 3e1928f170d..ef8e1975a2a 100644 --- a/Modules/Core/ImageFunction/include/itkMeanImageFunction.hxx +++ b/Modules/Core/ImageFunction/include/itkMeanImageFunction.hxx @@ -34,9 +34,7 @@ template 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/TestKernel/src/itkTestDriverInclude.cxx b/Modules/Core/TestKernel/src/itkTestDriverInclude.cxx index f0bb4d72bfb..f64dd8a7e02 100644 --- a/Modules/Core/TestKernel/src/itkTestDriverInclude.cxx +++ b/Modules/Core/TestKernel/src/itkTestDriverInclude.cxx @@ -503,10 +503,8 @@ RegressionTestHelper(const char * testImageFilename, } // The sizes of the baseline and test image must match - typename ImageType::SizeType baselineSize; - baselineSize = baselineReader->GetOutput()->GetLargestPossibleRegion().GetSize(); - typename ImageType::SizeType testSize; - testSize = testReader->GetOutput()->GetLargestPossibleRegion().GetSize(); + typename ImageType::SizeType baselineSize = baselineReader->GetOutput()->GetLargestPossibleRegion().GetSize(); + typename ImageType::SizeType testSize = testReader->GetOutput()->GetLargestPossibleRegion().GetSize(); if (baselineSize != testSize) { @@ -907,8 +905,7 @@ HashTestImage(const char * testImageFilename, const std::vector & b reader->SetFileName(testImageFilename); reader->UpdateLargestPossibleRegion(); - ImageType::SizeType size; - size = reader->GetOutput()->GetLargestPossibleRegion().GetSize(); + ImageType::SizeType size = reader->GetOutput()->GetLargestPossibleRegion().GetSize(); // Get the center slice of the image, In 3D, the first slice // is often a black slice with little debugging information. 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/BiasCorrection/include/itkMRIBiasFieldCorrectionFilter.hxx b/Modules/Filtering/BiasCorrection/include/itkMRIBiasFieldCorrectionFilter.hxx index 61fbc047928..20672dffc5e 100644 --- a/Modules/Filtering/BiasCorrection/include/itkMRIBiasFieldCorrectionFilter.hxx +++ b/Modules/Filtering/BiasCorrection/include/itkMRIBiasFieldCorrectionFilter.hxx @@ -785,9 +785,7 @@ void MRIBiasFieldCorrectionFilter::Log1PImage(InternalImageType * source, InternalImageType * target) { - InternalImageRegionType region; - - region = source->GetRequestedRegion(); + InternalImageRegionType region = source->GetRequestedRegion(); ImageRegionIterator s_iter(source, region); ImageRegionIterator t_iter(target, region); @@ -816,9 +814,7 @@ void MRIBiasFieldCorrectionFilter::ExpImage(InternalImageType * source, InternalImageType * target) { - InternalImageRegionType region; - - region = source->GetLargestPossibleRegion(); + InternalImageRegionType region = source->GetLargestPossibleRegion(); ImageRegionIterator s_iter(source, region); ImageRegionIterator t_iter(target, region); 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/BinaryMathematicalMorphology/include/itkObjectMorphologyImageFilter.hxx b/Modules/Filtering/BinaryMathematicalMorphology/include/itkObjectMorphologyImageFilter.hxx index 9e2ace6b228..e8613b7d7a7 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/include/itkObjectMorphologyImageFilter.hxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/include/itkObjectMorphologyImageFilter.hxx @@ -59,8 +59,7 @@ ObjectMorphologyImageFilter::GenerateInputRe // get a copy of the input requested region (should equal the output // requested region) - typename TInputImage::RegionType inputRequestedRegion; - inputRequestedRegion = inputPtr->GetRequestedRegion(); + typename TInputImage::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // pad the input requested region by the operator radius inputRequestedRegion.PadByRadius(m_Kernel.GetRadius()); diff --git a/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.hxx b/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.hxx index 50b8587bd64..9c94b8d7805 100644 --- a/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.hxx +++ b/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.hxx @@ -377,8 +377,7 @@ MaskedFFTNormalizedCorrelationImageFilter InputSizeType & FFTImageSize) { typename LocalInputImageType::PixelType constantPixel = 0; - typename LocalInputImageType::SizeType upperPad; - upperPad = FFTImageSize - inputImage->GetLargestPossibleRegion().GetSize(); + typename LocalInputImageType::SizeType upperPad = FFTImageSize - inputImage->GetLargestPossibleRegion().GetSize(); using PadType = itk::ConstantPadImageFilter; auto padder = PadType::New(); @@ -647,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/Convolution/include/itkNormalizedCorrelationImageFilter.hxx b/Modules/Filtering/Convolution/include/itkNormalizedCorrelationImageFilter.hxx index e7ab4a5ace6..cdd93a30b08 100644 --- a/Modules/Filtering/Convolution/include/itkNormalizedCorrelationImageFilter.hxx +++ b/Modules/Filtering/Convolution/include/itkNormalizedCorrelationImageFilter.hxx @@ -62,8 +62,7 @@ NormalizedCorrelationImageFilterGetRequestedRegion(); + typename TInputImage::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // set the mask requested region to match the input requested region if (maskPtr->GetLargestPossibleRegion().IsInside(inputRequestedRegion)) 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/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx b/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx index 0c6579b0b15..bbfa98e9ed9 100644 --- a/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx +++ b/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx @@ -166,8 +166,7 @@ PatchBasedDenoisingImageFilter::GenerateInputRequeste // Get a copy of the input requested region (should equal the output // requested region) - typename InputImageType::RegionType inputRequestedRegion; - inputRequestedRegion = inputPtr->GetRequestedRegion(); + typename InputImageType::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // Pad the input requested region by the operator radius inputRequestedRegion.PadByRadius(voxelNeighborhoodSize); @@ -487,8 +486,7 @@ PatchBasedDenoisingImageFilter::InitializePatchWeight for (ImageRegionIteratorWithIndex pwIt(physicalWeightsImage, physicalRegion); !pwIt.IsAtEnd(); ++pwIt) { - typename WeightsImageType::IndexType curIndex; - curIndex = pwIt.GetIndex(); + typename WeightsImageType::IndexType curIndex = pwIt.GetIndex(); // Compute distances of each pixel from center pixel Vector distanceVector; for (unsigned int d = 0; d < ImageDimension; ++d) diff --git a/Modules/Filtering/DisplacementField/include/itkDisplacementFieldJacobianDeterminantFilter.hxx b/Modules/Filtering/DisplacementField/include/itkDisplacementFieldJacobianDeterminantFilter.hxx index 95bfdb22524..3e47dab3fd9 100644 --- a/Modules/Filtering/DisplacementField/include/itkDisplacementFieldJacobianDeterminantFilter.hxx +++ b/Modules/Filtering/DisplacementField/include/itkDisplacementFieldJacobianDeterminantFilter.hxx @@ -106,8 +106,7 @@ DisplacementFieldJacobianDeterminantFilter // get a copy of the input requested region (should equal the output // requested region) - typename TInputImage::RegionType inputRequestedRegion; - inputRequestedRegion = inputPtr->GetRequestedRegion(); + typename TInputImage::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // pad the input requested region by the operator radius inputRequestedRegion.PadByRadius(m_NeighborhoodRadius); diff --git a/Modules/Filtering/DisplacementField/include/itkInverseDisplacementFieldImageFilter.hxx b/Modules/Filtering/DisplacementField/include/itkInverseDisplacementFieldImageFilter.hxx index 6d01860d246..1931fbb5e51 100644 --- a/Modules/Filtering/DisplacementField/include/itkInverseDisplacementFieldImageFilter.hxx +++ b/Modules/Filtering/DisplacementField/include/itkInverseDisplacementFieldImageFilter.hxx @@ -124,9 +124,7 @@ InverseDisplacementFieldImageFilter::PrepareKernelBas using InputRegionType = typename InputImageType::RegionType; using InputSizeType = typename InputImageType::SizeType; - InputRegionType region; - - region = inputImage->GetLargestPossibleRegion(); + InputRegionType region = inputImage->GetLargestPossibleRegion(); InputSizeType size = region.GetSize(); 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/GPUImageFilterBase/include/itkGPUNeighborhoodOperatorImageFilter.hxx b/Modules/Filtering/GPUImageFilterBase/include/itkGPUNeighborhoodOperatorImageFilter.hxx index 86e880b85fd..fb056a0682e 100644 --- a/Modules/Filtering/GPUImageFilterBase/include/itkGPUNeighborhoodOperatorImageFilter.hxx +++ b/Modules/Filtering/GPUImageFilterBase/include/itkGPUNeighborhoodOperatorImageFilter.hxx @@ -47,8 +47,7 @@ GPUNeighborhoodOperatorImageFilter< TInputImage, TOutputImage, TOperatorValueTyp // get a copy of the input requested region (should equal the output // requested region) - typename TInputImage::RegionType inputRequestedRegion; - inputRequestedRegion = inputPtr->GetRequestedRegion(); + typename TInputImage::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // pad the input requested region by the operator radius inputRequestedRegion.PadByRadius( m_Operator.GetRadius() ); diff --git a/Modules/Filtering/ImageFeature/include/itkBilateralImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkBilateralImageFilter.hxx index 92bf5bed6cc..3eff34e8b21 100644 --- a/Modules/Filtering/ImageFeature/include/itkBilateralImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkBilateralImageFilter.hxx @@ -92,8 +92,7 @@ BilateralImageFilter::GenerateInputRequestedRegion() // get a copy of the input requested region (should equal the output // requested region) - typename TInputImage::RegionType inputRequestedRegion; - inputRequestedRegion = inputPtr->GetRequestedRegion(); + typename TInputImage::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // pad the input requested region by the operator radius inputRequestedRegion.PadByRadius(radius); diff --git a/Modules/Filtering/ImageFeature/include/itkDerivativeImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkDerivativeImageFilter.hxx index b57a201e286..34173392c09 100644 --- a/Modules/Filtering/ImageFeature/include/itkDerivativeImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkDerivativeImageFilter.hxx @@ -49,8 +49,7 @@ DerivativeImageFilter::GenerateInputRequestedRegion() // get a copy of the input requested region (should equal the output // requested region) - typename TInputImage::RegionType inputRequestedRegion; - inputRequestedRegion = inputPtr->GetRequestedRegion(); + typename TInputImage::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // pad the input requested region by the operator radius inputRequestedRegion.PadByRadius(oper.GetRadius()); diff --git a/Modules/Filtering/ImageFeature/include/itkDiscreteGaussianDerivativeImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkDiscreteGaussianDerivativeImageFilter.hxx index b6b58a3dfe2..bc7ab987cdd 100644 --- a/Modules/Filtering/ImageFeature/include/itkDiscreteGaussianDerivativeImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkDiscreteGaussianDerivativeImageFilter.hxx @@ -68,8 +68,7 @@ DiscreteGaussianDerivativeImageFilter::GenerateInputR // get a copy of the input requested region (should equal the output // requested region) - typename TInputImage::RegionType inputRequestedRegion; - inputRequestedRegion = inputPtr->GetRequestedRegion(); + typename TInputImage::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // pad the input requested region by the operator radius inputRequestedRegion.PadByRadius(radius); 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/ImageFeature/include/itkLaplacianImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkLaplacianImageFilter.hxx index d21b0a97db2..62bb59287ef 100644 --- a/Modules/Filtering/ImageFeature/include/itkLaplacianImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkLaplacianImageFilter.hxx @@ -55,8 +55,7 @@ LaplacianImageFilter::GenerateInputRequestedRegion() // get a copy of the input requested region (should equal the output // requested region) - typename TInputImage::RegionType inputRequestedRegion; - inputRequestedRegion = inputPtr->GetRequestedRegion(); + typename TInputImage::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // pad the input requested region by the operator radius inputRequestedRegion.PadByRadius(oper.GetRadius()); diff --git a/Modules/Filtering/ImageFeature/include/itkSobelEdgeDetectionImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkSobelEdgeDetectionImageFilter.hxx index 386ad5bee69..c077f2fe633 100644 --- a/Modules/Filtering/ImageFeature/include/itkSobelEdgeDetectionImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkSobelEdgeDetectionImageFilter.hxx @@ -48,8 +48,7 @@ SobelEdgeDetectionImageFilter::GenerateInputRequested // get a copy of the input requested region (should equal the output // requested region) - typename TInputImage::RegionType inputRequestedRegion; - inputRequestedRegion = inputPtr->GetRequestedRegion(); + typename TInputImage::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // pad the input requested region by the operator radius inputRequestedRegion.PadByRadius(oper.GetRadius()); diff --git a/Modules/Filtering/ImageFeature/include/itkZeroCrossingImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkZeroCrossingImageFilter.hxx index f5b7e1c0008..b1af89921bb 100644 --- a/Modules/Filtering/ImageFeature/include/itkZeroCrossingImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkZeroCrossingImageFilter.hxx @@ -58,8 +58,7 @@ ZeroCrossingImageFilter::GenerateInputRequestedRegion // get a copy of the input requested region (should equal the output // requested region) - typename TInputImage::RegionType inputRequestedRegion; - inputRequestedRegion = inputPtr->GetRequestedRegion(); + typename TInputImage::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // pad the input requested region by the operator radius inputRequestedRegion.PadByRadius(radius); diff --git a/Modules/Filtering/ImageFilterBase/include/itkBoxImageFilter.hxx b/Modules/Filtering/ImageFilterBase/include/itkBoxImageFilter.hxx index a57c3738b94..327d49f5e9e 100644 --- a/Modules/Filtering/ImageFilterBase/include/itkBoxImageFilter.hxx +++ b/Modules/Filtering/ImageFilterBase/include/itkBoxImageFilter.hxx @@ -64,8 +64,7 @@ BoxImageFilter::GenerateInputRequestedRegion() // get a copy of the input requested region (should equal the output // requested region) - typename TInputImage::RegionType inputRequestedRegion; - inputRequestedRegion = inputPtr->GetRequestedRegion(); + typename TInputImage::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // pad the input requested region by the operator radius inputRequestedRegion.PadByRadius(m_Radius); diff --git a/Modules/Filtering/ImageFilterBase/include/itkMaskNeighborhoodOperatorImageFilter.hxx b/Modules/Filtering/ImageFilterBase/include/itkMaskNeighborhoodOperatorImageFilter.hxx index 84587174845..942183166c2 100644 --- a/Modules/Filtering/ImageFilterBase/include/itkMaskNeighborhoodOperatorImageFilter.hxx +++ b/Modules/Filtering/ImageFilterBase/include/itkMaskNeighborhoodOperatorImageFilter.hxx @@ -62,8 +62,7 @@ MaskNeighborhoodOperatorImageFilterGetRequestedRegion(); + typename TInputImage::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // set the mask requested region to match the input requested region if (maskPtr->GetLargestPossibleRegion().IsInside(inputRequestedRegion)) 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/ImageFilterBase/include/itkNeighborhoodOperatorImageFilter.hxx b/Modules/Filtering/ImageFilterBase/include/itkNeighborhoodOperatorImageFilter.hxx index 7414a8f8a95..12a6f2f35e0 100644 --- a/Modules/Filtering/ImageFilterBase/include/itkNeighborhoodOperatorImageFilter.hxx +++ b/Modules/Filtering/ImageFilterBase/include/itkNeighborhoodOperatorImageFilter.hxx @@ -45,8 +45,7 @@ NeighborhoodOperatorImageFilter:: // get a copy of the input requested region (should equal the output // requested region) - typename TInputImage::RegionType inputRequestedRegion; - inputRequestedRegion = inputPtr->GetRequestedRegion(); + typename TInputImage::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // pad the input requested region by the operator radius inputRequestedRegion.PadByRadius(m_Operator.GetRadius()); diff --git a/Modules/Filtering/ImageFilterBase/include/itkVectorNeighborhoodOperatorImageFilter.hxx b/Modules/Filtering/ImageFilterBase/include/itkVectorNeighborhoodOperatorImageFilter.hxx index bd6deef38ba..6a785bd30c8 100644 --- a/Modules/Filtering/ImageFilterBase/include/itkVectorNeighborhoodOperatorImageFilter.hxx +++ b/Modules/Filtering/ImageFilterBase/include/itkVectorNeighborhoodOperatorImageFilter.hxx @@ -44,8 +44,7 @@ VectorNeighborhoodOperatorImageFilter::GenerateInputR // get a copy of the input requested region (should equal the output // requested region) - typename TInputImage::RegionType inputRequestedRegion; - inputRequestedRegion = inputPtr->GetRequestedRegion(); + typename TInputImage::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // pad the input requested region by the operator radius inputRequestedRegion.PadByRadius(m_Operator.GetRadius()); diff --git a/Modules/Filtering/ImageGradient/include/itkGradientMagnitudeImageFilter.hxx b/Modules/Filtering/ImageGradient/include/itkGradientMagnitudeImageFilter.hxx index f547183d9c4..974ad50a543 100644 --- a/Modules/Filtering/ImageGradient/include/itkGradientMagnitudeImageFilter.hxx +++ b/Modules/Filtering/ImageGradient/include/itkGradientMagnitudeImageFilter.hxx @@ -64,8 +64,7 @@ GradientMagnitudeImageFilter::GenerateInputRequestedR // get a copy of the input requested region (should equal the output // requested region) - typename TInputImage::RegionType inputRequestedRegion; - inputRequestedRegion = inputPtr->GetRequestedRegion(); + typename TInputImage::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // pad the input requested region by one, which is the value of the first // coordinate of the operator radius. 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/ImageGradient/include/itkVectorGradientMagnitudeImageFilter.hxx b/Modules/Filtering/ImageGradient/include/itkVectorGradientMagnitudeImageFilter.hxx index 334b906d8ab..6d4916a9be0 100644 --- a/Modules/Filtering/ImageGradient/include/itkVectorGradientMagnitudeImageFilter.hxx +++ b/Modules/Filtering/ImageGradient/include/itkVectorGradientMagnitudeImageFilter.hxx @@ -99,8 +99,7 @@ VectorGradientMagnitudeImageFilter::Genera // get a copy of the input requested region (should equal the output // requested region) - typename TInputImage::RegionType inputRequestedRegion; - inputRequestedRegion = inputPtr->GetRequestedRegion(); + typename TInputImage::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); constexpr auto r1 = MakeFilled(1); // pad the input requested region by the operator radius 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 a0ad0a2ca85..ac579a4de83 100644 --- a/Modules/Filtering/ImageGrid/include/itkBSplineResampleImageFilterBase.hxx +++ b/Modules/Filtering/ImageGrid/include/itkBSplineResampleImageFilterBase.hxx @@ -348,11 +348,9 @@ 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; - scratchRegion = inputPtr->GetBufferedRegion(); + RegionType scratchRegion = inputPtr->GetBufferedRegion(); currentSize = startSize; // scratchImage only needs the 1/2 the space of the original // image for the first dimension. @@ -379,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); @@ -463,11 +460,9 @@ 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; - scratchRegion = inputPtr->GetBufferedRegion(); + RegionType scratchRegion = inputPtr->GetBufferedRegion(); currentSize = startSize; // scratchImage 2 times the space of the original image . @@ -495,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/itkResampleImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.hxx index 6b3f64c9747..aa767ba6d36 100644 --- a/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.hxx @@ -554,8 +554,8 @@ ResampleImageFilterGetTransformCategory() == TransformType::TransformCategoryEnum::Linear) { - typename TInputImage::RegionType inputRequestedRegion; - inputRequestedRegion = ImageAlgorithm::EnlargeRegionOverBox(output->GetRequestedRegion(), output, input, transform); + typename TInputImage::RegionType inputRequestedRegion = + ImageAlgorithm::EnlargeRegionOverBox(output->GetRequestedRegion(), output, input, transform); const typename TInputImage::RegionType inputLargestRegion(input->GetLargestPossibleRegion()); if (inputLargestRegion.IsInside(inputRequestedRegion.GetIndex()) || 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/itkAccumulateImageFilter.hxx b/Modules/Filtering/ImageStatistics/include/itkAccumulateImageFilter.hxx index d978621a935..9c7c4a47f53 100644 --- a/Modules/Filtering/ImageStatistics/include/itkAccumulateImageFilter.hxx +++ b/Modules/Filtering/ImageStatistics/include/itkAccumulateImageFilter.hxx @@ -104,9 +104,7 @@ AccumulateImageFilter::GenerateInputRequestedRegion() typename TInputImage::SizeType inputLargSize; typename TInputImage::IndexType inputLargIndex; typename TOutputImage::SizeType outputSize; - typename TOutputImage::IndexType outputIndex; - - outputIndex = this->GetOutput()->GetRequestedRegion().GetIndex(); + typename TOutputImage::IndexType outputIndex = this->GetOutput()->GetRequestedRegion().GetIndex(); outputSize = this->GetOutput()->GetRequestedRegion().GetSize(); inputLargSize = this->GetInput()->GetLargestPossibleRegion().GetSize(); inputLargIndex = this->GetInput()->GetLargestPossibleRegion().GetIndex(); 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/ImageStatistics/include/itkProjectionImageFilter.hxx b/Modules/Filtering/ImageStatistics/include/itkProjectionImageFilter.hxx index 506f4ca7fdc..3667a654f55 100644 --- a/Modules/Filtering/ImageStatistics/include/itkProjectionImageFilter.hxx +++ b/Modules/Filtering/ImageStatistics/include/itkProjectionImageFilter.hxx @@ -144,9 +144,7 @@ ProjectionImageFilter::GenerateInputReq typename TInputImage::SizeType inputLargSize; typename TInputImage::IndexType inputLargIndex; typename TOutputImage::SizeType outputSize; - typename TOutputImage::IndexType outputIndex; - - outputIndex = this->GetOutput()->GetRequestedRegion().GetIndex(); + typename TOutputImage::IndexType outputIndex = this->GetOutput()->GetRequestedRegion().GetIndex(); outputSize = this->GetOutput()->GetRequestedRegion().GetSize(); inputLargSize = this->GetInput()->GetLargestPossibleRegion().GetSize(); inputLargIndex = this->GetInput()->GetLargestPossibleRegion().GetIndex(); diff --git a/Modules/Filtering/LabelMap/include/itkBinaryImageToLabelMapFilter.hxx b/Modules/Filtering/LabelMap/include/itkBinaryImageToLabelMapFilter.hxx index 5f7cf568cfa..47b6ca78fbc 100644 --- a/Modules/Filtering/LabelMap/include/itkBinaryImageToLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkBinaryImageToLabelMapFilter.hxx @@ -168,8 +168,7 @@ BinaryImageToLabelMapFilter::DynamicThreadedGenerateD { // We've hit the start of a run SizeValueType length = 0; - IndexType thisIndex; - thisIndex = inLineIt.GetIndex(); + IndexType thisIndex = inLineIt.GetIndex(); ++length; ++inLineIt; while (!inLineIt.IsAtEndOfLine() && inLineIt.Get() == this->m_InputForegroundValue) 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/itkGrayscaleGeodesicDilateImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGeodesicDilateImageFilter.hxx index 2460b7cced9..9251eb3e781 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGeodesicDilateImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGeodesicDilateImageFilter.hxx @@ -107,8 +107,7 @@ GrayscaleGeodesicDilateImageFilter::GenerateInputRequ // get a copy of the marker image requested region (should equal // the output requested region) - MarkerImageRegionType markerRequestedRegion; - markerRequestedRegion = markerPtr->GetRequestedRegion(); + MarkerImageRegionType markerRequestedRegion = markerPtr->GetRequestedRegion(); // pad the marker requested region by the elementary operator radius markerRequestedRegion.PadByRadius(1); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGeodesicErodeImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGeodesicErodeImageFilter.hxx index 2cbcd528f0c..dac5b999cd0 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGeodesicErodeImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGeodesicErodeImageFilter.hxx @@ -107,8 +107,7 @@ GrayscaleGeodesicErodeImageFilter::GenerateInputReque // get a copy of the marker image requested region (should equal // the output requested region) - MarkerImageRegionType markerRequestedRegion; - markerRequestedRegion = markerPtr->GetRequestedRegion(); + MarkerImageRegionType markerRequestedRegion = markerPtr->GetRequestedRegion(); // pad the marker requested region by the elementary operator radius markerRequestedRegion.PadByRadius(1); 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/itkBinomialBlurImageFilter.hxx b/Modules/Filtering/Smoothing/include/itkBinomialBlurImageFilter.hxx index 8836f88b3bd..726b8d521fd 100644 --- a/Modules/Filtering/Smoothing/include/itkBinomialBlurImageFilter.hxx +++ b/Modules/Filtering/Smoothing/include/itkBinomialBlurImageFilter.hxx @@ -106,8 +106,7 @@ BinomialBlurImageFilter::GenerateData() using TTempImage = Image; auto tempPtr = TTempImage::New(); - typename TTempImage::RegionType tempRegion; - tempRegion = inputPtr->GetRequestedRegion(); + typename TTempImage::RegionType tempRegion = inputPtr->GetRequestedRegion(); tempPtr->SetRegions(tempRegion); tempPtr->Allocate(); diff --git a/Modules/Filtering/Smoothing/include/itkDiscreteGaussianImageFilter.hxx b/Modules/Filtering/Smoothing/include/itkDiscreteGaussianImageFilter.hxx index 8fd46e26191..eeaad943976 100644 --- a/Modules/Filtering/Smoothing/include/itkDiscreteGaussianImageFilter.hxx +++ b/Modules/Filtering/Smoothing/include/itkDiscreteGaussianImageFilter.hxx @@ -138,8 +138,7 @@ DiscreteGaussianImageFilter::GenerateInputRequestedRe // get a copy of the input requested region (should equal the output // requested region) - typename TInputImage::RegionType inputRequestedRegion; - inputRequestedRegion = inputPtr->GetRequestedRegion(); + typename TInputImage::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // pad the input requested region by the operator radius inputRequestedRegion.PadByRadius(radius); diff --git a/Modules/Filtering/Smoothing/include/itkFFTDiscreteGaussianImageFilter.hxx b/Modules/Filtering/Smoothing/include/itkFFTDiscreteGaussianImageFilter.hxx index 0539abee358..50182008d47 100644 --- a/Modules/Filtering/Smoothing/include/itkFFTDiscreteGaussianImageFilter.hxx +++ b/Modules/Filtering/Smoothing/include/itkFFTDiscreteGaussianImageFilter.hxx @@ -47,8 +47,7 @@ FFTDiscreteGaussianImageFilter::GenerateInputRequeste // get a copy of the input requested region (should equal the output // requested region) - typename TInputImage::RegionType inputRequestedRegion; - inputRequestedRegion = inputPtr->GetRequestedRegion(); + typename TInputImage::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // pad the input requested region by the operator radius RadiusType radius{}; 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/itkMultiphaseFiniteDifferenceImageFilter.hxx b/Modules/Nonunit/Review/include/itkMultiphaseFiniteDifferenceImageFilter.hxx index a8347b8e2b1..f2eddcc1704 100644 --- a/Modules/Nonunit/Review/include/itkMultiphaseFiniteDifferenceImageFilter.hxx +++ b/Modules/Nonunit/Review/include/itkMultiphaseFiniteDifferenceImageFilter.hxx @@ -162,8 +162,7 @@ MultiphaseFiniteDifferenceImageFilterGetRequestedRegion(); + FeatureRegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // pad the input requested region by the operator radius inputRequestedRegion.PadByRadius(radius); 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/itkMahalanobisDistanceMetric.hxx b/Modules/Numerics/Statistics/include/itkMahalanobisDistanceMetric.hxx index 58bd1458c0c..89715ed4306 100644 --- a/Modules/Numerics/Statistics/include/itkMahalanobisDistanceMetric.hxx +++ b/Modules/Numerics/Statistics/include/itkMahalanobisDistanceMetric.hxx @@ -27,9 +27,7 @@ template MahalanobisDistanceMetric::MahalanobisDistanceMetric() { - MeasurementVectorSizeType size; - - size = this->GetMeasurementVectorSize(); + MeasurementVectorSizeType size = this->GetMeasurementVectorSize(); this->m_Covariance.set_size(size, size); this->m_InverseCovariance.set_size(size, size); 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/Numerics/Statistics/include/itkScalarImageToRunLengthMatrixFilter.hxx b/Modules/Numerics/Statistics/include/itkScalarImageToRunLengthMatrixFilter.hxx index b5a10463952..1876bdcf906 100644 --- a/Modules/Numerics/Statistics/include/itkScalarImageToRunLengthMatrixFilter.hxx +++ b/Modules/Numerics/Statistics/include/itkScalarImageToRunLengthMatrixFilter.hxx @@ -190,9 +190,7 @@ ScalarImageToRunLengthMatrixFilter::Ge MeasurementType lastBinMax = this->GetOutput()->GetDimensionMaxs(0)[this->GetOutput()->GetSize(0) - 1]; PixelType pixelIntensity(PixelType{}); - IndexType index; - - index = centerIndex + offset; + IndexType index = centerIndex + offset; IndexType lastGoodIndex = centerIndex; bool runLengthSegmentAlreadyVisited = false; 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/LabelVoting/include/itkBinaryMedianImageFilter.hxx b/Modules/Segmentation/LabelVoting/include/itkBinaryMedianImageFilter.hxx index c85bc28c13e..b541438144d 100644 --- a/Modules/Segmentation/LabelVoting/include/itkBinaryMedianImageFilter.hxx +++ b/Modules/Segmentation/LabelVoting/include/itkBinaryMedianImageFilter.hxx @@ -58,8 +58,7 @@ BinaryMedianImageFilter::GenerateInputRequestedRegion // get a copy of the input requested region (should equal the output // requested region) - typename TInputImage::RegionType inputRequestedRegion; - inputRequestedRegion = inputPtr->GetRequestedRegion(); + typename TInputImage::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // pad the input requested region by the operator radius inputRequestedRegion.PadByRadius(m_Radius); diff --git a/Modules/Segmentation/LabelVoting/include/itkVotingBinaryImageFilter.hxx b/Modules/Segmentation/LabelVoting/include/itkVotingBinaryImageFilter.hxx index d1cec15c02d..6704082e11e 100644 --- a/Modules/Segmentation/LabelVoting/include/itkVotingBinaryImageFilter.hxx +++ b/Modules/Segmentation/LabelVoting/include/itkVotingBinaryImageFilter.hxx @@ -58,8 +58,7 @@ VotingBinaryImageFilter::GenerateInputRequestedRegion // get a copy of the input requested region (should equal the output // requested region) - typename TInputImage::RegionType inputRequestedRegion; - inputRequestedRegion = inputPtr->GetRequestedRegion(); + typename TInputImage::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // pad the input requested region by the operator radius inputRequestedRegion.PadByRadius(m_Radius); 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 d0a3287a1b6..eb03ac59c99 100644 --- a/Modules/Segmentation/Watersheds/include/itkTobogganImageFilter.hxx +++ b/Modules/Segmentation/Watersheds/include/itkTobogganImageFilter.hxx @@ -108,8 +108,7 @@ TobogganImageFilter::GenerateData() { for (t = 1; t >= -1; t = t - 2) { - IndexType NeighborIndex; - NeighborIndex = CurrentPositionIndex; + IndexType NeighborIndex = CurrentPositionIndex; NeighborIndex[Dimension] += t; if (outputImage->GetRequestedRegion().IsInside(NeighborIndex)) { @@ -120,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) { @@ -181,14 +179,12 @@ 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) { - IndexType NeighborIndex; - NeighborIndex = SeedIndex; + IndexType NeighborIndex = SeedIndex; NeighborIndex[Dimension] += t; if (outputImage->GetRequestedRegion().IsInside(NeighborIndex)) { 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;