diff --git a/Modules/Core/Common/test/itkIteratorTests.cxx b/Modules/Core/Common/test/itkIteratorTests.cxx index 1e1eab25ee0..b40732ef3ec 100644 --- a/Modules/Core/Common/test/itkIteratorTests.cxx +++ b/Modules/Core/Common/test/itkIteratorTests.cxx @@ -66,7 +66,7 @@ itkIteratorTests(int, char *[]) unsigned short * ptr = o3->GetBufferPointer(); memset(ptr, 0, num * sizeof(unsigned short)); clock_t end = clock(); - double elapsedTime = (end - start) / static_cast(CLOCKS_PER_SEC); + double elapsedTime = (end - start) / double{ CLOCKS_PER_SEC }; std::cout << "Raw pointer using memset" << std::endl; std::cout << "\tTime = " << elapsedTime << std::endl; @@ -83,7 +83,7 @@ itkIteratorTests(int, char *[]) } end = clock(); *ptr = 0; - elapsedTime = (end - start) / static_cast(CLOCKS_PER_SEC); + elapsedTime = (end - start) / double{ CLOCKS_PER_SEC }; std::cout << "Raw pointer as a 1D array" << std::endl; std::cout << "\tTime = " << elapsedTime << std::endl; @@ -109,7 +109,7 @@ itkIteratorTests(int, char *[]) ++i; } end = clock(); - elapsedTime = (end - start) / static_cast(CLOCKS_PER_SEC); + elapsedTime = (end - start) / double{ CLOCKS_PER_SEC }; std::cout << "Raw pointer in 3 nested loops" << std::endl; std::cout << "\tTime = " << elapsedTime << std::endl; @@ -134,7 +134,7 @@ itkIteratorTests(int, char *[]) ++i; } end = clock(); - elapsedTime = (end - start) / static_cast(CLOCKS_PER_SEC); + elapsedTime = (end - start) / double{ CLOCKS_PER_SEC }; std::cout << "ImageRegionIterator" << std::endl; std::cout << "\tTime = " << elapsedTime << std::endl; @@ -156,7 +156,7 @@ itkIteratorTests(int, char *[]) ++i; } end = clock(); - elapsedTime = (end - start) / static_cast(CLOCKS_PER_SEC); + elapsedTime = (end - start) / double{ CLOCKS_PER_SEC }; std::cout << "ImageRegionIteratorWithIndex" << std::endl; std::cout << "\tTime = " << elapsedTime << std::endl; diff --git a/Modules/Filtering/AntiAlias/test/itkAntiAliasBinaryImageFilterTest.cxx b/Modules/Filtering/AntiAlias/test/itkAntiAliasBinaryImageFilterTest.cxx index 774bfd4b581..9eb939fb697 100644 --- a/Modules/Filtering/AntiAlias/test/itkAntiAliasBinaryImageFilterTest.cxx +++ b/Modules/Filtering/AntiAlias/test/itkAntiAliasBinaryImageFilterTest.cxx @@ -40,12 +40,10 @@ constexpr int V_DEPTH = 64; float sphere(float x, float y, float z) { - const float dis = (x - static_cast(V_WIDTH) / 2.0) * (x - static_cast(V_WIDTH) / 2.0) / - ((0.2f * V_WIDTH) * (0.2f * V_WIDTH)) + - (y - static_cast(V_HEIGHT) / 2.0) * (y - static_cast(V_HEIGHT) / 2.0) / - ((0.2f * V_HEIGHT) * (0.2f * V_HEIGHT)) + - (z - static_cast(V_DEPTH) / 2.0) * (z - static_cast(V_DEPTH) / 2.0) / - ((0.2f * V_DEPTH) * (0.2f * V_DEPTH)); + const float dis = + (x - float{ V_WIDTH } / 2.0) * (x - float{ V_WIDTH } / 2.0) / ((0.2f * V_WIDTH) * (0.2f * V_WIDTH)) + + (y - float{ V_HEIGHT } / 2.0) * (y - float{ V_HEIGHT } / 2.0) / ((0.2f * V_HEIGHT) * (0.2f * V_HEIGHT)) + + (z - float{ V_DEPTH } / 2.0) * (z - float{ V_DEPTH } / 2.0) / ((0.2f * V_DEPTH) * (0.2f * V_DEPTH)); return (1.0f - dis); } diff --git a/Modules/Filtering/Colormap/include/itkCustomColormapFunction.hxx b/Modules/Filtering/Colormap/include/itkCustomColormapFunction.hxx index 06fe497b8c0..e71b965f9e1 100644 --- a/Modules/Filtering/Colormap/include/itkCustomColormapFunction.hxx +++ b/Modules/Filtering/Colormap/include/itkCustomColormapFunction.hxx @@ -62,7 +62,7 @@ CustomColormapFunction::operator()(const TScalar & v) const RGBPixelType pixel; NumericTraits::SetLength(pixel, 3); - for (auto color = static_cast(RED); color <= static_cast(BLUE); ++color) + for (auto color = size_t{ RED }; color <= size_t{ BLUE }; ++color) { pixel[color] = this->RescaleRGBComponentValue(RGBValue[color]); } diff --git a/Modules/Filtering/MathematicalMorphology/test/itkObjectMorphologyImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkObjectMorphologyImageFilterTest.cxx index 4b28f27bda1..c7bb8b4b572 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkObjectMorphologyImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkObjectMorphologyImageFilterTest.cxx @@ -153,7 +153,7 @@ itkObjectMorphologyImageFilterTest(int, char *[]) end = clock(); - elapsedTime = (end - start) / static_cast(CLOCKS_PER_SEC); + elapsedTime = (end - start) / double{ CLOCKS_PER_SEC }; // Print the content of the result image std::cout << " Success: " << std::endl; @@ -174,7 +174,7 @@ itkObjectMorphologyImageFilterTest(int, char *[]) end = clock(); - elapsedTime = (end - start) / static_cast(CLOCKS_PER_SEC); + elapsedTime = (end - start) / double{ CLOCKS_PER_SEC }; // Print the content of the result image std::cout << " Success: " << std::endl; @@ -214,7 +214,7 @@ itkObjectMorphologyImageFilterTest(int, char *[]) ++count; } end = clock(); - elapsedTime = (end - start) / static_cast(CLOCKS_PER_SEC); + elapsedTime = (end - start) / double{ CLOCKS_PER_SEC }; std::cout << " Success: " << std::endl; std::cout << " Time = " << elapsedTime << std::endl; @@ -241,7 +241,7 @@ itkObjectMorphologyImageFilterTest(int, char *[]) end = clock(); - elapsedTime = (end - start) / static_cast(CLOCKS_PER_SEC); + elapsedTime = (end - start) / double{ CLOCKS_PER_SEC }; // Print the content of the result image std::cout << " Success: " << std::endl; @@ -262,7 +262,7 @@ itkObjectMorphologyImageFilterTest(int, char *[]) end = clock(); - elapsedTime = (end - start) / static_cast(CLOCKS_PER_SEC); + elapsedTime = (end - start) / double{ CLOCKS_PER_SEC }; // Print the content of the result image std::cout << " Success: " << std::endl; @@ -302,7 +302,7 @@ itkObjectMorphologyImageFilterTest(int, char *[]) ++count; } end = clock(); - elapsedTime = (end - start) / static_cast(CLOCKS_PER_SEC); + elapsedTime = (end - start) / double{ CLOCKS_PER_SEC }; std::cout << " Success: " << std::endl; std::cout << " Time = " << elapsedTime << std::endl; diff --git a/Modules/IO/NIFTI/src/itkNiftiImageIO.cxx b/Modules/IO/NIFTI/src/itkNiftiImageIO.cxx index ed5282d1d2f..a88aede6447 100644 --- a/Modules/IO/NIFTI/src/itkNiftiImageIO.cxx +++ b/Modules/IO/NIFTI/src/itkNiftiImageIO.cxx @@ -1515,8 +1515,8 @@ NiftiImageIO::WriteImageInformation() // external tools believe that the time units must be set, even if there // is only one dataset. Having the time specified for a purely spatial // image has no consequence, so go ahead and set it to seconds. - this->m_NiftiImage->xyz_units = static_cast(NIFTI_UNITS_MM); - this->m_NiftiImage->time_units = static_cast(NIFTI_UNITS_SEC); + this->m_NiftiImage->xyz_units = int{ NIFTI_UNITS_MM }; + this->m_NiftiImage->time_units = int{ NIFTI_UNITS_SEC }; this->m_NiftiImage->dim[7] = this->m_NiftiImage->nw = 1; this->m_NiftiImage->dim[6] = this->m_NiftiImage->nv = 1; this->m_NiftiImage->dim[5] = this->m_NiftiImage->nu = 1; diff --git a/Modules/Segmentation/Classifiers/include/itkImageKmeansModelEstimator.hxx b/Modules/Segmentation/Classifiers/include/itkImageKmeansModelEstimator.hxx index cee3a6410ff..ad08a86fcdb 100644 --- a/Modules/Segmentation/Classifiers/include/itkImageKmeansModelEstimator.hxx +++ b/Modules/Segmentation/Classifiers/include/itkImageKmeansModelEstimator.hxx @@ -545,7 +545,7 @@ ImageKmeansModelEstimator::Perturb(double * ol for (unsigned int i = 0; i < m_VectorDimension; ++i) { srand(static_cast(time(nullptr))); - const double rand_num = (rand()) / (static_cast(RAND_MAX)); + const double rand_num = (rand()) / (double{ RAND_MAX }); if (oldCodeword[i] == 0.0) { diff --git a/Modules/Segmentation/LevelSets/test/itkCannySegmentationLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkCannySegmentationLevelSetImageFilterTest.cxx index a5ae6ece487..779bc9ac5e5 100644 --- a/Modules/Segmentation/LevelSets/test/itkCannySegmentationLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkCannySegmentationLevelSetImageFilterTest.cxx @@ -32,24 +32,20 @@ constexpr int V_DEPTH = 64; float sphere(float x, float y, float z) { - const float dis = (x - static_cast(V_WIDTH) / 2.0) * (x - static_cast(V_WIDTH) / 2.0) / - ((0.2f * V_WIDTH) * (0.2f * V_WIDTH)) + - (y - static_cast(V_HEIGHT) / 2.0) * (y - static_cast(V_HEIGHT) / 2.0) / - ((0.2f * V_HEIGHT) * (0.2f * V_HEIGHT)) + - (z - static_cast(V_DEPTH) / 2.0) * (z - static_cast(V_DEPTH) / 2.0) / - ((0.2f * V_DEPTH) * (0.2f * V_DEPTH)); + const float dis = + (x - float{ V_WIDTH } / 2.0) * (x - float{ V_WIDTH } / 2.0) / ((0.2f * V_WIDTH) * (0.2f * V_WIDTH)) + + (y - float{ V_HEIGHT } / 2.0) * (y - float{ V_HEIGHT } / 2.0) / ((0.2f * V_HEIGHT) * (0.2f * V_HEIGHT)) + + (z - float{ V_DEPTH } / 2.0) * (z - float{ V_DEPTH } / 2.0) / ((0.2f * V_DEPTH) * (0.2f * V_DEPTH)); return (1.0f - dis); } float sphere2(float x, float y, float z) { - const float dis = (x - static_cast(V_WIDTH) / 2.1) * (x - static_cast(V_WIDTH) / 2.1) / - ((0.2f * V_WIDTH) * (0.2f * V_WIDTH)) + - (y - static_cast(V_HEIGHT) / 2.0) * (y - static_cast(V_HEIGHT) / 2.0) / - ((0.2f * V_HEIGHT) * (0.2f * V_HEIGHT)) + - (z - static_cast(V_DEPTH) / 2.0) * (z - static_cast(V_DEPTH) / 2.0) / - ((0.2f * V_DEPTH) * (0.2f * V_DEPTH)); + const float dis = + (x - float{ V_WIDTH } / 2.1) * (x - float{ V_WIDTH } / 2.1) / ((0.2f * V_WIDTH) * (0.2f * V_WIDTH)) + + (y - float{ V_HEIGHT } / 2.0) * (y - float{ V_HEIGHT } / 2.0) / ((0.2f * V_HEIGHT) * (0.2f * V_HEIGHT)) + + (z - float{ V_DEPTH } / 2.0) * (z - float{ V_DEPTH } / 2.0) / ((0.2f * V_DEPTH) * (0.2f * V_DEPTH)); return (1.0f - dis); } diff --git a/Modules/Segmentation/LevelSets/test/itkLaplacianSegmentationLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkLaplacianSegmentationLevelSetImageFilterTest.cxx index 275138795b3..5efe2cdd5fb 100644 --- a/Modules/Segmentation/LevelSets/test/itkLaplacianSegmentationLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkLaplacianSegmentationLevelSetImageFilterTest.cxx @@ -33,24 +33,20 @@ constexpr int V_DEPTH = 64; float sphere(float x, float y, float z) { - const float dis = (x - static_cast(V_WIDTH) / 2.0) * (x - static_cast(V_WIDTH) / 2.0) / - ((0.2f * V_WIDTH) * (0.2f * V_WIDTH)) + - (y - static_cast(V_HEIGHT) / 2.0) * (y - static_cast(V_HEIGHT) / 2.0) / - ((0.2f * V_HEIGHT) * (0.2f * V_HEIGHT)) + - (z - static_cast(V_DEPTH) / 2.0) * (z - static_cast(V_DEPTH) / 2.0) / - ((0.2f * V_DEPTH) * (0.2f * V_DEPTH)); + const float dis = + (x - float{ V_WIDTH } / 2.0) * (x - float{ V_WIDTH } / 2.0) / ((0.2f * V_WIDTH) * (0.2f * V_WIDTH)) + + (y - float{ V_HEIGHT } / 2.0) * (y - float{ V_HEIGHT } / 2.0) / ((0.2f * V_HEIGHT) * (0.2f * V_HEIGHT)) + + (z - float{ V_DEPTH } / 2.0) * (z - float{ V_DEPTH } / 2.0) / ((0.2f * V_DEPTH) * (0.2f * V_DEPTH)); return (1.0f - dis); } float sphere2(float x, float y, float z) { - const float dis = (x - static_cast(V_WIDTH) / 2.1) * (x - static_cast(V_WIDTH) / 2.1) / - ((0.2f * V_WIDTH) * (0.2f * V_WIDTH)) + - (y - static_cast(V_HEIGHT) / 2.0) * (y - static_cast(V_HEIGHT) / 2.0) / - ((0.2f * V_HEIGHT) * (0.2f * V_HEIGHT)) + - (z - static_cast(V_DEPTH) / 2.0) * (z - static_cast(V_DEPTH) / 2.0) / - ((0.2f * V_DEPTH) * (0.2f * V_DEPTH)); + const float dis = + (x - float{ V_WIDTH } / 2.1) * (x - float{ V_WIDTH } / 2.1) / ((0.2f * V_WIDTH) * (0.2f * V_WIDTH)) + + (y - float{ V_HEIGHT } / 2.0) * (y - float{ V_HEIGHT } / 2.0) / ((0.2f * V_HEIGHT) * (0.2f * V_HEIGHT)) + + (z - float{ V_DEPTH } / 2.0) * (z - float{ V_DEPTH } / 2.0) / ((0.2f * V_DEPTH) * (0.2f * V_DEPTH)); return (1.0f - dis); } diff --git a/Modules/Segmentation/LevelSets/test/itkLevelSetFunctionTest.cxx b/Modules/Segmentation/LevelSets/test/itkLevelSetFunctionTest.cxx index 583ae90d78a..dae2906d7d8 100644 --- a/Modules/Segmentation/LevelSets/test/itkLevelSetFunctionTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkLevelSetFunctionTest.cxx @@ -45,8 +45,8 @@ constexpr unsigned int WIDTH = (256); float circle(unsigned int x, unsigned int y) { - float dis = (x - static_cast(WIDTH) / 2.0) * (x - static_cast(WIDTH) / 2.0) + - (y - static_cast(HEIGHT) / 2.0) * (y - static_cast(HEIGHT) / 2.0); + float dis = + (x - float{ WIDTH } / 2.0) * (x - float{ WIDTH } / 2.0) + (y - float{ HEIGHT } / 2.0) * (y - float{ HEIGHT } / 2.0); dis = RADIUS - std::sqrt(dis); return dis; } @@ -55,8 +55,8 @@ circle(unsigned int x, unsigned int y) float square(unsigned int x, unsigned int y) { - const float X = itk::Math::abs(x - static_cast(WIDTH) / 2.0); - const float Y = itk::Math::abs(y - static_cast(HEIGHT) / 2.0); + const float X = itk::Math::abs(x - float{ WIDTH } / 2.0); + const float Y = itk::Math::abs(y - float{ HEIGHT } / 2.0); float dis; if (!((X > RADIUS) && (Y > RADIUS))) { diff --git a/Modules/Segmentation/LevelSets/test/itkNarrowBandThresholdSegmentationLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkNarrowBandThresholdSegmentationLevelSetImageFilterTest.cxx index 5f92a8f610f..911e131602c 100644 --- a/Modules/Segmentation/LevelSets/test/itkNarrowBandThresholdSegmentationLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkNarrowBandThresholdSegmentationLevelSetImageFilterTest.cxx @@ -32,12 +32,10 @@ constexpr int V_DEPTH = 64; float sphere(float x, float y, float z) { - const float dis = (x - static_cast(V_WIDTH) / 2.0) * (x - static_cast(V_WIDTH) / 2.0) / - ((0.2f * V_WIDTH) * (0.2f * V_WIDTH)) + - (y - static_cast(V_HEIGHT) / 2.0) * (y - static_cast(V_HEIGHT) / 2.0) / - ((0.2f * V_HEIGHT) * (0.2f * V_HEIGHT)) + - (z - static_cast(V_DEPTH) / 2.0) * (z - static_cast(V_DEPTH) / 2.0) / - ((0.2f * V_DEPTH) * (0.2f * V_DEPTH)); + const float dis = + (x - float{ V_WIDTH } / 2.0) * (x - float{ V_WIDTH } / 2.0) / ((0.2f * V_WIDTH) * (0.2f * V_WIDTH)) + + (y - float{ V_HEIGHT } / 2.0) * (y - float{ V_HEIGHT } / 2.0) / ((0.2f * V_HEIGHT) * (0.2f * V_HEIGHT)) + + (z - float{ V_DEPTH } / 2.0) * (z - float{ V_DEPTH } / 2.0) / ((0.2f * V_DEPTH) * (0.2f * V_DEPTH)); return (1.0f - dis); } diff --git a/Modules/Segmentation/LevelSets/test/itkParallelSparseFieldLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkParallelSparseFieldLevelSetImageFilterTest.cxx index 91837e8e513..01844d85870 100644 --- a/Modules/Segmentation/LevelSets/test/itkParallelSparseFieldLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkParallelSparseFieldLevelSetImageFilterTest.cxx @@ -48,9 +48,9 @@ constexpr int RADIUS = (std::min(std::min(HEIGHT, WIDTH), DEPTH) / 4); float sphere(unsigned int x, unsigned int y, unsigned int z) { - float dis = (x - static_cast(WIDTH) / 2.0) * (x - static_cast(WIDTH) / 2.0) + - (y - static_cast(HEIGHT) / 2.0) * (y - static_cast(HEIGHT) / 2.0) + - (z - static_cast(DEPTH) / 2.0) * (z - static_cast(DEPTH) / 2.0); + float dis = (x - float{ WIDTH } / 2.0) * (x - float{ WIDTH } / 2.0) + + (y - float{ HEIGHT } / 2.0) * (y - float{ HEIGHT } / 2.0) + + (z - float{ DEPTH } / 2.0) * (z - float{ DEPTH } / 2.0); dis = RADIUS - std::sqrt(dis); return (-dis); } @@ -59,9 +59,9 @@ sphere(unsigned int x, unsigned int y, unsigned int z) float cube(unsigned int x, unsigned int y, unsigned int z) { - const float X = itk::Math::abs(x - static_cast(WIDTH) / 2.0); - const float Y = itk::Math::abs(y - static_cast(HEIGHT) / 2.0); - const float Z = itk::Math::abs(z - static_cast(DEPTH) / 2.0); + const float X = itk::Math::abs(x - float{ WIDTH } / 2.0); + const float Y = itk::Math::abs(y - float{ HEIGHT } / 2.0); + const float Z = itk::Math::abs(z - float{ DEPTH } / 2.0); float dis; if (!((X > RADIUS) && (Y > RADIUS) && (Z > RADIUS))) { diff --git a/Modules/Segmentation/LevelSets/test/itkSparseFieldFourthOrderLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkSparseFieldFourthOrderLevelSetImageFilterTest.cxx index d137ad4bed4..d6a2ee73b77 100644 --- a/Modules/Segmentation/LevelSets/test/itkSparseFieldFourthOrderLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkSparseFieldFourthOrderLevelSetImageFilterTest.cxx @@ -50,8 +50,8 @@ constexpr unsigned int WIDTH = (128); float square(unsigned int x, unsigned int y) { - const float X = itk::Math::abs(x - static_cast(WIDTH) / 2.0); - const float Y = itk::Math::abs(y - static_cast(HEIGHT) / 2.0); + const float X = itk::Math::abs(x - float{ WIDTH } / 2.0); + const float Y = itk::Math::abs(y - float{ HEIGHT } / 2.0); float dis; if (!((X > RADIUS) && (Y > RADIUS))) { diff --git a/Modules/Segmentation/LevelSets/test/itkThresholdSegmentationLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkThresholdSegmentationLevelSetImageFilterTest.cxx index 86add96ac4f..5c5ba9c4a84 100644 --- a/Modules/Segmentation/LevelSets/test/itkThresholdSegmentationLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkThresholdSegmentationLevelSetImageFilterTest.cxx @@ -32,12 +32,10 @@ constexpr int V_DEPTH = 64; float sphere(float x, float y, float z) { - const float dis = (x - static_cast(V_WIDTH) / 2.0) * (x - static_cast(V_WIDTH) / 2.0) / - ((0.2f * V_WIDTH) * (0.2f * V_WIDTH)) + - (y - static_cast(V_HEIGHT) / 2.0) * (y - static_cast(V_HEIGHT) / 2.0) / - ((0.2f * V_HEIGHT) * (0.2f * V_HEIGHT)) + - (z - static_cast(V_DEPTH) / 2.0) * (z - static_cast(V_DEPTH) / 2.0) / - ((0.2f * V_DEPTH) * (0.2f * V_DEPTH)); + const float dis = + (x - float{ V_WIDTH } / 2.0) * (x - float{ V_WIDTH } / 2.0) / ((0.2f * V_WIDTH) * (0.2f * V_WIDTH)) + + (y - float{ V_HEIGHT } / 2.0) * (y - float{ V_HEIGHT } / 2.0) / ((0.2f * V_HEIGHT) * (0.2f * V_HEIGHT)) + + (z - float{ V_DEPTH } / 2.0) * (z - float{ V_DEPTH } / 2.0) / ((0.2f * V_DEPTH) * (0.2f * V_DEPTH)); return (1.0f - dis); } diff --git a/Modules/Segmentation/LevelSets/test/itkUnsharpMaskLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkUnsharpMaskLevelSetImageFilterTest.cxx index 3a5d494d0a4..4f893334cc4 100644 --- a/Modules/Segmentation/LevelSets/test/itkUnsharpMaskLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkUnsharpMaskLevelSetImageFilterTest.cxx @@ -28,8 +28,8 @@ constexpr unsigned int WIDTH = (128); float square(unsigned int x, unsigned int y) { - const float X = itk::Math::abs(x - static_cast(WIDTH) / 2.0); - const float Y = itk::Math::abs(y - static_cast(HEIGHT) / 2.0); + const float X = itk::Math::abs(x - float{ WIDTH } / 2.0); + const float Y = itk::Math::abs(y - float{ HEIGHT } / 2.0); float dis; if (!((X > RADIUS) && (Y > RADIUS))) {