diff --git a/Modules/Core/Common/include/itkConstNeighborhoodIterator.hxx b/Modules/Core/Common/include/itkConstNeighborhoodIterator.hxx index 2845fac2da1..6432b206480 100644 --- a/Modules/Core/Common/include/itkConstNeighborhoodIterator.hxx +++ b/Modules/Core/Common/include/itkConstNeighborhoodIterator.hxx @@ -185,7 +185,7 @@ ConstNeighborhoodIterator::ComputeInternalIndex(cons { OffsetType ans; auto r = static_cast(n); - for (long i = static_cast(Dimension) - 1; i >= 0; --i) + for (long i = long{ Dimension } - 1; i >= 0; --i) { ans[i] = static_cast(r / this->GetStride(i)); r = r % this->GetStride(i); diff --git a/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.hxx b/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.hxx index b94e4e143b3..ede12d813ef 100644 --- a/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.hxx +++ b/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.hxx @@ -108,7 +108,7 @@ ConstNeighborhoodIteratorWithOnlyIndex::ComputeInternalIndex(NeighborInd { OffsetType ans; auto r = static_cast(n); - for (long i = static_cast(Dimension) - 1; i >= 0; --i) + for (long i = long{ Dimension } - 1; i >= 0; --i) { ans[i] = static_cast(r / this->GetStride(i)); r = r % this->GetStride(i); diff --git a/Modules/Core/Common/include/itkFiniteCylinderSpatialFunction.hxx b/Modules/Core/Common/include/itkFiniteCylinderSpatialFunction.hxx index f145ac17d5e..f7410bdfd67 100644 --- a/Modules/Core/Common/include/itkFiniteCylinderSpatialFunction.hxx +++ b/Modules/Core/Common/include/itkFiniteCylinderSpatialFunction.hxx @@ -29,7 +29,7 @@ FiniteCylinderSpatialFunction::FiniteCylinderSpatialFunction { // a normalized {1,1,...1} vector is // { 1.0 / sqrt( VDim ), ... } - const double orientationVal = 1.0 / std::sqrt(static_cast(VDimension)); + const double orientationVal = 1.0 / std::sqrt(double{ VDimension }); m_Orientation.Fill(orientationVal); m_NormalizedOrientation.Fill(orientationVal); m_AxisLength = 1.0f; // Length of cylinder axis. diff --git a/Modules/Core/Common/include/itkImportImageFilter.hxx b/Modules/Core/Common/include/itkImportImageFilter.hxx index 8380bf14620..31caf9827b1 100644 --- a/Modules/Core/Common/include/itkImportImageFilter.hxx +++ b/Modules/Core/Common/include/itkImportImageFilter.hxx @@ -38,14 +38,14 @@ ImportImageFilter::PrintSelf(std::ostream & os, Indent itkPrintSelfObjectMacro(ImportImageContainer); os << indent << "Import buffer size: " << m_Size << std::endl; os << indent << "Spacing: ["; - for (i = 0; i < static_cast(VImageDimension) - 1; ++i) + for (i = 0; i < int{ VImageDimension } - 1; ++i) { os << m_Spacing[i] << ", "; } os << m_Spacing[i] << ']' << std::endl; os << indent << "Origin: ["; - for (i = 0; i < static_cast(VImageDimension) - 1; ++i) + for (i = 0; i < int{ VImageDimension } - 1; ++i) { os << m_Origin[i] << ", "; } diff --git a/Modules/Core/ImageFunction/include/itkBSplineInterpolateImageFunction.hxx b/Modules/Core/ImageFunction/include/itkBSplineInterpolateImageFunction.hxx index f8b294bf0e2..1aa34d81a77 100644 --- a/Modules/Core/ImageFunction/include/itkBSplineInterpolateImageFunction.hxx +++ b/Modules/Core/ImageFunction/include/itkBSplineInterpolateImageFunction.hxx @@ -422,11 +422,11 @@ BSplineInterpolateImageFunction::Gene int pp = p; unsigned long indexFactor[ImageDimension]; indexFactor[0] = 1; - for (int j = 1; j < static_cast(ImageDimension); ++j) + for (int j = 1; j < int{ ImageDimension }; ++j) { indexFactor[j] = indexFactor[j - 1] * (m_SplineOrder + 1); } - for (int j = (static_cast(ImageDimension) - 1); j >= 0; j--) + for (int j = (int{ ImageDimension } - 1); j >= 0; j--) { m_PointsToIndex[p][j] = pp / indexFactor[j]; pp = pp % indexFactor[j]; diff --git a/Modules/Filtering/BinaryMathematicalMorphology/include/itkObjectMorphologyImageFilter.hxx b/Modules/Filtering/BinaryMathematicalMorphology/include/itkObjectMorphologyImageFilter.hxx index bbeac9af262..8e1efd60077 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/include/itkObjectMorphologyImageFilter.hxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/include/itkObjectMorphologyImageFilter.hxx @@ -171,7 +171,7 @@ bool ObjectMorphologyImageFilter::IsObjectPixelOnBoundary( const InputNeighborhoodIteratorType & iNIter) { - static const auto s = static_cast(std::pow(3.0, static_cast(ImageDimension))); + static const auto s = static_cast(std::pow(3.0, double{ ImageDimension })); PixelType tf; unsigned int i; diff --git a/Modules/Filtering/DistanceMap/include/itkSignedMaurerDistanceMapImageFilter.hxx b/Modules/Filtering/DistanceMap/include/itkSignedMaurerDistanceMapImageFilter.hxx index 81d97432a3b..35f59231f09 100644 --- a/Modules/Filtering/DistanceMap/include/itkSignedMaurerDistanceMapImageFilter.hxx +++ b/Modules/Filtering/DistanceMap/include/itkSignedMaurerDistanceMapImageFilter.hxx @@ -194,10 +194,10 @@ SignedMaurerDistanceMapImageFilter::ThreadedGenerateD // set the progress reporter. Use a pointer to be able to destroy it before // the creation of progress2 // so it won't set wrong progress at the end of ThreadedGenerateData() - float progressPerDimension = 0.67f / static_cast(ImageDimension); + float progressPerDimension = 0.67f / float{ ImageDimension }; if (!this->m_SquaredDistance) { - progressPerDimension = 0.67f / (static_cast(ImageDimension) + 1); + progressPerDimension = 0.67f / (float{ ImageDimension } + 1); } auto progress = std::make_unique(this, diff --git a/Modules/Filtering/DistanceMap/test/itkContourMeanDistanceImageFilterTest.cxx b/Modules/Filtering/DistanceMap/test/itkContourMeanDistanceImageFilterTest.cxx index 105e5e72974..069eedf5109 100644 --- a/Modules/Filtering/DistanceMap/test/itkContourMeanDistanceImageFilterTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkContourMeanDistanceImageFilterTest.cxx @@ -105,7 +105,7 @@ itkContourMeanDistanceImageFilterTest(int argc, char * argv[]) // check results constexpr FilterType::RealType trueDistance = 8.07158; - // std::sqrt( static_cast(ImageDimension) ); + // std::sqrt( double{ ImageDimension } ); const FilterType::RealType distance = filter->GetMeanDistance(); std::cout << " True distance: " << trueDistance << std::endl; diff --git a/Modules/Filtering/DistanceMap/test/itkDirectedHausdorffDistanceImageFilterTest1.cxx b/Modules/Filtering/DistanceMap/test/itkDirectedHausdorffDistanceImageFilterTest1.cxx index 57546d8d7c3..03ab5c50706 100644 --- a/Modules/Filtering/DistanceMap/test/itkDirectedHausdorffDistanceImageFilterTest1.cxx +++ b/Modules/Filtering/DistanceMap/test/itkDirectedHausdorffDistanceImageFilterTest1.cxx @@ -92,7 +92,7 @@ itkDirectedHausdorffDistanceImageFilterTest1(int, char *[]) filter->Update(); // Check results - const FilterType::RealType trueDistance = 10 * std::sqrt(static_cast(ImageDimension)); + const FilterType::RealType trueDistance = 10 * std::sqrt(double{ ImageDimension }); const FilterType::RealType distance = filter->GetDirectedHausdorffDistance(); std::cout << " True distance: " << trueDistance << std::endl; @@ -122,7 +122,7 @@ itkDirectedHausdorffDistanceImageFilterTest1(int, char *[]) filter->Update(); // Check results - const FilterType::RealType trueDistance = 5 * std::sqrt(static_cast(ImageDimension)); + const FilterType::RealType trueDistance = 5 * std::sqrt(double{ ImageDimension }); const FilterType::RealType distance = filter->GetDirectedHausdorffDistance(); std::cout << " True distance: " << trueDistance << std::endl; diff --git a/Modules/Filtering/DistanceMap/test/itkHausdorffDistanceImageFilterTest.cxx b/Modules/Filtering/DistanceMap/test/itkHausdorffDistanceImageFilterTest.cxx index 7405cfc79cc..b3ee8c43a97 100644 --- a/Modules/Filtering/DistanceMap/test/itkHausdorffDistanceImageFilterTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkHausdorffDistanceImageFilterTest.cxx @@ -100,7 +100,7 @@ itkHausdorffDistanceImageFilterTest(int argc, char * argv[]) filter->Update(); // Check results - const FilterType::RealType trueDistance = 10 * std::sqrt(static_cast(ImageDimension)); + const FilterType::RealType trueDistance = 10 * std::sqrt(double{ ImageDimension }); const FilterType::RealType distance = filter->GetHausdorffDistance(); std::cout << " True distance: " << trueDistance << std::endl; @@ -129,7 +129,7 @@ itkHausdorffDistanceImageFilterTest(int argc, char * argv[]) filter->Update(); // Check results - const FilterType::RealType trueDistance = 10 * std::sqrt(static_cast(ImageDimension)); + const FilterType::RealType trueDistance = 10 * std::sqrt(double{ ImageDimension }); const FilterType::RealType distance = filter->GetHausdorffDistance(); std::cout << " True distance: " << trueDistance << std::endl; diff --git a/Modules/Filtering/ImageFeature/include/itkHessianRecursiveGaussianImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkHessianRecursiveGaussianImageFilter.hxx index cec84b64025..d6b66c35a28 100644 --- a/Modules/Filtering/ImageFeature/include/itkHessianRecursiveGaussianImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkHessianRecursiveGaussianImageFilter.hxx @@ -280,7 +280,7 @@ HessianRecursiveGaussianImageFilter::GenerateData() // Deal with the 2D case. if (numberOfSmoothingFilters > 0) { - const int temp_dim = static_cast(ImageDimension) - 3; + const int temp_dim = int{ ImageDimension } - 3; const GaussianFilterPointer lastFilter = m_SmoothingFilters[temp_dim]; lastFilter->UpdateLargestPossibleRegion(); derivativeImage = lastFilter->GetOutput(); diff --git a/Modules/Filtering/ImageGradient/include/itkGradientRecursiveGaussianImageFilter.hxx b/Modules/Filtering/ImageGradient/include/itkGradientRecursiveGaussianImageFilter.hxx index d6b9ae99563..d8530f58bd8 100644 --- a/Modules/Filtering/ImageGradient/include/itkGradientRecursiveGaussianImageFilter.hxx +++ b/Modules/Filtering/ImageGradient/include/itkGradientRecursiveGaussianImageFilter.hxx @@ -271,7 +271,7 @@ GradientRecursiveGaussianImageFilter::GenerateData() // manually release memory in last filter in the mini-pipeline if constexpr (ImageDimension > 1) { - const int temp_dim = static_cast(ImageDimension) - 2; + const int temp_dim = int{ ImageDimension } - 2; m_SmoothingFilters[temp_dim]->GetOutput()->ReleaseData(); } else diff --git a/Modules/Filtering/LabelMap/include/itkShapeLabelMapFilter.hxx b/Modules/Filtering/LabelMap/include/itkShapeLabelMapFilter.hxx index b56cdf2422b..6fa28511f45 100644 --- a/Modules/Filtering/LabelMap/include/itkShapeLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkShapeLabelMapFilter.hxx @@ -534,7 +534,7 @@ ShapeLabelMapFilter::ComputePerimeter(LabelObjectType * lab // a data structure to store the number of intercepts on each direction using MapInterceptType = typename std::map; MapInterceptType intercepts; - // int nbOfDirections = static_cast(std::pow(2.0, static_cast(ImageDimension))) - 1; + // int nbOfDirections = static_cast(std::pow(2.0, int{ ImageDimension })) - 1; // intercepts.resize(nbOfDirections + 1); // code begins at position 1 // now iterate over the vectors of lines diff --git a/Modules/Filtering/MathematicalMorphology/include/itkFlatStructuringElement.hxx b/Modules/Filtering/MathematicalMorphology/include/itkFlatStructuringElement.hxx index cd91aaf4913..185a33fe2b8 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkFlatStructuringElement.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkFlatStructuringElement.hxx @@ -909,7 +909,7 @@ FlatStructuringElement::Cross(RadiusType radius) { *kernel_it = false; } - for (int d = 0; d < static_cast(VDimension); ++d) + for (int d = 0; d < int{ VDimension }; ++d) { OffsetType o{}; for (int i = -static_cast(radius[d]); i <= static_cast(radius[d]); ++i) @@ -938,7 +938,7 @@ FlatStructuringElement::Ball(RadiusType radius, bool radiusIsParamet // auto sourceImage = ImageType::New(); RadiusType size = radius; - for (i = 0; i < static_cast(VDimension); ++i) + for (i = 0; i < int{ VDimension }; ++i) { size[i] = 2 * size[i] + 1; } @@ -1205,7 +1205,7 @@ FlatStructuringElement::ComputeBufferFromLines() // auto sourceImage = ImageType::New(); RadiusType size = this->GetRadius(); - for (int i = 0; i < static_cast(VDimension); ++i) + for (int i = 0; i < int{ VDimension }; ++i) { size[i] = 2 * size[i] + 1; } @@ -1227,7 +1227,7 @@ FlatStructuringElement::ComputeBufferFromLines() // set the center pixel to 1 typename ImageType::IndexType center; - for (int i = 0; i < static_cast(VDimension); ++i) + for (int i = 0; i < int{ VDimension }; ++i) { center[i] = this->GetRadius()[i]; } diff --git a/Modules/IO/NIFTI/test/itkNiftiImageIOTest.h b/Modules/IO/NIFTI/test/itkNiftiImageIOTest.h index 7ad809f2c70..1c819b2dc76 100644 --- a/Modules/IO/NIFTI/test/itkNiftiImageIOTest.h +++ b/Modules/IO/NIFTI/test/itkNiftiImageIOTest.h @@ -269,7 +269,7 @@ TestImageOfSymMats(const std::string & fname) // direction matrix. const typename DtiImageType::DirectionType myDirection = PreFillDirection(); - std::cout << " === Testing DtiImageType: Image Dimension " << static_cast(VDimension) << std::endl + std::cout << " === Testing DtiImageType: Image Dimension " << int{ VDimension } << std::endl << "======================== Initialized Direction" << std::endl << myDirection << std::endl; diff --git a/Modules/IO/NIFTI/test/itkNiftiImageIOTest3.cxx b/Modules/IO/NIFTI/test/itkNiftiImageIOTest3.cxx index 82f0d59ad5d..b3f0a3af0fd 100644 --- a/Modules/IO/NIFTI/test/itkNiftiImageIOTest3.cxx +++ b/Modules/IO/NIFTI/test/itkNiftiImageIOTest3.cxx @@ -65,8 +65,7 @@ TestImageOfVectors(const std::string & fname, const std::string & intentCode = " // direction matrix. const typename VectorImageType::DirectionType myDirection = PreFillDirection(); - std::cout << " === Testing VectorLength: " << TVecLength << " Image Dimension " << static_cast(TDimension) - << std::endl; + std::cout << " === Testing VectorLength: " << TVecLength << " Image Dimension " << int{ TDimension } << std::endl; std::cout << "======================== Initialized Direction" << std::endl; std::cout << myDirection << std::endl; diff --git a/Modules/Registration/Common/include/itkRecursiveMultiResolutionPyramidImageFilter.hxx b/Modules/Registration/Common/include/itkRecursiveMultiResolutionPyramidImageFilter.hxx index 329541fe9ae..eef64ffc795 100644 --- a/Modules/Registration/Common/include/itkRecursiveMultiResolutionPyramidImageFilter.hxx +++ b/Modules/Registration/Common/include/itkRecursiveMultiResolutionPyramidImageFilter.hxx @@ -245,7 +245,7 @@ RecursiveMultiResolutionPyramidImageFilter::GenerateO requestedSize = requestedRegion.GetSize(); requestedIndex = requestedRegion.GetIndex(); - for (int idim = 0; idim < static_cast(ImageDimension); ++idim) + for (int idim = 0; idim < int{ ImageDimension }; ++idim) { factors[idim] = this->GetSchedule()[ilevel - 1][idim] / this->GetSchedule()[ilevel][idim]; @@ -282,7 +282,7 @@ RecursiveMultiResolutionPyramidImageFilter::GenerateO requestedSize = requestedRegion.GetSize(); requestedIndex = requestedRegion.GetIndex(); - for (int idim = 0; idim < static_cast(ImageDimension); ++idim) + for (int idim = 0; idim < int{ ImageDimension }; ++idim) { factors[idim] = this->GetSchedule()[ilevel][idim] / this->GetSchedule()[ilevel + 1][idim]; diff --git a/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.hxx b/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.hxx index 435036c3de4..a9939720ddc 100644 --- a/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.hxx +++ b/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.hxx @@ -159,7 +159,7 @@ GPUDemonsRegistrationFunction::In { m_Normalizer += fixedImageSpacing[k] * fixedImageSpacing[k]; } - m_Normalizer /= static_cast(ImageDimension); + m_Normalizer /= double{ ImageDimension }; // setup gradient calculator m_FixedImageGradientCalculator->SetInputImage(this->GetFixedImage()); diff --git a/Modules/Registration/PDEDeformable/include/itkDemonsRegistrationFunction.hxx b/Modules/Registration/PDEDeformable/include/itkDemonsRegistrationFunction.hxx index eb5a97edda3..cc3dc607968 100644 --- a/Modules/Registration/PDEDeformable/include/itkDemonsRegistrationFunction.hxx +++ b/Modules/Registration/PDEDeformable/include/itkDemonsRegistrationFunction.hxx @@ -124,7 +124,7 @@ DemonsRegistrationFunction::Initi { m_Normalizer += fixedImageSpacing[k] * fixedImageSpacing[k]; } - m_Normalizer /= static_cast(ImageDimension); + m_Normalizer /= double{ ImageDimension }; // setup gradient calculator m_FixedImageGradientCalculator->SetInputImage(this->GetFixedImage()); diff --git a/Modules/Registration/PDEDeformable/include/itkESMDemonsRegistrationFunction.hxx b/Modules/Registration/PDEDeformable/include/itkESMDemonsRegistrationFunction.hxx index 3130dc7e3bd..cc6162686b2 100644 --- a/Modules/Registration/PDEDeformable/include/itkESMDemonsRegistrationFunction.hxx +++ b/Modules/Registration/PDEDeformable/include/itkESMDemonsRegistrationFunction.hxx @@ -132,7 +132,7 @@ ESMDemonsRegistrationFunction::In { m_Normalizer += m_FixedImageSpacing[k] * m_FixedImageSpacing[k]; } - m_Normalizer *= m_MaximumUpdateStepLength * m_MaximumUpdateStepLength / static_cast(ImageDimension); + m_Normalizer *= m_MaximumUpdateStepLength * m_MaximumUpdateStepLength / double{ ImageDimension }; } else { diff --git a/Modules/Registration/PDEDeformable/include/itkFastSymmetricForcesDemonsRegistrationFunction.hxx b/Modules/Registration/PDEDeformable/include/itkFastSymmetricForcesDemonsRegistrationFunction.hxx index 76ecde63228..e00ce98610e 100644 --- a/Modules/Registration/PDEDeformable/include/itkFastSymmetricForcesDemonsRegistrationFunction.hxx +++ b/Modules/Registration/PDEDeformable/include/itkFastSymmetricForcesDemonsRegistrationFunction.hxx @@ -121,7 +121,7 @@ FastSymmetricForcesDemonsRegistrationFunction(ImageDimension); + m_Normalizer /= double{ ImageDimension }; // setup gradient calculator m_FixedImageGradientCalculator->SetInputImage(this->GetFixedImage()); diff --git a/Modules/Registration/PDEDeformable/include/itkSymmetricForcesDemonsRegistrationFunction.hxx b/Modules/Registration/PDEDeformable/include/itkSymmetricForcesDemonsRegistrationFunction.hxx index b1094ec8148..31288fabaaa 100644 --- a/Modules/Registration/PDEDeformable/include/itkSymmetricForcesDemonsRegistrationFunction.hxx +++ b/Modules/Registration/PDEDeformable/include/itkSymmetricForcesDemonsRegistrationFunction.hxx @@ -116,7 +116,7 @@ SymmetricForcesDemonsRegistrationFunction(ImageDimension); + m_Normalizer /= double{ ImageDimension }; // setup gradient calculator m_FixedImageGradientCalculator->SetInputImage(this->GetFixedImage()); diff --git a/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx b/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx index 0a0126ce9ef..3ab756f1dd3 100644 --- a/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx +++ b/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx @@ -58,7 +58,7 @@ ParallelSparseFieldCityBlockNeighborList::ParallelSparseField m_ArrayIndex.push_back(nCenter - it.GetStride(d)); m_NeighborhoodOffset[i][d] = -1; } - for (int d = 0; d < static_cast(Dimension); ++d, ++i) + for (int d = 0; d < int{ Dimension }; ++d, ++i) { m_ArrayIndex.push_back(nCenter + it.GetStride(d)); m_NeighborhoodOffset[i][d] = 1; diff --git a/Modules/Segmentation/LevelSets/include/itkSparseFieldFourthOrderLevelSetImageFilter.hxx b/Modules/Segmentation/LevelSets/include/itkSparseFieldFourthOrderLevelSetImageFilter.hxx index d6f2fe1b2b9..547fa6b3a93 100644 --- a/Modules/Segmentation/LevelSets/include/itkSparseFieldFourthOrderLevelSetImageFilter.hxx +++ b/Modules/Segmentation/LevelSets/include/itkSparseFieldFourthOrderLevelSetImageFilter.hxx @@ -44,7 +44,7 @@ SparseFieldFourthOrderLevelSetImageFilter::SparseFiel m_MaxRefitIteration = 100; m_MaxNormalIteration = 25; m_RMSChangeNormalProcessTrigger = ValueType{}; - m_CurvatureBandWidth = static_cast(ImageDimension) + 0.5; + m_CurvatureBandWidth = ValueType{ ImageDimension } + 0.5; m_NormalProcessType = 0; m_NormalProcessConductance = ValueType{}; m_NormalProcessUnsharpFlag = false; @@ -203,7 +203,7 @@ template void SparseFieldFourthOrderLevelSetImageFilter::ProcessNormals() { - auto temp = static_cast(ImageDimension); + auto temp = ValueType{ ImageDimension }; const typename NormalVectorFilterType::Pointer NormalVectorFilter = NormalVectorFilterType::New(); const typename NormalVectorFunctionType::Pointer NormalVectorFunction = NormalVectorFunctionType::New(); diff --git a/Modules/Segmentation/LevelSets/include/itkSparseFieldLevelSetImageFilter.hxx b/Modules/Segmentation/LevelSets/include/itkSparseFieldLevelSetImageFilter.hxx index 8d59f228019..aa8ead18c56 100644 --- a/Modules/Segmentation/LevelSets/include/itkSparseFieldLevelSetImageFilter.hxx +++ b/Modules/Segmentation/LevelSets/include/itkSparseFieldLevelSetImageFilter.hxx @@ -54,7 +54,7 @@ SparseFieldCityBlockNeighborList::SparseFieldCityBlockNeighbo m_ArrayIndex.push_back(nCenter - it.GetStride(d)); m_NeighborhoodOffset[i][d] = -1; } - for (int d = 0; d < static_cast(Dimension); ++d, ++i) + for (int d = 0; d < int{ Dimension }; ++d, ++i) { m_ArrayIndex.push_back(nCenter + it.GetStride(d)); m_NeighborhoodOffset[i][d] = 1; diff --git a/Modules/Segmentation/Watersheds/include/itkWatershedSegmenter.hxx b/Modules/Segmentation/Watersheds/include/itkWatershedSegmenter.hxx index 0de96126917..8c19050fdf7 100644 --- a/Modules/Segmentation/Watersheds/include/itkWatershedSegmenter.hxx +++ b/Modules/Segmentation/Watersheds/include/itkWatershedSegmenter.hxx @@ -645,7 +645,7 @@ Segmenter::GenerateConnectivity() m_Connectivity.direction[i][d] = -1; ++i; } - for (int d = 0; d < static_cast(ImageDimension); ++d) + for (int d = 0; d < int{ ImageDimension }; ++d) { const unsigned int stride = it.GetStride(d); m_Connectivity.index[i] = nCenter + stride;