diff --git a/Modules/Core/Common/include/itkGaussianKernelFunction.h b/Modules/Core/Common/include/itkGaussianKernelFunction.h index 6bce5d1bd04..d0d1829b188 100644 --- a/Modules/Core/Common/include/itkGaussianKernelFunction.h +++ b/Modules/Core/Common/include/itkGaussianKernelFunction.h @@ -59,7 +59,7 @@ class ITK_TEMPLATE_EXPORT GaussianKernelFunction : public KernelFunctionBase auto Vector::GetSquaredNorm() const -> RealValueType { - auto sum = T{}; + T sum{}; for (unsigned int i = 0; i < TVectorDimension; ++i) { const RealValueType value = (*this)[i]; @@ -198,7 +198,7 @@ template typename Vector::ValueType Vector::operator*(const Self & other) const { - auto value = T{}; + T value{}; for (unsigned int i = 0; i < TVectorDimension; ++i) { value += (*this)[i] * other[i]; diff --git a/Modules/Core/ImageFunction/include/itkMeanImageFunction.hxx b/Modules/Core/ImageFunction/include/itkMeanImageFunction.hxx index 5c40e52a619..af866c43ca8 100644 --- a/Modules/Core/ImageFunction/include/itkMeanImageFunction.hxx +++ b/Modules/Core/ImageFunction/include/itkMeanImageFunction.hxx @@ -34,7 +34,7 @@ template auto MeanImageFunction::EvaluateAtIndex(const IndexType & index) const -> RealType { - auto sum = RealType{}; + RealType sum{}; const InputImageType * const image = this->GetInputImage(); diff --git a/Modules/Core/ImageFunction/include/itkSumOfSquaresImageFunction.hxx b/Modules/Core/ImageFunction/include/itkSumOfSquaresImageFunction.hxx index 0ef48042d13..4d8e673e1de 100644 --- a/Modules/Core/ImageFunction/include/itkSumOfSquaresImageFunction.hxx +++ b/Modules/Core/ImageFunction/include/itkSumOfSquaresImageFunction.hxx @@ -35,7 +35,7 @@ template auto SumOfSquaresImageFunction::EvaluateAtIndex(const IndexType & index) const -> RealType { - auto sumOfSquares = RealType{}; + RealType sumOfSquares{}; const InputImageType * const image = this->GetInputImage(); diff --git a/Modules/Core/ImageFunction/test/itkSumOfSquaresImageFunctionGTest.cxx b/Modules/Core/ImageFunction/test/itkSumOfSquaresImageFunctionGTest.cxx index 8c620dc53ec..5454eb00522 100644 --- a/Modules/Core/ImageFunction/test/itkSumOfSquaresImageFunctionGTest.cxx +++ b/Modules/Core/ImageFunction/test/itkSumOfSquaresImageFunctionGTest.cxx @@ -46,7 +46,7 @@ CreateImageFilledWithSequenceOfNaturalNumbers(const typename TImage::SizeType & const auto image = TImage::New(); image->SetRegions(imageSize); image->Allocate(); - const auto imageBufferRange = itk::ImageBufferRange{ *image }; + const itk::ImageBufferRange imageBufferRange{ *image }; std::iota(imageBufferRange.begin(), imageBufferRange.end(), PixelType{ 1 }); return image; } @@ -158,7 +158,7 @@ TEST(SumOfSquaresImageFunction, EvaluateAtCenterPixelOfImageOfSize3x3) imageFunction->SetInputImage(image); - const auto imageBufferRange = itk::ImageBufferRange{ *image }; + const itk::ImageBufferRange imageBufferRange{ *image }; // Sum of squares of all pixels of the image: const auto expectedResult = std::accumulate( diff --git a/Modules/Core/SpatialObjects/include/itkImageMaskSpatialObject.hxx b/Modules/Core/SpatialObjects/include/itkImageMaskSpatialObject.hxx index b5bbc4630c0..21b95bab26c 100644 --- a/Modules/Core/SpatialObjects/include/itkImageMaskSpatialObject.hxx +++ b/Modules/Core/SpatialObjects/include/itkImageMaskSpatialObject.hxx @@ -41,7 +41,7 @@ ImageMaskSpatialObject::IsInsideInObjectSpace(const PointTyp const bool is_inside = Superclass::GetBufferedRegion().IsInside(index); - const auto background_zero = PixelType{}; + const PixelType background_zero{}; return is_inside && ((m_UseMaskValue == true && Math::ExactlyEquals(image->GetPixel(index), this->m_MaskValue)) || (m_UseMaskValue == false && Math::NotExactlyEquals(image->GetPixel(index), background_zero))); @@ -152,7 +152,7 @@ ImageMaskSpatialObject::ComputeMyBoundingBoxInIndexSpace() c const auto HasForegroundPixels = [&image, useMaskValue, maskValue](const RegionType & region) { for (const PixelType pixelValue : ImageRegionRange{ image, region }) { - constexpr auto zeroValue = PixelType{}; + constexpr PixelType zeroValue{}; if (pixelValue != zeroValue && (useMaskValue == false || pixelValue == maskValue)) { diff --git a/Modules/Filtering/AnisotropicSmoothing/include/itkGradientNDAnisotropicDiffusionFunction.hxx b/Modules/Filtering/AnisotropicSmoothing/include/itkGradientNDAnisotropicDiffusionFunction.hxx index 9c483ae2444..b234afc0133 100644 --- a/Modules/Filtering/AnisotropicSmoothing/include/itkGradientNDAnisotropicDiffusionFunction.hxx +++ b/Modules/Filtering/AnisotropicSmoothing/include/itkGradientNDAnisotropicDiffusionFunction.hxx @@ -78,7 +78,7 @@ GradientNDAnisotropicDiffusionFunction::ComputeUpdate(const Neighborhood const FloatOffsetType &) -> PixelType { // PixelType is scalar in this context - auto delta = PixelRealType{}; + PixelRealType delta{}; // Calculate the centralized derivatives for each dimension. PixelRealType dx[ImageDimension]; diff --git a/Modules/Filtering/AnisotropicSmoothing/include/itkVectorAnisotropicDiffusionFunction.hxx b/Modules/Filtering/AnisotropicSmoothing/include/itkVectorAnisotropicDiffusionFunction.hxx index 6d59f7686eb..5d8a74592a5 100644 --- a/Modules/Filtering/AnisotropicSmoothing/include/itkVectorAnisotropicDiffusionFunction.hxx +++ b/Modules/Filtering/AnisotropicSmoothing/include/itkVectorAnisotropicDiffusionFunction.hxx @@ -54,8 +54,8 @@ VectorAnisotropicDiffusionFunction::CalculateAverageGradientMagnitudeSqu auto fit = faceList.begin(); // Now do the actual processing - double accumulator = 0.0; - auto counter = SizeValueType{}; + double accumulator = 0.0; + SizeValueType counter{}; // First process the non-boundary region diff --git a/Modules/Filtering/Colormap/include/itkCustomColormapFunction.hxx b/Modules/Filtering/Colormap/include/itkCustomColormapFunction.hxx index e71b965f9e1..40d1f039af7 100644 --- a/Modules/Filtering/Colormap/include/itkCustomColormapFunction.hxx +++ b/Modules/Filtering/Colormap/include/itkCustomColormapFunction.hxx @@ -62,7 +62,7 @@ CustomColormapFunction::operator()(const TScalar & v) const RGBPixelType pixel; NumericTraits::SetLength(pixel, 3); - for (auto color = size_t{ RED }; color <= size_t{ BLUE }; ++color) + for (size_t color{ RED }; color <= size_t{ BLUE }; ++color) { pixel[color] = this->RescaleRGBComponentValue(RGBValue[color]); } diff --git a/Modules/Filtering/ImageGradient/include/itkVectorGradientMagnitudeImageFilter.h b/Modules/Filtering/ImageGradient/include/itkVectorGradientMagnitudeImageFilter.h index b0c5eb7a708..5bdce034963 100644 --- a/Modules/Filtering/ImageGradient/include/itkVectorGradientMagnitudeImageFilter.h +++ b/Modules/Filtering/ImageGradient/include/itkVectorGradientMagnitudeImageFilter.h @@ -317,7 +317,7 @@ class ITK_TEMPLATE_EXPORT VectorGradientMagnitudeImageFilter : public ImageToIma unsigned int j; TRealType dx; TRealType sum; - auto accum = TRealType{}; + TRealType accum{}; for (i = 0; i < ImageDimension; ++i) { sum = TRealType{}; diff --git a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest3.cxx b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest3.cxx index 3ca7500f434..b618ff89061 100644 --- a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest3.cxx +++ b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest3.cxx @@ -221,7 +221,7 @@ itkGradientRecursiveGaussianFilterTest3(int argc, char * argv[]) using myImageScalarType = itk::Image; myGradImage1DType::Pointer scalarPixelGradImage = nullptr; - auto pixelBorder = myScalarPixelType{}; + myScalarPixelType pixelBorder{}; auto pixelFill = static_cast(100.0); runResult = itkGradientRecursiveGaussianFilterTest3Run( pixelBorder, pixelFill, scalarPixelGradImage, argv[2]); diff --git a/Modules/Filtering/Smoothing/include/itkMeanImageFilter.hxx b/Modules/Filtering/Smoothing/include/itkMeanImageFilter.hxx index c54367e10ff..9114be6a7c3 100644 --- a/Modules/Filtering/Smoothing/include/itkMeanImageFilter.hxx +++ b/Modules/Filtering/Smoothing/include/itkMeanImageFilter.hxx @@ -89,7 +89,7 @@ MeanImageFilter::GenerateDataInSubregion( { neighborhoodRange.SetLocation(index); - auto sum = InputRealType{}; + InputRealType sum{}; for (const InputPixelType pixelValue : neighborhoodRange) { diff --git a/Modules/Filtering/Smoothing/test/itkMeanImageFilterGTest.cxx b/Modules/Filtering/Smoothing/test/itkMeanImageFilterGTest.cxx index a0de03cc6ef..91d0f44ade3 100644 --- a/Modules/Filtering/Smoothing/test/itkMeanImageFilterGTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkMeanImageFilterGTest.cxx @@ -68,7 +68,7 @@ CreateImageFilledWithSequenceOfNaturalNumbers(const typename TImage::RegionType const auto image = TImage::New(); image->SetRegions(imageRegion); image->Allocate(); - const auto imageBufferRange = itk::ImageBufferRange{ *image }; + const itk::ImageBufferRange imageBufferRange{ *image }; std::iota(imageBufferRange.begin(), imageBufferRange.end(), PixelType{ 1 }); return image; } diff --git a/Modules/Filtering/Smoothing/test/itkMedianImageFilterGTest.cxx b/Modules/Filtering/Smoothing/test/itkMedianImageFilterGTest.cxx index 0919e1fd968..3fa0e13eb86 100644 --- a/Modules/Filtering/Smoothing/test/itkMedianImageFilterGTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkMedianImageFilterGTest.cxx @@ -66,7 +66,7 @@ CreateImageFilledWithSequenceOfNaturalNumbers(const typename TImage::RegionType const auto image = TImage::New(); image->SetRegions(imageRegion); image->Allocate(); - const auto imageBufferRange = itk::ImageBufferRange{ *image }; + const itk::ImageBufferRange imageBufferRange{ *image }; std::iota(imageBufferRange.begin(), imageBufferRange.end(), PixelType{ 1 }); return image; } diff --git a/Modules/IO/TIFF/src/itkTIFFImageIO.cxx b/Modules/IO/TIFF/src/itkTIFFImageIO.cxx index 5417313bfec..52a7940eeb3 100644 --- a/Modules/IO/TIFF/src/itkTIFFImageIO.cxx +++ b/Modules/IO/TIFF/src/itkTIFFImageIO.cxx @@ -585,7 +585,7 @@ TIFFImageIO::InternalWrite(const void * buffer) const double resolution_y{ m_Spacing[1] != 0.0 ? 25.4 / m_Spacing[1] : 0.0 }; // rowsperstrip is set to a default value but modified based on the tif scanlinesize before // passing it into the TIFFSetField (see below). - auto rowsperstrip = uint32_t{ 0 }; + uint32_t rowsperstrip{ 0 }; uint16_t bps; switch (this->GetComponentType()) diff --git a/Modules/Segmentation/LevelSets/include/itkLevelSetFunctionWithRefitTerm.hxx b/Modules/Segmentation/LevelSets/include/itkLevelSetFunctionWithRefitTerm.hxx index 37273de5f2c..0d753f07681 100644 --- a/Modules/Segmentation/LevelSets/include/itkLevelSetFunctionWithRefitTerm.hxx +++ b/Modules/Segmentation/LevelSets/include/itkLevelSetFunctionWithRefitTerm.hxx @@ -80,7 +80,7 @@ LevelSetFunctionWithRefitTerm::ComputeCurvature( stride[j] = neighborhood.GetStride(j); indicator[j] = one << j; } - auto curvature = ScalarValueType{}; + ScalarValueType curvature{}; for (unsigned int counterN = 0; counterN < m_NumVertex; ++counterN) { diff --git a/Modules/Segmentation/LevelSets/include/itkNormalVectorDiffusionFunction.hxx b/Modules/Segmentation/LevelSets/include/itkNormalVectorDiffusionFunction.hxx index 7ddee5d60f7..b3abca9598b 100644 --- a/Modules/Segmentation/LevelSets/include/itkNormalVectorDiffusionFunction.hxx +++ b/Modules/Segmentation/LevelSets/include/itkNormalVectorDiffusionFunction.hxx @@ -139,7 +139,7 @@ NormalVectorDiffusionFunction::PrecomputeSparseUpdate(Neighbor // now compute the intrinsic derivative for (unsigned int j = 0; j < ImageDimension; ++j) // component axis { - auto DotProduct = NodeValueType{}; + NodeValueType DotProduct{}; for (unsigned int k = 0; k < ImageDimension; ++k) // derivative axis { DotProduct += (gradient[k][j] * CenterNode->m_ManifoldNormal[i][k]); @@ -173,7 +173,7 @@ NormalVectorDiffusionFunction::ComputeSparseUpdate(Neighborhoo const NeighborhoodScalesType neighborhoodScales = this->ComputeNeighborhoodScales(); - auto change = NormalVectorType{}; + NormalVectorType change{}; for (unsigned int i = 0; i < ImageDimension; ++i) // flux offset axis { const auto NextNode = it.GetNext(i); diff --git a/Modules/Segmentation/LevelSets/include/itkSparseFieldFourthOrderLevelSetImageFilter.hxx b/Modules/Segmentation/LevelSets/include/itkSparseFieldFourthOrderLevelSetImageFilter.hxx index 547fa6b3a93..152153b0a97 100644 --- a/Modules/Segmentation/LevelSets/include/itkSparseFieldFourthOrderLevelSetImageFilter.hxx +++ b/Modules/Segmentation/LevelSets/include/itkSparseFieldFourthOrderLevelSetImageFilter.hxx @@ -97,7 +97,7 @@ SparseFieldFourthOrderLevelSetImageFilter::ComputeCur indicator[j] = one << j; } - auto curvature = ValueType{}; + ValueType curvature{}; for (unsigned int counter = 0; counter < m_NumVertex; ++counter) { @@ -203,7 +203,7 @@ template void SparseFieldFourthOrderLevelSetImageFilter::ProcessNormals() { - auto temp = ValueType{ ImageDimension }; + ValueType temp{ ImageDimension }; const typename NormalVectorFilterType::Pointer NormalVectorFilter = NormalVectorFilterType::New(); const typename NormalVectorFunctionType::Pointer NormalVectorFunction = NormalVectorFunctionType::New(); diff --git a/Modules/Segmentation/LevelSets/include/itkSparseFieldLevelSetImageFilter.hxx b/Modules/Segmentation/LevelSets/include/itkSparseFieldLevelSetImageFilter.hxx index aa8ead18c56..26ab7acf96e 100644 --- a/Modules/Segmentation/LevelSets/include/itkSparseFieldLevelSetImageFilter.hxx +++ b/Modules/Segmentation/LevelSets/include/itkSparseFieldLevelSetImageFilter.hxx @@ -957,7 +957,7 @@ SparseFieldLevelSetImageFilter::PropagateLayerValues( statusIt.NeedToUseBoundaryConditionOff(); } - auto value = ValueType{}; + ValueType value{}; const StatusType past_end = static_cast(m_Layers.size()) - 1; auto toIt = m_Layers[to]->Begin(); diff --git a/Modules/Segmentation/RegionGrowing/include/itkConfidenceConnectedImageFilter.hxx b/Modules/Segmentation/RegionGrowing/include/itkConfidenceConnectedImageFilter.hxx index 6320b4d488b..10638f44dea 100644 --- a/Modules/Segmentation/RegionGrowing/include/itkConfidenceConnectedImageFilter.hxx +++ b/Modules/Segmentation/RegionGrowing/include/itkConfidenceConnectedImageFilter.hxx @@ -163,8 +163,8 @@ ConfidenceConnectedImageFilter::GenerateData() { neighborhoodRange.SetLocation(*si); - auto neighborhoodSum = InputRealType{ 0.0 }; - auto neighborhoodSumOfSquares = InputRealType{ 0.0 }; + InputRealType neighborhoodSum{ 0.0 }; + InputRealType neighborhoodSumOfSquares{ 0.0 }; for (const InputImagePixelType pixelValue : neighborhoodRange) { @@ -299,8 +299,8 @@ ConfidenceConnectedImageFilter::GenerateData() secondFunction->SetInputImage(outputImage); secondFunction->ThresholdBetween(m_ReplaceValue, m_ReplaceValue); - auto sum = InputRealType{}; - auto sumOfSquares = InputRealType{}; + InputRealType sum{}; + InputRealType sumOfSquares{}; typename TOutputImage::SizeValueType numberOfSamples = 0; SecondIteratorType sit(inputImage, secondFunction, m_Seeds);