From 42b0bfc0771652ade6a1055b00efbcf94376c20b Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Thu, 9 Mar 2023 15:49:13 +0100 Subject: [PATCH] STYLE: Replace `T var = NumericTraits::ZeroValue()` with `T var{}` Replaced initialization by `NumericTraits::ZeroValue()` with empty `{}` initializers. Did so by Replace in Files, using regular expressions: Find what: (\w+)([ ]+\w+) = NumericTraits<\1>::ZeroValue\(\); Replace with: $1$2{}; Follow-up to pull request https://github.com/InsightSoftwareConsortium/ITK/pull/3950 commmit ef5cc8c495c5515d5533eae36a6900e6a63c7819 "STYLE: Prefer C++11 zero initializer to ZeroValue", by Hans Johnson. --- .../include/itkConstNeighborhoodIterator.hxx | 2 +- ...ConstNeighborhoodIteratorWithOnlyIndex.hxx | 2 +- .../Common/include/itkCovariantVector.hxx | 2 +- Modules/Core/Common/include/itkImageBase.h | 8 ++-- Modules/Core/Common/include/itkMatrix.hxx | 8 ++-- .../include/itkNeighborhoodInnerProduct.hxx | 4 +- Modules/Core/Common/include/itkPoint.h | 2 +- .../Core/Common/include/itkResourceProbe.hxx | 2 +- .../include/itkSymmetricSecondRankTensor.hxx | 6 +-- .../Common/include/itkVariableSizeMatrix.hxx | 2 +- .../itkFiniteDifferenceImageFilter.hxx | 2 +- .../itkGPUFiniteDifferenceImageFilter.hxx | 2 +- .../itkCentralDifferenceImageFunction.hxx | 6 +-- ...lImageGaussianInterpolateImageFunction.hxx | 2 +- ...tkVectorLinearInterpolateImageFunction.hxx | 2 +- ...tkWindowedSincInterpolateImageFunction.hxx | 2 +- .../include/itkInteriorExteriorMeshFilter.hxx | 2 +- .../itkSimplexMeshAdaptTopologyFilter.hxx | 4 +- .../itkTriangleMeshToSimplexMeshFilter.hxx | 4 +- .../Mesh/include/itkVTKPolyDataWriter.hxx | 2 +- .../QuadEdgeMesh/include/itkQuadEdgeMesh.hxx | 6 +-- .../include/itkCompositeTransform.hxx | 18 ++++----- .../Transform/include/itkEuler3DTransform.hxx | 2 +- .../Transform/include/itkKernelTransform.hxx | 2 +- .../Transform/include/itkMultiTransform.hxx | 16 ++++---- ...urvatureNDAnisotropicDiffusionFunction.hxx | 2 +- ...naryClosingByReconstructionImageFilter.hxx | 2 +- ...kBinaryMorphologicalClosingImageFilter.hxx | 2 +- .../itkMinMaxCurvatureFlowFunction.hxx | 10 ++--- .../itkInverseDeconvolutionImageFilter.h | 2 +- .../itkTikhonovDeconvolutionImageFilter.h | 2 +- .../itkWienerDeconvolutionImageFilter.h | 2 +- .../itkPatchBasedDenoisingImageFilter.hxx | 2 +- ...kDisplacementFieldToBSplineImageFilter.hxx | 2 +- .../itkInvertDisplacementFieldImageFilter.hxx | 4 +- ...ContourDirectedMeanDistanceImageFilter.hxx | 2 +- ...tkDirectedHausdorffDistanceImageFilter.hxx | 2 +- .../include/itkFastMarchingImageFilter.h | 2 +- .../itkFastMarchingImageFilterBase.hxx | 2 +- .../itkFastMarchingQuadEdgeMeshFilterBase.hxx | 6 +-- ...kFastMarchingUpwindGradientImageFilter.hxx | 2 +- ...tMarchingUpwindGradientImageFilterBase.hxx | 2 +- .../itkCannyEdgeDetectionImageFilter.hxx | 4 +- .../include/itkZeroCrossingImageFilter.hxx | 4 +- .../itkGradientMagnitudeImageFilter.hxx | 2 +- .../ImageGrid/include/itkTileImageFilter.hxx | 2 +- .../include/itkPolylineMask2DImageFilter.hxx | 2 +- .../itkVectorRescaleIntensityImageFilter.hxx | 2 +- .../include/itkAccumulateImageFilter.hxx | 2 +- ...tkStandardDeviationProjectionImageFilter.h | 2 +- .../include/itkStatisticsImageFilter.hxx | 2 +- .../include/itkBinaryFillholeImageFilter.hxx | 2 +- .../include/itkShapeRelabelLabelMapFilter.h | 2 +- .../include/itkCleanQuadEdgeMeshFilter.hxx | 2 +- ...LaplacianDeformationQuadEdgeMeshFilter.hxx | 6 +-- .../itkQuadEdgeMeshParamMatrixCoefficients.h | 2 +- .../itkOtsuMultipleThresholdsCalculator.hxx | 16 ++++---- .../IO/MeshBase/include/itkMeshFileReader.hxx | 4 +- .../IO/MeshBase/include/itkMeshFileWriter.hxx | 4 +- Modules/IO/MeshBase/include/itkMeshIOBase.h | 12 +++--- .../itkPolygonGroupSpatialObjectXMLFile.cxx | 2 +- ...iscreteGaussianDerivativeImageFunction.hxx | 4 +- ...GradientMagnitudeGaussianImageFunction.hxx | 4 +- ...tkDiscreteHessianGaussianImageFunction.hxx | 2 +- ...kMultiphaseFiniteDifferenceImageFilter.hxx | 2 +- ...phaseSparseFiniteDifferenceImageFilter.hxx | 2 +- .../include/itkRegionBasedLevelSetFunction.h | 2 +- .../itkRegionBasedLevelSetFunction.hxx | 10 ++--- .../FEM/include/itkFEMRobustSolver.hxx | 2 +- ...egistrationParameterScalesFromJacobian.hxx | 2 +- ...gistrationParameterScalesFromShiftBase.hxx | 4 +- .../include/itkCovarianceSampleFilter.hxx | 2 +- ...ationMaximizationMixtureModelEstimator.hxx | 2 +- .../Statistics/include/itkHistogram.hxx | 2 +- .../itkHistogramToRunLengthFeaturesFilter.hxx | 20 +++++----- .../itkHistogramToTextureFeaturesFilter.hxx | 16 ++++---- .../include/itkMeanSampleFilter.hxx | 2 +- .../itkWeightedCovarianceSampleFilter.hxx | 8 ++-- .../include/itkWeightedMeanSampleFilter.hxx | 4 +- .../Statistics/test/itkSampleTest.cxx | 2 +- .../Statistics/test/itkSampleTest2.cxx | 2 +- .../Statistics/test/itkSampleTest3.cxx | 2 +- .../Statistics/test/itkSampleTest4.cxx | 2 +- .../include/itkBlockMatchingImageFilter.hxx | 14 +++---- ...CoefficientHistogramImageToImageMetric.hxx | 10 ++--- ...tkGradientDifferenceImageToImageMetric.hxx | 2 +- .../itkKappaStatisticImageToImageMetric.hxx | 6 +-- ...blerCompareHistogramImageToImageMetric.hxx | 2 +- .../itkMatchCardinalityImageToImageMetric.hxx | 4 +- ...ocalSquareDifferenceImageToImageMetric.hxx | 2 +- ...lSquareDifferencePointSetToImageMetric.hxx | 8 ++-- ...MeanSquaresHistogramImageToImageMetric.hxx | 4 +- .../itkMeanSquaresPointSetToImageMetric.hxx | 8 ++-- ...InformationHistogramImageToImageMetric.hxx | 6 +-- ...ormalizedCorrelationImageToImageMetric.hxx | 38 +++++++++---------- ...alizedCorrelationPointSetToImageMetric.hxx | 34 ++++++++--------- ...InformationHistogramImageToImageMetric.hxx | 6 +-- ...eMetricv4GetValueAndDerivativeThreader.hxx | 14 +++---- ...eMetricv4GetValueAndDerivativeThreader.hxx | 8 ++-- ...tionImageToImageMetricv4HelperThreader.hxx | 4 +- ...formationGetValueAndDerivativeThreader.hxx | 4 +- ...mMutualInformationImageToImageMetricv4.hxx | 2 +- .../itkLabeledPointSetToPointSetMetricv4.hxx | 4 +- .../itkObjectToObjectMultiMetricv4.hxx | 10 ++--- ...itkPointSetToPointSetMetricWithIndexv4.hxx | 6 +-- ...neVelocityFieldImageRegistrationMethod.hxx | 14 +++---- ...VelocityFieldImageRegistrationMethodv4.hxx | 12 +++--- ...tkConnectedComponentFunctorImageFilter.hxx | 2 +- .../itkConnectedComponentImageFilter.h | 2 +- .../itkVectorConnectedComponentImageFilter.h | 2 +- .../LevelSets/include/itkLevelSetFunction.hxx | 6 +-- .../itkBinaryImageToLevelSetImageAdaptor.hxx | 2 +- .../include/itkDiscreteLevelSetImage.hxx | 4 +- .../LevelSetsv4/include/itkLevelSetBase.hxx | 2 +- .../include/itkLevelSetDomainPartition.hxx | 2 +- .../itkLevelSetDomainPartitionImage.hxx | 2 +- .../itkLevelSetDomainPartitionMesh.hxx | 2 +- .../itkLevelSetEquationAdvectionTerm.hxx | 4 +- .../itkLevelSetEquationOverlapPenaltyTerm.hxx | 4 +- .../itkLevelSetEquationPropagationTerm.hxx | 4 +- .../itkLevelSetEquationTermContainer.hxx | 6 +-- .../itkUpdateMalcolmSparseLevelSet.hxx | 2 +- .../include/itkRGBGibbsPriorFilter.hxx | 6 +-- .../itkIsolatedConnectedImageFilter.hxx | 8 ++-- ...tkVectorConfidenceConnectedImageFilter.hxx | 2 +- ...logicalWatershedFromMarkersImageFilter.hxx | 4 +- .../include/itkTobogganImageFilter.hxx | 4 +- 127 files changed, 311 insertions(+), 311 deletions(-) diff --git a/Modules/Core/Common/include/itkConstNeighborhoodIterator.hxx b/Modules/Core/Common/include/itkConstNeighborhoodIterator.hxx index f8692f6410d..5dc14d96364 100644 --- a/Modules/Core/Common/include/itkConstNeighborhoodIterator.hxx +++ b/Modules/Core/Common/include/itkConstNeighborhoodIterator.hxx @@ -200,7 +200,7 @@ template auto ConstNeighborhoodIterator::GetBoundingBoxAsImageRegion() const -> RegionType { - const IndexValueType zero = NumericTraits::ZeroValue(); + const IndexValueType zero{}; const RegionType ans(this->GetIndex(zero), this->GetSize()); return ans; diff --git a/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.hxx b/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.hxx index e135d9d44ae..2d87290e5aa 100644 --- a/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.hxx +++ b/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.hxx @@ -120,7 +120,7 @@ template auto ConstNeighborhoodIteratorWithOnlyIndex::GetBoundingBoxAsImageRegion() const -> RegionType { - const IndexValueType zero = NumericTraits::ZeroValue(); + const IndexValueType zero{}; const RegionType ans(this->GetIndex(zero), this->GetSize()); return ans; diff --git a/Modules/Core/Common/include/itkCovariantVector.hxx b/Modules/Core/Common/include/itkCovariantVector.hxx index 98dfe78f7ef..672f44acb0f 100644 --- a/Modules/Core/Common/include/itkCovariantVector.hxx +++ b/Modules/Core/Common/include/itkCovariantVector.hxx @@ -125,7 +125,7 @@ template auto CovariantVector::GetSquaredNorm() const -> RealValueType { - RealValueType sum = NumericTraits::ZeroValue(); + RealValueType sum{}; for (unsigned int i = 0; i < VVectorDimension; ++i) { diff --git a/Modules/Core/Common/include/itkImageBase.h b/Modules/Core/Common/include/itkImageBase.h index 919df5fdf96..7a7bc9b48be 100644 --- a/Modules/Core/Common/include/itkImageBase.h +++ b/Modules/Core/Common/include/itkImageBase.h @@ -446,7 +446,7 @@ class ITK_TEMPLATE_EXPORT ImageBase : public DataObject for (unsigned int i = 0; i < VImageDimension; ++i) { - TCoordRep sum = NumericTraits::ZeroValue(); + TCoordRep sum{}; for (unsigned int j = 0; j < VImageDimension; ++j) { sum += this->m_PhysicalPointToIndex[i][j] * (point[j] - this->m_Origin[j]); @@ -532,7 +532,7 @@ class ITK_TEMPLATE_EXPORT ImageBase : public DataObject { for (unsigned int r = 0; r < VImageDimension; ++r) { - TCoordRep sum = NumericTraits::ZeroValue(); + TCoordRep sum{}; for (unsigned int c = 0; c < VImageDimension; ++c) { sum += this->m_IndexToPhysicalPoint(r, c) * index[c]; @@ -613,7 +613,7 @@ class ITK_TEMPLATE_EXPORT ImageBase : public DataObject for (unsigned int i = 0; i < VImageDimension; ++i) { using CoordSumType = typename NumericTraits::AccumulateType; - CoordSumType sum = NumericTraits::ZeroValue(); + CoordSumType sum{}; for (unsigned int j = 0; j < VImageDimension; ++j) { sum += direction[i][j] * inputGradient[j]; @@ -662,7 +662,7 @@ class ITK_TEMPLATE_EXPORT ImageBase : public DataObject for (unsigned int i = 0; i < VImageDimension; ++i) { using CoordSumType = typename NumericTraits::AccumulateType; - CoordSumType sum = NumericTraits::ZeroValue(); + CoordSumType sum{}; for (unsigned int j = 0; j < VImageDimension; ++j) { sum += inverseDirection[i][j] * inputGradient[j]; diff --git a/Modules/Core/Common/include/itkMatrix.hxx b/Modules/Core/Common/include/itkMatrix.hxx index 7dacaf15116..28f1d8446c7 100644 --- a/Modules/Core/Common/include/itkMatrix.hxx +++ b/Modules/Core/Common/include/itkMatrix.hxx @@ -31,7 +31,7 @@ Vector Matrix::operator*(const Vector Vector result; for (unsigned int r = 0; r < VRows; ++r) { - T sum = NumericTraits::ZeroValue(); + T sum{}; for (unsigned int c = 0; c < VColumns; ++c) { sum += m_Matrix(r, c) * vect[c]; @@ -50,7 +50,7 @@ Point Matrix::operator*(const Point & Point result; for (unsigned int r = 0; r < VRows; ++r) { - T sum = NumericTraits::ZeroValue(); + T sum{}; for (unsigned int c = 0; c < VColumns; ++c) { sum += m_Matrix(r, c) * pnt[c]; @@ -69,7 +69,7 @@ vnl_vector_fixed Matrix::operator*(const vnl_vecto vnl_vector_fixed result; for (unsigned int r = 0; r < VRows; ++r) { - T sum = NumericTraits::ZeroValue(); + T sum{}; for (unsigned int c = 0; c < VColumns; ++c) { sum += m_Matrix(r, c) * inVNLvect[c]; @@ -88,7 +88,7 @@ CovariantVector Matrix::operator*(const CovariantV CovariantVector result; for (unsigned int r = 0; r < VRows; ++r) { - T sum = NumericTraits::ZeroValue(); + T sum{}; for (unsigned int c = 0; c < VColumns; ++c) { sum += m_Matrix(r, c) * covect[c]; diff --git a/Modules/Core/Common/include/itkNeighborhoodInnerProduct.hxx b/Modules/Core/Common/include/itkNeighborhoodInnerProduct.hxx index cbb0d510b9d..86bd81f7fce 100644 --- a/Modules/Core/Common/include/itkNeighborhoodInnerProduct.hxx +++ b/Modules/Core/Common/include/itkNeighborhoodInnerProduct.hxx @@ -37,7 +37,7 @@ NeighborhoodInnerProduct::Compute(const ConstNe const typename OperatorType::ConstIterator op_end = op.End(); typename OperatorType::ConstIterator o_it = op.Begin(); - AccumulateRealType sum = NumericTraits::ZeroValue(); + AccumulateRealType sum{}; for (unsigned int i = start; o_it < op_end; i += stride, ++o_it) { @@ -63,7 +63,7 @@ NeighborhoodInnerProduct::Compute( using InputPixelRealType = typename NumericTraits::RealType; using AccumulateRealType = typename NumericTraits::AccumulateType; - AccumulateRealType sum = NumericTraits::ZeroValue(); + AccumulateRealType sum{}; using OutputPixelValueType = typename NumericTraits::ValueType; diff --git a/Modules/Core/Common/include/itkPoint.h b/Modules/Core/Common/include/itkPoint.h index ac2a7dfa9a2..828691457bd 100644 --- a/Modules/Core/Common/include/itkPoint.h +++ b/Modules/Core/Common/include/itkPoint.h @@ -276,7 +276,7 @@ class ITK_TEMPLATE_EXPORT Point : public FixedArray RealType SquaredEuclideanDistanceTo(const Point & pa) const { - RealType sum = NumericTraits::ZeroValue(); + RealType sum{}; for (unsigned int i = 0; i < VPointDimension; ++i) { diff --git a/Modules/Core/Common/include/itkResourceProbe.hxx b/Modules/Core/Common/include/itkResourceProbe.hxx index 6b2d15dbd51..7d87affc3d8 100644 --- a/Modules/Core/Common/include/itkResourceProbe.hxx +++ b/Modules/Core/Common/include/itkResourceProbe.hxx @@ -184,7 +184,7 @@ template MeanType ResourceProbe::GetMean() const { - MeanType meanValue = NumericTraits::ZeroValue(); + MeanType meanValue{}; if (this->m_NumberOfStops) { diff --git a/Modules/Core/Common/include/itkSymmetricSecondRankTensor.hxx b/Modules/Core/Common/include/itkSymmetricSecondRankTensor.hxx index 5307cdaca57..11262551363 100644 --- a/Modules/Core/Common/include/itkSymmetricSecondRankTensor.hxx +++ b/Modules/Core/Common/include/itkSymmetricSecondRankTensor.hxx @@ -238,7 +238,7 @@ template auto SymmetricSecondRankTensor::GetTrace() const -> AccumulateValueType { - AccumulateValueType trace = NumericTraits::ZeroValue(); + AccumulateValueType trace{}; unsigned int k = 0; for (unsigned int i = 0; i < Dimension; ++i) @@ -350,7 +350,7 @@ SymmetricSecondRankTensor::PreMultiply(const MatrixType & m) cons { for (unsigned int c = 0; c < VDimension; ++c) { - AccumulateType sum = NumericTraits::ZeroValue(); + AccumulateType sum{}; for (unsigned int t = 0; t < VDimension; ++t) { sum += m(r, t) * (*this)(t, c); @@ -375,7 +375,7 @@ SymmetricSecondRankTensor::PostMultiply(const MatrixType & m) con { for (unsigned int c = 0; c < VDimension; ++c) { - AccumulateType sum = NumericTraits::ZeroValue(); + AccumulateType sum{}; for (unsigned int t = 0; t < VDimension; ++t) { sum += (*this)(r, t) * m(t, c); diff --git a/Modules/Core/Common/include/itkVariableSizeMatrix.hxx b/Modules/Core/Common/include/itkVariableSizeMatrix.hxx index fe2c22911fa..70f6a0b632b 100644 --- a/Modules/Core/Common/include/itkVariableSizeMatrix.hxx +++ b/Modules/Core/Common/include/itkVariableSizeMatrix.hxx @@ -45,7 +45,7 @@ Array VariableSizeMatrix::operator*(const Array & vect) const Array result(rows); for (unsigned int r = 0; r < rows; ++r) { - T sum = NumericTraits::ZeroValue(); + T sum{}; for (unsigned int c = 0; c < cols; ++c) { sum += m_Matrix(r, c) * vect[c]; diff --git a/Modules/Core/FiniteDifference/include/itkFiniteDifferenceImageFilter.hxx b/Modules/Core/FiniteDifference/include/itkFiniteDifferenceImageFilter.hxx index c45ff37fc42..90d14f19c2f 100644 --- a/Modules/Core/FiniteDifference/include/itkFiniteDifferenceImageFilter.hxx +++ b/Modules/Core/FiniteDifference/include/itkFiniteDifferenceImageFilter.hxx @@ -169,7 +169,7 @@ typename FiniteDifferenceImageFilter::TimeStepType FiniteDifferenceImageFilter::ResolveTimeStep(const std::vector & timeStepList, const BooleanStdVectorType & valid) const { - TimeStepType oMin = NumericTraits::ZeroValue(); + TimeStepType oMin{}; bool flag = false; // grab first valid value diff --git a/Modules/Core/GPUFiniteDifference/include/itkGPUFiniteDifferenceImageFilter.hxx b/Modules/Core/GPUFiniteDifference/include/itkGPUFiniteDifferenceImageFilter.hxx index 3e4ab482bff..7c2e8b06a41 100644 --- a/Modules/Core/GPUFiniteDifference/include/itkGPUFiniteDifferenceImageFilter.hxx +++ b/Modules/Core/GPUFiniteDifference/include/itkGPUFiniteDifferenceImageFilter.hxx @@ -185,7 +185,7 @@ GPUFiniteDifferenceImageFilter::R const std::vector & timeStepList, const BooleanStdVectorType & valid) const { - TimeStepType oMin = NumericTraits::ZeroValue(); + TimeStepType oMin{}; bool flag = false; auto t_it = timeStepList.begin(); diff --git a/Modules/Core/ImageFunction/include/itkCentralDifferenceImageFunction.hxx b/Modules/Core/ImageFunction/include/itkCentralDifferenceImageFunction.hxx index d8c4cdba295..0ed8995ed2d 100644 --- a/Modules/Core/ImageFunction/include/itkCentralDifferenceImageFunction.hxx +++ b/Modules/Core/ImageFunction/include/itkCentralDifferenceImageFunction.hxx @@ -176,7 +176,7 @@ CentralDifferenceImageFunction::EvaluateAtI using PixelType = typename InputImageType::PixelType; const PixelType * neighPixels[Self::ImageDimension][2]; - const PixelType zeroPixel = NumericTraits::ZeroValue(); + const PixelType zeroPixel{}; const unsigned int MaxDims = Self::ImageDimension; bool dimOutOfBounds[Self::ImageDimension]; @@ -343,7 +343,7 @@ CentralDifferenceImageFunction::EvaluateSpe bool dimOutOfBounds[Self::ImageDimension]; const unsigned int MaxDims = Self::ImageDimension; PointValueType delta[Self::ImageDimension]; - PixelType zeroPixel = NumericTraits::ZeroValue(); + PixelType zeroPixel{}; ScalarDerivativeType componentDerivativeOut; ScalarDerivativeType componentDerivative; @@ -523,7 +523,7 @@ CentralDifferenceImageFunction::EvaluateAtC PixelType neighPixels[Self::ImageDimension][2]; bool dimOutOfBounds[Self::ImageDimension]; const unsigned int MaxDims = Self::ImageDimension; - PixelType zeroPixel = NumericTraits::ZeroValue(); + PixelType zeroPixel{}; for (unsigned int dim = 0; dim < MaxDims; ++dim) { diff --git a/Modules/Core/ImageFunction/include/itkLabelImageGaussianInterpolateImageFunction.hxx b/Modules/Core/ImageFunction/include/itkLabelImageGaussianInterpolateImageFunction.hxx index 247831afe7d..9269ab8c596 100644 --- a/Modules/Core/ImageFunction/include/itkLabelImageGaussianInterpolateImageFunction.hxx +++ b/Modules/Core/ImageFunction/include/itkLabelImageGaussianInterpolateImageFunction.hxx @@ -51,7 +51,7 @@ LabelImageGaussianInterpolateImageFunction::ZeroValue(); + OutputType Vmax{}; // Create a map object to store weights for each label encountered // inside the search region. This is not as efficient as having a diff --git a/Modules/Core/ImageFunction/include/itkVectorLinearInterpolateImageFunction.hxx b/Modules/Core/ImageFunction/include/itkVectorLinearInterpolateImageFunction.hxx index 0b8fccb93e9..80ca4cb5682 100644 --- a/Modules/Core/ImageFunction/include/itkVectorLinearInterpolateImageFunction.hxx +++ b/Modules/Core/ImageFunction/include/itkVectorLinearInterpolateImageFunction.hxx @@ -56,7 +56,7 @@ VectorLinearInterpolateImageFunction::EvaluateAtContinuo output.Fill(0.0); using ScalarRealType = typename NumericTraits::ScalarRealType; - ScalarRealType totalOverlap = NumericTraits::ZeroValue(); + ScalarRealType totalOverlap{}; for (unsigned int counter = 0; counter < m_Neighbors; ++counter) { diff --git a/Modules/Core/ImageFunction/include/itkWindowedSincInterpolateImageFunction.hxx b/Modules/Core/ImageFunction/include/itkWindowedSincInterpolateImageFunction.hxx index ffd72c8ead0..e94569c35c7 100644 --- a/Modules/Core/ImageFunction/include/itkWindowedSincInterpolateImageFunction.hxx +++ b/Modules/Core/ImageFunction/include/itkWindowedSincInterpolateImageFunction.hxx @@ -186,7 +186,7 @@ typename WindowedSincInterpolateImageFunction::RealType; - PixelType xPixelValue = NumericTraits::ZeroValue(); + PixelType xPixelValue{}; for (unsigned int j = 0; j < m_OffsetTableSize; ++j) { // Get the offset for this neighbor diff --git a/Modules/Core/Mesh/include/itkInteriorExteriorMeshFilter.hxx b/Modules/Core/Mesh/include/itkInteriorExteriorMeshFilter.hxx index 26069a05387..5f905a55cee 100644 --- a/Modules/Core/Mesh/include/itkInteriorExteriorMeshFilter.hxx +++ b/Modules/Core/Mesh/include/itkInteriorExteriorMeshFilter.hxx @@ -105,7 +105,7 @@ InteriorExteriorMeshFilter::GenerateD using ValueType = typename TSpatialFunction::OutputType; using PointIdType = typename TOutputMesh::PointIdentifier; - PointIdType pointId = NumericTraits::ZeroValue(); + PointIdType pointId{}; while (inputPoint != inPoints->End()) { diff --git a/Modules/Core/Mesh/include/itkSimplexMeshAdaptTopologyFilter.hxx b/Modules/Core/Mesh/include/itkSimplexMeshAdaptTopologyFilter.hxx index e581d2de487..d4911de81d5 100644 --- a/Modules/Core/Mesh/include/itkSimplexMeshAdaptTopologyFilter.hxx +++ b/Modules/Core/Mesh/include/itkSimplexMeshAdaptTopologyFilter.hxx @@ -245,7 +245,7 @@ SimplexMeshAdaptTopologyFilter::ComputeCellParameters() outputMesh->AddEdge(firstNewIndex, secondNewIndex); // splitting cell - PointIdentifier newPointIndex = NumericTraits::ZeroValue(); + PointIdentifier newPointIndex{}; auto * polygon = new OutputPolygonType; InputCellAutoPointer newPolygonPointer1; newPolygonPointer1.TakeOwnership(polygon); @@ -341,7 +341,7 @@ SimplexMeshAdaptTopologyFilter::ModifyNeighborCells(Cel { m_NewSimplexCellPointer.TakeOwnership(new OutputPolygonType); InputPolygonPointIdIterator pointIt = nextCell->PointIdsBegin(); - PointIdentifier cnt = NumericTraits::ZeroValue(); + PointIdentifier cnt{}; PointIdentifier first = *pointIt++; PointIdentifier startId = first; diff --git a/Modules/Core/Mesh/include/itkTriangleMeshToSimplexMeshFilter.hxx b/Modules/Core/Mesh/include/itkTriangleMeshToSimplexMeshFilter.hxx index efa0a62ded8..5270d833450 100644 --- a/Modules/Core/Mesh/include/itkTriangleMeshToSimplexMeshFilter.hxx +++ b/Modules/Core/Mesh/include/itkTriangleMeshToSimplexMeshFilter.hxx @@ -353,7 +353,7 @@ TriangleMeshToSimplexMeshFilter::CreateCells() // create a new cell m_NewSimplexCellPointer.TakeOwnership(new OutputPolygonType); - PointIdentifier vertexIdx = NumericTraits::ZeroValue(); + PointIdentifier vertexIdx{}; CellIdentifier nextIdx = startIdx; CellFeatureIdentifier featureId = 0; @@ -367,7 +367,7 @@ TriangleMeshToSimplexMeshFilter::CreateCells() EdgeIdentifierType line = std::make_pair(nextIdx, newIdx); EdgeIdentifierType lineInv = std::make_pair(newIdx, nextIdx); - CellIdentifier edgeIdx = NumericTraits::ZeroValue(); + CellIdentifier edgeIdx{}; if (m_LineCellIndices->IndexExists(line)) { diff --git a/Modules/Core/Mesh/include/itkVTKPolyDataWriter.hxx b/Modules/Core/Mesh/include/itkVTKPolyDataWriter.hxx index 7675213d970..35d8fb12954 100644 --- a/Modules/Core/Mesh/include/itkVTKPolyDataWriter.hxx +++ b/Modules/Core/Mesh/include/itkVTKPolyDataWriter.hxx @@ -206,7 +206,7 @@ VTKPolyDataWriter::GenerateData() // mesh can be saved. cellIterator = cells->Begin(); - PointIdentifier totalNumberOfPointsInPolygons = NumericTraits::ZeroValue(); + PointIdentifier totalNumberOfPointsInPolygons{}; while (cellIterator != cells->End()) { CellType * cellPointer = cellIterator.Value(); diff --git a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMesh.hxx b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMesh.hxx index 729c94e5832..705c967cc0d 100644 --- a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMesh.hxx +++ b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMesh.hxx @@ -1173,7 +1173,7 @@ QuadEdgeMesh::AddFace(const PointIdList & points) - { typename PointIdList::const_iterator itr = points.begin(); typename PointIdList::const_iterator end = points.end(); - PointIdentifier count = NumericTraits::ZeroValue(); + PointIdentifier count{}; const PointIdentifier pointId = points[i]; while (itr != end) { @@ -1421,7 +1421,7 @@ QuadEdgeMesh::ComputeNumberOfPoints() const -> Poin return (0); } - PointIdentifier numberOfPoints = NumericTraits::ZeroValue(); + PointIdentifier numberOfPoints{}; PointsContainerConstIterator pointIterator = points->Begin(); PointsContainerConstIterator pointEnd = points->End(); @@ -1447,7 +1447,7 @@ template auto QuadEdgeMesh::ComputeNumberOfFaces() const -> CellIdentifier { - CellIdentifier numberOfFaces = NumericTraits::ZeroValue(); + CellIdentifier numberOfFaces{}; CellsContainerConstIterator cellIterator = this->GetCells()->Begin(); CellsContainerConstIterator cellEnd = this->GetCells()->End(); diff --git a/Modules/Core/Transform/include/itkCompositeTransform.hxx b/Modules/Core/Transform/include/itkCompositeTransform.hxx index 5935dafac4c..ff9c16e4136 100644 --- a/Modules/Core/Transform/include/itkCompositeTransform.hxx +++ b/Modules/Core/Transform/include/itkCompositeTransform.hxx @@ -498,7 +498,7 @@ CompositeTransform::ComputeJacobianWithRespect return; } - NumberOfParametersType offset = NumericTraits::ZeroValue(); + NumberOfParametersType offset{}; OutputPointType transformedPoint(p); @@ -628,7 +628,7 @@ CompositeTransform::GetParameters() const -> c * it's efficient. */ this->m_Parameters.SetSize(this->GetNumberOfParameters()); - NumberOfParametersType offset = NumericTraits::ZeroValue(); + NumberOfParametersType offset{}; for (auto it = transforms.rbegin(); it != transforms.rend(); ++it) { @@ -676,7 +676,7 @@ CompositeTransform::SetParameters(const Parame } else { - NumberOfParametersType offset = NumericTraits::ZeroValue(); + NumberOfParametersType offset{}; auto it = transforms.end(); do @@ -713,7 +713,7 @@ CompositeTransform::GetFixedParameters() const * it's efficient. */ this->m_FixedParameters.SetSize(this->GetNumberOfFixedParameters()); - NumberOfParametersType offset = NumericTraits::ZeroValue(); + NumberOfParametersType offset{}; for (auto it = transforms.rbegin(); it != transforms.rend(); ++it) { @@ -735,7 +735,7 @@ CompositeTransform::SetFixedParameters(const F * sub transforms currently selected for optimization. */ TransformQueueType transforms = this->GetTransformsToOptimizeQueue(); - NumberOfParametersType offset = NumericTraits::ZeroValue(); + NumberOfParametersType offset{}; /* Verify proper input size. */ @@ -767,7 +767,7 @@ CompositeTransform::GetNumberOfParameters() co * However, it seems that number of parameter might change for dense * field transforms (deformation, bspline) during processing and * we wouldn't know that in this class, so this is safest. */ - NumberOfParametersType result = NumericTraits::ZeroValue(); + NumberOfParametersType result{}; for (long tind = (long)this->GetNumberOfTransforms() - 1; tind >= 0; tind--) @@ -795,7 +795,7 @@ CompositeTransform::GetNumberOfLocalParameters * set to be used for optimized. * Note that unlike in GetNumberOfParameters(), we don't expect the * number of local parameters to possibly change. */ - NumberOfParametersType result = NumericTraits::ZeroValue(); + NumberOfParametersType result{}; for (long tind = (long)this->GetNumberOfTransforms() - 1; tind >= 0; tind--) { if (this->GetNthTransformToOptimize(tind)) @@ -820,7 +820,7 @@ CompositeTransform::GetNumberOfFixedParameters * set to be used for optimized. * NOTE: We might want to optimize this only to store the result and * only re-calc when the composite object has been modified. */ - NumberOfParametersType result = NumericTraits::ZeroValue(); + NumberOfParametersType result{}; for (long tind = (long)this->GetNumberOfTransforms() - 1; tind >= 0; tind--) { @@ -858,7 +858,7 @@ CompositeTransform::UpdateTransformParameters( << numberOfParameters << std::endl); } - NumberOfParametersType offset = NumericTraits::ZeroValue(); + NumberOfParametersType offset{}; for (long tind = (long)this->GetNumberOfTransforms() - 1; tind >= 0; tind--) diff --git a/Modules/Core/Transform/include/itkEuler3DTransform.hxx b/Modules/Core/Transform/include/itkEuler3DTransform.hxx index f37d739ecb2..d1c16bb1768 100644 --- a/Modules/Core/Transform/include/itkEuler3DTransform.hxx +++ b/Modules/Core/Transform/include/itkEuler3DTransform.hxx @@ -234,7 +234,7 @@ Euler3DTransform::ComputeMatrix() const ScalarType cz = std::cos(m_AngleZ); const ScalarType sz = std::sin(m_AngleZ); const ScalarType one = NumericTraits::OneValue(); - const ScalarType zero = NumericTraits::ZeroValue(); + const ScalarType zero{}; Matrix RotationX; RotationX[0][0] = one; diff --git a/Modules/Core/Transform/include/itkKernelTransform.hxx b/Modules/Core/Transform/include/itkKernelTransform.hxx index 15b589829a7..02ce7bf1e20 100644 --- a/Modules/Core/Transform/include/itkKernelTransform.hxx +++ b/Modules/Core/Transform/include/itkKernelTransform.hxx @@ -379,7 +379,7 @@ KernelTransform::SetParameters(const Parameter if (¶meters != &(this->m_Parameters)) { const size_t parameterSize = this->GetParameters().Size(); - const NumberOfParametersType offset = NumericTraits::ZeroValue(); + const NumberOfParametersType offset{}; this->CopyInParameters(&(parameters.data_block())[offset], &(parameters.data_block())[offset] + parameterSize); } diff --git a/Modules/Core/Transform/include/itkMultiTransform.hxx b/Modules/Core/Transform/include/itkMultiTransform.hxx index bae35f353ce..2ca060a2693 100644 --- a/Modules/Core/Transform/include/itkMultiTransform.hxx +++ b/Modules/Core/Transform/include/itkMultiTransform.hxx @@ -84,7 +84,7 @@ MultiTransform::GetParameters( /* Resize destructively. But if it's already this size, nothing is done so * it's efficient. */ this->m_Parameters.SetSize(this->GetNumberOfParameters()); - NumberOfParametersType offset = NumericTraits::ZeroValue(); + NumberOfParametersType offset{}; TransformQueueType transforms = this->GetTransformQueue(); typename TransformQueueType::const_iterator it; it = transforms.begin(); @@ -120,7 +120,7 @@ MultiTransform::SetParameters( } TransformQueueType transforms = this->GetTransformQueue(); - NumberOfParametersType offset = NumericTraits::ZeroValue(); + NumberOfParametersType offset{}; auto it = transforms.begin(); do @@ -155,7 +155,7 @@ MultiTransform::GetFixedParame * it's efficient. */ this->m_FixedParameters.SetSize(this->GetNumberOfFixedParameters()); - NumberOfParametersType offset = NumericTraits::ZeroValue(); + NumberOfParametersType offset{}; typename TransformQueueType::const_iterator it; TransformQueueType transforms = this->GetTransformQueue(); it = transforms.begin(); @@ -189,7 +189,7 @@ MultiTransform::SetFixedParame /* Assumes input params are concatenation of the parameters of the * sub transforms. */ TransformQueueType transforms = this->GetTransformQueue(); - NumberOfParametersType offset = NumericTraits::ZeroValue(); + NumberOfParametersType offset{}; /* Why is this done? Seems unnecessary. */ this->m_FixedParameters = inputParameters; @@ -218,7 +218,7 @@ MultiTransform::GetNumberOfPar * However, it seems that number of parameter might change for dense * field transforms (deformation, bspline) during processing and * we wouldn't know that in this class, so this is safest. */ - NumberOfParametersType result = NumericTraits::ZeroValue(); + NumberOfParametersType result{}; for (SizeValueType tind = 0; tind < this->GetNumberOfTransforms(); ++tind) @@ -246,7 +246,7 @@ MultiTransform::GetNumberOfLoc /* Note that unlike in GetNumberOfParameters(), we don't expect the * number of local parameters to possibly change, so we can cache * the value. */ - NumberOfParametersType result = NumericTraits::ZeroValue(); + NumberOfParametersType result{}; for (SizeValueType tind = 0; tind < this->GetNumberOfTransforms(); ++tind) { @@ -263,7 +263,7 @@ auto MultiTransform::GetNumberOfFixedParameters() const -> NumberOfParametersType { - NumberOfParametersType result = NumericTraits::ZeroValue(); + NumberOfParametersType result{}; for (SizeValueType tind = 0; tind < this->GetNumberOfTransforms(); ++tind) { @@ -299,7 +299,7 @@ MultiTransform::UpdateTransfor << numberOfParameters << std::endl); } - NumberOfParametersType offset = NumericTraits::ZeroValue(); + NumberOfParametersType offset{}; for (SizeValueType tind = 0; tind < this->GetNumberOfTransforms(); ++tind) { diff --git a/Modules/Filtering/AnisotropicSmoothing/include/itkVectorCurvatureNDAnisotropicDiffusionFunction.hxx b/Modules/Filtering/AnisotropicSmoothing/include/itkVectorCurvatureNDAnisotropicDiffusionFunction.hxx index 4bb5cf0d4b7..f948247a962 100644 --- a/Modules/Filtering/AnisotropicSmoothing/include/itkVectorCurvatureNDAnisotropicDiffusionFunction.hxx +++ b/Modules/Filtering/AnisotropicSmoothing/include/itkVectorCurvatureNDAnisotropicDiffusionFunction.hxx @@ -90,7 +90,7 @@ VectorCurvatureNDAnisotropicDiffusionFunction::ComputeUpdate(const Neigh double Cx[ImageDimension]; double Cxd[ImageDimension]; - const ScalarValueType ScalarValueTypeZero = NumericTraits::ZeroValue(); + const ScalarValueType ScalarValueTypeZero{}; PixelType dx_forward[ImageDimension]; PixelType dx_backward[ImageDimension]; diff --git a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryClosingByReconstructionImageFilter.hxx b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryClosingByReconstructionImageFilter.hxx index af199b0d72c..bb40e157792 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryClosingByReconstructionImageFilter.hxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryClosingByReconstructionImageFilter.hxx @@ -61,7 +61,7 @@ BinaryClosingByReconstructionImageFilter::GenerateData() // let choose a background value. Background value should not be given by user // because closing is extensive so no background pixels will be added // it is just needed for internal erosion filter and constant padder - InputPixelType backgroundValue = NumericTraits::ZeroValue(); + InputPixelType backgroundValue{}; if (m_ForegroundValue == backgroundValue) { // current background value is already used for foreground value diff --git a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologicalClosingImageFilter.hxx b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologicalClosingImageFilter.hxx index 652fb2ca237..c798c39299c 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologicalClosingImageFilter.hxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologicalClosingImageFilter.hxx @@ -53,7 +53,7 @@ BinaryMorphologicalClosingImageFilter::Gener // let choose a background value. Background value should not be given by user // because closing is extensive so no background pixels will be added // it is just needed for internal erosion filter and constant padder - InputPixelType backgroundValue = NumericTraits::ZeroValue(); + InputPixelType backgroundValue{}; if (m_ForegroundValue == backgroundValue) { // current background value is already used for foreground value diff --git a/Modules/Filtering/CurvatureFlow/include/itkMinMaxCurvatureFlowFunction.hxx b/Modules/Filtering/CurvatureFlow/include/itkMinMaxCurvatureFlowFunction.hxx index 7edee2df6a2..b130aeaad9c 100644 --- a/Modules/Filtering/CurvatureFlow/include/itkMinMaxCurvatureFlowFunction.hxx +++ b/Modules/Filtering/CurvatureFlow/include/itkMinMaxCurvatureFlowFunction.hxx @@ -120,7 +120,7 @@ auto MinMaxCurvatureFlowFunction::ComputeThreshold(const DispatchBase &, const NeighborhoodType & it) const -> PixelType { - PixelType threshold = NumericTraits::ZeroValue(); + PixelType threshold{}; // Compute gradient PixelType gradient[ImageDimension]; @@ -167,8 +167,8 @@ MinMaxCurvatureFlowFunction::ComputeThreshold(const DispatchBase &, cons for (neighIter = it.Begin(); neighIter < neighEnd; ++neighIter, ++i) { - PixelType dotProduct = NumericTraits::ZeroValue(); - PixelType vectorMagnitude = NumericTraits::ZeroValue(); + PixelType dotProduct{}; + PixelType vectorMagnitude{}; for (j = 0; j < ImageDimension; ++j) { @@ -224,7 +224,7 @@ MinMaxCurvatureFlowFunction::ComputeThreshold(const Dispatch<2> &, const return it.GetCenterPixel(); } - PixelType threshold = NumericTraits::ZeroValue(); + PixelType threshold{}; // Compute gradient double gradient[imageDimension]; @@ -286,7 +286,7 @@ MinMaxCurvatureFlowFunction::ComputeThreshold(const Dispatch<3> &, const return it.GetCenterPixel(); } - PixelType threshold = NumericTraits::ZeroValue(); + PixelType threshold{}; // Compute gradient double gradient[imageDimension]; diff --git a/Modules/Filtering/Deconvolution/include/itkInverseDeconvolutionImageFilter.h b/Modules/Filtering/Deconvolution/include/itkInverseDeconvolutionImageFilter.h index 8a6002b10b2..3e3b285c96c 100644 --- a/Modules/Filtering/Deconvolution/include/itkInverseDeconvolutionImageFilter.h +++ b/Modules/Filtering/Deconvolution/include/itkInverseDeconvolutionImageFilter.h @@ -142,7 +142,7 @@ class ITK_TEMPLATE_EXPORT InverseDeconvolutionFunctor operator()(const TInput1 & I, const TInput2 & H) const { const double absH = itk::Math::abs(H); - TOutput value = NumericTraits::ZeroValue(); + TOutput value{}; if (absH >= m_KernelZeroMagnitudeThreshold) { value = static_cast(I / H); diff --git a/Modules/Filtering/Deconvolution/include/itkTikhonovDeconvolutionImageFilter.h b/Modules/Filtering/Deconvolution/include/itkTikhonovDeconvolutionImageFilter.h index 73cc592254f..00e0fccbfd3 100644 --- a/Modules/Filtering/Deconvolution/include/itkTikhonovDeconvolutionImageFilter.h +++ b/Modules/Filtering/Deconvolution/include/itkTikhonovDeconvolutionImageFilter.h @@ -143,7 +143,7 @@ class ITK_TEMPLATE_EXPORT TikhonovDeconvolutionFunctor { typename TOutput::value_type normH = std::norm(H); typename TOutput::value_type denominator = normH + m_RegularizationConstant; - TOutput value = NumericTraits::ZeroValue(); + TOutput value{}; if (denominator >= m_KernelZeroMagnitudeThreshold) { value = static_cast(I * (std::conj(H) / denominator)); diff --git a/Modules/Filtering/Deconvolution/include/itkWienerDeconvolutionImageFilter.h b/Modules/Filtering/Deconvolution/include/itkWienerDeconvolutionImageFilter.h index fd7852bba65..62b92c15b45 100644 --- a/Modules/Filtering/Deconvolution/include/itkWienerDeconvolutionImageFilter.h +++ b/Modules/Filtering/Deconvolution/include/itkWienerDeconvolutionImageFilter.h @@ -173,7 +173,7 @@ class ITK_TEMPLATE_EXPORT WienerDeconvolutionFunctor TPixel Pf = std::norm(I); TPixel denominator = std::norm(H) + (Pn / (Pf - Pn)); - TPixel value = NumericTraits::ZeroValue(); + TPixel value{}; if (itk::Math::abs(denominator) >= m_KernelZeroMagnitudeThreshold) { value = I * (std::conj(H) / denominator); diff --git a/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx b/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx index 3c57d5fca3e..570c9a4a020 100644 --- a/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx +++ b/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx @@ -2340,7 +2340,7 @@ PatchBasedDenoisingImageFilter::ComputeGradientJointE useCachedComputations = true; - RealValueType gaussianJointEntropy = NumericTraits::ZeroValue(); + RealValueType gaussianJointEntropy{}; for (unsigned int ic = 0; ic < m_NumIndependentComponents; ++ic) { RealValueType kernelSigma = m_KernelBandwidthSigma[ic]; diff --git a/Modules/Filtering/DisplacementField/include/itkDisplacementFieldToBSplineImageFilter.hxx b/Modules/Filtering/DisplacementField/include/itkDisplacementFieldToBSplineImageFilter.hxx index a7be8bb0c6f..9f47ae253aa 100644 --- a/Modules/Filtering/DisplacementField/include/itkDisplacementFieldToBSplineImageFilter.hxx +++ b/Modules/Filtering/DisplacementField/include/itkDisplacementFieldToBSplineImageFilter.hxx @@ -126,7 +126,7 @@ DisplacementFieldToBSplineImageFilter auto weights = WeightsContainerType::New(); - IdentifierType numberOfPoints = NumericTraits::ZeroValue(); + IdentifierType numberOfPoints{}; const typename WeightsContainerType::Element boundaryWeight = 1.0e10; diff --git a/Modules/Filtering/DisplacementField/include/itkInvertDisplacementFieldImageFilter.hxx b/Modules/Filtering/DisplacementField/include/itkInvertDisplacementFieldImageFilter.hxx index 92ed782a6e3..4f206d3f789 100644 --- a/Modules/Filtering/DisplacementField/include/itkInvertDisplacementFieldImageFilter.hxx +++ b/Modules/Filtering/DisplacementField/include/itkInvertDisplacementFieldImageFilter.hxx @@ -208,8 +208,8 @@ InvertDisplacementFieldImageFilter::DynamicThreadedGe else { VectorType inverseSpacing; - RealType localMean = NumericTraits::ZeroValue(); - RealType localMax = NumericTraits::ZeroValue(); + RealType localMean{}; + RealType localMax{}; for (unsigned int d = 0; d < ImageDimension; ++d) { inverseSpacing[d] = 1.0 / this->m_DisplacementFieldSpacing[d]; diff --git a/Modules/Filtering/DistanceMap/include/itkContourDirectedMeanDistanceImageFilter.hxx b/Modules/Filtering/DistanceMap/include/itkContourDirectedMeanDistanceImageFilter.hxx index f07e54b4835..006b4b2ca69 100644 --- a/Modules/Filtering/DistanceMap/include/itkContourDirectedMeanDistanceImageFilter.hxx +++ b/Modules/Filtering/DistanceMap/include/itkContourDirectedMeanDistanceImageFilter.hxx @@ -148,7 +148,7 @@ ContourDirectedMeanDistanceImageFilter::AfterThreade // Find mean over all threads IdentifierType count = 0; - RealType sum = NumericTraits::ZeroValue(); + RealType sum{}; for (ThreadIdType i = 0; i < numberOfWorkUnits; ++i) { diff --git a/Modules/Filtering/DistanceMap/include/itkDirectedHausdorffDistanceImageFilter.hxx b/Modules/Filtering/DistanceMap/include/itkDirectedHausdorffDistanceImageFilter.hxx index 93fadbd2a13..29b49da084d 100644 --- a/Modules/Filtering/DistanceMap/include/itkDirectedHausdorffDistanceImageFilter.hxx +++ b/Modules/Filtering/DistanceMap/include/itkDirectedHausdorffDistanceImageFilter.hxx @@ -158,7 +158,7 @@ DirectedHausdorffDistanceImageFilter::DynamicThreade ImageRegionConstIterator it1(inputPtr1, regionForThread); ImageRegionConstIterator it2(m_DistanceMap, regionForThread); - RealType maxDistance = NumericTraits::ZeroValue(); + RealType maxDistance{}; CompensatedSummationType sum = 0.0; IdentifierType pixelCount = 0; diff --git a/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilter.h b/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilter.h index 076e43412d0..2df45cf14b2 100644 --- a/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilter.h +++ b/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilter.h @@ -229,7 +229,7 @@ class ITK_TEMPLATE_EXPORT FastMarchingImageFilter : public ImageToImageFilterGetLargestPossibleRegion()); b_it.GoToBegin(); - TPixel zero_value = NumericTraits::ZeroValue(); + TPixel zero_value{}; typename NodeContainer::ElementIdentifier NumberOfPoints = 0; NodeType node; diff --git a/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilterBase.hxx b/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilterBase.hxx index a05bbbb882d..8e5cb0eec71 100644 --- a/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilterBase.hxx +++ b/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilterBase.hxx @@ -501,7 +501,7 @@ FastMarchingImageFilterBase::InitializeOutput(OutputImageType * NodePairContainerConstIterator pointsIter = this->m_ForbiddenPoints->Begin(); NodePairContainerConstIterator pointsEnd = this->m_ForbiddenPoints->End(); - OutputPixelType zero = NumericTraits::ZeroValue(); + OutputPixelType zero{}; while (pointsIter != pointsEnd) { diff --git a/Modules/Filtering/FastMarching/include/itkFastMarchingQuadEdgeMeshFilterBase.hxx b/Modules/Filtering/FastMarching/include/itkFastMarchingQuadEdgeMeshFilterBase.hxx index b2170bb0570..6cd79358c01 100644 --- a/Modules/Filtering/FastMarching/include/itkFastMarchingQuadEdgeMeshFilterBase.hxx +++ b/Modules/Filtering/FastMarching/include/itkFastMarchingQuadEdgeMeshFilterBase.hxx @@ -54,7 +54,7 @@ const typename FastMarchingQuadEdgeMeshFilterBase::OutputPixelT FastMarchingQuadEdgeMeshFilterBase::GetOutputValue(OutputMeshType * oMesh, const NodeType & iNode) const { - OutputPixelType outputValue = NumericTraits::ZeroValue(); + OutputPixelType outputValue{}; oMesh->GetPointData(iNode, &outputValue); return outputValue; } @@ -130,7 +130,7 @@ FastMarchingQuadEdgeMeshFilterBase::UpdateValue(OutputMeshType OutputPointType p; oMesh->GetPoint(iNode, &p); - InputPixelType F = NumericTraits::ZeroValue(); + InputPixelType F{}; this->m_InputMesh->GetPointData(iNode, &F); if (F < 0.) @@ -645,7 +645,7 @@ FastMarchingQuadEdgeMeshFilterBase::InitializeOutput(OutputMesh NodePairContainerConstIterator pointsIter = this->m_ForbiddenPoints->Begin(); NodePairContainerConstIterator pointsEnd = this->m_ForbiddenPoints->End(); - OutputPixelType zero = NumericTraits::ZeroValue(); + OutputPixelType zero{}; while (pointsIter != pointsEnd) { diff --git a/Modules/Filtering/FastMarching/include/itkFastMarchingUpwindGradientImageFilter.hxx b/Modules/Filtering/FastMarching/include/itkFastMarchingUpwindGradientImageFilter.hxx index d2b45ea7b35..2c9112f4d11 100644 --- a/Modules/Filtering/FastMarching/include/itkFastMarchingUpwindGradientImageFilter.hxx +++ b/Modules/Filtering/FastMarching/include/itkFastMarchingUpwindGradientImageFilter.hxx @@ -265,7 +265,7 @@ FastMarchingUpwindGradientImageFilter::ComputeGradient( const LevelSetIndexType & lastIndex = this->GetLastIndex(); const LevelSetIndexType & startIndex = this->GetStartIndex(); - const LevelSetPixelType ZERO = NumericTraits::ZeroValue(); + const LevelSetPixelType ZERO{}; OutputSpacingType spacing = this->GetOutput()->GetSpacing(); diff --git a/Modules/Filtering/FastMarching/include/itkFastMarchingUpwindGradientImageFilterBase.hxx b/Modules/Filtering/FastMarching/include/itkFastMarchingUpwindGradientImageFilterBase.hxx index 53adc37d56a..a347f78ae8a 100644 --- a/Modules/Filtering/FastMarching/include/itkFastMarchingUpwindGradientImageFilterBase.hxx +++ b/Modules/Filtering/FastMarching/include/itkFastMarchingUpwindGradientImageFilterBase.hxx @@ -109,7 +109,7 @@ FastMarchingUpwindGradientImageFilterBase::ComputeGradient(Outp OutputPixelType dx_backward; GradientPixelType gradientPixel; - const OutputPixelType ZERO = NumericTraits::ZeroValue(); + const OutputPixelType ZERO{}; OutputSpacingType spacing = oImage->GetSpacing(); diff --git a/Modules/Filtering/ImageFeature/include/itkCannyEdgeDetectionImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkCannyEdgeDetectionImageFilter.hxx index 712c73e29fc..9f929137348 100644 --- a/Modules/Filtering/ImageFeature/include/itkCannyEdgeDetectionImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkCannyEdgeDetectionImageFilter.hxx @@ -155,7 +155,7 @@ CannyEdgeDetectionImageFilter::ComputeCannyEdge(const dxx[i] = innerProduct(m_ComputeCannyEdgeSlice[i], it, m_ComputeCannyEdge2ndDerivativeOper); } - OutputImagePixelType deriv = NumericTraits::ZeroValue(); + OutputImagePixelType deriv{}; int k = 0; // Calculate the 2nd derivative @@ -405,7 +405,7 @@ CannyEdgeDetectionImageFilter::ThreadedCompute2ndDeri typename NeighborhoodAlgorithm::ImageBoundaryFacesCalculator::FaceListType faceList = bC(input, outputRegionForThread, radius); - InputImagePixelType zero = NumericTraits::ZeroValue(); + InputImagePixelType zero{}; OutputImagePixelType dx[ImageDimension]; OutputImagePixelType dx1[ImageDimension]; diff --git a/Modules/Filtering/ImageFeature/include/itkZeroCrossingImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkZeroCrossingImageFilter.hxx index 52feacc223a..c34f8126646 100644 --- a/Modules/Filtering/ImageFeature/include/itkZeroCrossingImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkZeroCrossingImageFilter.hxx @@ -54,7 +54,7 @@ ZeroCrossingImageFilter::GenerateInputRequestedRegion } // Build an operator so that we can determine the kernel size - SizeValueType radius = NumericTraits::ZeroValue(); + SizeValueType radius{}; // get a copy of the input requested region (should equal the output // requested region) @@ -114,7 +114,7 @@ ZeroCrossingImageFilter::DynamicThreadedGenerateData( TotalProgressReporter progress(this, output->GetRequestedRegion().GetNumberOfPixels()); InputImagePixelType this_one, that, abs_this_one, abs_that; - InputImagePixelType zero = NumericTraits::ZeroValue(); + InputImagePixelType zero{}; FixedArray offset; diff --git a/Modules/Filtering/ImageGradient/include/itkGradientMagnitudeImageFilter.hxx b/Modules/Filtering/ImageGradient/include/itkGradientMagnitudeImageFilter.hxx index a74c5077069..b9ce1b1107e 100644 --- a/Modules/Filtering/ImageGradient/include/itkGradientMagnitudeImageFilter.hxx +++ b/Modules/Filtering/ImageGradient/include/itkGradientMagnitudeImageFilter.hxx @@ -165,7 +165,7 @@ GradientMagnitudeImageFilter::DynamicThreadedGenerate while (!bit.IsAtEnd()) { - RealType a = NumericTraits::ZeroValue(); + RealType a{}; for (i = 0; i < ImageDimension; ++i) { const RealType g = SIP(x_slice[i], bit, op[i]); diff --git a/Modules/Filtering/ImageGrid/include/itkTileImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkTileImageFilter.hxx index e078032af21..8cf4e5c4805 100644 --- a/Modules/Filtering/ImageGrid/include/itkTileImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkTileImageFilter.hxx @@ -52,7 +52,7 @@ TileImageFilter::GenerateData() OutputPixelType defaultPixelValue = m_DefaultPixelValue; if (NumericTraits::GetLength(defaultPixelValue) == 0) { - const OutputPixelComponentType zeroComponent = NumericTraits::ZeroValue(); + const OutputPixelComponentType zeroComponent{}; const unsigned int nComponents = output->GetNumberOfComponentsPerPixel(); NumericTraits::SetLength(defaultPixelValue, nComponents); for (unsigned int n = 0; n < nComponents; ++n) diff --git a/Modules/Filtering/ImageIntensity/include/itkPolylineMask2DImageFilter.hxx b/Modules/Filtering/ImageIntensity/include/itkPolylineMask2DImageFilter.hxx index e1bc1a9ece0..92d67af9898 100644 --- a/Modules/Filtering/ImageIntensity/include/itkPolylineMask2DImageFilter.hxx +++ b/Modules/Filtering/ImageIntensity/include/itkPolylineMask2DImageFilter.hxx @@ -110,7 +110,7 @@ PolylineMask2DImageFilter::GenerateData() bool pflag; /* define background, foreground pixel values and unlabeled pixel value */ - PixelType zero_val = NumericTraits::ZeroValue(); + PixelType zero_val{}; auto u_val = static_cast(0); auto b_val = static_cast(2); auto f_val = static_cast(255); diff --git a/Modules/Filtering/ImageIntensity/include/itkVectorRescaleIntensityImageFilter.hxx b/Modules/Filtering/ImageIntensity/include/itkVectorRescaleIntensityImageFilter.hxx index 000d527867a..1733a9e5845 100644 --- a/Modules/Filtering/ImageIntensity/include/itkVectorRescaleIntensityImageFilter.hxx +++ b/Modules/Filtering/ImageIntensity/include/itkVectorRescaleIntensityImageFilter.hxx @@ -56,7 +56,7 @@ VectorRescaleIntensityImageFilter::BeforeThreadedGene InputIterator it(inputImage, inputImage->GetBufferedRegion()); - InputRealType maximumSquaredMagnitude = NumericTraits::ZeroValue(); + InputRealType maximumSquaredMagnitude{}; while (!it.IsAtEnd()) { diff --git a/Modules/Filtering/ImageStatistics/include/itkAccumulateImageFilter.hxx b/Modules/Filtering/ImageStatistics/include/itkAccumulateImageFilter.hxx index e02d3e342e7..e294d46ff70 100644 --- a/Modules/Filtering/ImageStatistics/include/itkAccumulateImageFilter.hxx +++ b/Modules/Filtering/ImageStatistics/include/itkAccumulateImageFilter.hxx @@ -187,7 +187,7 @@ AccumulateImageFilter::GenerateData() const typename TInputImage::RegionType AccumulatedRegion(AccumulatedIndex, AccumulatedSize); inputIterType inputIter(inputImage, AccumulatedRegion); inputIter.GoToBegin(); - AccumulateType Value = NumericTraits::ZeroValue(); + AccumulateType Value{}; while (!inputIter.IsAtEnd()) { Value += static_cast(inputIter.Get()); diff --git a/Modules/Filtering/ImageStatistics/include/itkStandardDeviationProjectionImageFilter.h b/Modules/Filtering/ImageStatistics/include/itkStandardDeviationProjectionImageFilter.h index ba41c4dd398..daccbfe5376 100644 --- a/Modules/Filtering/ImageStatistics/include/itkStandardDeviationProjectionImageFilter.h +++ b/Modules/Filtering/ImageStatistics/include/itkStandardDeviationProjectionImageFilter.h @@ -85,7 +85,7 @@ class StandardDeviationAccumulator typename NumericTraits::RealType mean = ((RealType)m_Sum) / m_Size; typename std::vector::iterator it; - RealType squaredSum = NumericTraits::ZeroValue(); + RealType squaredSum{}; for (it = m_Values.begin(); it != m_Values.end(); ++it) { squaredSum += itk::Math::sqr(*it - mean); diff --git a/Modules/Filtering/ImageStatistics/include/itkStatisticsImageFilter.hxx b/Modules/Filtering/ImageStatistics/include/itkStatisticsImageFilter.hxx index f0e24c49778..f2f0fde1f4a 100644 --- a/Modules/Filtering/ImageStatistics/include/itkStatisticsImageFilter.hxx +++ b/Modules/Filtering/ImageStatistics/include/itkStatisticsImageFilter.hxx @@ -101,7 +101,7 @@ StatisticsImageFilter::ThreadedStreamedGenerateData(const RegionTyp CompensatedSummation sum = NumericTraits::ZeroValue(); CompensatedSummation sumOfSquares = NumericTraits::ZeroValue(); - SizeValueType count = NumericTraits::ZeroValue(); + SizeValueType count{}; PixelType min = NumericTraits::max(); PixelType max = NumericTraits::NonpositiveMin(); diff --git a/Modules/Filtering/LabelMap/include/itkBinaryFillholeImageFilter.hxx b/Modules/Filtering/LabelMap/include/itkBinaryFillholeImageFilter.hxx index b2311cda00c..a226f99024b 100644 --- a/Modules/Filtering/LabelMap/include/itkBinaryFillholeImageFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkBinaryFillholeImageFilter.hxx @@ -65,7 +65,7 @@ BinaryFillholeImageFilter::GenerateData() // let choose a background value. Background value should not be given by user // because closing is extensive so no background pixels will be added // it is just needed for internal erosion filter and constant padder - InputImagePixelType backgroundValue = NumericTraits::ZeroValue(); + InputImagePixelType backgroundValue{}; if (m_ForegroundValue == backgroundValue) { // current background value is already used for foreground value diff --git a/Modules/Filtering/LabelMap/include/itkShapeRelabelLabelMapFilter.h b/Modules/Filtering/LabelMap/include/itkShapeRelabelLabelMapFilter.h index d1c3a90e3b8..5412d054824 100644 --- a/Modules/Filtering/LabelMap/include/itkShapeRelabelLabelMapFilter.h +++ b/Modules/Filtering/LabelMap/include/itkShapeRelabelLabelMapFilter.h @@ -152,7 +152,7 @@ class ITK_TEMPLATE_EXPORT ShapeRelabelLabelMapFilter : public InPlaceLabelMapFil // and put back the objects in the map output->ClearLabels(); - PixelType label = NumericTraits::ZeroValue(); + PixelType label{}; typename VectorType::const_iterator it2 = labelObjects.begin(); while (it2 != labelObjects.end()) { diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/include/itkCleanQuadEdgeMeshFilter.hxx b/Modules/Filtering/QuadEdgeMeshFiltering/include/itkCleanQuadEdgeMeshFilter.hxx index 221bc99716a..a4951d23d55 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/include/itkCleanQuadEdgeMeshFilter.hxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/include/itkCleanQuadEdgeMeshFilter.hxx @@ -43,7 +43,7 @@ template void CleanQuadEdgeMeshFilter::GenerateData() { - InputCoordRepType zeroValue = NumericTraits::ZeroValue(); + InputCoordRepType zeroValue{}; InputCoordRepType absoluteToleranceSquared = this->m_AbsoluteTolerance * this->m_AbsoluteTolerance; if ((Math::ExactlyEquals(this->m_AbsoluteTolerance, zeroValue)) && diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/include/itkLaplacianDeformationQuadEdgeMeshFilter.hxx b/Modules/Filtering/QuadEdgeMeshFiltering/include/itkLaplacianDeformationQuadEdgeMeshFilter.hxx index 829c12cb75a..460c2cdccce 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/include/itkLaplacianDeformationQuadEdgeMeshFilter.hxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/include/itkLaplacianDeformationQuadEdgeMeshFilter.hxx @@ -50,7 +50,7 @@ LaplacianDeformationQuadEdgeMeshFilter:: OutputQEPrimal * qeIt = qe; OutputQEPrimal * qeIt2 = qe->GetOnext(); - OutputCoordRepType oW = NumericTraits::ZeroValue(); + OutputCoordRepType oW{}; do { @@ -222,8 +222,8 @@ LaplacianDeformationQuadEdgeMeshFilter:: } else { - OutputCoordRepType ww = NumericTraits::ZeroValue(); - OutputCoordRepType w = NumericTraits::ZeroValue(); + OutputCoordRepType ww{}; + OutputCoordRepType w{}; qe = output->FindEdge(vId); if (qe) diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/include/itkQuadEdgeMeshParamMatrixCoefficients.h b/Modules/Filtering/QuadEdgeMeshFiltering/include/itkQuadEdgeMeshParamMatrixCoefficients.h index ce005f362b1..9e2b918a0d0 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/include/itkQuadEdgeMeshParamMatrixCoefficients.h +++ b/Modules/Filtering/QuadEdgeMeshFiltering/include/itkQuadEdgeMeshParamMatrixCoefficients.h @@ -205,7 +205,7 @@ class ITK_TEMPLATE_EXPORT AuthalicMatrixCoefficients : public MatrixCoefficients InputPointIdentifier id2 = iEdge->GetDestination(); InputPointType pt2 = iMesh->GetPoint(id2); - InputCoordRepType oValue = NumericTraits::ZeroValue(); + InputCoordRepType oValue{}; if (iEdge->IsLeftSet()) { diff --git a/Modules/Filtering/Thresholding/include/itkOtsuMultipleThresholdsCalculator.hxx b/Modules/Filtering/Thresholding/include/itkOtsuMultipleThresholdsCalculator.hxx index abe80bb3cb8..bcdf27b2b0f 100644 --- a/Modules/Filtering/Thresholding/include/itkOtsuMultipleThresholdsCalculator.hxx +++ b/Modules/Filtering/Thresholding/include/itkOtsuMultipleThresholdsCalculator.hxx @@ -150,7 +150,7 @@ OtsuMultipleThresholdsCalculator::Compute() typename TInputHistogram::ConstIterator iter = histogram->Begin(); typename TInputHistogram::ConstIterator end = histogram->End(); - MeanType globalMean = NumericTraits::ZeroValue(); + MeanType globalMean{}; const FrequencyType globalFrequency = histogram->GetTotalFrequency(); while (iter != end) { @@ -173,7 +173,7 @@ OtsuMultipleThresholdsCalculator::Compute() InstanceIdentifierVectorType maxVarThresholdIndexes = thresholdIndexes; // Compute frequency and mean of initial classes - FrequencyType freqSum = NumericTraits::ZeroValue(); + FrequencyType freqSum{}; FrequencyVectorType classFrequency(numberOfClasses); for (j = 0; j < numberOfClasses - 1; ++j) { @@ -190,7 +190,7 @@ OtsuMultipleThresholdsCalculator::Compute() imgPDF[j] = (WeightType)histogram->GetFrequency(j) / (WeightType)globalFrequency; } - MeanType meanSum = NumericTraits::ZeroValue(); + MeanType meanSum{}; MeanVectorType classMean(numberOfClasses); for (j = 0; j < numberOfClasses - 1; ++j) { @@ -222,9 +222,9 @@ OtsuMultipleThresholdsCalculator::Compute() // distribution. // #ifndef ITK_COMPILER_SUPPORTS_SSE2_32 - volatile VarianceType maxVarBetween = NumericTraits::ZeroValue(); + volatile VarianceType maxVarBetween{}; #else - VarianceType maxVarBetween = NumericTraits::ZeroValue(); + VarianceType maxVarBetween{}; #endif // // The introduction of the "volatile" modifier forces the compiler to keep @@ -240,7 +240,7 @@ OtsuMultipleThresholdsCalculator::Compute() maxVarBetween /= static_cast(globalFrequency); // Sum the relevant weights for valley emphasis - WeightType valleyEmphasisFactor = NumericTraits::ZeroValue(); + WeightType valleyEmphasisFactor{}; if (m_ValleyEmphasis) { for (j = 0; j < numberOfClasses - 1; ++j) @@ -263,9 +263,9 @@ OtsuMultipleThresholdsCalculator::Compute() // distribution. // #ifndef ITK_COMPILER_SUPPORTS_SSE2_32 - volatile VarianceType varBetween = NumericTraits::ZeroValue(); + volatile VarianceType varBetween{}; #else - VarianceType varBetween = NumericTraits::ZeroValue(); + VarianceType varBetween{}; #endif // // The introduction of the "volatile" modifier forces the compiler to keep diff --git a/Modules/IO/MeshBase/include/itkMeshFileReader.hxx b/Modules/IO/MeshBase/include/itkMeshFileReader.hxx index b108f531d23..c563dae29a9 100644 --- a/Modules/IO/MeshBase/include/itkMeshFileReader.hxx +++ b/Modules/IO/MeshBase/include/itkMeshFileReader.hxx @@ -124,8 +124,8 @@ MeshFileReader::Re { typename TOutputMesh::Pointer output = this->GetOutput(); - SizeValueType index = NumericTraits::ZeroValue(); - OutputCellIdentifier id = NumericTraits::ZeroValue(); + SizeValueType index{}; + OutputCellIdentifier id{}; while (index < m_MeshIO->GetCellBufferSize()) { auto type = static_cast(static_cast(buffer[index++])); diff --git a/Modules/IO/MeshBase/include/itkMeshFileWriter.hxx b/Modules/IO/MeshBase/include/itkMeshFileWriter.hxx index 86307d8a19e..90ee757f848 100644 --- a/Modules/IO/MeshBase/include/itkMeshFileWriter.hxx +++ b/Modules/IO/MeshBase/include/itkMeshFileWriter.hxx @@ -318,7 +318,7 @@ MeshFileWriter::CopyPointsToBuffer(Output * data) { const typename InputMeshType::PointsContainer * points = this->GetInput()->GetPoints(); - SizeValueType index = NumericTraits::ZeroValue(); + SizeValueType index{}; typename TInputMesh::PointsContainerConstIterator pter = points->Begin(); while (pter != points->End()) @@ -345,7 +345,7 @@ MeshFileWriter::CopyCellsToBuffer(Output * data) typename TInputMesh::CellType * cellPtr; // For each cell - SizeValueType index = NumericTraits::ZeroValue(); + SizeValueType index{}; typename TInputMesh::CellsContainerConstIterator cter = cells->Begin(); while (cter != cells->End()) { diff --git a/Modules/IO/MeshBase/include/itkMeshIOBase.h b/Modules/IO/MeshBase/include/itkMeshIOBase.h index 1bf98e0ef7f..2b183fb863e 100644 --- a/Modules/IO/MeshBase/include/itkMeshIOBase.h +++ b/Modules/IO/MeshBase/include/itkMeshIOBase.h @@ -715,8 +715,8 @@ class ITKIOMeshBase_EXPORT MeshIOBase : public LightProcessObject { if (input && output) { - SizeValueType inputIndex = NumericTraits::ZeroValue(); - SizeValueType outputIndex = NumericTraits::ZeroValue(); + SizeValueType inputIndex{}; + SizeValueType outputIndex{}; for (SizeValueType ii = 0; ii < m_NumberOfCells; ++ii) { ++inputIndex; // ignore the cell type @@ -773,8 +773,8 @@ class ITKIOMeshBase_EXPORT MeshIOBase : public LightProcessObject { if (input && output) { - SizeValueType inputIndex = NumericTraits::ZeroValue(); - SizeValueType outputIndex = NumericTraits::ZeroValue(); + SizeValueType inputIndex{}; + SizeValueType outputIndex{}; for (SizeValueType ii = 0; ii < numberOfCells; ++ii) { output[outputIndex++] = static_cast(cellType); @@ -795,8 +795,8 @@ class ITKIOMeshBase_EXPORT MeshIOBase : public LightProcessObject { if (input && output) { - SizeValueType inputIndex = NumericTraits::ZeroValue(); - SizeValueType outputIndex = NumericTraits::ZeroValue(); + SizeValueType inputIndex{}; + SizeValueType outputIndex{}; for (SizeValueType ii = 0; ii < numberOfCells; ++ii) { auto numberOfPoints = static_cast(input[inputIndex++]); diff --git a/Modules/IO/SpatialObjects/src/itkPolygonGroupSpatialObjectXMLFile.cxx b/Modules/IO/SpatialObjects/src/itkPolygonGroupSpatialObjectXMLFile.cxx index 4a3d3162b44..72504af1b86 100644 --- a/Modules/IO/SpatialObjects/src/itkPolygonGroupSpatialObjectXMLFile.cxx +++ b/Modules/IO/SpatialObjects/src/itkPolygonGroupSpatialObjectXMLFile.cxx @@ -177,7 +177,7 @@ WriteMetaDataAttribute(PolygonGroupSpatialObjectXMLFileWriter * This, const char * const attName, std::ofstream & output) { - T value = NumericTraits::ZeroValue(); + T value{}; if (ExposeMetaData(thisDic, MetaName, value)) { diff --git a/Modules/Nonunit/Review/include/itkDiscreteGaussianDerivativeImageFunction.hxx b/Modules/Nonunit/Review/include/itkDiscreteGaussianDerivativeImageFunction.hxx index 7c717c2bfe0..6617978f7a0 100644 --- a/Modules/Nonunit/Review/include/itkDiscreteGaussianDerivativeImageFunction.hxx +++ b/Modules/Nonunit/Review/include/itkDiscreteGaussianDerivativeImageFunction.hxx @@ -222,8 +222,8 @@ DiscreteGaussianDerivativeImageFunction::EvaluateAtContinu // Interpolated value is the weighted sum of each of the surrounding // neighbors. The weight for each neighbor is the fraction overlap // of the neighbor pixel with respect to a pixel centered on point. - TOutput value = NumericTraits::ZeroValue(); - TOutput totalOverlap = NumericTraits::ZeroValue(); + TOutput value{}; + TOutput totalOverlap{}; for (NumberOfNeighborsType counter = 0; counter < numberOfNeighbors; ++counter) { diff --git a/Modules/Nonunit/Review/include/itkDiscreteGradientMagnitudeGaussianImageFunction.hxx b/Modules/Nonunit/Review/include/itkDiscreteGradientMagnitudeGaussianImageFunction.hxx index e83fceb11cf..ed7cd019b27 100644 --- a/Modules/Nonunit/Review/include/itkDiscreteGradientMagnitudeGaussianImageFunction.hxx +++ b/Modules/Nonunit/Review/include/itkDiscreteGradientMagnitudeGaussianImageFunction.hxx @@ -256,8 +256,8 @@ DiscreteGradientMagnitudeGaussianImageFunction::EvaluateAt // Interpolated value is the weighted sum of each of the surrounding // neighbors. The weight for each neighbor is the fraction overlap // of the neighbor pixel with respect to a pixel centered on point. - TOutput value = NumericTraits::ZeroValue(); - TOutput totalOverlap = NumericTraits::ZeroValue(); + TOutput value{}; + TOutput totalOverlap{}; for (NumberOfNeighborsType counter = 0; counter < neighbors; ++counter) { diff --git a/Modules/Nonunit/Review/include/itkDiscreteHessianGaussianImageFunction.hxx b/Modules/Nonunit/Review/include/itkDiscreteHessianGaussianImageFunction.hxx index 57c7deca9a2..074bcd2b7db 100644 --- a/Modules/Nonunit/Review/include/itkDiscreteHessianGaussianImageFunction.hxx +++ b/Modules/Nonunit/Review/include/itkDiscreteHessianGaussianImageFunction.hxx @@ -254,7 +254,7 @@ DiscreteHessianGaussianImageFunction::EvaluateAtContinuous // neighbors. The weight for each neighbor is the fraction overlap // of the neighbor pixel with respect to a pixel centered on point. OutputType hessian, currentHessian; - TOutput totalOverlap = NumericTraits::ZeroValue(); + TOutput totalOverlap{}; for (NumberOfNeighborsType counter = 0; counter < neighbors; ++counter) { diff --git a/Modules/Nonunit/Review/include/itkMultiphaseFiniteDifferenceImageFilter.hxx b/Modules/Nonunit/Review/include/itkMultiphaseFiniteDifferenceImageFilter.hxx index 7890660d76c..b0c678f7f1a 100644 --- a/Modules/Nonunit/Review/include/itkMultiphaseFiniteDifferenceImageFilter.hxx +++ b/Modules/Nonunit/Review/include/itkMultiphaseFiniteDifferenceImageFilter.hxx @@ -203,7 +203,7 @@ typename MultiphaseFiniteDifferenceImageFilter:: ResolveTimeStep(const TimeStepVectorType & timeStepList, const std::vector & valid) { - TimeStepType oMin = NumericTraits::ZeroValue(); + TimeStepType oMin{}; const SizeValueType size = timeStepList.size(); if (size == valid.size()) diff --git a/Modules/Nonunit/Review/include/itkMultiphaseSparseFiniteDifferenceImageFilter.hxx b/Modules/Nonunit/Review/include/itkMultiphaseSparseFiniteDifferenceImageFilter.hxx index 03c8aaf6700..ce7eeca1540 100644 --- a/Modules/Nonunit/Review/include/itkMultiphaseSparseFiniteDifferenceImageFilter.hxx +++ b/Modules/Nonunit/Review/include/itkMultiphaseSparseFiniteDifferenceImageFilter.hxx @@ -814,7 +814,7 @@ MultiphaseSparseFiniteDifferenceImageFilter::ZeroValue(); // warnings + ValueType value{}; // warnings bool found_neighbor_flag; LayerIterator toIt; LayerNodeType * node; diff --git a/Modules/Nonunit/Review/include/itkRegionBasedLevelSetFunction.h b/Modules/Nonunit/Review/include/itkRegionBasedLevelSetFunction.h index e629d1b15ef..bae4fad5251 100644 --- a/Modules/Nonunit/Review/include/itkRegionBasedLevelSetFunction.h +++ b/Modules/Nonunit/Review/include/itkRegionBasedLevelSetFunction.h @@ -99,7 +99,7 @@ class ITK_TEMPLATE_EXPORT RegionBasedLevelSetFunction : public FiniteDifferenceF { GlobalDataStruct() { - ScalarValueType null_value = NumericTraits::ZeroValue(); + ScalarValueType null_value{}; m_MaxCurvatureChange = null_value; m_MaxAdvectionChange = null_value; diff --git a/Modules/Nonunit/Review/include/itkRegionBasedLevelSetFunction.hxx b/Modules/Nonunit/Review/include/itkRegionBasedLevelSetFunction.hxx index ee06993d309..9f5383eb727 100644 --- a/Modules/Nonunit/Review/include/itkRegionBasedLevelSetFunction.hxx +++ b/Modules/Nonunit/Review/include/itkRegionBasedLevelSetFunction.hxx @@ -170,7 +170,7 @@ RegionBasedLevelSetFunction::ComputeCurvature(con GlobalDataStruct * gd) { // Calculate the mean curvature - ScalarValueType curvature = NumericTraits::ZeroValue(); + ScalarValueType curvature{}; unsigned int i, j; @@ -248,10 +248,10 @@ RegionBasedLevelSetFunction::ComputeUpdate(const // Access the neighborhood center pixel of phi const ScalarValueType inputValue = it.GetCenterPixel(); - ScalarValueType laplacian_term = NumericTraits::ZeroValue(); - ScalarValueType curvature_term = NumericTraits::ZeroValue(); - ScalarValueType curvature = NumericTraits::ZeroValue(); - ScalarValueType globalTerm = NumericTraits::ZeroValue(); + ScalarValueType laplacian_term{}; + ScalarValueType curvature_term{}; + ScalarValueType curvature{}; + ScalarValueType globalTerm{}; VectorType advection_field; ScalarValueType x_energy, advection_term = NumericTraits::ZeroValue(); diff --git a/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx b/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx index a2aab323ad4..3342a89c95c 100644 --- a/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx +++ b/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx @@ -539,7 +539,7 @@ RobustSolver::DeleteLandmarksOutOfMesh() using VectorContainerType = itk::VectorContainer; auto newLoadContainer = VectorContainerType::New(); - LoadIdentifier numToRemoveLoads = NumericTraits::ZeroValue(); + LoadIdentifier numToRemoveLoads{}; LoadContainerType * container = this->m_FEMObject->GetModifiableLoadContainer(); diff --git a/Modules/Numerics/Optimizersv4/include/itkRegistrationParameterScalesFromJacobian.hxx b/Modules/Numerics/Optimizersv4/include/itkRegistrationParameterScalesFromJacobian.hxx index 3f182be90c3..a8cf0d8583c 100644 --- a/Modules/Numerics/Optimizersv4/include/itkRegistrationParameterScalesFromJacobian.hxx +++ b/Modules/Numerics/Optimizersv4/include/itkRegistrationParameterScalesFromJacobian.hxx @@ -73,7 +73,7 @@ RegistrationParameterScalesFromJacobian::EstimateStepScale(const Parame this->ComputeSampleStepScales(step, sampleScales); const auto numSamples = static_cast(this->m_SamplePoints.size()); - FloatType scaleSum = NumericTraits::ZeroValue(); + FloatType scaleSum{}; // checking each sample point for (SizeValueType c = 0; c < numSamples; ++c) diff --git a/Modules/Numerics/Optimizersv4/include/itkRegistrationParameterScalesFromShiftBase.hxx b/Modules/Numerics/Optimizersv4/include/itkRegistrationParameterScalesFromShiftBase.hxx index 39c6effaaa8..b522b23aeb1 100644 --- a/Modules/Numerics/Optimizersv4/include/itkRegistrationParameterScalesFromShiftBase.hxx +++ b/Modules/Numerics/Optimizersv4/include/itkRegistrationParameterScalesFromShiftBase.hxx @@ -137,7 +137,7 @@ RegistrationParameterScalesFromShiftBase::EstimateStepScale(const Param // For global transforms, we want a linear approximation of the function // of step scale w.r.t "step". This is true only when "step" is close to // zero. Therefore, we need to scale "step" down. - FloatType maxStep = NumericTraits::ZeroValue(); + FloatType maxStep{}; for (typename ParametersType::SizeValueType p = 0; p < step.GetSize(); ++p) { if (maxStep < itk::Math::abs(step[p])) @@ -208,7 +208,7 @@ RegistrationParameterScalesFromShiftBase::ComputeMaximumVoxelShift(cons this->ComputeSampleShifts(deltaParameters, sampleShifts); - FloatType maxShift = NumericTraits::ZeroValue(); + FloatType maxShift{}; for (SizeValueType s = 0; s < sampleShifts.size(); ++s) { if (maxShift < sampleShifts[s]) diff --git a/Modules/Numerics/Statistics/include/itkCovarianceSampleFilter.hxx b/Modules/Numerics/Statistics/include/itkCovarianceSampleFilter.hxx index bce640313e7..1b584e8974d 100644 --- a/Modules/Numerics/Statistics/include/itkCovarianceSampleFilter.hxx +++ b/Modules/Numerics/Statistics/include/itkCovarianceSampleFilter.hxx @@ -140,7 +140,7 @@ CovarianceSampleFilter::GenerateData() NumericTraits::SetLength(diff, measurementVectorSize); using TotalFrequencyType = typename SampleType::TotalAbsoluteFrequencyType; - TotalFrequencyType totalFrequency = NumericTraits::ZeroValue(); + TotalFrequencyType totalFrequency{}; typename SampleType::ConstIterator iter = input->Begin(); const typename SampleType::ConstIterator end = input->End(); diff --git a/Modules/Numerics/Statistics/include/itkExpectationMaximizationMixtureModelEstimator.hxx b/Modules/Numerics/Statistics/include/itkExpectationMaximizationMixtureModelEstimator.hxx index 136f64499e3..e6385d2b783 100644 --- a/Modules/Numerics/Statistics/include/itkExpectationMaximizationMixtureModelEstimator.hxx +++ b/Modules/Numerics/Statistics/include/itkExpectationMaximizationMixtureModelEstimator.hxx @@ -162,7 +162,7 @@ ExpectationMaximizationMixtureModelEstimator::CalculateDensities() using FrequencyType = typename TSample::AbsoluteFrequencyType; FrequencyType frequency; - FrequencyType zeroFrequency = NumericTraits::ZeroValue(); + FrequencyType zeroFrequency{}; typename TSample::MeasurementVectorType mvector; double density; double densitySum; diff --git a/Modules/Numerics/Statistics/include/itkHistogram.hxx b/Modules/Numerics/Statistics/include/itkHistogram.hxx index 625bebc0632..5385836d5a9 100644 --- a/Modules/Numerics/Statistics/include/itkHistogram.hxx +++ b/Modules/Numerics/Statistics/include/itkHistogram.hxx @@ -627,7 +627,7 @@ Histogram::Quantile(unsigned int dimension, d else { n = size - 1; - InstanceIdentifier m = NumericTraits::ZeroValue(); + InstanceIdentifier m{}; p_n = 1.0; do { diff --git a/Modules/Numerics/Statistics/include/itkHistogramToRunLengthFeaturesFilter.hxx b/Modules/Numerics/Statistics/include/itkHistogramToRunLengthFeaturesFilter.hxx index fb487ed65d1..02c63afe566 100644 --- a/Modules/Numerics/Statistics/include/itkHistogramToRunLengthFeaturesFilter.hxx +++ b/Modules/Numerics/Statistics/include/itkHistogramToRunLengthFeaturesFilter.hxx @@ -75,16 +75,16 @@ HistogramToRunLengthFeaturesFilter::GenerateData() this->m_TotalNumberOfRuns = static_cast(inputHistogram->GetTotalFrequency()); - MeasurementType shortRunEmphasis = NumericTraits::ZeroValue(); - MeasurementType longRunEmphasis = NumericTraits::ZeroValue(); - MeasurementType greyLevelNonuniformity = NumericTraits::ZeroValue(); - MeasurementType runLengthNonuniformity = NumericTraits::ZeroValue(); - MeasurementType lowGreyLevelRunEmphasis = NumericTraits::ZeroValue(); - MeasurementType highGreyLevelRunEmphasis = NumericTraits::ZeroValue(); - MeasurementType shortRunLowGreyLevelEmphasis = NumericTraits::ZeroValue(); - MeasurementType shortRunHighGreyLevelEmphasis = NumericTraits::ZeroValue(); - MeasurementType longRunLowGreyLevelEmphasis = NumericTraits::ZeroValue(); - MeasurementType longRunHighGreyLevelEmphasis = NumericTraits::ZeroValue(); + MeasurementType shortRunEmphasis{}; + MeasurementType longRunEmphasis{}; + MeasurementType greyLevelNonuniformity{}; + MeasurementType runLengthNonuniformity{}; + MeasurementType lowGreyLevelRunEmphasis{}; + MeasurementType highGreyLevelRunEmphasis{}; + MeasurementType shortRunLowGreyLevelEmphasis{}; + MeasurementType shortRunHighGreyLevelEmphasis{}; + MeasurementType longRunLowGreyLevelEmphasis{}; + MeasurementType longRunHighGreyLevelEmphasis{}; vnl_vector greyLevelNonuniformityVector(inputHistogram->GetSize()[0], 0.0); vnl_vector runLengthNonuniformityVector(inputHistogram->GetSize()[1], 0.0); diff --git a/Modules/Numerics/Statistics/include/itkHistogramToTextureFeaturesFilter.hxx b/Modules/Numerics/Statistics/include/itkHistogramToTextureFeaturesFilter.hxx index d9f93f9fd12..199871f104c 100644 --- a/Modules/Numerics/Statistics/include/itkHistogramToTextureFeaturesFilter.hxx +++ b/Modules/Numerics/Statistics/include/itkHistogramToTextureFeaturesFilter.hxx @@ -94,16 +94,16 @@ HistogramToTextureFeaturesFilter::GenerateData() this->ComputeMeansAndVariances(pixelMean, marginalMean, marginalDevSquared, pixelVariance); // Finally compute the texture features. Another one pass. - MeasurementType energy = NumericTraits::ZeroValue(); - MeasurementType entropy = NumericTraits::ZeroValue(); - MeasurementType correlation = NumericTraits::ZeroValue(); + MeasurementType energy{}; + MeasurementType entropy{}; + MeasurementType correlation{}; - MeasurementType inverseDifferenceMoment = NumericTraits::ZeroValue(); + MeasurementType inverseDifferenceMoment{}; - MeasurementType inertia = NumericTraits::ZeroValue(); - MeasurementType clusterShade = NumericTraits::ZeroValue(); - MeasurementType clusterProminence = NumericTraits::ZeroValue(); - MeasurementType haralickCorrelation = NumericTraits::ZeroValue(); + MeasurementType inertia{}; + MeasurementType clusterShade{}; + MeasurementType clusterProminence{}; + MeasurementType haralickCorrelation{}; double pixelVarianceSquared = pixelVariance * pixelVariance; // Variance is only used in correlation. If variance is 0, then diff --git a/Modules/Numerics/Statistics/include/itkMeanSampleFilter.hxx b/Modules/Numerics/Statistics/include/itkMeanSampleFilter.hxx index 2d3de5f8a52..82ef2bf0266 100644 --- a/Modules/Numerics/Statistics/include/itkMeanSampleFilter.hxx +++ b/Modules/Numerics/Statistics/include/itkMeanSampleFilter.hxx @@ -124,7 +124,7 @@ MeanSampleFilter::GenerateData() std::vector sum(measurementVectorSize); using TotalFrequencyType = typename SampleType::TotalAbsoluteFrequencyType; - TotalFrequencyType totalFrequency = NumericTraits::ZeroValue(); + TotalFrequencyType totalFrequency{}; typename SampleType::ConstIterator iter = input->Begin(); const typename SampleType::ConstIterator end = input->End(); diff --git a/Modules/Numerics/Statistics/include/itkWeightedCovarianceSampleFilter.hxx b/Modules/Numerics/Statistics/include/itkWeightedCovarianceSampleFilter.hxx index b7bafa421d5..24530bc8e26 100644 --- a/Modules/Numerics/Statistics/include/itkWeightedCovarianceSampleFilter.hxx +++ b/Modules/Numerics/Statistics/include/itkWeightedCovarianceSampleFilter.hxx @@ -92,9 +92,9 @@ WeightedCovarianceSampleFilter::ComputeCovarianceMatrixWithWeightingFun MeasurementVectorRealType diff; NumericTraits::SetLength(diff, measurementVectorSize); - WeightValueType totalWeight = NumericTraits::ZeroValue(); + WeightValueType totalWeight{}; - WeightValueType totalSquaredWeight = NumericTraits::ZeroValue(); + WeightValueType totalSquaredWeight{}; typename SampleType::ConstIterator iter = input->Begin(); const typename SampleType::ConstIterator end = input->End(); @@ -189,9 +189,9 @@ WeightedCovarianceSampleFilter::ComputeCovarianceMatrixWithWeights() MeasurementVectorRealType diff; NumericTraits::SetLength(diff, measurementVectorSize); - WeightValueType totalWeight = NumericTraits::ZeroValue(); + WeightValueType totalWeight{}; - WeightValueType totalSquaredWeight = NumericTraits::ZeroValue(); + WeightValueType totalSquaredWeight{}; typename SampleType::ConstIterator iter = input->Begin(); const typename SampleType::ConstIterator end = input->End(); diff --git a/Modules/Numerics/Statistics/include/itkWeightedMeanSampleFilter.hxx b/Modules/Numerics/Statistics/include/itkWeightedMeanSampleFilter.hxx index bdfc508512a..604f6cd4f93 100644 --- a/Modules/Numerics/Statistics/include/itkWeightedMeanSampleFilter.hxx +++ b/Modules/Numerics/Statistics/include/itkWeightedMeanSampleFilter.hxx @@ -81,7 +81,7 @@ WeightedMeanSampleFilter::ComputeMeanWithWeights() const WeightArrayType & weightsArray = this->GetWeights(); - WeightValueType totalWeight = NumericTraits::ZeroValue(); + WeightValueType totalWeight{}; typename SampleType::ConstIterator iter = input->Begin(); typename SampleType::ConstIterator end = input->End(); @@ -142,7 +142,7 @@ WeightedMeanSampleFilter::ComputeMeanWithWeightingFunction() const WeightingFunctionType * const weightFunction = this->GetWeightingFunction(); - WeightValueType totalWeight = NumericTraits::ZeroValue(); + WeightValueType totalWeight{}; typename SampleType::ConstIterator iter = input->Begin(); const typename SampleType::ConstIterator end = input->End(); diff --git a/Modules/Numerics/Statistics/test/itkSampleTest.cxx b/Modules/Numerics/Statistics/test/itkSampleTest.cxx index b4708d77486..f2dc9bd86d8 100644 --- a/Modules/Numerics/Statistics/test/itkSampleTest.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleTest.cxx @@ -82,7 +82,7 @@ class MySample : public Sample TotalAbsoluteFrequencyType GetTotalFrequency() const override { - TotalAbsoluteFrequencyType sum = NumericTraits::ZeroValue(); + TotalAbsoluteFrequencyType sum{}; auto itr = m_Frequencies.begin(); while (itr != m_Frequencies.end()) { diff --git a/Modules/Numerics/Statistics/test/itkSampleTest2.cxx b/Modules/Numerics/Statistics/test/itkSampleTest2.cxx index 4244f668f6e..359c6b0baa8 100644 --- a/Modules/Numerics/Statistics/test/itkSampleTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleTest2.cxx @@ -89,7 +89,7 @@ class MySample : public Sample TotalAbsoluteFrequencyType GetTotalFrequency() const override { - TotalAbsoluteFrequencyType sum = NumericTraits::ZeroValue(); + TotalAbsoluteFrequencyType sum{}; auto itr = m_Frequencies.begin(); while (itr != m_Frequencies.end()) { diff --git a/Modules/Numerics/Statistics/test/itkSampleTest3.cxx b/Modules/Numerics/Statistics/test/itkSampleTest3.cxx index 7c65bae0250..9e95bf0452f 100644 --- a/Modules/Numerics/Statistics/test/itkSampleTest3.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleTest3.cxx @@ -90,7 +90,7 @@ class MySample : public Sample TotalAbsoluteFrequencyType GetTotalFrequency() const override { - TotalAbsoluteFrequencyType sum = NumericTraits::ZeroValue(); + TotalAbsoluteFrequencyType sum{}; auto itr = m_Frequencies.begin(); while (itr != m_Frequencies.end()) { diff --git a/Modules/Numerics/Statistics/test/itkSampleTest4.cxx b/Modules/Numerics/Statistics/test/itkSampleTest4.cxx index 866dded14eb..6b25ae2459c 100644 --- a/Modules/Numerics/Statistics/test/itkSampleTest4.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleTest4.cxx @@ -90,7 +90,7 @@ class MySample : public Sample TotalAbsoluteFrequencyType GetTotalFrequency() const override { - TotalAbsoluteFrequencyType sum = NumericTraits::ZeroValue(); + TotalAbsoluteFrequencyType sum{}; auto itr = m_Frequencies.begin(); while (itr != m_Frequencies.end()) { diff --git a/Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxx b/Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxx index a29307de890..265afa24a60 100644 --- a/Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxx +++ b/Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxx @@ -316,7 +316,7 @@ BlockMatchingImageFilterTransformPhysicalPointToIndex(originalLocation); // the block is selected for a minimum similarity metric - SimilaritiesValue similarity = NumericTraits::ZeroValue(); + SimilaritiesValue similarity{}; // New point location DisplacementsVector displacement; @@ -336,11 +336,11 @@ BlockMatchingImageFilter::ZeroValue(); - SimilaritiesValue fixedSumOfSquares = NumericTraits::ZeroValue(); - SimilaritiesValue movingSum = NumericTraits::ZeroValue(); - SimilaritiesValue movingSumOfSquares = NumericTraits::ZeroValue(); - SimilaritiesValue covariance = NumericTraits::ZeroValue(); + SimilaritiesValue fixedSum{}; + SimilaritiesValue fixedSumOfSquares{}; + SimilaritiesValue movingSum{}; + SimilaritiesValue movingSumOfSquares{}; + SimilaritiesValue covariance{}; // iterate over voxels in blockRadius for (SizeValueType i = 0; i < numberOfVoxelInBlock; ++i) // windowIterator.Size() == numberOfVoxelInBlock @@ -359,7 +359,7 @@ BlockMatchingImageFilter::ZeroValue(); + SimilaritiesValue sim{}; if ((fixedVariance * movingVariance) != 0.0) { sim = (covariance * covariance) / (fixedVariance * movingVariance); diff --git a/Modules/Registration/Common/include/itkCorrelationCoefficientHistogramImageToImageMetric.hxx b/Modules/Registration/Common/include/itkCorrelationCoefficientHistogramImageToImageMetric.hxx index 9785046a067..7521243e7d0 100644 --- a/Modules/Registration/Common/include/itkCorrelationCoefficientHistogramImageToImageMetric.hxx +++ b/Modules/Registration/Common/include/itkCorrelationCoefficientHistogramImageToImageMetric.hxx @@ -38,7 +38,7 @@ auto CorrelationCoefficientHistogramImageToImageMetric::MeanX(HistogramType & histogram) const -> MeasureType { - MeasureType meanX = NumericTraits::ZeroValue(); + MeasureType meanX{}; for (unsigned int i = 0; i < this->m_HistogramSize[0]; ++i) { @@ -57,7 +57,7 @@ auto CorrelationCoefficientHistogramImageToImageMetric::MeanY(HistogramType & histogram) const -> MeasureType { - MeasureType meanY = NumericTraits::ZeroValue(); + MeasureType meanY{}; for (unsigned int i = 0; i < this->m_HistogramSize[1]; ++i) { @@ -76,7 +76,7 @@ auto CorrelationCoefficientHistogramImageToImageMetric::VarianceX(HistogramType & histogram) const -> MeasureType { - MeasureType varX = NumericTraits::ZeroValue(); + MeasureType varX{}; for (unsigned int i = 0; i < this->m_HistogramSize[0]; ++i) { @@ -92,7 +92,7 @@ auto CorrelationCoefficientHistogramImageToImageMetric::VarianceY(HistogramType & histogram) const -> MeasureType { - MeasureType varY = NumericTraits::ZeroValue(); + MeasureType varY{}; for (unsigned int i = 0; i < this->m_HistogramSize[1]; ++i) { @@ -108,7 +108,7 @@ typename CorrelationCoefficientHistogramImageToImageMetric::Covariance( HistogramType & histogram) const { - MeasureType var = NumericTraits::ZeroValue(); + MeasureType var{}; MeasureType meanX = MeanX(histogram); MeasureType meanY = MeanY(histogram); diff --git a/Modules/Registration/Common/include/itkGradientDifferenceImageToImageMetric.hxx b/Modules/Registration/Common/include/itkGradientDifferenceImageToImageMetric.hxx index 5ea8a50fe90..9f45dd5effc 100644 --- a/Modules/Registration/Common/include/itkGradientDifferenceImageToImageMetric.hxx +++ b/Modules/Registration/Common/include/itkGradientDifferenceImageToImageMetric.hxx @@ -296,7 +296,7 @@ GradientDifferenceImageToImageMetric::ComputeMeasure( this->SetTransformParameters(parameters); m_TransformMovingImageFilter->UpdateLargestPossibleRegion(); - MeasureType measure = NumericTraits::ZeroValue(); + MeasureType measure{}; for (iDimension = 0; iDimension < FixedImageDimension; ++iDimension) { diff --git a/Modules/Registration/Common/include/itkKappaStatisticImageToImageMetric.hxx b/Modules/Registration/Common/include/itkKappaStatisticImageToImageMetric.hxx index 28eab6b2d0d..782f6fc924f 100644 --- a/Modules/Registration/Common/include/itkKappaStatisticImageToImageMetric.hxx +++ b/Modules/Registration/Common/include/itkKappaStatisticImageToImageMetric.hxx @@ -73,9 +73,9 @@ KappaStatisticImageToImageMetric::GetValue(const Tran // and moving image. // MeasureType measure; - MeasureType intersection = NumericTraits::ZeroValue(); - MeasureType movingForegroundArea = NumericTraits::ZeroValue(); - MeasureType fixedForegroundArea = NumericTraits::ZeroValue(); + MeasureType intersection{}; + MeasureType movingForegroundArea{}; + MeasureType fixedForegroundArea{}; // Compute fixedForegroundArea, movingForegroundArea, and // intersection. Loop over the fixed image. diff --git a/Modules/Registration/Common/include/itkKullbackLeiblerCompareHistogramImageToImageMetric.hxx b/Modules/Registration/Common/include/itkKullbackLeiblerCompareHistogramImageToImageMetric.hxx index ee305198233..21c5f62c949 100644 --- a/Modules/Registration/Common/include/itkKullbackLeiblerCompareHistogramImageToImageMetric.hxx +++ b/Modules/Registration/Common/include/itkKullbackLeiblerCompareHistogramImageToImageMetric.hxx @@ -49,7 +49,7 @@ KullbackLeiblerCompareHistogramImageToImageMetric::Ev // First the term that measures the entropy of the term // p(x,y) log p(x,y) - p(x,y) log q(x,y) - MeasureType KullbackLeibler = NumericTraits::ZeroValue(); + MeasureType KullbackLeibler{}; HistogramIteratorType measured_it = histogram.Begin(); HistogramIteratorType measured_end = histogram.End(); diff --git a/Modules/Registration/Common/include/itkMatchCardinalityImageToImageMetric.hxx b/Modules/Registration/Common/include/itkMatchCardinalityImageToImageMetric.hxx index 0b15e0ed486..ae644ee31e4 100644 --- a/Modules/Registration/Common/include/itkMatchCardinalityImageToImageMetric.hxx +++ b/Modules/Registration/Common/include/itkMatchCardinalityImageToImageMetric.hxx @@ -55,7 +55,7 @@ MatchCardinalityImageToImageMetric::GetNonconstValue( // Initialize some variables before spawning threads // // - MeasureType measure = NumericTraits::ZeroValue(); + MeasureType measure{}; this->m_NumberOfPixelsCounted = 0; m_ThreadMatches.clear(); @@ -126,7 +126,7 @@ MatchCardinalityImageToImageMetric::ThreadedGetValue( typename FixedImageType::IndexType index; FixedIteratorType ti(fixedImage, regionForThread); - MeasureType threadMeasure = NumericTraits::ZeroValue(); + MeasureType threadMeasure{}; SizeValueType threadNumberOfPixelsCounted = 0; while (!ti.IsAtEnd()) diff --git a/Modules/Registration/Common/include/itkMeanReciprocalSquareDifferenceImageToImageMetric.hxx b/Modules/Registration/Common/include/itkMeanReciprocalSquareDifferenceImageToImageMetric.hxx index 84474fd0048..e18390acd3f 100644 --- a/Modules/Registration/Common/include/itkMeanReciprocalSquareDifferenceImageToImageMetric.hxx +++ b/Modules/Registration/Common/include/itkMeanReciprocalSquareDifferenceImageToImageMetric.hxx @@ -63,7 +63,7 @@ MeanReciprocalSquareDifferenceImageToImageMetric::Get typename FixedImageType::IndexType index; - MeasureType measure = NumericTraits::ZeroValue(); + MeasureType measure{}; this->m_NumberOfPixelsCounted = 0; diff --git a/Modules/Registration/Common/include/itkMeanReciprocalSquareDifferencePointSetToImageMetric.hxx b/Modules/Registration/Common/include/itkMeanReciprocalSquareDifferencePointSetToImageMetric.hxx index 03ee330133e..7c4b5d97026 100644 --- a/Modules/Registration/Common/include/itkMeanReciprocalSquareDifferencePointSetToImageMetric.hxx +++ b/Modules/Registration/Common/include/itkMeanReciprocalSquareDifferencePointSetToImageMetric.hxx @@ -48,7 +48,7 @@ MeanReciprocalSquareDifferencePointSetToImageMetricGetPointData()->Begin(); PointDataIterator pointDataEnd = fixedPointSet->GetPointData()->End(); - MeasureType measure = NumericTraits::ZeroValue(); + MeasureType measure{}; this->m_NumberOfPixelsCounted = 0; double lambdaSquared = std::pow(this->m_Lambda, 2); @@ -156,7 +156,7 @@ MeanReciprocalSquareDifferencePointSetToImageMetricGetGradientImage()->GetPixel(mappedIndex); for (unsigned int par = 0; par < ParametersDimension; ++par) { - RealType sum = NumericTraits::ZeroValue(); + RealType sum{}; for (unsigned int dim = 0; dim < Self::FixedPointSetDimension; ++dim) { // Will it be computationally more efficient to instead calculate the @@ -204,7 +204,7 @@ MeanReciprocalSquareDifferencePointSetToImageMetricm_NumberOfPixelsCounted = 0; - MeasureType measure = NumericTraits::ZeroValue(); + MeasureType measure{}; this->SetTransformParameters(parameters); double lambdaSquared = std::pow(this->m_Lambda, 2); @@ -255,7 +255,7 @@ MeanReciprocalSquareDifferencePointSetToImageMetricGetGradientImage()->GetPixel(mappedIndex); for (unsigned int par = 0; par < ParametersDimension; ++par) { - RealType sum = NumericTraits::ZeroValue(); + RealType sum{}; for (unsigned int dim = 0; dim < Self::FixedPointSetDimension; ++dim) { sum -= jacobian(dim, par) * gradient[dim] * std::pow(lambdaSquared + diffSquared, 2); diff --git a/Modules/Registration/Common/include/itkMeanSquaresHistogramImageToImageMetric.hxx b/Modules/Registration/Common/include/itkMeanSquaresHistogramImageToImageMetric.hxx index 14d4927785a..124cf8744e7 100644 --- a/Modules/Registration/Common/include/itkMeanSquaresHistogramImageToImageMetric.hxx +++ b/Modules/Registration/Common/include/itkMeanSquaresHistogramImageToImageMetric.hxx @@ -26,10 +26,10 @@ auto MeanSquaresHistogramImageToImageMetric::EvaluateMeasure(HistogramType & histogram) const -> MeasureType { - MeasureType measure = NumericTraits::ZeroValue(); + MeasureType measure{}; HistogramIteratorType it = histogram.Begin(); HistogramIteratorType end = histogram.End(); - HistogramFrequencyType totalNumberOfSamples = NumericTraits::ZeroValue(); + HistogramFrequencyType totalNumberOfSamples{}; while (it != end) { diff --git a/Modules/Registration/Common/include/itkMeanSquaresPointSetToImageMetric.hxx b/Modules/Registration/Common/include/itkMeanSquaresPointSetToImageMetric.hxx index 40a673d4b47..3ac057134ea 100644 --- a/Modules/Registration/Common/include/itkMeanSquaresPointSetToImageMetric.hxx +++ b/Modules/Registration/Common/include/itkMeanSquaresPointSetToImageMetric.hxx @@ -43,7 +43,7 @@ MeanSquaresPointSetToImageMetric::GetValue( PointDataIterator pointDataItr = fixedPointSet->GetPointData()->Begin(); PointDataIterator pointDataEnd = fixedPointSet->GetPointData()->End(); - MeasureType measure = NumericTraits::ZeroValue(); + MeasureType measure{}; this->m_NumberOfPixelsCounted = 0; @@ -150,7 +150,7 @@ MeanSquaresPointSetToImageMetric::GetDerivative( const GradientPixelType gradient = this->GetGradientImage()->GetPixel(mappedIndex); for (unsigned int par = 0; par < ParametersDimension; ++par) { - RealType sum = NumericTraits::ZeroValue(); + RealType sum{}; for (unsigned int dim = 0; dim < Self::FixedPointSetDimension; ++dim) { sum += 2.0 * diff * jacobian(dim, par) * gradient[dim]; @@ -199,7 +199,7 @@ MeanSquaresPointSetToImageMetric::GetValueAndDeriv } this->m_NumberOfPixelsCounted = 0; - MeasureType measure = NumericTraits::ZeroValue(); + MeasureType measure{}; this->SetTransformParameters(parameters); @@ -250,7 +250,7 @@ MeanSquaresPointSetToImageMetric::GetValueAndDeriv const GradientPixelType gradient = this->GetGradientImage()->GetPixel(mappedIndex); for (unsigned int par = 0; par < ParametersDimension; ++par) { - RealType sum = NumericTraits::ZeroValue(); + RealType sum{}; for (unsigned int dim = 0; dim < Self::FixedPointSetDimension; ++dim) { sum += 2.0 * diff * jacobian(dim, par) * gradient[dim]; diff --git a/Modules/Registration/Common/include/itkMutualInformationHistogramImageToImageMetric.hxx b/Modules/Registration/Common/include/itkMutualInformationHistogramImageToImageMetric.hxx index 14d79f67d39..ee67c901788 100644 --- a/Modules/Registration/Common/include/itkMutualInformationHistogramImageToImageMetric.hxx +++ b/Modules/Registration/Common/include/itkMutualInformationHistogramImageToImageMetric.hxx @@ -27,9 +27,9 @@ typename MutualInformationHistogramImageToImageMetric MutualInformationHistogramImageToImageMetric::EvaluateMeasure( HistogramType & histogram) const { - MeasureType entropyX = NumericTraits::ZeroValue(); - MeasureType entropyY = NumericTraits::ZeroValue(); - MeasureType jointEntropy = NumericTraits::ZeroValue(); + MeasureType entropyX{}; + MeasureType entropyY{}; + MeasureType jointEntropy{}; using HistogramFrequencyRealType = typename NumericTraits::RealType; diff --git a/Modules/Registration/Common/include/itkNormalizedCorrelationImageToImageMetric.hxx b/Modules/Registration/Common/include/itkNormalizedCorrelationImageToImageMetric.hxx index abd68bdb171..4f12204a2d1 100644 --- a/Modules/Registration/Common/include/itkNormalizedCorrelationImageToImageMetric.hxx +++ b/Modules/Registration/Common/include/itkNormalizedCorrelationImageToImageMetric.hxx @@ -55,11 +55,11 @@ NormalizedCorrelationImageToImageMetric::GetValue( using AccumulateType = typename NumericTraits::AccumulateType; - AccumulateType sff = NumericTraits::ZeroValue(); - AccumulateType smm = NumericTraits::ZeroValue(); - AccumulateType sfm = NumericTraits::ZeroValue(); - AccumulateType sf = NumericTraits::ZeroValue(); - AccumulateType sm = NumericTraits::ZeroValue(); + AccumulateType sff{}; + AccumulateType smm{}; + AccumulateType sfm{}; + AccumulateType sf{}; + AccumulateType sm{}; while (!ti.IsAtEnd()) { @@ -153,11 +153,11 @@ NormalizedCorrelationImageToImageMetric::GetDerivativ using AccumulateType = typename NumericTraits::AccumulateType; - AccumulateType sff = NumericTraits::ZeroValue(); - AccumulateType smm = NumericTraits::ZeroValue(); - AccumulateType sfm = NumericTraits::ZeroValue(); - AccumulateType sf = NumericTraits::ZeroValue(); - AccumulateType sm = NumericTraits::ZeroValue(); + AccumulateType sff{}; + AccumulateType smm{}; + AccumulateType sfm{}; + AccumulateType sf{}; + AccumulateType sm{}; const unsigned int ParametersDimension = this->GetNumberOfParameters(); derivative = DerivativeType(ParametersDimension); @@ -257,8 +257,8 @@ NormalizedCorrelationImageToImageMetric::GetDerivativ const GradientPixelType gradient = this->GetGradientImage()->GetPixel(mappedIndex); for (unsigned int par = 0; par < ParametersDimension; ++par) { - RealType sumF = NumericTraits::ZeroValue(); - RealType sumM = NumericTraits::ZeroValue(); + RealType sumF{}; + RealType sumM{}; for (unsigned int dim = 0; dim < dimension; ++dim) { const RealType differential = jacobian(dim, par) * gradient[dim]; @@ -336,11 +336,11 @@ NormalizedCorrelationImageToImageMetric::GetValueAndD using AccumulateType = typename NumericTraits::AccumulateType; - AccumulateType sff = NumericTraits::ZeroValue(); - AccumulateType smm = NumericTraits::ZeroValue(); - AccumulateType sfm = NumericTraits::ZeroValue(); - AccumulateType sf = NumericTraits::ZeroValue(); - AccumulateType sm = NumericTraits::ZeroValue(); + AccumulateType sff{}; + AccumulateType smm{}; + AccumulateType sfm{}; + AccumulateType sf{}; + AccumulateType sm{}; const unsigned int ParametersDimension = this->GetNumberOfParameters(); derivative = DerivativeType(ParametersDimension); @@ -442,8 +442,8 @@ NormalizedCorrelationImageToImageMetric::GetValueAndD const GradientPixelType gradient = this->GetGradientImage()->GetPixel(mappedIndex); for (unsigned int par = 0; par < ParametersDimension; ++par) { - RealType sumF = NumericTraits::ZeroValue(); - RealType sumM = NumericTraits::ZeroValue(); + RealType sumF{}; + RealType sumM{}; for (unsigned int dim = 0; dim < dimension; ++dim) { const RealType differential = jacobian(dim, par) * gradient[dim]; diff --git a/Modules/Registration/Common/include/itkNormalizedCorrelationPointSetToImageMetric.hxx b/Modules/Registration/Common/include/itkNormalizedCorrelationPointSetToImageMetric.hxx index c4dc2d7ada9..75e62d6364e 100644 --- a/Modules/Registration/Common/include/itkNormalizedCorrelationPointSetToImageMetric.hxx +++ b/Modules/Registration/Common/include/itkNormalizedCorrelationPointSetToImageMetric.hxx @@ -55,11 +55,11 @@ NormalizedCorrelationPointSetToImageMetric::GetVal using AccumulateType = typename NumericTraits::AccumulateType; - AccumulateType sff = NumericTraits::ZeroValue(); - AccumulateType smm = NumericTraits::ZeroValue(); - AccumulateType sfm = NumericTraits::ZeroValue(); - AccumulateType sf = NumericTraits::ZeroValue(); - AccumulateType sm = NumericTraits::ZeroValue(); + AccumulateType sff{}; + AccumulateType smm{}; + AccumulateType sfm{}; + AccumulateType sf{}; + AccumulateType sm{}; while (pointItr != pointEnd && pointDataItr != pointDataEnd) { @@ -133,11 +133,11 @@ NormalizedCorrelationPointSetToImageMetric::GetDer using AccumulateType = typename NumericTraits::AccumulateType; - AccumulateType sff = NumericTraits::ZeroValue(); - AccumulateType smm = NumericTraits::ZeroValue(); - AccumulateType sfm = NumericTraits::ZeroValue(); - AccumulateType sf = NumericTraits::ZeroValue(); - AccumulateType sm = NumericTraits::ZeroValue(); + AccumulateType sff{}; + AccumulateType smm{}; + AccumulateType sfm{}; + AccumulateType sf{}; + AccumulateType sm{}; const unsigned int ParametersDimension = this->GetNumberOfParameters(); derivative = DerivativeType(ParametersDimension); @@ -200,7 +200,7 @@ NormalizedCorrelationPointSetToImageMetric::GetDer const GradientPixelType gradient = this->GetGradientImage()->GetPixel(mappedIndex); for (unsigned int par = 0; par < ParametersDimension; ++par) { - RealType sumD = NumericTraits::ZeroValue(); + RealType sumD{}; for (unsigned int dim = 0; dim < dimension; ++dim) { const RealType differential = jacobian(dim, par) * gradient[dim]; @@ -276,11 +276,11 @@ NormalizedCorrelationPointSetToImageMetric::GetVal using AccumulateType = typename NumericTraits::AccumulateType; - AccumulateType sff = NumericTraits::ZeroValue(); - AccumulateType smm = NumericTraits::ZeroValue(); - AccumulateType sfm = NumericTraits::ZeroValue(); - AccumulateType sf = NumericTraits::ZeroValue(); - AccumulateType sm = NumericTraits::ZeroValue(); + AccumulateType sff{}; + AccumulateType smm{}; + AccumulateType sfm{}; + AccumulateType sf{}; + AccumulateType sm{}; const unsigned int ParametersDimension = this->GetNumberOfParameters(); derivative = DerivativeType(ParametersDimension); @@ -343,7 +343,7 @@ NormalizedCorrelationPointSetToImageMetric::GetVal const GradientPixelType gradient = this->GetGradientImage()->GetPixel(mappedIndex); for (unsigned int par = 0; par < ParametersDimension; ++par) { - RealType sumD = NumericTraits::ZeroValue(); + RealType sumD{}; for (unsigned int dim = 0; dim < dimension; ++dim) { const RealType differential = jacobian(dim, par) * gradient[dim]; diff --git a/Modules/Registration/Common/include/itkNormalizedMutualInformationHistogramImageToImageMetric.hxx b/Modules/Registration/Common/include/itkNormalizedMutualInformationHistogramImageToImageMetric.hxx index da0ef2b37a5..d874d8e6a84 100644 --- a/Modules/Registration/Common/include/itkNormalizedMutualInformationHistogramImageToImageMetric.hxx +++ b/Modules/Registration/Common/include/itkNormalizedMutualInformationHistogramImageToImageMetric.hxx @@ -27,9 +27,9 @@ typename NormalizedMutualInformationHistogramImageToImageMetric::EvaluateMeasure( HistogramType & histogram) const { - MeasureType entropyX = NumericTraits::ZeroValue(); - MeasureType entropyY = NumericTraits::ZeroValue(); - MeasureType jointEntropy = NumericTraits::ZeroValue(); + MeasureType entropyX{}; + MeasureType entropyY{}; + MeasureType jointEntropy{}; using HistogramFrequencyRealType = typename NumericTraits::RealType; diff --git a/Modules/Registration/Metricsv4/include/itkANTSNeighborhoodCorrelationImageToImageMetricv4GetValueAndDerivativeThreader.hxx b/Modules/Registration/Metricsv4/include/itkANTSNeighborhoodCorrelationImageToImageMetricv4GetValueAndDerivativeThreader.hxx index 18d316d4e37..0dc153223b8 100644 --- a/Modules/Registration/Metricsv4/include/itkANTSNeighborhoodCorrelationImageToImageMetricv4GetValueAndDerivativeThreader.hxx +++ b/Modules/Registration/Metricsv4/include/itkANTSNeighborhoodCorrelationImageToImageMetricv4GetValueAndDerivativeThreader.hxx @@ -42,8 +42,8 @@ ANTSNeighborhoodCorrelationImageToImageMetricv4GetValueAndDerivativeThreaderm_ANTSAssociateOnceFlag, [this, &associate]() { this->m_ANTSAssociate = associate; }); VirtualPointType virtualPoint; - MeasureType metricValueResult = NumericTraits::ZeroValue(); - MeasureType metricValueSum = NumericTraits::ZeroValue(); + MeasureType metricValueResult{}; + MeasureType metricValueSum{}; bool pointIsValid; ScanIteratorType scanIt; ScanParametersType scanParameters; @@ -137,7 +137,7 @@ ANTSNeighborhoodCorrelationImageToImageMetricv4GetValueAndDerivativeThreader< const SizeValueType numberOfFillZero = scanParameters.numberOfFillZero; const SizeValueType hoodlen = scanParameters.windowLength; - InternalComputationValueType zero = NumericTraits::ZeroValue(); + InternalComputationValueType zero{}; scanMem.QsumFixed2 = SumQueueType(numberOfFillZero, zero); scanMem.QsumMoving2 = SumQueueType(numberOfFillZero, zero); scanMem.QsumFixed = SumQueueType(numberOfFillZero, zero); @@ -150,7 +150,7 @@ ANTSNeighborhoodCorrelationImageToImageMetricv4GetValueAndDerivativeThreader< // Now add the rest of the values from each hyperplane SizeValueType diameter = 2 * scanParameters.radius[0]; - const LocalRealType localZero = NumericTraits::ZeroValue(); + const LocalRealType localZero{}; for (SizeValueType i = numberOfFillZero; i < (diameter + NumericTraits::OneValue()); ++i) { LocalRealType sumFixed2 = localZero; @@ -234,7 +234,7 @@ ANTSNeighborhoodCorrelationImageToImageMetricv4GetValueAndDerivativeThreader< using LocalRealType = InternalComputationValueType; - const LocalRealType localZero = NumericTraits::ZeroValue(); + const LocalRealType localZero{}; LocalRealType sumFixed2 = localZero; LocalRealType sumMoving2 = localZero; @@ -381,7 +381,7 @@ ANTSNeighborhoodCorrelationImageToImageMetricv4GetValueAndDerivativeThreader< { using LocalRealType = InternalComputationValueType; - const LocalRealType localZero = NumericTraits::ZeroValue(); + const LocalRealType localZero{}; LocalRealType count = localZero; @@ -587,7 +587,7 @@ ANTSNeighborhoodCorrelationImageToImageMetricv4GetValueAndDerivativeThreader::ZeroValue(); + MeasureType metricValueResult{}; bool pointIsValid; ScanIteratorType scanIt; ScanParametersType scanParameters; diff --git a/Modules/Registration/Metricsv4/include/itkCorrelationImageToImageMetricv4GetValueAndDerivativeThreader.hxx b/Modules/Registration/Metricsv4/include/itkCorrelationImageToImageMetricv4GetValueAndDerivativeThreader.hxx index f3fc04b53eb..48e0fa622c2 100644 --- a/Modules/Registration/Metricsv4/include/itkCorrelationImageToImageMetricv4GetValueAndDerivativeThreader.hxx +++ b/Modules/Registration/Metricsv4/include/itkCorrelationImageToImageMetricv4GetValueAndDerivativeThreader.hxx @@ -117,9 +117,9 @@ CorrelationImageToImageMetricv4GetValueAndDerivativeThreaderm_CorrelationAssociate->m_Value = NumericTraits::ZeroValue(); - InternalComputationValueType fm = NumericTraits::ZeroValue(); - InternalComputationValueType f2 = NumericTraits::ZeroValue(); - InternalComputationValueType m2 = NumericTraits::ZeroValue(); + InternalComputationValueType fm{}; + InternalComputationValueType f2{}; + InternalComputationValueType m2{}; for (ThreadIdType threadId = 0; threadId < numWorkUnitsUsed; ++threadId) { fm += this->m_CorrelationMetricValueDerivativePerThreadVariables[threadId].fm; @@ -315,7 +315,7 @@ CorrelationImageToImageMetricv4GetValueAndDerivativeThreader< for (unsigned int par = 0; par < this->m_CorrelationAssociate->GetNumberOfLocalParameters(); ++par) { - InternalComputationValueType sum = NumericTraits::ZeroValue(); + InternalComputationValueType sum{}; for (SizeValueType dim = 0; dim < ImageToImageMetricv4Type::MovingImageDimension; ++dim) { sum += movingImageGradient[dim] * jacobian(dim, par); diff --git a/Modules/Registration/Metricsv4/include/itkCorrelationImageToImageMetricv4HelperThreader.hxx b/Modules/Registration/Metricsv4/include/itkCorrelationImageToImageMetricv4HelperThreader.hxx index 2b680016705..7aedd591feb 100644 --- a/Modules/Registration/Metricsv4/include/itkCorrelationImageToImageMetricv4HelperThreader.hxx +++ b/Modules/Registration/Metricsv4/include/itkCorrelationImageToImageMetricv4HelperThreader.hxx @@ -78,8 +78,8 @@ CorrelationImageToImageMetricv4HelperThreader::ZeroValue(); - InternalComputationValueType sumM = NumericTraits::ZeroValue(); + InternalComputationValueType sumF{}; + InternalComputationValueType sumM{}; for (ThreadIdType threadId = 0; threadId < numWorkUnitsUsed; ++threadId) { diff --git a/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationGetValueAndDerivativeThreader.hxx b/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationGetValueAndDerivativeThreader.hxx index 6f183cc09be..1432a1275b6 100644 --- a/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationGetValueAndDerivativeThreader.hxx +++ b/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationGetValueAndDerivativeThreader.hxx @@ -168,7 +168,7 @@ JointHistogramMutualInformationGetValueAndDerivativeThreader< for (NumberOfParametersType par = 0; par < this->GetCachedNumberOfLocalParameters(); ++par) { - InternalComputationValueType sum = NumericTraits::ZeroValue(); + InternalComputationValueType sum{}; for (SizeValueType dim = 0; dim < TImageToImageMetric::MovingImageDimension; ++dim) { sum += scalingfactor * jacobian(dim, par) * movingImageGradient[dim]; @@ -312,7 +312,7 @@ JointHistogramMutualInformationGetValueAndDerivativeThreader< } InternalComputationValueType delta = rightpoint[ind] - leftpoint[ind]; - InternalComputationValueType deriv = NumericTraits::ZeroValue(); + InternalComputationValueType deriv{}; if (delta > NumericTraits::ZeroValue()) { deriv = this->m_JointHistogramMIPerThreadVariables[threadId].JointPDFInterpolator->Evaluate(rightpoint) - diff --git a/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationImageToImageMetricv4.hxx b/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationImageToImageMetricv4.hxx index 063cf3c6d5f..d8ae4b911f8 100644 --- a/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationImageToImageMetricv4.hxx +++ b/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationImageToImageMetricv4.hxx @@ -217,7 +217,7 @@ JointHistogramMutualInformationImageToImageMetricv4::ZeroValue(); + PDFValueType pdfzero{}; this->m_JointPDF->FillBuffer(pdfzero); this->m_FixedImageMarginalPDF->FillBuffer(pdfzero); this->m_MovingImageMarginalPDF->FillBuffer(pdfzero); diff --git a/Modules/Registration/Metricsv4/include/itkLabeledPointSetToPointSetMetricv4.hxx b/Modules/Registration/Metricsv4/include/itkLabeledPointSetToPointSetMetricv4.hxx index 5862ecd07ac..88493f78152 100644 --- a/Modules/Registration/Metricsv4/include/itkLabeledPointSetToPointSetMetricv4.hxx +++ b/Modules/Registration/Metricsv4/include/itkLabeledPointSetToPointSetMetricv4.hxx @@ -132,7 +132,7 @@ typename LabeledPointSetToPointSetMetricv4Initialize(); - typename FixedPointSetType::PointIdentifier count = NumericTraits::ZeroValue(); + typename FixedPointSetType::PointIdentifier count{}; typename FixedPointSetType::PointsContainerConstIterator It = this->m_FixedPointSet->GetPoints()->Begin(); typename FixedPointSetType::PointDataContainerIterator ItD = this->m_FixedPointSet->GetPointData()->Begin(); @@ -158,7 +158,7 @@ typename LabeledPointSetToPointSetMetricv4Initialize(); - typename MovingPointSetType::PointIdentifier count = NumericTraits::ZeroValue(); + typename MovingPointSetType::PointIdentifier count{}; typename MovingPointSetType::PointsContainerConstIterator It = this->m_MovingPointSet->GetPoints()->Begin(); typename MovingPointSetType::PointDataContainerIterator ItD = this->m_MovingPointSet->GetPointData()->Begin(); diff --git a/Modules/Registration/Metricsv4/include/itkObjectToObjectMultiMetricv4.hxx b/Modules/Registration/Metricsv4/include/itkObjectToObjectMultiMetricv4.hxx index d1a1471bb3d..e5c7bae5261 100644 --- a/Modules/Registration/Metricsv4/include/itkObjectToObjectMultiMetricv4.hxx +++ b/Modules/Registration/Metricsv4/include/itkObjectToObjectMultiMetricv4.hxx @@ -133,7 +133,7 @@ ObjectToObjectMultiMetricv4m_MetricWeights.Size()); } /* normalize the weights */ - WeightValueType sum = NumericTraits::ZeroValue(); + WeightValueType sum{}; for (SizeValueType j = 0; j < this->GetNumberOfMetrics(); ++j) { sum += this->m_MetricWeights[j]; @@ -292,17 +292,17 @@ ObjectToObjectMultiMetricv4::ZeroValue()); DerivativeType metricDerivative; - MeasureType metricValue = NumericTraits::ZeroValue(); + MeasureType metricValue{}; // Loop over metrics - DerivativeValueType totalMagnitude = NumericTraits::ZeroValue(); + DerivativeValueType totalMagnitude{}; for (SizeValueType j = 0; j < this->GetNumberOfMetrics(); ++j) { this->m_MetricQueue[j]->GetValueAndDerivative(metricValue, metricDerivative); this->m_MetricValueArray[j] = metricValue; DerivativeValueType magnitude = metricDerivative.magnitude(); - DerivativeValueType weightOverMagnitude = NumericTraits::ZeroValue(); + DerivativeValueType weightOverMagnitude{}; totalMagnitude += magnitude; if (magnitude > NumericTraits::epsilon()) @@ -351,7 +351,7 @@ typename ObjectToObjectMultiMetricv4:: GetWeightedValue() const { - MeasureType value = NumericTraits::ZeroValue(); + MeasureType value{}; for (SizeValueType j = 0; j < this->GetNumberOfMetrics(); ++j) { diff --git a/Modules/Registration/Metricsv4/include/itkPointSetToPointSetMetricWithIndexv4.hxx b/Modules/Registration/Metricsv4/include/itkPointSetToPointSetMetricWithIndexv4.hxx index 88ead569f40..b59dec91e64 100644 --- a/Modules/Registration/Metricsv4/include/itkPointSetToPointSetMetricWithIndexv4.hxx +++ b/Modules/Registration/Metricsv4/include/itkPointSetToPointSetMetricWithIndexv4.hxx @@ -228,7 +228,7 @@ void PointSetToPointSetMetricWithIndexv4::GetDerivative( DerivativeType & derivative) const { - MeasureType value = NumericTraits::ZeroValue(); + MeasureType value{}; this->CalculateValueAndDerivative(value, derivative, false); } @@ -297,7 +297,7 @@ PointSetToPointSetMetricWithIndexv4::SetLength(pixel, 1); for (PointIdentifier index = ranges[rangeIndex].first; index < ranges[rangeIndex].second; ++index) { - MeasureType pointValue = NumericTraits::ZeroValue(); + MeasureType pointValue{}; LocalDerivativeType pointDerivative; /* Verify the virtual point is in the virtual domain. @@ -421,7 +421,7 @@ PointSetToPointSetMetricWithIndexv4::ZeroValue(); + SizeValueType numberOfValidPoints{}; PointsConstIterator virtualIt = this->m_VirtualTransformedPointSet->GetPoints()->Begin(); while (virtualIt != this->m_VirtualTransformedPointSet->GetPoints()->End()) { diff --git a/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx b/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx index 9abdfeface0..460185a1e97 100644 --- a/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx +++ b/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx @@ -299,8 +299,8 @@ TimeVaryingBSplineVelocityFieldImageRegistrationMethodGetDebug()) { - RealType spatialNorm = NumericTraits::ZeroValue(); - RealType spatioTemporalNorm = NumericTraits::ZeroValue(); + RealType spatialNorm{}; + RealType spatioTemporalNorm{}; typename TimeVaryingVelocityFieldType::SizeType radius; radius.Fill(1); @@ -316,8 +316,8 @@ TimeVaryingBSplineVelocityFieldImageRegistrationMethod ItV(radius, velocityField, faceList.front()); for (ItV.GoToBegin(); !ItV.IsAtEnd(); ++ItV) { - RealType localSpatialNorm = NumericTraits::ZeroValue(); - RealType localSpatioTemporalNorm = NumericTraits::ZeroValue(); + RealType localSpatialNorm{}; + RealType localSpatioTemporalNorm{}; for (unsigned int d = 0; d < ImageDimension + 1; ++d) { DisplacementVectorType vector = (ItV.GetNext(d) - ItV.GetPrevious(d)) * 0.5 * velocityFieldSpacing[d]; @@ -361,11 +361,11 @@ TimeVaryingBSplineVelocityFieldImageRegistrationMethod< velocityFieldPointSet->Initialize(); velocityFieldWeights->Initialize(); - IdentifierType numberOfVelocityFieldPoints = NumericTraits::ZeroValue(); + IdentifierType numberOfVelocityFieldPoints{}; for (SizeValueType timePoint = 0; timePoint < this->m_NumberOfTimePointSamples; ++timePoint) { - RealType t = NumericTraits::ZeroValue(); + RealType t{}; if (this->m_NumberOfTimePointSamples > 1) { t = static_cast(timePoint) / static_cast(this->m_NumberOfTimePointSamples - 1); @@ -464,7 +464,7 @@ TimeVaryingBSplineVelocityFieldImageRegistrationMethod< this->m_Metric->Initialize(); typename ImageMetricType::DerivativeType metricDerivative; - MeasureType value = NumericTraits::ZeroValue(); + MeasureType value{}; this->m_Metric->GetValueAndDerivative(value, metricDerivative); diff --git a/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingVelocityFieldImageRegistrationMethodv4.hxx b/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingVelocityFieldImageRegistrationMethodv4.hxx index 192aa116417..bc58d57387b 100644 --- a/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingVelocityFieldImageRegistrationMethodv4.hxx +++ b/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingVelocityFieldImageRegistrationMethodv4.hxx @@ -144,13 +144,13 @@ TimeVaryingVelocityFieldImageRegistrationMethodv4m_CurrentIteration++ < this->m_NumberOfIterationsPerLevel[this->m_CurrentLevel] && !this->m_IsConverged) { updateDerivative.Fill(0); - MeasureType value = NumericTraits::ZeroValue(); + MeasureType value{}; this->m_CurrentMetricValue = NumericTraits::ZeroValue(); // Time index zero brings the moving image closest to the fixed image for (IndexValueType timePoint = 0; timePoint < numberOfTimePoints; ++timePoint) { - RealType t = NumericTraits::ZeroValue(); + RealType t{}; if (numberOfTimePoints > 1) { t = static_cast(timePoint) / static_cast(numberOfTimePoints - 1); @@ -360,8 +360,8 @@ TimeVaryingVelocityFieldImageRegistrationMethodv4GetDebug()) { - RealType spatialNorm = NumericTraits::ZeroValue(); - RealType spatioTemporalNorm = NumericTraits::ZeroValue(); + RealType spatialNorm{}; + RealType spatioTemporalNorm{}; typename TimeVaryingVelocityFieldType::SizeType radius; radius.Fill(1); @@ -377,8 +377,8 @@ TimeVaryingVelocityFieldImageRegistrationMethodv4 ItV(radius, velocityField, faceList.front()); for (ItV.GoToBegin(); !ItV.IsAtEnd(); ++ItV) { - RealType localSpatialNorm = NumericTraits::ZeroValue(); - RealType localSpatioTemporalNorm = NumericTraits::ZeroValue(); + RealType localSpatialNorm{}; + RealType localSpatioTemporalNorm{}; for (unsigned int d = 0; d < ImageDimension + 1; ++d) { DisplacementVectorType vector = (ItV.GetNext(d) - ItV.GetPrevious(d)) * 0.5 * velocityFieldSpacing[d]; diff --git a/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentFunctorImageFilter.hxx b/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentFunctorImageFilter.hxx index 3624765c4fa..68fedcb48ad 100644 --- a/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentFunctorImageFilter.hxx +++ b/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentFunctorImageFilter.hxx @@ -35,7 +35,7 @@ ConnectedComponentFunctorImageFilter::ZeroValue(); + OutputPixelType maxLabel{}; const OutputPixelType maxPossibleLabel = NumericTraits::max(); typename TOutputImage::Pointer output = this->GetOutput(); diff --git a/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentImageFilter.h b/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentImageFilter.h index 340b9e8b120..7c7436fb9a2 100644 --- a/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentImageFilter.h +++ b/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentImageFilter.h @@ -197,7 +197,7 @@ class ITK_TEMPLATE_EXPORT ConnectedComponentImageFilter using WorkUnitData = typename ScanlineFunctions::WorkUnitData; private: - OutputPixelType m_BackgroundValue = NumericTraits::ZeroValue(); + OutputPixelType m_BackgroundValue{}; LabelType m_ObjectCount = 0; typename TInputImage::ConstPointer m_Input{}; diff --git a/Modules/Segmentation/ConnectedComponents/include/itkVectorConnectedComponentImageFilter.h b/Modules/Segmentation/ConnectedComponents/include/itkVectorConnectedComponentImageFilter.h index c6d632ffa72..25d2fc58269 100644 --- a/Modules/Segmentation/ConnectedComponents/include/itkVectorConnectedComponentImageFilter.h +++ b/Modules/Segmentation/ConnectedComponents/include/itkVectorConnectedComponentImageFilter.h @@ -78,7 +78,7 @@ class SimilarVectorsFunctor operator()(const TInput & a, const TInput & b) const { using RealValueType = typename NumericTraits::RealType; - RealValueType dotProduct = NumericTraits::ZeroValue(); + RealValueType dotProduct{}; for (unsigned int i = 0; i < NumericTraits::GetLength(a); ++i) { dotProduct += a[i] * b[i]; diff --git a/Modules/Segmentation/LevelSets/include/itkLevelSetFunction.hxx b/Modules/Segmentation/LevelSets/include/itkLevelSetFunction.hxx index 5cd8e77c9d3..de80ae3fb29 100644 --- a/Modules/Segmentation/LevelSets/include/itkLevelSetFunction.hxx +++ b/Modules/Segmentation/LevelSets/include/itkLevelSetFunction.hxx @@ -59,7 +59,7 @@ LevelSetFunction::ComputeMinimalCurvature(const NeighborhoodType & i ScalarValueType gradMag = std::sqrt(gd->m_GradMagSqr); ScalarValueType Pgrad[ImageDimension][ImageDimension]; ScalarValueType tmp_matrix[ImageDimension][ImageDimension]; - const ScalarValueType ZERO = NumericTraits::ZeroValue(); + const ScalarValueType ZERO{}; vnl_matrix_fixed Curve; const ScalarValueType MIN_EIG = NumericTraits::min(); @@ -154,7 +154,7 @@ LevelSetFunction::ComputeMeanCurvature(const NeighborhoodType & itkN GlobalDataStruct * gd) { // Calculate the mean curvature - ScalarValueType curvature_term = NumericTraits::ZeroValue(); + ScalarValueType curvature_term{}; unsigned int i, j; for (i = 0; i < ImageDimension; ++i) @@ -286,7 +286,7 @@ LevelSetFunction::ComputeUpdate(const NeighborhoodType & it, const FloatOffsetType & offset) { unsigned int i, j; - const ScalarValueType ZERO = NumericTraits::ZeroValue(); + const ScalarValueType ZERO{}; const ScalarValueType center_value = it.GetCenterPixel(); const NeighborhoodScalesType neighborhoodScales = this->ComputeNeighborhoodScales(); diff --git a/Modules/Segmentation/LevelSetsv4/include/itkBinaryImageToLevelSetImageAdaptor.hxx b/Modules/Segmentation/LevelSetsv4/include/itkBinaryImageToLevelSetImageAdaptor.hxx index f978a1946b1..ba17b09f129 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkBinaryImageToLevelSetImageAdaptor.hxx +++ b/Modules/Segmentation/LevelSetsv4/include/itkBinaryImageToLevelSetImageAdaptor.hxx @@ -194,7 +194,7 @@ BinaryImageToLevelSetImageAdaptorm_LabelMap->GetLabelObject(LevelSetType::MinusThreeLayer()); - const LevelSetOutputType zero = NumericTraits::ZeroValue(); + const LevelSetOutputType zero{}; LevelSetLayerType & layer0 = this->m_LevelSet->GetLayer(LevelSetType::ZeroLayer()); diff --git a/Modules/Segmentation/LevelSetsv4/include/itkDiscreteLevelSetImage.hxx b/Modules/Segmentation/LevelSetsv4/include/itkDiscreteLevelSetImage.hxx index ade933e67f4..13c6aba4226 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkDiscreteLevelSetImage.hxx +++ b/Modules/Segmentation/LevelSetsv4/include/itkDiscreteLevelSetImage.hxx @@ -221,7 +221,7 @@ template auto DiscreteLevelSetImage::EvaluateLaplacian(const InputType & inputIndex) const -> OutputRealType { - OutputRealType oLaplacian = NumericTraits::ZeroValue(); + OutputRealType oLaplacian{}; const auto centerValue = static_cast(this->Evaluate(inputIndex)); @@ -440,7 +440,7 @@ template auto DiscreteLevelSetImage::EvaluateMeanCurvature(const InputType & inputIndex) const -> OutputRealType { - OutputRealType oValue = NumericTraits::ZeroValue(); + OutputRealType oValue{}; HessianType hessian = this->EvaluateHessian(inputIndex); GradientType grad = this->EvaluateGradient(inputIndex); diff --git a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetBase.hxx b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetBase.hxx index 9b3c99999d9..3c7f1564693 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetBase.hxx +++ b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetBase.hxx @@ -79,7 +79,7 @@ template ::EvaluateMeanCurvature(const InputType & iP) const -> OutputRealType { - OutputRealType oValue = NumericTraits::ZeroValue(); + OutputRealType oValue{}; HessianType hessian = this->EvaluateHessian(iP); GradientType grad = this->EvaluateGradient(iP); diff --git a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetDomainPartition.hxx b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetDomainPartition.hxx index f09f037d209..cfc614fc1e7 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetDomainPartition.hxx +++ b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetDomainPartition.hxx @@ -27,7 +27,7 @@ void LevelSetDomainPartition::PopulateListImage() { ListPixelType pixelList; - IdentifierType i = NumericTraits::ZeroValue(); + IdentifierType i{}; while (i < this->m_NumberOfLevelSetFunctions) { pixelList.push_back(i++); diff --git a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetDomainPartitionImage.hxx b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetDomainPartitionImage.hxx index 858b9ce0f4c..3242435a9fa 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetDomainPartitionImage.hxx +++ b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetDomainPartitionImage.hxx @@ -47,7 +47,7 @@ LevelSetDomainPartitionImage::PopulateListDomain() { ListIndexType listIndex = lIt.GetIndex(); IdentifierListType identifierList; - IdentifierType i = NumericTraits::ZeroValue(); + IdentifierType i{}; while (i < this->m_NumberOfLevelSetFunctions) { if (this->m_LevelSetDomainRegionVector[i].IsInside(listIndex)) diff --git a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetDomainPartitionMesh.hxx b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetDomainPartitionMesh.hxx index 929933eb939..96d36dd430c 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetDomainPartitionMesh.hxx +++ b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetDomainPartitionMesh.hxx @@ -35,7 +35,7 @@ LevelSetDomainPartitionMesh::PopulateListDomain() PointIdentifierType & idx = p_it->Index(); IdentifierListType identifierList; - for (IdentifierType i = NumericTraits::ZeroValue(); i < this->m_NumberOfLevelSetFunctions; ++i) + for (IdentifierType i{}; i < this->m_NumberOfLevelSetFunctions; ++i) { if (this->m_LevelSetDataPointerVector[i]->VerifyInsideRegion(idx)) { diff --git a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationAdvectionTerm.hxx b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationAdvectionTerm.hxx index de80453df6e..a214543c533 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationAdvectionTerm.hxx +++ b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationAdvectionTerm.hxx @@ -150,7 +150,7 @@ LevelSetEquationAdvectionTerm::Value(const LevelSetI -> LevelSetOutputRealType { VectorType advectionField = this->AdvectionSpeed(iP); - LevelSetOutputRealType oValue = NumericTraits::ZeroValue(); + LevelSetOutputRealType oValue{}; LevelSetGradientType backwardGradient = this->m_CurrentLevelSetPointer->EvaluateBackwardGradient(iP); LevelSetGradientType forwardGradient = this->m_CurrentLevelSetPointer->EvaluateForwardGradient(iP); @@ -178,7 +178,7 @@ LevelSetEquationAdvectionTerm::Value(const LevelSetI const LevelSetDataType & iData) { VectorType advectionField = this->AdvectionSpeed(iP); - LevelSetOutputRealType oValue = NumericTraits::ZeroValue(); + LevelSetOutputRealType oValue{}; for (unsigned int dim = 0; dim < ImageDimension; ++dim) { diff --git a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationOverlapPenaltyTerm.hxx b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationOverlapPenaltyTerm.hxx index 2274aa54fd1..00d601b75d5 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationOverlapPenaltyTerm.hxx +++ b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationOverlapPenaltyTerm.hxx @@ -64,7 +64,7 @@ auto LevelSetEquationOverlapPenaltyTerm::Value(const LevelSetInputIndexType & index) -> LevelSetOutputRealType { - LevelSetOutputRealType value = NumericTraits::ZeroValue(); + LevelSetOutputRealType value{}; this->ComputeSumTerm(index, value); return -value; } @@ -74,7 +74,7 @@ typename LevelSetEquationOverlapPenaltyTerm::LevelSe LevelSetEquationOverlapPenaltyTerm::Value(const LevelSetInputIndexType & index, const LevelSetDataType & itkNotUsed(data)) { - LevelSetOutputRealType value = NumericTraits::ZeroValue(); + LevelSetOutputRealType value{}; this->ComputeSumTerm(index, value); return -value; } diff --git a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationPropagationTerm.hxx b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationPropagationTerm.hxx index 919b72f5a4f..d5be99e9f31 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationPropagationTerm.hxx +++ b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationPropagationTerm.hxx @@ -83,7 +83,7 @@ LevelSetEquationPropagationTerm:: LevelSetGradientType backwardGradient = this->m_CurrentLevelSetPointer->EvaluateBackwardGradient(iP); LevelSetGradientType forwardGradient = this->m_CurrentLevelSetPointer->EvaluateForwardGradient(iP); - const LevelSetOutputRealType zero = NumericTraits::ZeroValue(); + const LevelSetOutputRealType zero{}; // // Construct upwind gradient values for use in the propagation speed term: @@ -110,7 +110,7 @@ typename LevelSetEquationPropagationTerm::Value(const LevelSetInputIndexType & iP, const LevelSetDataType & iData) { - const LevelSetOutputRealType zero = NumericTraits::ZeroValue(); + const LevelSetOutputRealType zero{}; LevelSetOutputRealType propagation_gradient = zero; for (unsigned int i = 0; i < ImageDimension; ++i) diff --git a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationTermContainer.hxx b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationTermContainer.hxx index decfbf81968..ab5f68707ad 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationTermContainer.hxx +++ b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationTermContainer.hxx @@ -265,7 +265,7 @@ LevelSetEquationTermContainer::Evaluate(const L auto cfl_it = m_TermContribution.begin(); - LevelSetOutputRealType oValue = NumericTraits::ZeroValue(); + LevelSetOutputRealType oValue{}; while (term_it != term_end) { @@ -299,7 +299,7 @@ LevelSetEquationTermContainer::Evaluate(const L auto cfl_it = m_TermContribution.begin(); - LevelSetOutputRealType oValue = NumericTraits::ZeroValue(); + LevelSetOutputRealType oValue{}; while (term_it != term_end) { @@ -351,7 +351,7 @@ LevelSetEquationTermContainer::ComputeCFLContri auto cfl_it = m_TermContribution.begin(); - LevelSetOutputRealType oValue = NumericTraits::ZeroValue(); + LevelSetOutputRealType oValue{}; while (term_it != term_end) { diff --git a/Modules/Segmentation/LevelSetsv4/include/itkUpdateMalcolmSparseLevelSet.hxx b/Modules/Segmentation/LevelSetsv4/include/itkUpdateMalcolmSparseLevelSet.hxx index 46a2381cb88..a6218c92c29 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkUpdateMalcolmSparseLevelSet.hxx +++ b/Modules/Segmentation/LevelSetsv4/include/itkUpdateMalcolmSparseLevelSet.hxx @@ -141,7 +141,7 @@ UpdateMalcolmSparseLevelSet::FillUpdateContainer const LevelSetOutputRealType update = termContainer->Evaluate(inputIndex); - LevelSetOutputType value = NumericTraits::ZeroValue(); + LevelSetOutputType value{}; if (update > NumericTraits::ZeroValue()) { diff --git a/Modules/Segmentation/MarkovRandomFieldsClassifiers/include/itkRGBGibbsPriorFilter.hxx b/Modules/Segmentation/MarkovRandomFieldsClassifiers/include/itkRGBGibbsPriorFilter.hxx index 0c73b6596ac..1b3fc5f8a46 100644 --- a/Modules/Segmentation/MarkovRandomFieldsClassifiers/include/itkRGBGibbsPriorFilter.hxx +++ b/Modules/Segmentation/MarkovRandomFieldsClassifiers/include/itkRGBGibbsPriorFilter.hxx @@ -625,9 +625,9 @@ RGBGibbsPriorFilter::RegionEraser() m_RegionCount[r] = 1; } - LabelType i = NumericTraits::ZeroValue(); - LabelType k = NumericTraits::ZeroValue(); - LabelType l = NumericTraits::ZeroValue(); + LabelType i{}; + LabelType k{}; + LabelType l{}; LabelType label; while (!labelledImageIt.IsAtEnd()) diff --git a/Modules/Segmentation/RegionGrowing/include/itkIsolatedConnectedImageFilter.hxx b/Modules/Segmentation/RegionGrowing/include/itkIsolatedConnectedImageFilter.hxx index 37e9933d55a..bc79c071cf1 100644 --- a/Modules/Segmentation/RegionGrowing/include/itkIsolatedConnectedImageFilter.hxx +++ b/Modules/Segmentation/RegionGrowing/include/itkIsolatedConnectedImageFilter.hxx @@ -237,7 +237,7 @@ IsolatedConnectedImageFilter::GenerateData() // Find the sum of the intensities in m_Seeds2. If the second // seeds are not included, the sum should be zero. Otherwise, // it will be other than zero. - InputRealType seedIntensitySum = NumericTraits::ZeroValue(); + InputRealType seedIntensitySum{}; typename SeedsContainerType::const_iterator si = m_Seeds2.begin(); typename SeedsContainerType::const_iterator li = m_Seeds2.end(); while (si != li) @@ -302,7 +302,7 @@ IsolatedConnectedImageFilter::GenerateData() // Find the sum of the intensities in m_Seeds2. If the second // seeds are not included, the sum should be zero. Otherwise, // it will be other than zero. - InputRealType seedIntensitySum = NumericTraits::ZeroValue(); + InputRealType seedIntensitySum{}; typename SeedsContainerType::const_iterator si = m_Seeds2.begin(); typename SeedsContainerType::const_iterator li = m_Seeds2.end(); while (si != li) @@ -360,8 +360,8 @@ IsolatedConnectedImageFilter::GenerateData() // Find the sum of the intensities in m_Seeds2. If the second // seeds are not included, the sum should be zero. Otherwise, // it will be other than zero. - InputRealType seed1IntensitySum = NumericTraits::ZeroValue(); - InputRealType seed2IntensitySum = NumericTraits::ZeroValue(); + InputRealType seed1IntensitySum{}; + InputRealType seed2IntensitySum{}; typename SeedsContainerType::const_iterator si1 = m_Seeds1.begin(); typename SeedsContainerType::const_iterator li1 = m_Seeds1.end(); while (si1 != li1) diff --git a/Modules/Segmentation/RegionGrowing/include/itkVectorConfidenceConnectedImageFilter.hxx b/Modules/Segmentation/RegionGrowing/include/itkVectorConfidenceConnectedImageFilter.hxx index f300991af58..af3969b9a77 100644 --- a/Modules/Segmentation/RegionGrowing/include/itkVectorConfidenceConnectedImageFilter.hxx +++ b/Modules/Segmentation/RegionGrowing/include/itkVectorConfidenceConnectedImageFilter.hxx @@ -269,7 +269,7 @@ VectorConfidenceConnectedImageFilter::GenerateData() covariance.fill(NumericTraits::ZeroValue()); mean.fill(NumericTraits::ZeroValue()); - SizeValueType num = NumericTraits::ZeroValue(); + SizeValueType num{}; SecondIteratorType sit(inputImage, secondFunction, m_Seeds); sit.GoToBegin(); diff --git a/Modules/Segmentation/Watersheds/include/itkMorphologicalWatershedFromMarkersImageFilter.hxx b/Modules/Segmentation/Watersheds/include/itkMorphologicalWatershedFromMarkersImageFilter.hxx index a0470a1c160..ea02ef63026 100644 --- a/Modules/Segmentation/Watersheds/include/itkMorphologicalWatershedFromMarkersImageFilter.hxx +++ b/Modules/Segmentation/Watersheds/include/itkMorphologicalWatershedFromMarkersImageFilter.hxx @@ -91,9 +91,9 @@ MorphologicalWatershedFromMarkersImageFilter::Generate //--------------------------------------------------------------------------- // the label used to find background in the marker image - static const LabelImagePixelType bgLabel = NumericTraits::ZeroValue(); + static const LabelImagePixelType bgLabel{}; // the label used to mark the watershed line in the output image - static const LabelImagePixelType wsLabel = NumericTraits::ZeroValue(); + static const LabelImagePixelType wsLabel{}; this->AllocateOutputs(); diff --git a/Modules/Segmentation/Watersheds/include/itkTobogganImageFilter.hxx b/Modules/Segmentation/Watersheds/include/itkTobogganImageFilter.hxx index 8a2395ec03d..cb50846cd29 100644 --- a/Modules/Segmentation/Watersheds/include/itkTobogganImageFilter.hxx +++ b/Modules/Segmentation/Watersheds/include/itkTobogganImageFilter.hxx @@ -57,8 +57,8 @@ TobogganImageFilter::GenerateData() auto inputImage = static_cast(this->GetInput()); OutputImagePointer outputImage = this->GetOutput(); - OutputImagePixelType z = NumericTraits::ZeroValue(); - OutputImagePixelType CurrentLabel = NumericTraits::ZeroValue(); + OutputImagePixelType z{}; + OutputImagePixelType CurrentLabel{}; CurrentLabel += 2;