diff --git a/Modules/Bridge/NumPy/include/itkPyBuffer.hxx b/Modules/Bridge/NumPy/include/itkPyBuffer.hxx index 1f9a39afb77..064c3a9d6b5 100644 --- a/Modules/Bridge/NumPy/include/itkPyBuffer.hxx +++ b/Modules/Bridge/NumPy/include/itkPyBuffer.hxx @@ -112,7 +112,7 @@ PyBuffer::_get_image_view_from_contiguous_array(PyObject * arr, PyObject using InternalPixelType = typename TImage::InternalPixelType; using ImporterType = ImportImageContainer; auto importer = ImporterType::New(); - constexpr bool importImageFilterWillOwnTheBuffer = false; + constexpr bool importImageFilterWillOwnTheBuffer{ false }; auto * const data = static_cast(buffer); importer->SetImportPointer(data, numberOfPixels, importImageFilterWillOwnTheBuffer); diff --git a/Modules/Bridge/VtkGlue/test/itkImageToVTKImageFilterRGBTest.cxx b/Modules/Bridge/VtkGlue/test/itkImageToVTKImageFilterRGBTest.cxx index 43e65f2109d..f085ec0d15e 100644 --- a/Modules/Bridge/VtkGlue/test/itkImageToVTKImageFilterRGBTest.cxx +++ b/Modules/Bridge/VtkGlue/test/itkImageToVTKImageFilterRGBTest.cxx @@ -34,7 +34,7 @@ itkImageToVTKImageFilterRGBTest(int argc, char * argv[]) } const char * inputFileName = argv[1]; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelComponentType = unsigned char; using PixelType = itk::RGBPixel; using ImageType = itk::Image; diff --git a/Modules/Bridge/VtkGlue/test/itkImageToVTKImageFilterTest.cxx b/Modules/Bridge/VtkGlue/test/itkImageToVTKImageFilterTest.cxx index 72556d2fc2f..f737ca9b1e2 100644 --- a/Modules/Bridge/VtkGlue/test/itkImageToVTKImageFilterTest.cxx +++ b/Modules/Bridge/VtkGlue/test/itkImageToVTKImageFilterTest.cxx @@ -25,7 +25,7 @@ int itkImageToVTKImageFilterTest(int, char *[]) { - constexpr int dim = 3; + constexpr int dim{ 3 }; using ImageType = itk::Image; using SourceType = itk::RandomImageSource; using SpacingType = SourceType::SpacingType; diff --git a/Modules/Bridge/VtkGlue/test/itkVTKImageToImageFilterTest.cxx b/Modules/Bridge/VtkGlue/test/itkVTKImageToImageFilterTest.cxx index 5f1c3a4b49b..c5ac4badaf1 100644 --- a/Modules/Bridge/VtkGlue/test/itkVTKImageToImageFilterTest.cxx +++ b/Modules/Bridge/VtkGlue/test/itkVTKImageToImageFilterTest.cxx @@ -25,7 +25,7 @@ int itkVTKImageToImageFilterTest(int, char *[]) { - constexpr int dim = 2; + constexpr int dim{ 2 }; using ImageType = itk::Image; using VTKNoiseType = vtkSmartPointer; using ConnectorType = itk::VTKImageToImageFilter; diff --git a/Modules/Bridge/VtkGlue/test/runViewImage.cxx b/Modules/Bridge/VtkGlue/test/runViewImage.cxx index bf3dbba5e49..31d11612a56 100644 --- a/Modules/Bridge/VtkGlue/test/runViewImage.cxx +++ b/Modules/Bridge/VtkGlue/test/runViewImage.cxx @@ -54,7 +54,7 @@ runViewImage(int argc, char * argv[]) } const std::string inputImage = argv[1]; - constexpr unsigned int dimension = 3; + constexpr unsigned int dimension{ 3 }; using PixelType = float; using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; diff --git a/Modules/Core/Common/include/itkBresenhamLine.hxx b/Modules/Core/Common/include/itkBresenhamLine.hxx index 12a8c6a413c..6da54e2aaa9 100644 --- a/Modules/Core/Common/include/itkBresenhamLine.hxx +++ b/Modules/Core/Common/include/itkBresenhamLine.hxx @@ -32,7 +32,7 @@ BresenhamLine::BuildLine(LType Direction, IdentifierType length) -> Direction.Normalize(); // we are going to start at 0 - constexpr IndexType StartIndex = { { 0 } }; + constexpr IndexType StartIndex{ 0 }; IndexType LastIndex; for (unsigned int i = 0; i < VDimension; ++i) { diff --git a/Modules/Core/Common/include/itkDerivativeOperator.h b/Modules/Core/Common/include/itkDerivativeOperator.h index 145e85516a3..496423ce9df 100644 --- a/Modules/Core/Common/include/itkDerivativeOperator.h +++ b/Modules/Core/Common/include/itkDerivativeOperator.h @@ -39,7 +39,7 @@ namespace itk using DerivativeOperatorType = itk::DerivativeOperator; DerivativeOperatorType derivativeOperator; derivativeOperator.SetDirection(0); // X dimension - constexpr auto radius = itk::Size<2>::Filled(1); // A radius of 1 in both dimensions is a 3x3 operator + constexpr auto radius = itk::Size<2>::Filled(1); // A radius of 1 in both dimensions is a 3x3 operator derivativeOperator.CreateToRadius(radius); \endcode * and creates a kernel that looks like: diff --git a/Modules/Core/Common/include/itkGaussianDerivativeOperator.h b/Modules/Core/Common/include/itkGaussianDerivativeOperator.h index 8132f0b1304..be1d66b947c 100644 --- a/Modules/Core/Common/include/itkGaussianDerivativeOperator.h +++ b/Modules/Core/Common/include/itkGaussianDerivativeOperator.h @@ -171,7 +171,7 @@ class ITK_TEMPLATE_EXPORT GaussianDerivativeOperator : public NeighborhoodOperat void SetMaximumError(const double maxerror) { - constexpr double Min = 0.00001; + constexpr double Min{ 0.00001 }; const double Max = 1.0 - Min; m_MaximumError = std::clamp(maxerror, Min, Max); diff --git a/Modules/Core/Common/include/itkGaussianDerivativeOperator.hxx b/Modules/Core/Common/include/itkGaussianDerivativeOperator.hxx index eef227ae43c..583804eab53 100644 --- a/Modules/Core/Common/include/itkGaussianDerivativeOperator.hxx +++ b/Modules/Core/Common/include/itkGaussianDerivativeOperator.hxx @@ -222,7 +222,7 @@ template double GaussianDerivativeOperator::ModifiedBesselI(int n, double y) { - constexpr double DIGITS = 10.0; + constexpr double DIGITS{ 10.0 }; if (n < 2) { diff --git a/Modules/Core/Common/include/itkGaussianOperator.hxx b/Modules/Core/Common/include/itkGaussianOperator.hxx index 0ce5268ae93..5aa580cd3a8 100644 --- a/Modules/Core/Common/include/itkGaussianOperator.hxx +++ b/Modules/Core/Common/include/itkGaussianOperator.hxx @@ -137,7 +137,7 @@ template double GaussianOperator::ModifiedBesselI(int n, double y) { - constexpr double ACCURACY = 40.0; + constexpr double ACCURACY{ 40.0 }; if (n < 2) { diff --git a/Modules/Core/Common/include/itkHexahedronCell.hxx b/Modules/Core/Common/include/itkHexahedronCell.hxx index 315cf04412b..4dc07d8a174 100644 --- a/Modules/Core/Common/include/itkHexahedronCell.hxx +++ b/Modules/Core/Common/include/itkHexahedronCell.hxx @@ -385,7 +385,7 @@ HexahedronCell::EvaluatePosition(CoordinateType * x, fcol[i] -= x[i]; } - constexpr unsigned int HARD_CODED_POINT_DIM = 3; // This variable is used to + constexpr unsigned int HARD_CODED_POINT_DIM{ 3 }; // This variable is used to static_assert(Self::PointDimension3D == HARD_CODED_POINT_DIM, "ERROR: Self::PointDimension3D does not equal HARD_CODED_POINT_DIM (i.e. 3)."); // compute determinants and generate improvements @@ -475,7 +475,7 @@ HexahedronCell::EvaluatePosition(CoordinateType * x, this->InterpolationFunctions(pcoords, weights); - constexpr unsigned int HARD_CODED_WEIGHTS_DIM = 8; + constexpr unsigned int HARD_CODED_WEIGHTS_DIM{ 8 }; static_assert(Self::NumberOfPoints == HARD_CODED_WEIGHTS_DIM, "ERROR: Self::NumberOfPoints does not equal HARD_CODED_WEIGHTS_DIM (i.e. 8)"); if (weight) diff --git a/Modules/Core/Common/include/itkImageIORegion.h b/Modules/Core/Common/include/itkImageIORegion.h index 6fb96b6e8d9..b6e1ba4b798 100644 --- a/Modules/Core/Common/include/itkImageIORegion.h +++ b/Modules/Core/Common/include/itkImageIORegion.h @@ -226,7 +226,7 @@ class ImageIORegionAdaptor // const unsigned int ioDimension = outIORegion.GetImageDimension(); - constexpr unsigned int imageDimension = VDimension; + constexpr unsigned int imageDimension{ VDimension }; const unsigned int minDimension = std::min(ioDimension, imageDimension); @@ -266,7 +266,7 @@ class ImageIORegionAdaptor // ignored. // const unsigned int ioDimension = inIORegion.GetImageDimension(); - constexpr unsigned int imageDimension = VDimension; + constexpr unsigned int imageDimension{ VDimension }; const unsigned int minDimension = std::min(ioDimension, imageDimension); diff --git a/Modules/Core/Common/include/itkImageRegion.h b/Modules/Core/Common/include/itkImageRegion.h index efc457ccf85..88830aca6f6 100644 --- a/Modules/Core/Common/include/itkImageRegion.h +++ b/Modules/Core/Common/include/itkImageRegion.h @@ -288,7 +288,7 @@ class ITK_TEMPLATE_EXPORT ImageRegion final [[nodiscard]] bool IsInside(const ContinuousIndex & index) const { - constexpr TCoordinate half = 0.5; + constexpr TCoordinate half{ 0.5 }; for (unsigned int i = 0; i < ImageDimension; ++i) { // Use negation of tests so that index[i]==NaN leads to returning false. diff --git a/Modules/Core/Common/include/itkIndexRange.h b/Modules/Core/Common/include/itkIndexRange.h index ccbd3753a31..36246cdf814 100644 --- a/Modules/Core/Common/include/itkIndexRange.h +++ b/Modules/Core/Common/include/itkIndexRange.h @@ -39,7 +39,7 @@ namespace itk * * The following example prints all indices of an 2-D grid space of size 2x3. \code - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; const Size size = { {2, 3} }; const ZeroBasedIndexRange indexRange{ size }; diff --git a/Modules/Core/Common/include/itkMacro.h b/Modules/Core/Common/include/itkMacro.h index c5ad81be303..8a410427533 100644 --- a/Modules/Core/Common/include/itkMacro.h +++ b/Modules/Core/Common/include/itkMacro.h @@ -750,7 +750,7 @@ OutputWindowDisplayGenericOutputText(const char * file, unsigned int line, const // the cache lines. By aligning multi-threaded structures with the // cache lines, false shared can be reduced, and performance // increased. -constexpr size_t ITK_CACHE_LINE_ALIGNMENT = 64; +constexpr size_t ITK_CACHE_LINE_ALIGNMENT{ 64 }; // // itkPadStruct will add padding to a structure to ensure a minimum size diff --git a/Modules/Core/Common/include/itkSobelOperator.h b/Modules/Core/Common/include/itkSobelOperator.h index de359cb3472..163fc93271a 100644 --- a/Modules/Core/Common/include/itkSobelOperator.h +++ b/Modules/Core/Common/include/itkSobelOperator.h @@ -35,7 +35,7 @@ namespace itk * 1) Set the direction by calling \code SetDirection \endcode * 2) call \code - constexpr auto radius = itk::Size<2>::Filled(1); + constexpr auto radius = itk::Size<2>::Filled(1); sobelOperator.CreateToRadius(radius); \endcode * 3) You may optionally scale the coefficients of this operator using the diff --git a/Modules/Core/Common/include/itkSobelOperator.hxx b/Modules/Core/Common/include/itkSobelOperator.hxx index 88db75528de..13d9ec14e2e 100644 --- a/Modules/Core/Common/include/itkSobelOperator.hxx +++ b/Modules/Core/Common/include/itkSobelOperator.hxx @@ -83,7 +83,7 @@ auto SobelOperator::GenerateCoefficients() -> CoefficientVector { CoefficientVector coeff; - constexpr std::size_t coeff_size = (VDimension == 2) ? 9 : 27; + constexpr std::size_t coeff_size{ (VDimension == 2) ? 9 : 27 }; coeff.reserve(coeff_size); if (VDimension == 2 && this->GetDirection() == 0) { diff --git a/Modules/Core/Common/include/itkSpatialOrientationAdapter.h b/Modules/Core/Common/include/itkSpatialOrientationAdapter.h index 1b2bbbe07a7..016c3b4c606 100644 --- a/Modules/Core/Common/include/itkSpatialOrientationAdapter.h +++ b/Modules/Core/Common/include/itkSpatialOrientationAdapter.h @@ -41,7 +41,7 @@ namespace Function inline unsigned Max3(double x, double y, double z) { - constexpr double obliquityThresholdCosineValue = 0.001; + constexpr double obliquityThresholdCosineValue{ 0.001 }; const double absX = itk::Math::abs(x); const double absY = itk::Math::abs(y); diff --git a/Modules/Core/Common/include/itkSymmetricEigenAnalysis.hxx b/Modules/Core/Common/include/itkSymmetricEigenAnalysis.hxx index d75dd968ca9..ae9f1f611d3 100644 --- a/Modules/Core/Common/include/itkSymmetricEigenAnalysis.hxx +++ b/Modules/Core/Common/include/itkSymmetricEigenAnalysis.hxx @@ -401,7 +401,7 @@ template unsigned int SymmetricEigenAnalysis::ComputeEigenValuesUsingQL(double * d, double * e) const { - constexpr double c_b10 = 1.0; + constexpr double c_b10{ 1.0 }; // Local variables unsigned int ierr = 0; @@ -545,7 +545,7 @@ SymmetricEigenAnalysis::ComputeEigenValuesAndVec double * e, double * z) const { - constexpr double c_b10 = 1.0; + constexpr double c_b10{ 1.0 }; if (m_Order == 1) { return 1; diff --git a/Modules/Core/Common/include/itkThreadSupport.h b/Modules/Core/Common/include/itkThreadSupport.h index d5dbf1d5934..710aa37551f 100644 --- a/Modules/Core/Common/include/itkThreadSupport.h +++ b/Modules/Core/Common/include/itkThreadSupport.h @@ -36,22 +36,22 @@ namespace itk */ /** @ITKStartGrouping */ #if defined(ITK_USE_PTHREADS) -constexpr size_t ITK_MAX_THREADS = ITK_DEFAULT_MAX_THREADS; +constexpr size_t ITK_MAX_THREADS{ ITK_DEFAULT_MAX_THREADS }; using MutexType = pthread_mutex_t; using FastMutexType = pthread_mutex_t; using ThreadFunctionType = void * (*)(void *); using ThreadProcessIdType = pthread_t; # if !defined(ITK_FUTURE_LEGACY_REMOVE) -constexpr ThreadProcessIdType ITK_DEFAULT_THREAD_ID = {}; +constexpr ThreadProcessIdType ITK_DEFAULT_THREAD_ID{}; # endif using ITK_THREAD_RETURN_TYPE = void *; /** @ITKEndGrouping */ -constexpr ITK_THREAD_RETURN_TYPE ITK_THREAD_RETURN_DEFAULT_VALUE = nullptr; +constexpr ITK_THREAD_RETURN_TYPE ITK_THREAD_RETURN_DEFAULT_VALUE{ nullptr }; using itk::ITK_THREAD_RETURN_DEFAULT_VALUE; // We need this out of the itk namespace for #define to work below using ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION = itk::ITK_THREAD_RETURN_TYPE; #elif defined(ITK_USE_WIN32_THREADS) -constexpr size_t ITK_MAX_THREADS = ITK_DEFAULT_MAX_THREADS; +constexpr size_t ITK_MAX_THREADS{ ITK_DEFAULT_MAX_THREADS }; using MutexType = HANDLE; using FastMutexType = CRITICAL_SECTION; using ThreadFunctionType = unsigned int(__stdcall *)(void *); @@ -60,19 +60,19 @@ using ThreadProcessIdType = HANDLE; static const ThreadProcessIdType ITK_DEFAULT_THREAD_ID = INVALID_HANDLE_VALUE; # endif using ITK_THREAD_RETURN_TYPE = unsigned int; -constexpr ITK_THREAD_RETURN_TYPE ITK_THREAD_RETURN_DEFAULT_VALUE = 0; +constexpr ITK_THREAD_RETURN_TYPE ITK_THREAD_RETURN_DEFAULT_VALUE{ 0 }; // WINAPI expands to __stdcall which specifies a function call convention and has little no meaning on variable // declarations # define ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION itk::ITK_THREAD_RETURN_TYPE __stdcall #else -constexpr size_t ITK_MAX_THREADS = 1; +constexpr size_t ITK_MAX_THREADS{ 1 }; using MutexType = int; using FastMutexType = int; using ThreadFunctionType = void (*)(void *); using ThreadProcessIdType = int; # if !defined(ITK_FUTURE_LEGACY_REMOVE) -constexpr ThreadProcessIdType ITK_DEFAULT_THREAD_ID = 0; +constexpr ThreadProcessIdType ITK_DEFAULT_THREAD_ID{ 0 }; # endif using ITK_THREAD_RETURN_TYPE = void; # define ITK_THREAD_RETURN_DEFAULT_VALUE diff --git a/Modules/Core/Common/include/itkTriangleCell.hxx b/Modules/Core/Common/include/itkTriangleCell.hxx index bb3f8f6510a..af1518cf29c 100644 --- a/Modules/Core/Common/include/itkTriangleCell.hxx +++ b/Modules/Core/Common/include/itkTriangleCell.hxx @@ -420,7 +420,7 @@ TriangleCell::EvaluatePosition(CoordinateType * x, // Test if the projected point is inside the cell. // Zero with epsilon - constexpr double zwe = -NumericTraits::min(); + constexpr double zwe{ -NumericTraits::min() }; // Since the three barycentric coordinates are interdependent // only three tests should be necessary. That is, we only need diff --git a/Modules/Core/Common/include/itkVersor.hxx b/Modules/Core/Common/include/itkVersor.hxx index f1fb4caa927..9364c51896d 100644 --- a/Modules/Core/Common/include/itkVersor.hxx +++ b/Modules/Core/Common/include/itkVersor.hxx @@ -112,7 +112,7 @@ Versor::operator==(const Self & v) const const typename itk::NumericTraits::AccumulateType square = ratio.m_W * ratio.m_W; - constexpr double epsilon = 1e-300; + constexpr double epsilon{ 1e-300 }; if (itk::Math::abs(1.0f - square) < epsilon) { diff --git a/Modules/Core/Common/src/itkIndent.cxx b/Modules/Core/Common/src/itkIndent.cxx index 4ef7b089045..ba69a4ed328 100644 --- a/Modules/Core/Common/src/itkIndent.cxx +++ b/Modules/Core/Common/src/itkIndent.cxx @@ -27,8 +27,8 @@ *=========================================================================*/ #include "itkObjectFactory.h" -constexpr int ITK_STD_INDENT = 2; -constexpr int ITK_NUMBER_OF_BLANKS = 40; +constexpr int ITK_STD_INDENT{ 2 }; +constexpr int ITK_NUMBER_OF_BLANKS{ 40 }; namespace itk { diff --git a/Modules/Core/Common/src/itkMemoryUsageObserver.cxx b/Modules/Core/Common/src/itkMemoryUsageObserver.cxx index 9f273fc530f..63f41f6babe 100644 --- a/Modules/Core/Common/src/itkMemoryUsageObserver.cxx +++ b/Modules/Core/Common/src/itkMemoryUsageObserver.cxx @@ -428,7 +428,7 @@ SysResourceMemoryUsageObserver::GetMemoryUsage() // Maybe use getrusage() ?? rusage resourceInfo; - constexpr int who = RUSAGE_SELF; + constexpr int who{ RUSAGE_SELF }; if (getrusage(who, &resourceInfo) == 0) { return static_cast(resourceInfo.ru_ixrss); diff --git a/Modules/Core/Common/src/itkMersenneTwisterRandomVariateGenerator.cxx b/Modules/Core/Common/src/itkMersenneTwisterRandomVariateGenerator.cxx index ef0720e0a1a..b643751799b 100644 --- a/Modules/Core/Common/src/itkMersenneTwisterRandomVariateGenerator.cxx +++ b/Modules/Core/Common/src/itkMersenneTwisterRandomVariateGenerator.cxx @@ -203,7 +203,7 @@ MersenneTwisterRandomVariateGenerator::reload() static constexpr unsigned int M = 397; // get rid of VS warning - constexpr auto index = int{ M } - int{ StateVectorLength }; + constexpr int index{ int{ M } - int{ StateVectorLength } }; IntegerType * p = m_State; diff --git a/Modules/Core/Common/src/itkObjectFactoryBase.cxx b/Modules/Core/Common/src/itkObjectFactoryBase.cxx index 59e2f482473..45b4f51d7c1 100644 --- a/Modules/Core/Common/src/itkObjectFactoryBase.cxx +++ b/Modules/Core/Common/src/itkObjectFactoryBase.cxx @@ -321,7 +321,7 @@ CreateFullPath(const char * path, const char * file) # ifdef _WIN32 const char sep = '\\'; # else - constexpr char sep = '/'; + constexpr char sep{ '/' }; # endif /** * make sure the end of path is a separator @@ -510,7 +510,7 @@ ObjectFactoryBase::RegisterFactory(ObjectFactoryBase * factory, InsertionPositio if (factory->m_LibraryHandle == nullptr) { - constexpr char nonDynamicName[] = "Non-Dynamicaly loaded factory"; + constexpr char nonDynamicName[]{ "Non-Dynamicaly loaded factory" }; factory->m_LibraryPath = nonDynamicName; } else diff --git a/Modules/Core/Common/src/itkProcessObject.cxx b/Modules/Core/Common/src/itkProcessObject.cxx index 8223b0998bc..d6273a0377d 100644 --- a/Modules/Core/Common/src/itkProcessObject.cxx +++ b/Modules/Core/Common/src/itkProcessObject.cxx @@ -39,11 +39,11 @@ namespace itk namespace { // local namespace for managing globals -constexpr size_t ITK_GLOBAL_INDEX_NAMES_NUMBER = 10; -constexpr size_t ITK_GLOBAL_INDEX_NAMES_LENGTH = 3; -constexpr char globalIndexNames[ITK_GLOBAL_INDEX_NAMES_NUMBER][ITK_GLOBAL_INDEX_NAMES_LENGTH] = { - "_0", "_1", "_2", "_3", "_4", "_5", "_6", "_7", "_8", "_9" -}; +constexpr size_t ITK_GLOBAL_INDEX_NAMES_NUMBER{ 10 }; +constexpr size_t ITK_GLOBAL_INDEX_NAMES_LENGTH{ 3 }; +constexpr char globalIndexNames[ITK_GLOBAL_INDEX_NAMES_NUMBER][ITK_GLOBAL_INDEX_NAMES_LENGTH]{ "_0", "_1", "_2", "_3", + "_4", "_5", "_6", "_7", + "_8", "_9" }; } // namespace diff --git a/Modules/Core/Common/src/itkWin32OutputWindow.cxx b/Modules/Core/Common/src/itkWin32OutputWindow.cxx index 9e151d3ffc6..217c0f81565 100644 --- a/Modules/Core/Common/src/itkWin32OutputWindow.cxx +++ b/Modules/Core/Common/src/itkWin32OutputWindow.cxx @@ -208,7 +208,7 @@ Win32OutputWindow::Initialize() lpParam.hInstance, // handle to application instance &lpParam // pointer to window-creation data ); - constexpr int maxsize = 5242880; + constexpr int maxsize{ 5242880 }; SendMessage(Win32OutputWindow::m_OutputWindow, EM_LIMITTEXT, maxsize, 0L); diff --git a/Modules/Core/Common/test/VNLSparseLUSolverTraitsTest.cxx b/Modules/Core/Common/test/VNLSparseLUSolverTraitsTest.cxx index 7a3ba7537a9..76286a784a4 100644 --- a/Modules/Core/Common/test/VNLSparseLUSolverTraitsTest.cxx +++ b/Modules/Core/Common/test/VNLSparseLUSolverTraitsTest.cxx @@ -59,7 +59,7 @@ VNLSparseLUSolverTraitsTest(int, char *[]) /** * Build the linear system to solve */ - constexpr unsigned int N = 3; + constexpr unsigned int N{ 3 }; VectorType Bx = SolverTraits::InitializeVector(N); Bx.fill(0.); Bx[0] = 2.1; @@ -86,7 +86,7 @@ VNLSparseLUSolverTraitsTest(int, char *[]) /** * Define the tolerance and expected results */ - constexpr CoordinateType tolerance = 1e-9; + constexpr CoordinateType tolerance{ 1e-9 }; VectorType Xexpected(N); Xexpected(0) = 1.575; diff --git a/Modules/Core/Common/test/itkAbortProcessObjectTest.cxx b/Modules/Core/Common/test/itkAbortProcessObjectTest.cxx index 253c52d01c2..5777c136dfc 100644 --- a/Modules/Core/Common/test/itkAbortProcessObjectTest.cxx +++ b/Modules/Core/Common/test/itkAbortProcessObjectTest.cxx @@ -64,8 +64,8 @@ itkAbortProcessObjectTest(int, char *[]) auto img = ShortImage::New(); // fill in an image - constexpr ShortImage::IndexType index = { { 0, 0 } }; - constexpr ShortImage::SizeType size = { { 100, 100 } }; + constexpr ShortImage::IndexType index{ 0, 0 }; + constexpr ShortImage::SizeType size{ 100, 100 }; const ShortImage::RegionType region{ index, size }; img->SetRegions(region); img->Allocate(); @@ -85,8 +85,8 @@ itkAbortProcessObjectTest(int, char *[]) extract->SetInput(img); // fill in an image - constexpr ShortImage::IndexType extractIndex = { { 0, 0 } }; - constexpr ShortImage::SizeType extractSize = { { 99, 99 } }; + constexpr ShortImage::IndexType extractIndex{ 0, 0 }; + constexpr ShortImage::SizeType extractSize{ 99, 99 }; const ShortImage::RegionType extractRegion{ extractIndex, extractSize }; extract->SetExtractionRegion(extractRegion); diff --git a/Modules/Core/Common/test/itkAdaptorComparisonTest.cxx b/Modules/Core/Common/test/itkAdaptorComparisonTest.cxx index 403148d7677..a011370ea76 100644 --- a/Modules/Core/Common/test/itkAdaptorComparisonTest.cxx +++ b/Modules/Core/Common/test/itkAdaptorComparisonTest.cxx @@ -84,7 +84,7 @@ BypassAdaptorSupportModifyScalars(itk::Image * img) void AdaptorSupportedModifyVectors(itk::Image, 3> * img) { - constexpr unsigned int N = 3; + constexpr unsigned int N{ 3 }; using VectorType = itk::Vector; itk::ImageRegionIteratorWithIndex> it(img, img->GetRequestedRegion()); @@ -105,7 +105,7 @@ AdaptorSupportedModifyVectors(itk::Image, 3> * img) void NoAdaptorSupportModifyVectors(itk::Image, 3> * img) { - constexpr unsigned int N = 3; + constexpr unsigned int N{ 3 }; using VectorType = itk::Vector; itk::ImageRegionIterator> it(img, img->GetRequestedRegion()); @@ -127,7 +127,7 @@ NoAdaptorSupportModifyVectors(itk::Image, 3> * img) void BypassAdaptorSupportModifyVectors(itk::Image, 3> * img) { - constexpr unsigned int N = 3; + constexpr unsigned int N{ 3 }; using VectorType = itk::Vector; itk::ImageRegionIteratorWithIndex> it(img, img->GetRequestedRegion()); @@ -147,7 +147,7 @@ BypassAdaptorSupportModifyVectors(itk::Image, 3> * img) void BypassNoAdaptorSupportModifyVectors(itk::Image, 3> * img) { - constexpr unsigned int N = 3; + constexpr unsigned int N{ 3 }; using VectorType = itk::Vector; itk::ImageRegionIterator> it(img, img->GetRequestedRegion()); diff --git a/Modules/Core/Common/test/itkAggregateTypesGTest.cxx b/Modules/Core/Common/test/itkAggregateTypesGTest.cxx index 299f44e71cd..92f937e02eb 100644 --- a/Modules/Core/Common/test/itkAggregateTypesGTest.cxx +++ b/Modules/Core/Common/test/itkAggregateTypesGTest.cxx @@ -329,16 +329,16 @@ TEST(Specialized, Index) using IndexType = itk::Index<4>; - constexpr IndexType zeroBasis = { { 1, 0, 0, 0 } }; - constexpr IndexType oneBasis = { { 0, 1, 0, 0 } }; - constexpr IndexType twoBasis = { { 0, 0, 1, 0 } }; - constexpr IndexType threeBasis = { { 0, 0, 0, 1 } }; + constexpr IndexType zeroBasis{ 1, 0, 0, 0 }; + constexpr IndexType oneBasis{ 0, 1, 0, 0 }; + constexpr IndexType twoBasis{ 0, 0, 1, 0 }; + constexpr IndexType threeBasis{ 0, 0, 0, 1 }; ITK_EXPECT_VECTOR_NEAR(IndexType::GetBasisIndex(0), zeroBasis, 0); ITK_EXPECT_VECTOR_NEAR(IndexType::GetBasisIndex(1), oneBasis, 0); ITK_EXPECT_VECTOR_NEAR(IndexType::GetBasisIndex(2), twoBasis, 0); ITK_EXPECT_VECTOR_NEAR(IndexType::GetBasisIndex(3), threeBasis, 0); - constexpr IndexType known3s{ { 3, 3, 3, 3 } }; + constexpr IndexType known3s{ 3, 3, 3, 3 }; IndexType threes; IndexType::IndexValueType raw3s[4] = { 3, 3, 3, 3 }; threes.SetIndex(raw3s); @@ -353,18 +353,18 @@ TEST(Specialized, Offset) using OffsetType = itk::Offset<4>; - constexpr OffsetType zeroBasis = { { 1, 0, 0, 0 } }; - constexpr OffsetType oneBasis = { { 0, 1, 0, 0 } }; - constexpr OffsetType twoBasis = { { 0, 0, 1, 0 } }; - constexpr OffsetType threeBasis = { { 0, 0, 0, 1 } }; + constexpr OffsetType zeroBasis{ 1, 0, 0, 0 }; + constexpr OffsetType oneBasis{ 0, 1, 0, 0 }; + constexpr OffsetType twoBasis{ 0, 0, 1, 0 }; + constexpr OffsetType threeBasis{ 0, 0, 0, 1 }; ITK_EXPECT_VECTOR_NEAR(OffsetType::GetBasisOffset(0), zeroBasis, 0); ITK_EXPECT_VECTOR_NEAR(OffsetType::GetBasisOffset(1), oneBasis, 0); ITK_EXPECT_VECTOR_NEAR(OffsetType::GetBasisOffset(2), twoBasis, 0); ITK_EXPECT_VECTOR_NEAR(OffsetType::GetBasisOffset(3), threeBasis, 0); - constexpr OffsetType known3s{ { 3, 3, 3, 3 } }; + constexpr OffsetType known3s{ 3, 3, 3, 3 }; OffsetType threes; - constexpr OffsetType::OffsetValueType raw3s[4] = { 3, 3, 3, 3 }; + constexpr OffsetType::OffsetValueType raw3s[4]{ 3, 3, 3, 3 }; threes.SetOffset(raw3s); ITK_EXPECT_VECTOR_NEAR(threes, known3s, 0); } @@ -375,9 +375,9 @@ TEST(Specialized, Size) EXPECT_EQ(itk::Size<7>::GetSizeDimension(), 7); using SizeType = itk::Size<4>; - constexpr SizeType known3s{ { 3, 3, 3, 3 } }; + constexpr SizeType known3s{ 3, 3, 3, 3 }; SizeType threes; - constexpr SizeType::SizeValueType raw3s[4] = { 3, 3, 3, 3 }; + constexpr SizeType::SizeValueType raw3s[4]{ 3, 3, 3, 3 }; threes.SetSize(raw3s); ITK_EXPECT_VECTOR_NEAR(threes, known3s, 0); } diff --git a/Modules/Core/Common/test/itkAnatomicalOrientationGTest.cxx b/Modules/Core/Common/test/itkAnatomicalOrientationGTest.cxx index 104005bc15c..1a74b04dad0 100644 --- a/Modules/Core/Common/test/itkAnatomicalOrientationGTest.cxx +++ b/Modules/Core/Common/test/itkAnatomicalOrientationGTest.cxx @@ -168,9 +168,9 @@ TEST(AnatomicalOrientation, ConvertDirectionToPositiveEnum) d(0, 2) = 1; EXPECT_EQ(OE::SPL, AnatomicalOrientation(d)); - constexpr itk::SpacePrecisionType data[] = { 0.5986634407395047, 0.22716302314740483, -0.768113953548866, - 0.5627936241740271, 0.563067040943212, 0.6051601804419384, - 0.5699696670095713, -0.794576911518317, 0.20924175102261847 }; + constexpr itk::SpacePrecisionType data[]{ 0.5986634407395047, 0.22716302314740483, -0.768113953548866, + 0.5627936241740271, 0.563067040943212, 0.6051601804419384, + 0.5699696670095713, -0.794576911518317, 0.20924175102261847 }; const ImageType::DirectionType::InternalMatrixType m{ data }; d.GetVnlMatrix() = m; EXPECT_EQ(OE::PIR, AnatomicalOrientation(d)); @@ -243,7 +243,7 @@ TEST(AntomicalOrientation, ToFromEnumInteroperability) EXPECT_EQ(itk_rai, itk::AnatomicalOrientation(OE::LPS)); EXPECT_EQ(itk_rai.GetAsPositiveOrientation(), OE::LPS); EXPECT_EQ(itk_rai.GetAsPositiveStringEncoding(), "LPS"); - constexpr std::array expected_terms = { { CE::RightToLeft, CE::AnteriorToPosterior, CE::InferiorToSuperior } }; + constexpr std::array expected_terms{ { CE::RightToLeft, CE::AnteriorToPosterior, CE::InferiorToSuperior } }; EXPECT_EQ(itk_rai.GetTerms(), expected_terms); } diff --git a/Modules/Core/Common/test/itkAnnulusOperatorTest.cxx b/Modules/Core/Common/test/itkAnnulusOperatorTest.cxx index 31155af9ca7..e079850adcd 100644 --- a/Modules/Core/Common/test/itkAnnulusOperatorTest.cxx +++ b/Modules/Core/Common/test/itkAnnulusOperatorTest.cxx @@ -28,7 +28,7 @@ itkAnnulusOperatorTest(int, char *[]) // scope. const itk::StdStreamStateSave coutState(std::cout); - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using OperatorType = itk::AnnulusOperator; @@ -41,7 +41,7 @@ itkAnnulusOperatorTest(int, char *[]) normalizedAnnulus.SetInnerRadius(3); normalizedAnnulus.SetThickness(2); - constexpr bool brightCenter = false; + constexpr bool brightCenter{ false }; ITK_TEST_SET_GET_BOOLEAN((&normalizedAnnulus), BrightCenter, brightCenter); try @@ -107,26 +107,26 @@ itkAnnulusOperatorTest(int, char *[]) std::cout << "Creating an annulus by specifying values"; OperatorType annulus; - constexpr bool normalize = false; + constexpr bool normalize{ false }; ITK_TEST_SET_GET_BOOLEAN((&annulus), Normalize, normalize); - constexpr double innerRadius = 2; + constexpr double innerRadius{ 2 }; annulus.SetInnerRadius(innerRadius); ITK_TEST_SET_GET_VALUE(innerRadius, annulus.GetInnerRadius()); - constexpr double thickness = 1; + constexpr double thickness{ 1 }; annulus.SetThickness(thickness); ITK_TEST_SET_GET_VALUE(thickness, annulus.GetThickness()); - constexpr typename OperatorType::PixelType exteriorValue = 1; + constexpr typename OperatorType::PixelType exteriorValue{ 1 }; annulus.SetExteriorValue(exteriorValue); ITK_TEST_SET_GET_VALUE(exteriorValue, annulus.GetExteriorValue()); - constexpr typename OperatorType::PixelType annulusValue = 8; + constexpr typename OperatorType::PixelType annulusValue{ 8 }; annulus.SetAnnulusValue(annulusValue); ITK_TEST_SET_GET_VALUE(annulusValue, annulus.GetAnnulusValue()); - constexpr typename OperatorType::PixelType interiorValue = 4; + constexpr typename OperatorType::PixelType interiorValue{ 4 }; annulus.SetInteriorValue(interiorValue); ITK_TEST_SET_GET_VALUE(interiorValue, annulus.GetInteriorValue()); diff --git a/Modules/Core/Common/test/itkArray2DTest.cxx b/Modules/Core/Common/test/itkArray2DTest.cxx index 4b1f531a5a8..fee32df50b7 100644 --- a/Modules/Core/Common/test/itkArray2DTest.cxx +++ b/Modules/Core/Common/test/itkArray2DTest.cxx @@ -28,8 +28,8 @@ itkArray2DTest(int, char *[]) using VnlMatrixType = vnl_matrix; - constexpr unsigned int rows = 3; - constexpr unsigned int cols = 4; + constexpr unsigned int rows{ 3 }; + constexpr unsigned int cols{ 4 }; ArrayType a(rows, cols); VnlMatrixType vm(rows, cols); @@ -44,7 +44,7 @@ itkArray2DTest(int, char *[]) } } - constexpr double tolerance = 1e-6; + constexpr double tolerance{ 1e-6 }; // test copy constructor ArrayType b(a); diff --git a/Modules/Core/Common/test/itkArrayTest.cxx b/Modules/Core/Common/test/itkArrayTest.cxx index 4ad5b558949..a862f85b311 100644 --- a/Modules/Core/Common/test/itkArrayTest.cxx +++ b/Modules/Core/Common/test/itkArrayTest.cxx @@ -50,7 +50,7 @@ itkArrayTest(int, char *[]) // // Create an itk::Array which does not manage its own memory // - constexpr unsigned int n = 7; + constexpr unsigned int n{ 7 }; float buffer[n]; FloatArrayType notMyOwnBoss; notMyOwnBoss.SetSize(n); @@ -101,7 +101,7 @@ itkArrayTest(int, char *[]) // Test the case where we construct an array that points // to a user allocated buffer where the user wants to // maintain responsibility for deleting the array. - constexpr size_t testSizeForArraySetDataSameSize = 10; + constexpr size_t testSizeForArraySetDataSameSize{ 10 }; FloatArrayType objectToCopy(testSizeForArraySetDataSameSize); auto * data = new float[testSizeForArraySetDataSameSize]; objectToCopy.SetDataSameSize(data); // This implicitly means LetArrayManageMemory=false diff --git a/Modules/Core/Common/test/itkAtanRegularizedHeavisideStepFunctionTest1.cxx b/Modules/Core/Common/test/itkAtanRegularizedHeavisideStepFunctionTest1.cxx index 2ce0e8a28f4..775e5ebaa00 100644 --- a/Modules/Core/Common/test/itkAtanRegularizedHeavisideStepFunctionTest1.cxx +++ b/Modules/Core/Common/test/itkAtanRegularizedHeavisideStepFunctionTest1.cxx @@ -32,26 +32,26 @@ itkAtanRegularizedHeavisideStepFunctionTest1(int, char *[]) std::cout << "GetNameOfClass() = " << functionBase0->GetNameOfClass() << std::endl; functionBase0->Print(std::cout); - constexpr double epsilon = -1.0; + constexpr double epsilon{ -1.0 }; ITK_TRY_EXPECT_EXCEPTION(functionBase0->SetEpsilon(epsilon)); - constexpr double epsilon0 = 1.0; - constexpr double epsilon1 = 1e-4; + constexpr double epsilon0{ 1.0 }; + constexpr double epsilon1{ 1e-4 }; ITK_TEST_SET_GET_VALUE(epsilon0, functionBase0->GetEpsilon()); functionBase0->SetEpsilon(epsilon1); ITK_TEST_SET_GET_VALUE(epsilon1, functionBase0->GetEpsilon()); - constexpr double epsilon2 = 0.5; + constexpr double epsilon2{ 0.5 }; functionBase0->SetEpsilon(epsilon2); - constexpr int minValue = -20; - constexpr int maxValue = 20; + constexpr int minValue{ -20 }; + constexpr int maxValue{ 20 }; - constexpr InputType incValue = 0.1; + constexpr InputType incValue{ 0.1 }; for (int x = minValue; x < maxValue; ++x) { diff --git a/Modules/Core/Common/test/itkBSplineInterpolationWeightFunctionTest.cxx b/Modules/Core/Common/test/itkBSplineInterpolationWeightFunctionTest.cxx index 8f00440a270..c9c1cab95f6 100644 --- a/Modules/Core/Common/test/itkBSplineInterpolationWeightFunctionTest.cxx +++ b/Modules/Core/Common/test/itkBSplineInterpolationWeightFunctionTest.cxx @@ -46,8 +46,8 @@ itkBSplineInterpolationWeightFunctionTest(int, char *[]) { // Creating a local scope using CoordinateType = double; - constexpr unsigned int SpaceDimension = 1; - constexpr unsigned int SplineOrder = 2; + constexpr unsigned int SpaceDimension{ 1 }; + constexpr unsigned int SplineOrder{ 2 }; std::cout << "Testing SpaceDimension= " << SpaceDimension; std::cout << " and SplineOrder= " << SplineOrder << std::endl; @@ -92,12 +92,12 @@ itkBSplineInterpolationWeightFunctionTest(int, char *[]) function->Evaluate(position1, weights1, startIndex1); function->Evaluate(position2, weights2, startIndex2); - constexpr unsigned int numberOfWeigts = weights1.size(); + constexpr unsigned int numberOfWeigts{ weights1.size() }; const int indexDifference = itk::Math::abs(startIndex2[0] + startIndex1[0]) & 1; - constexpr double tolerance = 1e-6; + constexpr double tolerance{ 1e-6 }; bool symmetryForXBroken = false; for (unsigned int nw = 0; nw < numberOfWeigts - indexDifference; ++nw) @@ -146,8 +146,8 @@ itkBSplineInterpolationWeightFunctionTest(int, char *[]) } { // Creating a local scope using CoordinateType = double; - constexpr unsigned int SpaceDimension = 1; - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int SpaceDimension{ 1 }; + constexpr unsigned int SplineOrder{ 3 }; std::cout << "Testing SpaceDimension= " << SpaceDimension; std::cout << " and SplineOrder= " << SplineOrder << std::endl; @@ -180,12 +180,12 @@ itkBSplineInterpolationWeightFunctionTest(int, char *[]) function->Evaluate(position1, weights1, startIndex1); function->Evaluate(position2, weights2, startIndex2); - constexpr unsigned int numberOfWeigts = weights1.size(); + constexpr unsigned int numberOfWeigts{ weights1.size() }; const int indexDifference = itk::Math::abs(startIndex2[0] + startIndex1[0] + 1) & 1; - constexpr double tolerance = 1e-6; + constexpr double tolerance{ 1e-6 }; bool symmetryForXBroken = false; for (unsigned int nw = 0; nw < numberOfWeigts - indexDifference; ++nw) @@ -235,8 +235,8 @@ itkBSplineInterpolationWeightFunctionTest(int, char *[]) { // Creating a local scope using CoordinateType = double; - constexpr unsigned int SpaceDimension = 3; - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int SpaceDimension{ 3 }; + constexpr unsigned int SplineOrder{ 3 }; std::cout << "Testing SpaceDimension= " << SpaceDimension; std::cout << " and SplineOrder= " << SplineOrder << std::endl; @@ -249,8 +249,8 @@ itkBSplineInterpolationWeightFunctionTest(int, char *[]) auto function = FunctionType::New(); function->Print(std::cout); - constexpr SizeType size = FunctionType::SupportSize; - constexpr unsigned long numberOfWeights = FunctionType::NumberOfWeights; + constexpr SizeType size{ FunctionType::SupportSize }; + constexpr unsigned long numberOfWeights{ FunctionType::NumberOfWeights }; std::cout << "Number Of Weights: " << numberOfWeights << std::endl; diff --git a/Modules/Core/Common/test/itkBSplineKernelFunctionTest.cxx b/Modules/Core/Common/test/itkBSplineKernelFunctionTest.cxx index 257756479f6..323168f0176 100644 --- a/Modules/Core/Common/test/itkBSplineKernelFunctionTest.cxx +++ b/Modules/Core/Common/test/itkBSplineKernelFunctionTest.cxx @@ -25,37 +25,37 @@ itkBSplineKernelFunctionTest(int, char *[]) { // Externally generated results - constexpr unsigned int npoints = 49; - - constexpr double x[npoints] = { -3, -2.875, -2.75, -2.625, -2.5, -2.375, -2.25, -2.125, -2, -1.875, - -1.75, -1.625, -1.5, -1.375, -1.25, -1.125, -1, -0.875, -0.75, -0.625, - -0.5, -0.375, -0.25, -0.125, 0, 0.125, 0.25, 0.375, 0.5, 0.625, - 0.75, 0.875, 1, 1.125, 1.25, 1.375, 1.5, 1.625, 1.75, 1.875, - 2, 2.125, 2.25, 2.375, 2.5, 2.625, 2.75, 2.875, 3 }; - - constexpr double b0[npoints] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 1, 1, 1, 1, - 1, 1, 1, 0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - - constexpr double b1[npoints] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1, 0.875, - 0.75, 0.625, 0.5, 0.375, 0.25, 0.125, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - - constexpr double b2[npoints] = { 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0.0078125, - 0.03125, 0.0703125, 0.125, 0.195313, 0.28125, 0.382813, 0.5, - 0.609375, 0.6875, 0.734375, 0.75, 0.734375, 0.6875, 0.609375, - 0.5, 0.382813, 0.28125, 0.195313, 0.125, 0.0703125, 0.03125, - 0.0078125, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0 }; - - constexpr double b3[npoints] = { 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0.000325521, 0.00260417, 0.00878906, 0.0208333, 0.0406901, - 0.0703125, 0.111654, 0.166667, 0.236003, 0.315104, 0.398112, 0.479167, - 0.552409, 0.611979, 0.652018, 0.666667, 0.652018, 0.611979, 0.552409, - 0.479167, 0.398112, 0.315104, 0.236003, 0.166667, 0.111654, 0.0703125, - 0.0406901, 0.0208333, 0.00878906, 0.00260417, 0.000325521, 0, 0, - 0, 0, 0, 0, 0, 0, 0 }; + constexpr unsigned int npoints{ 49 }; + + constexpr double x[npoints]{ -3, -2.875, -2.75, -2.625, -2.5, -2.375, -2.25, -2.125, -2, -1.875, + -1.75, -1.625, -1.5, -1.375, -1.25, -1.125, -1, -0.875, -0.75, -0.625, + -0.5, -0.375, -0.25, -0.125, 0, 0.125, 0.25, 0.375, 0.5, 0.625, + 0.75, 0.875, 1, 1.125, 1.25, 1.375, 1.5, 1.625, 1.75, 1.875, + 2, 2.125, 2.25, 2.375, 2.5, 2.625, 2.75, 2.875, 3 }; + + constexpr double b0[npoints]{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 1, 1, 1, 1, + 1, 1, 1, 0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + + constexpr double b1[npoints]{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1, 0.875, + 0.75, 0.625, 0.5, 0.375, 0.25, 0.125, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + + constexpr double b2[npoints]{ 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0.0078125, + 0.03125, 0.0703125, 0.125, 0.195313, 0.28125, 0.382813, 0.5, + 0.609375, 0.6875, 0.734375, 0.75, 0.734375, 0.6875, 0.609375, + 0.5, 0.382813, 0.28125, 0.195313, 0.125, 0.0703125, 0.03125, + 0.0078125, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0 }; + + constexpr double b3[npoints]{ 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0.000325521, 0.00260417, 0.00878906, 0.0208333, 0.0406901, + 0.0703125, 0.111654, 0.166667, 0.236003, 0.315104, 0.398112, 0.479167, + 0.552409, 0.611979, 0.652018, 0.666667, 0.652018, 0.611979, 0.552409, + 0.479167, 0.398112, 0.315104, 0.236003, 0.166667, 0.111654, 0.0703125, + 0.0406901, 0.0208333, 0.00878906, 0.00260417, 0.000325521, 0, 0, + 0, 0, 0, 0, 0, 0, 0 }; // Testing the output of BSplineKernelFunction @@ -65,7 +65,7 @@ itkBSplineKernelFunctionTest(int, char *[]) auto function = FunctionType::New(); \ \ function->Print(std::cout); \ - constexpr double epsilon = 1e-6; \ + constexpr double epsilon{ 1e-6 }; \ for (unsigned int j = 0; j < npoints; ++j) \ { \ double results = function->Evaluate(x[j]); \ @@ -92,16 +92,16 @@ itkBSplineKernelFunctionTest(int, char *[]) // Testing derivative spline order = 0 { - constexpr unsigned int SplineOrder = 0; + constexpr unsigned int SplineOrder{ 0 }; using DerivativeFunctionType = itk::BSplineDerivativeKernelFunction; auto derivFunction = DerivativeFunctionType::New(); derivFunction->Print(std::cout); - constexpr double xx = -0.25; - constexpr double expectedValue = 0.0; + constexpr double xx{ -0.25 }; + constexpr double expectedValue{ 0.0 }; const double results = derivFunction->Evaluate(xx); - constexpr double epsilon = 1e-6; + constexpr double epsilon{ 1e-6 }; if (itk::Math::abs(results - expectedValue) > epsilon) { std::cerr.precision(static_cast(itk::Math::abs(std::log10(epsilon)))); @@ -116,7 +116,7 @@ itkBSplineKernelFunctionTest(int, char *[]) // Testing derivative spline order = 1 { - constexpr unsigned int SplineOrder = 1; + constexpr unsigned int SplineOrder{ 1 }; using DerivativeFunctionType = itk::BSplineDerivativeKernelFunction; auto derivFunction = DerivativeFunctionType::New(); @@ -128,7 +128,7 @@ itkBSplineKernelFunctionTest(int, char *[]) const double expectedValue = function->Evaluate(xx + 0.5) - function->Evaluate(xx - 0.5); const double results = derivFunction->Evaluate(xx); - constexpr double epsilon = 1e-6; + constexpr double epsilon{ 1e-6 }; if (itk::Math::abs(results - expectedValue) > epsilon) { std::cerr.precision(static_cast(itk::Math::abs(std::log10(epsilon)))); @@ -144,7 +144,7 @@ itkBSplineKernelFunctionTest(int, char *[]) // Testing derivative spline order = 2 { - constexpr unsigned int SplineOrder = 2; + constexpr unsigned int SplineOrder{ 2 }; using DerivativeFunctionType = itk::BSplineDerivativeKernelFunction; auto derivFunction = DerivativeFunctionType::New(); derivFunction->Print(std::cout); @@ -157,7 +157,7 @@ itkBSplineKernelFunctionTest(int, char *[]) const double expectedValue = function->Evaluate(xx + 0.5) - function->Evaluate(xx - 0.5); const double results = derivFunction->Evaluate(xx); - constexpr double epsilon = 1e-6; + constexpr double epsilon{ 1e-6 }; if (itk::Math::abs(results - expectedValue) > epsilon) { std::cerr.precision(static_cast(itk::Math::abs(std::log10(epsilon)))); @@ -173,7 +173,7 @@ itkBSplineKernelFunctionTest(int, char *[]) // Testing derivative spline order = 3 { - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int SplineOrder{ 3 }; using DerivativeFunctionType = itk::BSplineDerivativeKernelFunction; auto derivFunction = DerivativeFunctionType::New(); derivFunction->Print(std::cout); @@ -186,7 +186,7 @@ itkBSplineKernelFunctionTest(int, char *[]) const double expectedValue = function->Evaluate(xx + 0.5) - function->Evaluate(xx - 0.5); const double results = derivFunction->Evaluate(xx); - constexpr double epsilon = 1e-6; + constexpr double epsilon{ 1e-6 }; if (itk::Math::abs(results - expectedValue) > epsilon) { std::cerr.precision(static_cast(itk::Math::abs(std::log10(epsilon)))); diff --git a/Modules/Core/Common/test/itkBoundingBoxTest.cxx b/Modules/Core/Common/test/itkBoundingBoxTest.cxx index b2abe8efc6c..21593bccb22 100644 --- a/Modules/Core/Common/test/itkBoundingBoxTest.cxx +++ b/Modules/Core/Common/test/itkBoundingBoxTest.cxx @@ -138,7 +138,7 @@ itkBoundingBoxTest(int, char *[]) const CC::PointsContainerPointer Points3D = CC::PointsContainer::New(); - constexpr CC::PointType::ValueType qval1[3] = { -1.0f, -1.0f, -1.0f }; + constexpr CC::PointType::ValueType qval1[3]{ -1.0f, -1.0f, -1.0f }; CC::PointType Q = qval1; Points3D->InsertElement(0, Q); @@ -193,7 +193,7 @@ itkBoundingBoxTest(int, char *[]) // Testing the DeepCopy method { - constexpr double tolerance = 1e-10; + constexpr double tolerance{ 1e-10 }; const CC::Pointer clone = my3DBox->DeepCopy(); const CC::BoundsArrayType & originalBounds = my3DBox->GetBounds(); const CC::BoundsArrayType & clonedbounds = clone->GetBounds(); diff --git a/Modules/Core/Common/test/itkByteSwapTest.cxx b/Modules/Core/Common/test/itkByteSwapTest.cxx index 4408b01fa56..eb2566cceaa 100644 --- a/Modules/Core/Common/test/itkByteSwapTest.cxx +++ b/Modules/Core/Common/test/itkByteSwapTest.cxx @@ -57,7 +57,7 @@ itkByteSwapTest(int, char *[]) std::cout << "Passed unsigned char: " << uc << std::endl; unsigned short us = 1; - constexpr unsigned short us1 = 1; + constexpr unsigned short us1{ 1 }; if constexpr (itk::ByteSwapper::SystemIsBE()) { itk::ByteSwapper::SwapFromSystemToLittleEndian(&us); @@ -74,7 +74,7 @@ itkByteSwapTest(int, char *[]) } std::cout << "Passed unsigned short: " << us << std::endl; unsigned int ui = 1; - constexpr unsigned int ui1 = 1; + constexpr unsigned int ui1{ 1 }; if constexpr (itk::ByteSwapper::SystemIsBigEndian()) { itk::ByteSwapper::SwapFromSystemToLittleEndian(&ui); @@ -92,7 +92,7 @@ itkByteSwapTest(int, char *[]) std::cout << "Passed unsigned int: " << ui << std::endl; unsigned long ul = 1; - constexpr unsigned long ul1 = 1; + constexpr unsigned long ul1{ 1 }; try { if constexpr (itk::ByteSwapper::SystemIsBigEndian()) @@ -144,7 +144,7 @@ itkByteSwapTest(int, char *[]) } float f = 1.0; - constexpr float f1 = 1.0; + constexpr float f1{ 1.0 }; try { if constexpr (itk::ByteSwapper::SystemIsBigEndian()) @@ -171,7 +171,7 @@ itkByteSwapTest(int, char *[]) } double d = 1.0; - constexpr double d1 = 1.0; + constexpr double d1{ 1.0 }; try { if constexpr (itk::ByteSwapper::SystemIsBigEndian()) diff --git a/Modules/Core/Common/test/itkCompensatedSummationTest.cxx b/Modules/Core/Common/test/itkCompensatedSummationTest.cxx index 2332837c4ac..b902b5310c4 100644 --- a/Modules/Core/Common/test/itkCompensatedSummationTest.cxx +++ b/Modules/Core/Common/test/itkCompensatedSummationTest.cxx @@ -30,11 +30,11 @@ itkCompensatedSummationTest(int, char *[]) const itk::StdStreamStateSave coutState(std::cout); using FloatType = float; - constexpr long seedValue = 17; + constexpr long seedValue{ 17 }; - constexpr FloatType expectedMean = 0.5; + constexpr FloatType expectedMean{ 0.5 }; - constexpr itk::SizeValueType accumSize = 50000000; + constexpr itk::SizeValueType accumSize{ 50000000 }; using GeneratorType = itk::Statistics::MersenneTwisterRandomVariateGenerator; auto generator = GeneratorType::New(); diff --git a/Modules/Core/Common/test/itkCompensatedSummationTest2.cxx b/Modules/Core/Common/test/itkCompensatedSummationTest2.cxx index 156539ead73..b025083ee3a 100644 --- a/Modules/Core/Common/test/itkCompensatedSummationTest2.cxx +++ b/Modules/Core/Common/test/itkCompensatedSummationTest2.cxx @@ -71,7 +71,7 @@ class CompensatedSummationTest2Associate void ThreadedExecution(const DomainType & subdomain, const itk::ThreadIdType threadId) override { - constexpr double value = 1.0 / 7; + constexpr double value{ 1.0 / 7 }; for (DomainType::IndexValueType i = subdomain[0]; i <= subdomain[1]; ++i) { this->m_PerThreadCompensatedSum[threadId].AddElement(value); @@ -156,7 +156,7 @@ itkCompensatedSummationTest2(int, char *[]) domain[1] = maxNumberOfThreads * 10000; /* Test with single thread. We should get the same result. */ - constexpr itk::ThreadIdType numberOfThreads = 1; + constexpr itk::ThreadIdType numberOfThreads{ 1 }; domainThreader->SetMaximumNumberOfThreads(numberOfThreads); domainThreader->SetNumberOfWorkUnits(numberOfThreads); std::cout << "Testing with " << numberOfThreads << " threads and domain " << domain << " ..." << std::endl; diff --git a/Modules/Core/Common/test/itkConicShellInteriorExteriorSpatialFunctionTest.cxx b/Modules/Core/Common/test/itkConicShellInteriorExteriorSpatialFunctionTest.cxx index 5c8b58acc6e..e47009ce9e5 100644 --- a/Modules/Core/Common/test/itkConicShellInteriorExteriorSpatialFunctionTest.cxx +++ b/Modules/Core/Common/test/itkConicShellInteriorExteriorSpatialFunctionTest.cxx @@ -28,7 +28,7 @@ itkConicShellInteriorExteriorSpatialFunctionTest(int, char *[]) int testStatus = EXIT_SUCCESS; // Define the dimensionality - constexpr unsigned int PointDimension = 3; + constexpr unsigned int PointDimension{ 3 }; // Define the point coordinate representation type using PointCoordinateType = float; @@ -59,7 +59,7 @@ itkConicShellInteriorExteriorSpatialFunctionTest(int, char *[]) originGradient.GetVnlVector().normalize(); conicShellInteriorExteriorSpatialFunction->SetOriginGradient(originGradient); - constexpr double tolerance = 10e-6; + constexpr double tolerance{ 10e-6 }; std::cerr.precision(static_cast(itk::Math::abs(std::log10(tolerance)))); for (unsigned int i = 0; i < originGradient.Size(); ++i) { @@ -74,15 +74,15 @@ itkConicShellInteriorExteriorSpatialFunctionTest(int, char *[]) } } - constexpr double distanceMin = 10.0; + constexpr double distanceMin{ 10.0 }; conicShellInteriorExteriorSpatialFunction->SetDistanceMin(distanceMin); ITK_TEST_SET_GET_VALUE(distanceMin, conicShellInteriorExteriorSpatialFunction->GetDistanceMin()); - constexpr double distanceMax = 50.0; + constexpr double distanceMax{ 50.0 }; conicShellInteriorExteriorSpatialFunction->SetDistanceMax(distanceMax); ITK_TEST_SET_GET_VALUE(distanceMax, conicShellInteriorExteriorSpatialFunction->GetDistanceMax()); - constexpr double epsilon = 1e-3; + constexpr double epsilon{ 1e-3 }; conicShellInteriorExteriorSpatialFunction->SetEpsilon(epsilon); ITK_TEST_SET_GET_VALUE(epsilon, conicShellInteriorExteriorSpatialFunction->GetEpsilon()); diff --git a/Modules/Core/Common/test/itkConnectedImageNeighborhoodShapeGTest.cxx b/Modules/Core/Common/test/itkConnectedImageNeighborhoodShapeGTest.cxx index 2ca4311d425..dc47d8d5bb8 100644 --- a/Modules/Core/Common/test/itkConnectedImageNeighborhoodShapeGTest.cxx +++ b/Modules/Core/Common/test/itkConnectedImageNeighborhoodShapeGTest.cxx @@ -82,7 +82,7 @@ Assert_GenerateImageNeighborhoodOffsets_returns_expected_offsets_excluding_cente { using ShapeType = itk::ConnectedImageNeighborhoodShape; - constexpr bool includeCenterPixel = false; + constexpr bool includeCenterPixel{ false }; const ShapeType shape{ VMaximumCityblockDistance, includeCenterPixel }; ASSERT_EQ(GenerateImageNeighborhoodOffsets(shape), expectedOffsets); @@ -286,8 +286,8 @@ TEST(ConnectedImageNeighborhoodShape, SupportsConstShapedNeighborhoodIterator) // Define a shape that should generate the same offsets as in the // previous ActivateOffset(offset) calls. - constexpr size_t cityBlockDistance = 1; - constexpr bool includeCenterPixel = false; + constexpr size_t cityBlockDistance{ 1 }; + constexpr bool includeCenterPixel{ false }; shapedNeighborhoodIterator.ActivateOffsets( itk::GenerateConnectedImageNeighborhoodShapeOffsets()); diff --git a/Modules/Core/Common/test/itkConstNeighborhoodIteratorTest.cxx b/Modules/Core/Common/test/itkConstNeighborhoodIteratorTest.cxx index 56888f9148e..8022ca20a94 100644 --- a/Modules/Core/Common/test/itkConstNeighborhoodIteratorTest.cxx +++ b/Modules/Core/Common/test/itkConstNeighborhoodIteratorTest.cxx @@ -212,7 +212,7 @@ itkConstNeighborhoodIteratorTest(int, char *[]) // Test IndexInBounds // println("Testing IndexInBounds"); - constexpr int dims[4] = { 13, 11, 9, 7 }; + constexpr int dims[4]{ 13, 11, 9, 7 }; const TestImageType::Pointer iib_img = GetTestImage(dims[0], dims[1], dims[2], dims[3]); radius[0] = 4; radius[1] = 3; diff --git a/Modules/Core/Common/test/itkConstNeighborhoodIteratorWithOnlyIndexTest.cxx b/Modules/Core/Common/test/itkConstNeighborhoodIteratorWithOnlyIndexTest.cxx index f524d76b973..a04a81a64fa 100644 --- a/Modules/Core/Common/test/itkConstNeighborhoodIteratorWithOnlyIndexTest.cxx +++ b/Modules/Core/Common/test/itkConstNeighborhoodIteratorWithOnlyIndexTest.cxx @@ -343,7 +343,7 @@ itkConstNeighborhoodIteratorWithOnlyIndexTestRun() // Test IndexInBounds // std::cout << "Testing IndexInBounds" << std::endl; - constexpr int dims[4] = { 13, 11, 9, 7 }; + constexpr int dims[4]{ 13, 11, 9, 7 }; const typename ImageType::Pointer iib_img = itkConstNeighborhoodIteratorWithOnlyIndexTestGetTestImage(dims[0], dims[1], dims[2], dims[3]); radius[0] = 4; diff --git a/Modules/Core/Common/test/itkConstantBoundaryConditionTest.cxx b/Modules/Core/Common/test/itkConstantBoundaryConditionTest.cxx index 6ed6884b172..fb0b1ab55a8 100644 --- a/Modules/Core/Common/test/itkConstantBoundaryConditionTest.cxx +++ b/Modules/Core/Common/test/itkConstantBoundaryConditionTest.cxx @@ -122,8 +122,8 @@ itkConstantBoundaryConditionTest(int, char *[]) { // Test an image to cover one operator() method. auto image = ImageType::New(); - constexpr SizeType imageSize = { { 5, 5 } }; - constexpr IndexType imageIndex = { { 0, 0 } }; + constexpr SizeType imageSize{ 5, 5 }; + constexpr IndexType imageIndex{ 0, 0 }; RegionType imageRegion{ imageIndex, imageSize }; image->SetRegions(imageRegion); image->Allocate(); @@ -157,7 +157,7 @@ itkConstantBoundaryConditionTest(int, char *[]) itk::ConstantBoundaryCondition bc; itk::ConstantBoundaryCondition vbc; - constexpr ImageType::PixelType constant = 3; + constexpr ImageType::PixelType constant{ 3 }; bc.SetConstant(constant); if (bc.GetConstant() != constant) diff --git a/Modules/Core/Common/test/itkConstantBoundaryImageNeighborhoodPixelAccessPolicyGTest.cxx b/Modules/Core/Common/test/itkConstantBoundaryImageNeighborhoodPixelAccessPolicyGTest.cxx index 5cbad17f338..0cef4173e70 100644 --- a/Modules/Core/Common/test/itkConstantBoundaryImageNeighborhoodPixelAccessPolicyGTest.cxx +++ b/Modules/Core/Common/test/itkConstantBoundaryImageNeighborhoodPixelAccessPolicyGTest.cxx @@ -89,8 +89,8 @@ TEST(ConstantBoundaryImageNeighborhoodPixelAccessPolicy, YieldsZeroOutsideImageB const auto image = CreateImage(sizeX, sizeY); image->FillBuffer(42); - constexpr ImageType::IndexType locationOutsideImage{ { -1, -1 } }; - constexpr itk::Size radius = { {} }; + constexpr ImageType::IndexType locationOutsideImage{ -1, -1 }; + constexpr itk::Size radius{}; const std::vector> offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); const RangeType range{ *image, locationOutsideImage, offsets }; @@ -119,8 +119,8 @@ TEST(ConstantBoundaryImageNeighborhoodPixelAccessPolicy, YieldsSpecifiedConstant const auto image = CreateImage(sizeX, sizeY); image->FillBuffer(42); - constexpr ImageType::IndexType locationOutsideImage{ { -1, -1 } }; - constexpr itk::Size radius = { {} }; + constexpr ImageType::IndexType locationOutsideImage{ -1, -1 }; + constexpr itk::Size radius{}; const std::vector> offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); const auto numberOfExpectedNeighbors = offsets.size(); @@ -163,8 +163,8 @@ TEST(ConstantBoundaryImageNeighborhoodPixelAccessPolicy, YieldsSameValuesAsConst }; const auto image = CreateImageFilledWithSequenceOfNaturalNumbers(sizeX, sizeY); - constexpr ImageType::IndexType location{ {} }; - constexpr itk::Size radius = { { 1, 2 } }; + constexpr ImageType::IndexType location{}; + constexpr itk::Size radius{ { 1, 2 } }; const std::vector> offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); diff --git a/Modules/Core/Common/test/itkCovariantVectorGeometryTest.cxx b/Modules/Core/Common/test/itkCovariantVectorGeometryTest.cxx index 243e61c9a05..7672a4f6cb8 100644 --- a/Modules/Core/Common/test/itkCovariantVectorGeometryTest.cxx +++ b/Modules/Core/Common/test/itkCovariantVectorGeometryTest.cxx @@ -29,7 +29,7 @@ int itkCovariantVectorGeometryTest(int, char *[]) { // Dimension & Type - constexpr unsigned int N = 3; + constexpr unsigned int N{ 3 }; using ValueType = double; // Vector type @@ -137,7 +137,7 @@ itkCovariantVectorGeometryTest(int, char *[]) { std::cout << "Test for CastFrom() method... "; - constexpr float tolerance = 1e-7; + constexpr float tolerance{ 1e-7 }; // CovariantVector Classes using DoubleCovariantVectorType = itk::CovariantVector; @@ -190,7 +190,7 @@ itkCovariantVectorGeometryTest(int, char *[]) covariant[1] = 3.0; covariant[2] = 5.0; - constexpr double expectedValue = -28.0; + constexpr double expectedValue{ -28.0 }; if (!itk::Math::FloatAlmostEqual(expectedValue, covariant * contravariant) || !itk::Math::FloatAlmostEqual(expectedValue, contravariant * covariant)) diff --git a/Modules/Core/Common/test/itkCrossHelperTest.cxx b/Modules/Core/Common/test/itkCrossHelperTest.cxx index 7d4e4c2f882..86da6504a99 100644 --- a/Modules/Core/Common/test/itkCrossHelperTest.cxx +++ b/Modules/Core/Common/test/itkCrossHelperTest.cxx @@ -24,9 +24,9 @@ int itkCrossHelperTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) { - constexpr unsigned int Dimension2D = 2; - constexpr unsigned int Dimension3D = 3; - constexpr unsigned int Dimension4D = 4; + constexpr unsigned int Dimension2D{ 2 }; + constexpr unsigned int Dimension3D{ 3 }; + constexpr unsigned int Dimension4D{ 4 }; using CoordinateType = double; diff --git a/Modules/Core/Common/test/itkDerivativeOperatorTest.cxx b/Modules/Core/Common/test/itkDerivativeOperatorTest.cxx index 7cd82cfd11a..1924da7f59a 100644 --- a/Modules/Core/Common/test/itkDerivativeOperatorTest.cxx +++ b/Modules/Core/Common/test/itkDerivativeOperatorTest.cxx @@ -61,7 +61,7 @@ class DerivativeOperatorTestHelper : public DerivativeOperator; @@ -42,9 +42,9 @@ itkEllipsoidInteriorExteriorSpatialFunctionTest(int, char *[]) spatialFunc->SetAxes(axes); // Define function doitkEllipsoidInteriorExteriorSpatialFunctionTest, which encapsulates ellipsoid. - constexpr int xExtent = 50; - constexpr int yExtent = 50; - constexpr int zExtent = 50; + constexpr int xExtent{ 50 }; + constexpr int yExtent{ 50 }; + constexpr int zExtent{ 50 }; // Define and set the center of the ellipsoid in the center of // the function doitkEllipsoidInteriorExteriorSpatialFunctionTest diff --git a/Modules/Core/Common/test/itkExtractImage3Dto2DTest.cxx b/Modules/Core/Common/test/itkExtractImage3Dto2DTest.cxx index ee8f215c256..ba16c724264 100644 --- a/Modules/Core/Common/test/itkExtractImage3Dto2DTest.cxx +++ b/Modules/Core/Common/test/itkExtractImage3Dto2DTest.cxx @@ -32,7 +32,7 @@ itkExtractImage3Dto2DTest(int, char *[]) auto src = RandomImageSourceType::New(); src->SetMin(0); src->SetMax(255); - constexpr Image3DType::SizeType size = { { 16, 16, 16 } }; + constexpr Image3DType::SizeType size{ 16, 16, 16 }; src->SetSize(size); src->Update(); const Image3DType::Pointer im3d(src->GetOutput()); diff --git a/Modules/Core/Common/test/itkExtractImageTest.cxx b/Modules/Core/Common/test/itkExtractImageTest.cxx index 06360e7af45..0feca7174a9 100644 --- a/Modules/Core/Common/test/itkExtractImageTest.cxx +++ b/Modules/Core/Common/test/itkExtractImageTest.cxx @@ -35,15 +35,15 @@ ExtractImageInPlaceTest() using SourceType = itk::RandomImageSource; auto source = SourceType::New(); - constexpr ImageType::SizeType size = { { 32, 32, 32 } }; + constexpr ImageType::SizeType size{ 32, 32, 32 }; source->SetSize(size); source->UpdateLargestPossibleRegion(); - constexpr ImageType::IndexType extractIndex = { { 16, 16, 16 } }; - constexpr ImageType::SizeType extractSize = { { 8, 8, 8 } }; - constexpr ImageType::SizeType zeroSize = { { 0, 0, 0 } }; + constexpr ImageType::IndexType extractIndex{ 16, 16, 16 }; + constexpr ImageType::SizeType extractSize{ 8, 8, 8 }; + constexpr ImageType::SizeType zeroSize{ 0, 0, 0 }; using ExtractFilterType = itk::ExtractImageFilter; auto extract = ExtractFilterType::New(); diff --git a/Modules/Core/Common/test/itkFileOutputWindowTest.cxx b/Modules/Core/Common/test/itkFileOutputWindowTest.cxx index 145530135c6..f679f56f0d2 100644 --- a/Modules/Core/Common/test/itkFileOutputWindowTest.cxx +++ b/Modules/Core/Common/test/itkFileOutputWindowTest.cxx @@ -40,9 +40,9 @@ itkFileOutputWindowTest(int, char *[]) std::cout << "window->GetFileName(): " << fileName2 << std::endl; // Test itkSetMacros - constexpr bool flush = false; + constexpr bool flush{ false }; window->SetFlush(flush); - constexpr bool append = false; + constexpr bool append{ false }; window->SetAppend(append); // Test itkGetMacros diff --git a/Modules/Core/Common/test/itkFiniteCylinderSpatialFunctionTest.cxx b/Modules/Core/Common/test/itkFiniteCylinderSpatialFunctionTest.cxx index 8fa13646ee7..7f7bef291d3 100644 --- a/Modules/Core/Common/test/itkFiniteCylinderSpatialFunctionTest.cxx +++ b/Modules/Core/Common/test/itkFiniteCylinderSpatialFunctionTest.cxx @@ -25,7 +25,7 @@ itkFiniteCylinderSpatialFunctionTest(int, char *[]) std::cout << "itkFiniteCylinderSpatialFunction test start" << std::endl; // Test will create a cylinder (3 - dimensional) - constexpr unsigned int dimension = 3; + constexpr unsigned int dimension{ 3 }; // Cylinder spatial function type alias. using TCylinderFunctionType = itk::FiniteCylinderSpatialFunction; @@ -44,14 +44,14 @@ itkFiniteCylinderSpatialFunctionTest(int, char *[]) orientation[2] = 0.0; ITK_TRY_EXPECT_EXCEPTION(spatialFunc->SetOrientation(orientation)); - constexpr double axis = 40.0; + constexpr double axis{ 40.0 }; spatialFunc->SetAxisLength(axis); ITK_TEST_SET_GET_VALUE(axis, spatialFunc->GetAxisLength()); // Define function, which encapsulates cylinder. - constexpr int xExtent = 50; - constexpr int yExtent = 50; - constexpr int zExtent = 50; + constexpr int xExtent{ 50 }; + constexpr int yExtent{ 50 }; + constexpr int zExtent{ 50 }; TCylinderFunctionVectorType center; center[0] = xExtent / 2; @@ -66,7 +66,7 @@ itkFiniteCylinderSpatialFunctionTest(int, char *[]) spatialFunc->SetOrientation(orientation); ITK_TEST_SET_GET_VALUE(orientation, spatialFunc->GetOrientation()); - constexpr double radius = 5.0; + constexpr double radius{ 5.0 }; spatialFunc->SetRadius(radius); ITK_TEST_SET_GET_VALUE(radius, spatialFunc->GetRadius()); diff --git a/Modules/Core/Common/test/itkFixedArrayGTest.cxx b/Modules/Core/Common/test/itkFixedArrayGTest.cxx index 1f14a61c4c0..b0b2d92dc0a 100644 --- a/Modules/Core/Common/test/itkFixedArrayGTest.cxx +++ b/Modules/Core/Common/test/itkFixedArrayGTest.cxx @@ -233,7 +233,6 @@ Is_Filled_FixedArray_correctly_filled() using FixedArrayType = itk::FixedArray; constexpr auto filledFixedArray = FixedArrayType::Filled(VFillValue); - for (unsigned int i{}; i < FixedArrayType::Length; ++i) { if (filledFixedArray[i] != VFillValue) diff --git a/Modules/Core/Common/test/itkFixedArrayTest.cxx b/Modules/Core/Common/test/itkFixedArrayTest.cxx index bd5d33ca247..82058e39a71 100644 --- a/Modules/Core/Common/test/itkFixedArrayTest.cxx +++ b/Modules/Core/Common/test/itkFixedArrayTest.cxx @@ -80,7 +80,7 @@ itkFixedArrayTest(int, char *[]) return EXIT_FAILURE; // should be equal // Test Get/Set element - constexpr unsigned int n = 20; + constexpr unsigned int n{ 20 }; itk::FixedArray array20; for (unsigned int i = 0; i < n; ++i) { diff --git a/Modules/Core/Common/test/itkFixedArrayTest2.cxx b/Modules/Core/Common/test/itkFixedArrayTest2.cxx index 9687588a87d..a084c397c02 100644 --- a/Modules/Core/Common/test/itkFixedArrayTest2.cxx +++ b/Modules/Core/Common/test/itkFixedArrayTest2.cxx @@ -25,10 +25,10 @@ int itkFixedArrayTest2(int, char *[]) { // Define the number of elements in the array - constexpr unsigned int nelements = 10000000L; + constexpr unsigned int nelements{ 10000000L }; // Define the number of runs used for timing - constexpr unsigned int nrun = 10; + constexpr unsigned int nrun{ 10 }; // Declare a simple timer diff --git a/Modules/Core/Common/test/itkFloodFillIteratorTest.cxx b/Modules/Core/Common/test/itkFloodFillIteratorTest.cxx index 3efb543e715..e22e3b7677f 100644 --- a/Modules/Core/Common/test/itkFloodFillIteratorTest.cxx +++ b/Modules/Core/Common/test/itkFloodFillIteratorTest.cxx @@ -28,7 +28,7 @@ int itkFloodFillIteratorTest(int, char *[]) { - constexpr unsigned int dim = 3; + constexpr unsigned int dim{ 3 }; // Image type alias using TImageType = itk::Image; @@ -92,7 +92,7 @@ itkFloodFillIteratorTest(int, char *[]) //---------Create and initialize a spatial function iterator----------- TImageType::IndexType seedPos; - constexpr TImageType::IndexValueType pos[] = { 10, 10, 10 }; + constexpr TImageType::IndexValueType pos[]{ 10, 10, 10 }; seedPos.SetIndex(pos); using TItType = itk::FloodFilledSpatialFunctionConditionalIterator; diff --git a/Modules/Core/Common/test/itkFloodFilledSpatialFunctionTest.cxx b/Modules/Core/Common/test/itkFloodFilledSpatialFunctionTest.cxx index ffd894a8903..283d385e106 100644 --- a/Modules/Core/Common/test/itkFloodFilledSpatialFunctionTest.cxx +++ b/Modules/Core/Common/test/itkFloodFilledSpatialFunctionTest.cxx @@ -29,7 +29,7 @@ to itkFloodFilledSpatialFunctionConditionalIterator. int itkFloodFilledSpatialFunctionTest(int, char *[]) { - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; // Image type alias using ImageType = itk::Image; @@ -92,7 +92,7 @@ itkFloodFilledSpatialFunctionTest(int, char *[]) // Create and initialize a spatial function iterator ImageType::IndexType seedPos; - constexpr ImageType::IndexValueType pos[] = { 2, 2 }; + constexpr ImageType::IndexValueType pos[]{ 2, 2 }; seedPos.SetIndex(pos); using ItType = itk::FloodFilledSpatialFunctionConditionalIterator; diff --git a/Modules/Core/Common/test/itkFrustumSpatialFunctionTest.cxx b/Modules/Core/Common/test/itkFrustumSpatialFunctionTest.cxx index 1c583d1a2b5..a50a50a48c4 100644 --- a/Modules/Core/Common/test/itkFrustumSpatialFunctionTest.cxx +++ b/Modules/Core/Common/test/itkFrustumSpatialFunctionTest.cxx @@ -26,7 +26,7 @@ itkFrustumSpatialFunctionTest(int, char *[]) { // Define the dimensionality - constexpr unsigned int PointDimension = 3; + constexpr unsigned int PointDimension{ 3 }; // Define the point coordinate representation type using PointCoordinateType = float; @@ -56,15 +56,15 @@ itkFrustumSpatialFunctionTest(int, char *[]) frustrumSpatialFunction->SetBottomPlane(bottomPlane); ITK_TEST_SET_GET_VALUE(bottomPlane, frustrumSpatialFunction->GetBottomPlane()); - constexpr double angleZ = 36; + constexpr double angleZ{ 36 }; frustrumSpatialFunction->SetAngleZ(angleZ); ITK_TEST_SET_GET_VALUE(angleZ, frustrumSpatialFunction->GetAngleZ()); - constexpr double apertureAngleX = 54; + constexpr double apertureAngleX{ 54 }; frustrumSpatialFunction->SetApertureAngleX(apertureAngleX); ITK_TEST_SET_GET_VALUE(apertureAngleX, frustrumSpatialFunction->GetApertureAngleX()); - constexpr double apertureAngleY = 120; + constexpr double apertureAngleY{ 120 }; frustrumSpatialFunction->SetApertureAngleY(apertureAngleY); ITK_TEST_SET_GET_VALUE(apertureAngleY, frustrumSpatialFunction->GetApertureAngleY()); diff --git a/Modules/Core/Common/test/itkGaussianDerivativeOperatorTest.cxx b/Modules/Core/Common/test/itkGaussianDerivativeOperatorTest.cxx index 093cb0dcda4..e9810c42e89 100644 --- a/Modules/Core/Common/test/itkGaussianDerivativeOperatorTest.cxx +++ b/Modules/Core/Common/test/itkGaussianDerivativeOperatorTest.cxx @@ -34,7 +34,7 @@ TestGaussianOperator(double variance, double error, unsigned int width, unsigned GaussianOp op; - constexpr bool normalizeAcrossScale = false; + constexpr bool normalizeAcrossScale{ false }; ITK_TEST_SET_GET_BOOLEAN((&op), NormalizeAcrossScale, normalizeAcrossScale); op.SetVariance(variance); @@ -59,7 +59,7 @@ TestGaussianOperator(double variance, double error, unsigned int width, unsigned std::cout.precision(16); - constexpr double epsilon = itk::NumericTraits::epsilon() * 32; + constexpr double epsilon{ itk::NumericTraits::epsilon() * 32 }; if (order == 0 && itk::Math::abs(total - 1.0) > epsilon) { std::cerr << "Test failed!" << std::endl; diff --git a/Modules/Core/Common/test/itkGaussianSpatialFunctionTest.cxx b/Modules/Core/Common/test/itkGaussianSpatialFunctionTest.cxx index bb03f70127a..e864c9a8958 100644 --- a/Modules/Core/Common/test/itkGaussianSpatialFunctionTest.cxx +++ b/Modules/Core/Common/test/itkGaussianSpatialFunctionTest.cxx @@ -30,7 +30,7 @@ itkGaussianSpatialFunctionTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixeltType = double; using GaussianSpatialFunctionType = itk::GaussianSpatialFunction; @@ -98,8 +98,8 @@ itkGaussianSpatialFunctionTest(int argc, char * argv[]) } else { - constexpr double oneDimensionalFactor = 1.0; - constexpr double factor = oneDimensionalFactor * oneDimensionalFactor * oneDimensionalFactor; + constexpr double oneDimensionalFactor{ 1.0 }; + constexpr double factor{ oneDimensionalFactor * oneDimensionalFactor * oneDimensionalFactor }; expectedValueAtMean = scale / factor; } diff --git a/Modules/Core/Common/test/itkHashTableTest.cxx b/Modules/Core/Common/test/itkHashTableTest.cxx index e373395bd17..2a3161e3c2e 100644 --- a/Modules/Core/Common/test/itkHashTableTest.cxx +++ b/Modules/Core/Common/test/itkHashTableTest.cxx @@ -119,7 +119,7 @@ itkHashTableTest(int, char *[]) std::cout << "Set is empty." << std::endl; } months.rehash(50); - constexpr HashMapType::value_type p("psychotic break", 2); + constexpr HashMapType::value_type p{ "psychotic break", 2 }; months.insert(p); auto map_it = months.begin(); const HashMapType MapCopy = months; diff --git a/Modules/Core/Common/test/itkHeavisideStepFunctionTest1.cxx b/Modules/Core/Common/test/itkHeavisideStepFunctionTest1.cxx index 9ec3622ed31..edaa5d94820 100644 --- a/Modules/Core/Common/test/itkHeavisideStepFunctionTest1.cxx +++ b/Modules/Core/Common/test/itkHeavisideStepFunctionTest1.cxx @@ -31,10 +31,10 @@ itkHeavisideStepFunctionTest1(int, char *[]) std::cout << "GetNameOfClass() = " << functionBase0->GetNameOfClass() << std::endl; functionBase0->Print(std::cout); - constexpr int minValue = -20; - constexpr int maxValue = 20; + constexpr int minValue{ -20 }; + constexpr int maxValue{ 20 }; - constexpr InputType incValue = 0.1; + constexpr InputType incValue{ 0.1 }; for (int x = minValue; x < maxValue; ++x) { diff --git a/Modules/Core/Common/test/itkImageAdaptorPipeLineTest.cxx b/Modules/Core/Common/test/itkImageAdaptorPipeLineTest.cxx index bc22a0841e0..70cda73bcaf 100644 --- a/Modules/Core/Common/test/itkImageAdaptorPipeLineTest.cxx +++ b/Modules/Core/Common/test/itkImageAdaptorPipeLineTest.cxx @@ -82,7 +82,7 @@ itkImageAdaptorPipeLineTest(int, char *[]) const myRegionType region{ start, size }; - constexpr float spacing[3] = { 1.0, 1.0, 1.0 }; + constexpr float spacing[3]{ 1.0, 1.0, 1.0 }; //------------------------------------------------------------- // Create and Initialize the RGBPixel image @@ -143,7 +143,7 @@ itkImageAdaptorPipeLineTest(int, char *[]) myFloatIteratorType itf(myFloatImage, myFloatImage->GetRequestedRegion()); - constexpr myFloatPixelType initialFloatValue = 5.0; + constexpr myFloatPixelType initialFloatValue{ 5.0 }; while (!itf.IsAtEnd()) { diff --git a/Modules/Core/Common/test/itkImageBufferRangeGTest.cxx b/Modules/Core/Common/test/itkImageBufferRangeGTest.cxx index d11d541c5d4..852d1578cbe 100644 --- a/Modules/Core/Common/test/itkImageBufferRangeGTest.cxx +++ b/Modules/Core/Common/test/itkImageBufferRangeGTest.cxx @@ -341,7 +341,7 @@ TEST(ImageBufferRange, IteratorsCanBePassedToStdReverseCopy) const ImageBufferRange range{ *image }; - constexpr unsigned int numberOfPixels = sizeX * sizeY; + constexpr unsigned int numberOfPixels{ sizeX * sizeY }; const std::vector stdVector(range.begin(), range.end()); std::vector reversedStdVector1(numberOfPixels); @@ -532,7 +532,7 @@ TEST(ImageBufferRange, SupportsVectorImage) sizeZ = 2 }; const auto image = ImageType::New(); - constexpr typename ImageType::SizeType imageSize = { { sizeX, sizeY, sizeZ } }; + constexpr typename ImageType::SizeType imageSize{ { sizeX, sizeY, sizeZ } }; image->SetRegions(imageSize); image->SetVectorLength(vectorLength); image->AllocateInitialized(); @@ -664,7 +664,7 @@ TEST(ImageBufferRange, IteratorsSupportRandomAccess) { // Expression to be tested: 'r += n' - constexpr difference_type n = 3; + constexpr difference_type n{ 3 }; r = initialIterator; const auto expectedResult = [&r](const difference_type nn) { @@ -685,7 +685,7 @@ TEST(ImageBufferRange, IteratorsSupportRandomAccess) } { // Expressions to be tested: 'a + n' and 'n + a' - constexpr difference_type n = 3; + constexpr difference_type n{ 3 }; static_assert(std::is_same_v, "Return type tested"); static_assert(std::is_same_v, "Return type tested"); @@ -701,7 +701,7 @@ TEST(ImageBufferRange, IteratorsSupportRandomAccess) } { // Expression to be tested: 'r -= n' - constexpr difference_type n = 3; + constexpr difference_type n{ 3 }; r = initialIterator; const auto expectedResult = [&r](const difference_type nn) { @@ -715,7 +715,7 @@ TEST(ImageBufferRange, IteratorsSupportRandomAccess) } { // Expression to be tested: 'a - n' - constexpr difference_type n = -3; + constexpr difference_type n{ -3 }; static_assert(std::is_same_v, "Return type tested"); @@ -737,7 +737,7 @@ TEST(ImageBufferRange, IteratorsSupportRandomAccess) } { // Expression to be tested: 'a[n]' - constexpr difference_type n = 3; + constexpr difference_type n{ 3 }; static_assert(std::is_convertible_v, "Return type tested"); EXPECT_EQ(a[n], *(a + n)); } @@ -797,7 +797,7 @@ TEST(ImageBufferRange, ProvidesReverseIterators) const RangeType range{ *image }; - constexpr unsigned int numberOfPixels = sizeX * sizeY; + constexpr unsigned int numberOfPixels{ sizeX * sizeY }; const std::vector stdVector(range.begin(), range.end()); std::vector reversedStdVector1(numberOfPixels); diff --git a/Modules/Core/Common/test/itkImageDuplicatorTest.cxx b/Modules/Core/Common/test/itkImageDuplicatorTest.cxx index 3234900863d..23f65172087 100644 --- a/Modules/Core/Common/test/itkImageDuplicatorTest.cxx +++ b/Modules/Core/Common/test/itkImageDuplicatorTest.cxx @@ -241,7 +241,7 @@ itkImageDuplicatorTest(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; constexpr unsigned int VectorLength = 2 * Dimension; using PixelType = float; using VectorImageType = itk::VectorImage; diff --git a/Modules/Core/Common/test/itkImageDuplicatorTest2.cxx b/Modules/Core/Common/test/itkImageDuplicatorTest2.cxx index 5217028e53e..80de4aa3ac8 100644 --- a/Modules/Core/Common/test/itkImageDuplicatorTest2.cxx +++ b/Modules/Core/Common/test/itkImageDuplicatorTest2.cxx @@ -35,7 +35,7 @@ itkImageDuplicatorTest2(int argc, char * argv[]) } using PixelType = float; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using ImageType = itk::Image; using DuplicatorType = itk::ImageDuplicator; diff --git a/Modules/Core/Common/test/itkImageGTest.cxx b/Modules/Core/Common/test/itkImageGTest.cxx index 4f0cd44d1f3..adb41b53475 100644 --- a/Modules/Core/Common/test/itkImageGTest.cxx +++ b/Modules/Core/Common/test/itkImageGTest.cxx @@ -221,7 +221,7 @@ TEST(Image, IsXImageGeometry) const auto image1 = generate_image({ 2, 2 }); - constexpr double tol = 1e-8; + constexpr double tol{ 1e-8 }; auto image2 = generate_image({ 2, 2 }); diff --git a/Modules/Core/Common/test/itkImageIteratorTest.cxx b/Modules/Core/Common/test/itkImageIteratorTest.cxx index 4a8412a28f1..baa20f7e5d0 100644 --- a/Modules/Core/Common/test/itkImageIteratorTest.cxx +++ b/Modules/Core/Common/test/itkImageIteratorTest.cxx @@ -46,7 +46,7 @@ TestConstPixelAccess(const itk::Image & in, itk::Image, ImageDimension>::Pointer o3 = @@ -55,13 +55,11 @@ itkImageIteratorTest(int, char *[]) float origin3D[ImageDimension] = { 5.0f, 2.1f, 8.1f }; float spacing3D[ImageDimension] = { 1.5f, 2.1f, 1.0f }; - constexpr itk::Image, ImageDimension>::SizeType imageSize3D = { { 20, 40, 60 } }; + constexpr itk::Image, ImageDimension>::SizeType imageSize3D{ { 20, 40, 60 } }; - constexpr itk::Image, ImageDimension>::IndexType startIndex3D = { { 5, 4, 1 } }; - constexpr itk::Image, ImageDimension>::IndexType regionStartIndex3D = { - { 5, 10, 12 } - }; - constexpr itk::Image, ImageDimension>::IndexType regionEndIndex3D = { { 8, 15, 17 } }; + constexpr itk::Image, ImageDimension>::IndexType startIndex3D{ { 5, 4, 1 } }; + constexpr itk::Image, ImageDimension>::IndexType regionStartIndex3D{ { 5, 10, 12 } }; + constexpr itk::Image, ImageDimension>::IndexType regionEndIndex3D{ { 8, 15, 17 } }; const itk::Image, ImageDimension>::RegionType region{ startIndex3D, imageSize3D }; diff --git a/Modules/Core/Common/test/itkImageLinearIteratorTest.cxx b/Modules/Core/Common/test/itkImageLinearIteratorTest.cxx index 7566718f48e..e903f9b251b 100644 --- a/Modules/Core/Common/test/itkImageLinearIteratorTest.cxx +++ b/Modules/Core/Common/test/itkImageLinearIteratorTest.cxx @@ -26,7 +26,7 @@ itkImageLinearIteratorTest(int, char *[]) { std::cout << "Creating an image of indices" << std::endl; - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using PixelType = itk::Index; @@ -100,7 +100,7 @@ itkImageLinearIteratorTest(int, char *[]) ConstIteratorType cot(myConstImage, region0); // Test exceptions - constexpr int direction = ImageType::GetImageDimension() + 1; + constexpr int direction{ ImageType::GetImageDimension() + 1 }; ITK_TRY_EXPECT_EXCEPTION(cot.SetDirection(direction)); cot.GoToBegin(); diff --git a/Modules/Core/Common/test/itkImageNeighborhoodOffsetsGTest.cxx b/Modules/Core/Common/test/itkImageNeighborhoodOffsetsGTest.cxx index 481a3fc6227..d367557cea6 100644 --- a/Modules/Core/Common/test/itkImageNeighborhoodOffsetsGTest.cxx +++ b/Modules/Core/Common/test/itkImageNeighborhoodOffsetsGTest.cxx @@ -58,8 +58,8 @@ class EmptyImageNeighborhoodShape TEST(ImageNeighborhoodOffsets, GenerateImageNeighborhoodOffsetsReturnsEmptyVectorForEmptyShape) { - constexpr unsigned int ImageDimension = 2; - constexpr EmptyImageNeighborhoodShape shape = {}; + constexpr unsigned int ImageDimension{ 2 }; + constexpr EmptyImageNeighborhoodShape shape{}; const std::vector> offsets = itk::GenerateImageNeighborhoodOffsets(shape); EXPECT_EQ(offsets, std::vector>()); @@ -68,7 +68,7 @@ TEST(ImageNeighborhoodOffsets, GenerateImageNeighborhoodOffsetsReturnsEmptyVecto TEST(ImageNeighborhoodOffsets, GenerateRectangularImageNeighborhoodOffsetsReturnsOneOffsetForDefaultRadius) { - constexpr itk::Size<> radius = { {} }; + constexpr itk::Size<> radius{}; const std::vector> offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); EXPECT_EQ(offsets, std::vector>(1)); @@ -77,7 +77,7 @@ TEST(ImageNeighborhoodOffsets, GenerateRectangularImageNeighborhoodOffsetsReturn TEST(ImageNeighborhoodOffsets, GenerateRectangularImageNeighborhoodOffsetsForSmallestHorizontalNeigborhood) { - constexpr itk::Size<> radius = { { 1, 0 } }; + constexpr itk::Size<> radius{ { 1, 0 } }; const std::vector> offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); EXPECT_EQ(offsets, (std::vector>{ { { -1, 0 } }, { { 0, 0 } }, { { 1, 0 } } })); @@ -86,7 +86,7 @@ TEST(ImageNeighborhoodOffsets, GenerateRectangularImageNeighborhoodOffsetsForSma TEST(ImageNeighborhoodOffsets, GenerateRectangularImageNeighborhoodOffsetsForSmallestVerticalNeigborhood) { - constexpr itk::Size<> radius = { { 0, 1 } }; + constexpr itk::Size<> radius{ { 0, 1 } }; const std::vector> offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); EXPECT_EQ(offsets, (std::vector>{ { { 0, -1 } }, { { 0, 0 } }, { { 0, 1 } } })); diff --git a/Modules/Core/Common/test/itkImageRandomConstIteratorWithOnlyIndexTest.cxx b/Modules/Core/Common/test/itkImageRandomConstIteratorWithOnlyIndexTest.cxx index 9c0d16b0c65..965765812f1 100644 --- a/Modules/Core/Common/test/itkImageRandomConstIteratorWithOnlyIndexTest.cxx +++ b/Modules/Core/Common/test/itkImageRandomConstIteratorWithOnlyIndexTest.cxx @@ -26,7 +26,7 @@ itkImageRandomConstIteratorWithOnlyIndexTest(int, char *[]) { std::cout << "Creating an image of indices" << std::endl; - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using PixelType = itk::Index; @@ -41,7 +41,7 @@ itkImageRandomConstIteratorWithOnlyIndexTest(int, char *[]) size0[1] = 100; size0[2] = 100; - constexpr unsigned long numberOfSamples = 10; + constexpr unsigned long numberOfSamples{ 10 }; constexpr ImageType::IndexType start0{}; diff --git a/Modules/Core/Common/test/itkImageRandomIteratorTest.cxx b/Modules/Core/Common/test/itkImageRandomIteratorTest.cxx index 38637d987fc..d8504ce8bd4 100644 --- a/Modules/Core/Common/test/itkImageRandomIteratorTest.cxx +++ b/Modules/Core/Common/test/itkImageRandomIteratorTest.cxx @@ -26,7 +26,7 @@ itkImageRandomIteratorTest(int, char *[]) { std::cout << "Creating an image of indices" << std::endl; - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using PixelType = itk::Index; @@ -41,7 +41,7 @@ itkImageRandomIteratorTest(int, char *[]) size0[1] = 100; size0[2] = 100; - constexpr unsigned long numberOfSamples = 10; + constexpr unsigned long numberOfSamples{ 10 }; constexpr ImageType::IndexType start0{}; diff --git a/Modules/Core/Common/test/itkImageRandomIteratorTest2.cxx b/Modules/Core/Common/test/itkImageRandomIteratorTest2.cxx index 1a8f3ca787a..1e0fabbf1ea 100644 --- a/Modules/Core/Common/test/itkImageRandomIteratorTest2.cxx +++ b/Modules/Core/Common/test/itkImageRandomIteratorTest2.cxx @@ -37,7 +37,7 @@ itkImageRandomIteratorTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned long; diff --git a/Modules/Core/Common/test/itkImageRandomNonRepeatingIteratorWithIndexTest.cxx b/Modules/Core/Common/test/itkImageRandomNonRepeatingIteratorWithIndexTest.cxx index 490d7a0f4b6..c28184ec36e 100644 --- a/Modules/Core/Common/test/itkImageRandomNonRepeatingIteratorWithIndexTest.cxx +++ b/Modules/Core/Common/test/itkImageRandomNonRepeatingIteratorWithIndexTest.cxx @@ -29,7 +29,7 @@ int itkImageRandomNonRepeatingIteratorWithIndexTest(int, char *[]) { - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using PixelType = itk::Index; using ImageType = itk::Image; using PriorityPixelType = itk::SizeValueType; @@ -46,7 +46,7 @@ itkImageRandomNonRepeatingIteratorWithIndexTest(int, char *[]) size0[0] = 50; size0[1] = 50; size0[2] = 50; - constexpr unsigned long numberOfSamples = 10; + constexpr unsigned long numberOfSamples{ 10 }; constexpr ImageType::IndexType start0{}; const ImageType::RegionType region0{ start0, size0 }; myImage->SetRegions(region0); diff --git a/Modules/Core/Common/test/itkImageRandomNonRepeatingIteratorWithIndexTest2.cxx b/Modules/Core/Common/test/itkImageRandomNonRepeatingIteratorWithIndexTest2.cxx index 204776871a9..fe29be147ff 100644 --- a/Modules/Core/Common/test/itkImageRandomNonRepeatingIteratorWithIndexTest2.cxx +++ b/Modules/Core/Common/test/itkImageRandomNonRepeatingIteratorWithIndexTest2.cxx @@ -29,13 +29,13 @@ int itkImageRandomNonRepeatingIteratorWithIndexTest2(int, char *[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = itk::Index; using ImageType = itk::Image; using RandomConstIteratorType = itk::ImageRandomNonRepeatingConstIteratorWithIndex; - constexpr unsigned long N = 10; - constexpr int Seed = 42; + constexpr unsigned long N{ 10 }; + constexpr int Seed{ 42 }; auto size = ImageType::SizeType::Filled(N); constexpr ImageType::IndexType start{}; const ImageType::RegionType region{ start, size }; diff --git a/Modules/Core/Common/test/itkImageRegionExclusionIteratorWithIndexTest.cxx b/Modules/Core/Common/test/itkImageRegionExclusionIteratorWithIndexTest.cxx index 62aaef6dce0..e1d16d6e18f 100644 --- a/Modules/Core/Common/test/itkImageRegionExclusionIteratorWithIndexTest.cxx +++ b/Modules/Core/Common/test/itkImageRegionExclusionIteratorWithIndexTest.cxx @@ -47,8 +47,8 @@ RunTest(const TRegion & region, const TRegion & exclusionRegion) using ValueIteratorType = itk::ImageRegionIteratorWithIndex; using IndexIteratorType = itk::ImageRegionIteratorWithIndex; - constexpr unsigned char normalRegionValue = 100; - constexpr unsigned char exclusionRegionValue = 200; + constexpr unsigned char normalRegionValue{ 100 }; + constexpr unsigned char exclusionRegionValue{ 200 }; // Initialize the Image IndexIteratorType ii(myIndexImage, region); @@ -252,7 +252,7 @@ RunTest(const TRegion & region, const TRegion & exclusionRegion) int itkImageRegionExclusionIteratorWithIndexTest(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using SizeType = itk::Size; using IndexType = itk::Index; using RegionType = itk::ImageRegion; @@ -261,7 +261,7 @@ itkImageRegionExclusionIteratorWithIndexTest(int, char *[]) auto regionSize = itk::MakeFilled(7); const RegionType region{ regionStart, regionSize }; - constexpr SizeType::SizeValueType size[2] = { 4, 7 }; + constexpr SizeType::SizeValueType size[2]{ 4, 7 }; for (const SizeType::SizeValueType s : size) { diff --git a/Modules/Core/Common/test/itkImageRegionRangeGTest.cxx b/Modules/Core/Common/test/itkImageRegionRangeGTest.cxx index 90a7b70b751..ddd29ea0de7 100644 --- a/Modules/Core/Common/test/itkImageRegionRangeGTest.cxx +++ b/Modules/Core/Common/test/itkImageRegionRangeGTest.cxx @@ -629,8 +629,8 @@ TEST(ImageRegionRange, ThrowsInReleaseWhenIterationRegionIsOutsideBufferedRegion const auto image = ImageType::New(); - constexpr IndexType imageIndex{ { -1, -2 } }; - constexpr SizeType imageSize{ { 3, 4 } }; + constexpr IndexType imageIndex{ -1, -2 }; + constexpr SizeType imageSize{ 3, 4 }; image->SetRegions(RegionType{ imageIndex, imageSize }); image->AllocateInitialized(); diff --git a/Modules/Core/Common/test/itkImageRegionTest.cxx b/Modules/Core/Common/test/itkImageRegionTest.cxx index a1735bfb2ee..d53d70a99e2 100644 --- a/Modules/Core/Common/test/itkImageRegionTest.cxx +++ b/Modules/Core/Common/test/itkImageRegionTest.cxx @@ -24,7 +24,7 @@ int itkImageRegionTest(int, char *[]) { - constexpr unsigned int dimension = 3; + constexpr unsigned int dimension{ 3 }; using CoordinateType = double; using RegionType = itk::ImageRegion; @@ -38,12 +38,12 @@ itkImageRegionTest(int, char *[]) bool passed = true; - constexpr SizeType sizeA = { { 10, 20, 30 } }; - constexpr SizeType sizeB = { { 5, 10, 15 } }; + constexpr SizeType sizeA{ 10, 20, 30 }; + constexpr SizeType sizeB{ 5, 10, 15 }; - constexpr IndexType startA = { { 12, 12, 12 } }; - constexpr IndexType startB = { { 14, 14, 14 } }; - constexpr IndexType endA = { { 21, 31, 41 } }; + constexpr IndexType startA{ 12, 12, 12 }; + constexpr IndexType startB{ 14, 14, 14 }; + constexpr IndexType endA{ 21, 31, 41 }; RegionType regionA = { startA, sizeA }; @@ -264,7 +264,7 @@ itkImageRegionTest(int, char *[]) std::cout << "NaN < -1 = " << (indexC[0] < -1.0) << std::endl; std::cout << "NaN > -1 = " << (indexC[0] > -1.0) << std::endl; - constexpr CoordinateType NaN = ContinuousIndexNumericTraits::quiet_NaN(); + constexpr CoordinateType NaN{ ContinuousIndexNumericTraits::quiet_NaN() }; std::cout << "RoundHalfIntegerUp(NaN): " << itk::Math::RoundHalfIntegerUp(NaN) << std::endl; std::cout << "RoundHalfIntegerUp< CoordinateType >(NaN) < static_cast (0): " << (itk::Math::RoundHalfIntegerUp(NaN) < static_cast(0)) << std::endl; @@ -305,7 +305,7 @@ itkImageRegionTest(int, char *[]) RegionType shrinkRegion{ shrinkIndex, shrinkSize }; RegionType padAndShrinkRegion = shrinkRegion; - constexpr itk::OffsetValueType offsetValueRadius = 4; + constexpr itk::OffsetValueType offsetValueRadius{ 4 }; padAndShrinkRegion.PadByRadius(offsetValueRadius); padAndShrinkRegion.ShrinkByRadius(offsetValueRadius); if (shrinkRegion != padAndShrinkRegion) diff --git a/Modules/Core/Common/test/itkImageReverseIteratorTest.cxx b/Modules/Core/Common/test/itkImageReverseIteratorTest.cxx index 532ac855443..25125c7e97f 100644 --- a/Modules/Core/Common/test/itkImageReverseIteratorTest.cxx +++ b/Modules/Core/Common/test/itkImageReverseIteratorTest.cxx @@ -49,7 +49,7 @@ itkImageReverseIteratorTest(int, char *[]) { using PixelType = itk::Vector; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using ImageType = itk::Image; @@ -59,14 +59,14 @@ itkImageReverseIteratorTest(int, char *[]) float origin3D[3] = { 5.0f, 2.1f, 8.1f }; float spacing3D[3] = { 1.5f, 2.1f, 1.0f }; - constexpr ImageType::SizeType imageSize3D = { { 20, 40, 60 } }; - constexpr ImageType::SizeType bufferSize3D = { { 8, 20, 14 } }; - constexpr ImageType::SizeType regionSize3D = { { 4, 6, 6 } }; + constexpr ImageType::SizeType imageSize3D{ 20, 40, 60 }; + constexpr ImageType::SizeType bufferSize3D{ 8, 20, 14 }; + constexpr ImageType::SizeType regionSize3D{ 4, 6, 6 }; - constexpr ImageType::IndexType startIndex3D = { { 5, 4, 1 } }; - constexpr ImageType::IndexType bufferStartIndex3D = { { 2, 3, 5 } }; - constexpr ImageType::IndexType regionStartIndex3D = { { 5, 10, 12 } }; - constexpr ImageType::IndexType regionEndIndex3D = { { 8, 15, 17 } }; + constexpr ImageType::IndexType startIndex3D{ 5, 4, 1 }; + constexpr ImageType::IndexType bufferStartIndex3D{ 2, 3, 5 }; + constexpr ImageType::IndexType regionStartIndex3D{ 5, 10, 12 }; + constexpr ImageType::IndexType regionEndIndex3D{ 8, 15, 17 }; ImageType::RegionType region{ startIndex3D, imageSize3D }; diff --git a/Modules/Core/Common/test/itkImageScanlineIteratorTest1.cxx b/Modules/Core/Common/test/itkImageScanlineIteratorTest1.cxx index 6caf685092d..b30e093fc5a 100644 --- a/Modules/Core/Common/test/itkImageScanlineIteratorTest1.cxx +++ b/Modules/Core/Common/test/itkImageScanlineIteratorTest1.cxx @@ -57,14 +57,14 @@ itkImageScanlineIteratorTest1(int, char *[]) using ImageType = itk::Image, 3>; - constexpr ImageType::SizeType imageSize3D = { { 20, 40, 60 } }; - constexpr ImageType::SizeType bufferSize3D = { { 8, 20, 14 } }; - constexpr ImageType::SizeType regionSize3D = { { 4, 6, 6 } }; - - constexpr ImageType::IndexType startIndex3D = { { 5, 4, 1 } }; - constexpr ImageType::IndexType bufferStartIndex3D = { { 2, 3, 5 } }; - constexpr ImageType::IndexType regionStartIndex3D = { { 5, 10, 12 } }; - constexpr ImageType::IndexType regionEndIndex3D = { { 8, 15, 17 } }; + constexpr ImageType::SizeType imageSize3D{ 20, 40, 60 }; + constexpr ImageType::SizeType bufferSize3D{ 8, 20, 14 }; + constexpr ImageType::SizeType regionSize3D{ 4, 6, 6 }; + + constexpr ImageType::IndexType startIndex3D{ 5, 4, 1 }; + constexpr ImageType::IndexType bufferStartIndex3D{ 2, 3, 5 }; + constexpr ImageType::IndexType regionStartIndex3D{ 5, 10, 12 }; + constexpr ImageType::IndexType regionEndIndex3D{ 8, 15, 17 }; ImageType::RegionType region{ startIndex3D, imageSize3D }; diff --git a/Modules/Core/Common/test/itkImageSliceIteratorTest.cxx b/Modules/Core/Common/test/itkImageSliceIteratorTest.cxx index c36407f0bd6..244fa3a137c 100644 --- a/Modules/Core/Common/test/itkImageSliceIteratorTest.cxx +++ b/Modules/Core/Common/test/itkImageSliceIteratorTest.cxx @@ -25,7 +25,7 @@ itkImageSliceIteratorTest(int, char *[]) { std::cout << "Creating an image of indices" << std::endl; - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using PixelType = itk::Index; diff --git a/Modules/Core/Common/test/itkImageTest.cxx b/Modules/Core/Common/test/itkImageTest.cxx index 2559bdd027e..62d76653747 100644 --- a/Modules/Core/Common/test/itkImageTest.cxx +++ b/Modules/Core/Common/test/itkImageTest.cxx @@ -82,7 +82,7 @@ itkImageTest(int, char *[]) // test inverse direction std::cout << "Test inverse direction." << std::endl; Image::DirectionType product = direction * image->GetInverseDirection(); - constexpr double eps = 1e-06; + constexpr double eps{ 1e-06 }; if (itk::Math::abs(product[0][0] - 1.0) > eps || itk::Math::abs(product[1][1] - 1.0) > eps || itk::Math::abs(product[0][1]) > eps || itk::Math::abs(product[1][0]) > eps) { diff --git a/Modules/Core/Common/test/itkImageToImageToleranceTest.cxx b/Modules/Core/Common/test/itkImageToImageToleranceTest.cxx index aff164c94a0..aaba4fab350 100644 --- a/Modules/Core/Common/test/itkImageToImageToleranceTest.cxx +++ b/Modules/Core/Common/test/itkImageToImageToleranceTest.cxx @@ -27,7 +27,7 @@ itkImageToImageToleranceTest(int, char *[]) auto image1 = ImageType::New(); auto image2 = ImageType::New(); - constexpr ImageType::SizeType size = { { 3, 3, 3 } }; + constexpr ImageType::SizeType size{ 3, 3, 3 }; image1->SetRegions(size); image1->Allocate(); image1->FillBuffer(1); diff --git a/Modules/Core/Common/test/itkImageVectorOptimizerParametersHelperTest.cxx b/Modules/Core/Common/test/itkImageVectorOptimizerParametersHelperTest.cxx index aa651e88413..48a221586de 100644 --- a/Modules/Core/Common/test/itkImageVectorOptimizerParametersHelperTest.cxx +++ b/Modules/Core/Common/test/itkImageVectorOptimizerParametersHelperTest.cxx @@ -25,8 +25,8 @@ namespace { using ValueType = double; -constexpr itk::SizeValueType ImageDimension = 2; -constexpr itk::SizeValueType VectorDimension = 4; +constexpr itk::SizeValueType ImageDimension{ 2 }; +constexpr itk::SizeValueType VectorDimension{ 4 }; using VectorPixelType = itk::Vector; using ImageVectorType = itk::Image; using ImageVectorPointer = ImageVectorType::Pointer; @@ -83,7 +83,7 @@ itkImageVectorOptimizerParametersHelperTest(int, char *[]) constexpr IndexType start{}; SizeType size; - constexpr int dimLength = 3; + constexpr int dimLength{ 3 }; size.Fill(dimLength); const RegionType region{ start, size }; diff --git a/Modules/Core/Common/test/itkImportImageTest.cxx b/Modules/Core/Common/test/itkImportImageTest.cxx index 2f8f59a942e..c2950f68c1b 100644 --- a/Modules/Core/Common/test/itkImportImageTest.cxx +++ b/Modules/Core/Common/test/itkImportImageTest.cxx @@ -32,7 +32,7 @@ itkImportImageTest(int, char *[]) rawImage[i] = i; } // typedefs to simplify the syntax - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = short; using ImportImageFilter = itk::ImportImageFilter; @@ -54,19 +54,19 @@ itkImportImageTest(int, char *[]) const ImportImageFilter::Pointer import = ImportImageFilter::New(); // Test the SetVectorMacros and GetVectorMacros - constexpr itk::SpacePrecisionType data[2] = { 1.0, 1.0 }; + constexpr itk::SpacePrecisionType data[2]{ 1.0, 1.0 }; import->SetSpacing(data); - constexpr float data2[2] = { 1.0, 1.0 }; + constexpr float data2[2]{ 1.0, 1.0 }; import->SetSpacing(data2); const itk::SpacePrecisionType * spacingValue = import->GetSpacing().GetDataPointer(); std::cout << "import->GetSpacing(): " << spacingValue << std::endl; - constexpr double data3[2] = { 1.0, 1.0 }; + constexpr double data3[2]{ 1.0, 1.0 }; import->SetOrigin(data3); - constexpr float data4[2] = { 1.0, 1.0 }; + constexpr float data4[2]{ 1.0, 1.0 }; import->SetOrigin(data4); const itk::SpacePrecisionType * originValue = import->GetOrigin().GetDataPointer(); diff --git a/Modules/Core/Common/test/itkIndexRangeGTest.cxx b/Modules/Core/Common/test/itkIndexRangeGTest.cxx index 06c25205fc2..eff7f881e06 100644 --- a/Modules/Core/Common/test/itkIndexRangeGTest.cxx +++ b/Modules/Core/Common/test/itkIndexRangeGTest.cxx @@ -265,7 +265,7 @@ TEST(IndexRange, CanBeUsedAsExpressionOfRangeBasedForLoop) TEST(IndexRange, SupportsImageRegion) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ImageRegionIndexRangeType = ImageRegionIndexRange; using IndexType = ImageRegionIndexRangeType::IndexType; diff --git a/Modules/Core/Common/test/itkIteratorTests.cxx b/Modules/Core/Common/test/itkIteratorTests.cxx index ad0ef7b6410..fb2edfac853 100644 --- a/Modules/Core/Common/test/itkIteratorTests.cxx +++ b/Modules/Core/Common/test/itkIteratorTests.cxx @@ -34,13 +34,13 @@ itkIteratorTests(int, char *[]) double origin3D[3] = { 5, 2.1, 8.1 }; double spacing3D[3] = { 1.5, 2.1, 1 }; - constexpr ScalarImage::SizeType imageSize3D = { { 200, 200, 200 } }; - constexpr ScalarImage::SizeType bufferSize3D = { { 200, 200, 200 } }; - constexpr ScalarImage::SizeType regionSize3D = { { 190, 190, 190 } }; + constexpr ScalarImage::SizeType imageSize3D{ 200, 200, 200 }; + constexpr ScalarImage::SizeType bufferSize3D{ 200, 200, 200 }; + constexpr ScalarImage::SizeType regionSize3D{ 190, 190, 190 }; - constexpr ScalarImage::IndexType startIndex3D = { { 0, 0, 0 } }; - constexpr ScalarImage::IndexType bufferStartIndex3D = { { 0, 0, 0 } }; - constexpr ScalarImage::IndexType regionStartIndex3D = { { 5, 5, 5 } }; + constexpr ScalarImage::IndexType startIndex3D{ 0, 0, 0 }; + constexpr ScalarImage::IndexType bufferStartIndex3D{ 0, 0, 0 }; + constexpr ScalarImage::IndexType regionStartIndex3D{ 5, 5, 5 }; ScalarImage::RegionType region{ startIndex3D, imageSize3D }; @@ -122,7 +122,7 @@ itkIteratorTests(int, char *[]) start = clock(); itk::ImageRegionIterator it(o3, region); - constexpr unsigned short scalar = 5; + constexpr unsigned short scalar{ 5 }; { unsigned int i = 0; diff --git a/Modules/Core/Common/test/itkLineIteratorTest.cxx b/Modules/Core/Common/test/itkLineIteratorTest.cxx index 0bc3b7ab6f1..f2ae008133c 100644 --- a/Modules/Core/Common/test/itkLineIteratorTest.cxx +++ b/Modules/Core/Common/test/itkLineIteratorTest.cxx @@ -28,7 +28,7 @@ int itkLineIteratorTest(int argc, char * argv[]) { - constexpr int Dimension = 2; + constexpr int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; using IndexType = ImageType::RegionType::IndexType; diff --git a/Modules/Core/Common/test/itkMathCastWithRangeCheckTest.cxx b/Modules/Core/Common/test/itkMathCastWithRangeCheckTest.cxx index 63246603bbd..050edf3b05d 100644 --- a/Modules/Core/Common/test/itkMathCastWithRangeCheckTest.cxx +++ b/Modules/Core/Common/test/itkMathCastWithRangeCheckTest.cxx @@ -78,7 +78,7 @@ template bool DoCastWithRangeCheckTest(const T1 * = nullptr, const T2 * = nullptr) { - constexpr int minus_one = -1; + constexpr int minus_one{ -1 }; // test convert T2 to T1 bool pass = true; diff --git a/Modules/Core/Common/test/itkMathRoundProfileTest1.cxx b/Modules/Core/Common/test/itkMathRoundProfileTest1.cxx index b18b53eb4ed..edeb7388e0d 100644 --- a/Modules/Core/Common/test/itkMathRoundProfileTest1.cxx +++ b/Modules/Core/Common/test/itkMathRoundProfileTest1.cxx @@ -61,11 +61,11 @@ itkMathRoundProfileTest1(int, char *[]) IntArrayType output3; IntArrayType output4; - constexpr unsigned long numberOfValues = 1000L; + constexpr unsigned long numberOfValues{ 1000L }; - constexpr double initialValue = -10.0; + constexpr double initialValue{ -10.0 }; - constexpr double valueIncrement = (-initialValue - initialValue) / numberOfValues; + constexpr double valueIncrement{ (-initialValue - initialValue) / numberOfValues }; std::cout << "Initial Value = " << initialValue << std::endl; std::cout << "Value Increment = " << valueIncrement << std::endl; diff --git a/Modules/Core/Common/test/itkMathRoundTest2.cxx b/Modules/Core/Common/test/itkMathRoundTest2.cxx index a0555f3e6dc..f8faf5be10c 100644 --- a/Modules/Core/Common/test/itkMathRoundTest2.cxx +++ b/Modules/Core/Common/test/itkMathRoundTest2.cxx @@ -36,16 +36,16 @@ TemplatedRoundTest() { bool ok = true; - constexpr unsigned int numberOfElements = 15; + constexpr unsigned int numberOfElements{ 15 }; // input data for rounding methods - constexpr float input[] = { -8.4999f, -8.50f, -8.5001f, 8.4999f, 8.50f, 8.5001f, -9.4999f, -9.50f, - -9.5001f, 9.4999f, 9.50f, 9.5001f, -0.4999f, -.50f, -.5001f }; + constexpr float input[]{ -8.4999f, -8.50f, -8.5001f, 8.4999f, 8.50f, 8.5001f, -9.4999f, -9.50f, + -9.5001f, 9.4999f, 9.50f, 9.5001f, -0.4999f, -.50f, -.5001f }; T roundOutput[] = { -8, -8, -9, 8, 9, 9, -9, -9, -10, 9, 10, 10, 0, 0, -1 }; - constexpr T halftoevenOutput[] = { -8, -8, -9, 8, 8, 9, -9, -10, -10, 9, 10, 10, 0, 0, -1 }; + constexpr T halftoevenOutput[]{ -8, -8, -9, 8, 8, 9, -9, -10, -10, 9, 10, 10, 0, 0, -1 }; T * halfupOutput = roundOutput; @@ -53,13 +53,13 @@ TemplatedRoundTest() //////// // input data for floor and ceil methods - constexpr float fcinput[] = { 8.0f, 8.9999f, 8.0001f, -8.0f, -8.9999f, -8.0001f, 9.0f, 9.9999f, - 9.0001f, -9.0f, -9.9999f, -9.0001f, -1.0f, -0.9999f, -1.0001f }; + constexpr float fcinput[]{ 8.0f, 8.9999f, 8.0001f, -8.0f, -8.9999f, -8.0001f, 9.0f, 9.9999f, + 9.0001f, -9.0f, -9.9999f, -9.0001f, -1.0f, -0.9999f, -1.0001f }; - constexpr T floorOutput[] = { 8, 8, 8, -8, -9, -9, 9, 9, 9, -9, -10, -10, -1, -1, -2 }; + constexpr T floorOutput[]{ 8, 8, 8, -8, -9, -9, 9, 9, 9, -9, -10, -10, -1, -1, -2 }; - constexpr T ceilOutput[] = { 8, 9, 9, -8, -8, -8, 9, 10, 10, -9, -9, -9, -1, 0, -1 }; + constexpr T ceilOutput[]{ 8, 9, 9, -8, -8, -8, 9, 10, 10, -9, -9, -9, -1, 0, -1 }; // Round diff --git a/Modules/Core/Common/test/itkMathTest.cxx b/Modules/Core/Common/test/itkMathTest.cxx index ddee7b89905..0f046a5027e 100644 --- a/Modules/Core/Common/test/itkMathTest.cxx +++ b/Modules/Core/Common/test/itkMathTest.cxx @@ -587,11 +587,11 @@ main(int, char *[]) { // Test various equals operations. //========================= - constexpr signed char sc = -1; + constexpr signed char sc{ -1 }; constexpr auto uc = static_cast(-1); testPassStatus = (TestIntegersAreSame(sc, uc) == EXIT_SUCCESS) ? testPassStatus : EXIT_FAILURE; //========================= - constexpr int si = -1; + constexpr int si{ -1 }; constexpr auto ul = static_cast(-1); testPassStatus = (TestIntegersAreSame(si, ul) == EXIT_SUCCESS) ? testPassStatus : EXIT_FAILURE; //========================= @@ -602,8 +602,8 @@ main(int, char *[]) testPassStatus = (TestIntegersAreSame(si, ust) == EXIT_SUCCESS) ? testPassStatus : EXIT_FAILURE; //========================= - constexpr float f = -1.0f; - constexpr double d = 1.01; + constexpr float f{ -1.0f }; + constexpr double d{ 1.01 }; // Test AlmostEquals() if (itk::Math::AlmostEquals(f, d) || itk::Math::AlmostEquals(d, f)) @@ -711,8 +711,8 @@ main(int, char *[]) // Test comparison between complex and real number with the same value constexpr std::complex z3Double(0.123, 0); - constexpr float r3Float = 0.123; - constexpr double r3Double = 0.123; + constexpr float r3Float{ 0.123 }; + constexpr double r3Double{ 0.123 }; std::cout << "Testing COMPLEX vs REAL, DOUBLE vs DOUBLE, SAME values " << std::endl; if (itk::Math::NotAlmostEquals(z3Double, r3Double)) diff --git a/Modules/Core/Common/test/itkMatrixTest.cxx b/Modules/Core/Common/test/itkMatrixTest.cxx index 5c339c2f193..ffd327c9225 100644 --- a/Modules/Core/Common/test/itkMatrixTest.cxx +++ b/Modules/Core/Common/test/itkMatrixTest.cxx @@ -46,7 +46,7 @@ itkMatrixTest(int, char *[]) std::cout << resultVector[1] << ", "; std::cout << resultVector[2] << std::endl; - constexpr PointType::ValueType p1Init[3] = { 3, 4, 5 }; + constexpr PointType::ValueType p1Init[3]{ 3, 4, 5 }; const PointType p1 = p1Init; PointType resultPoint = matrix * p1; @@ -87,7 +87,7 @@ itkMatrixTest(int, char *[]) auto matrix5 = itk::MakeFilled(1.7); - constexpr NumericType value = 2; + constexpr NumericType value{ 2 }; matrix5[1][1] = value; if (itk::Math::NotExactlyEquals(matrix5[1][1], value)) { @@ -96,7 +96,7 @@ itkMatrixTest(int, char *[]) } // Test access with the operator()(row,col) - constexpr NumericType value2 = 19; + constexpr NumericType value2{ 19 }; matrix5(1, 1) = value2; if (itk::Math::NotExactlyEquals(matrix5[1][1], value2)) { @@ -195,8 +195,8 @@ itkMatrixTest(int, char *[]) { // Test for Matrix addition and subtraction - constexpr unsigned int nc = 4; - constexpr unsigned int nr = 3; + constexpr unsigned int nc{ 4 }; + constexpr unsigned int nr{ 3 }; using AddSubtractMatrixType = itk::Matrix; @@ -231,7 +231,7 @@ itkMatrixTest(int, char *[]) // Check the addition and subtraction values { - constexpr double tolerance = 1e-7; + constexpr double tolerance{ 1e-7 }; for (unsigned int r = 0; r < nr; ++r) { for (unsigned int c = 0; c < nc; ++c) @@ -257,7 +257,7 @@ itkMatrixTest(int, char *[]) // Check the in-place addition and subtraction values { - constexpr double tolerance = 1e-7; + constexpr double tolerance{ 1e-7 }; for (unsigned int r = 0; r < nr; ++r) { for (unsigned int c = 0; c < nc; ++c) @@ -297,7 +297,7 @@ itkMatrixTest(int, char *[]) MatrixType matrixB(vnlMatrixA); // Test constructor { // verify values - constexpr double tolerance = 1e-7; + constexpr double tolerance{ 1e-7 }; for (unsigned int row = 0; row < 3; ++row) { for (unsigned int col = 0; col < 3; ++col) @@ -315,7 +315,7 @@ itkMatrixTest(int, char *[]) matrixC = vnlMatrixA; // Test assignment { // verify values - constexpr double tolerance = 1e-7; + constexpr double tolerance{ 1e-7 }; for (unsigned int row = 0; row < 3; ++row) { for (unsigned int col = 0; col < 3; ++col) diff --git a/Modules/Core/Common/test/itkMemoryProbesCollecterBaseTest.cxx b/Modules/Core/Common/test/itkMemoryProbesCollecterBaseTest.cxx index 7ab4269119a..0f563508673 100644 --- a/Modules/Core/Common/test/itkMemoryProbesCollecterBaseTest.cxx +++ b/Modules/Core/Common/test/itkMemoryProbesCollecterBaseTest.cxx @@ -36,7 +36,7 @@ Sleep(unsigned int milliseconds) int itkMemoryProbesCollecterBaseTest(int, char *[]) { - constexpr size_t bufsize = 768L * 1024L * 1024L; // 768 MiB + constexpr size_t bufsize{ 768L * 1024L * 1024L }; // 768 MiB itk::MemoryProbesCollectorBase mcollecter; itk::MemoryProbe probe; diff --git a/Modules/Core/Common/test/itkMersenneTwisterRandomVariateGeneratorTest.cxx b/Modules/Core/Common/test/itkMersenneTwisterRandomVariateGeneratorTest.cxx index 472eb85ef48..2890c08b003 100644 --- a/Modules/Core/Common/test/itkMersenneTwisterRandomVariateGeneratorTest.cxx +++ b/Modules/Core/Common/test/itkMersenneTwisterRandomVariateGeneratorTest.cxx @@ -33,7 +33,7 @@ itkMersenneTwisterRandomVariateGeneratorTest(int, char *[]) using Twister = itk::Statistics::MersenneTwisterRandomVariateGenerator; - constexpr Twister::IntegerType seed = 1234; + constexpr Twister::IntegerType seed{ 1234 }; // Test Get/SetSeed Twister::GetInstance()->SetSeed(seed); @@ -63,11 +63,11 @@ itkMersenneTwisterRandomVariateGeneratorTest(int, char *[]) } // Ensure we get the same series of numbers - constexpr Twister::IntegerType expected[5] = { static_cast(3294740812u), - static_cast(4175194053u), - static_cast(3041332341u), - static_cast(199851601u), - static_cast(3422518480u) }; + constexpr Twister::IntegerType expected[5]{ static_cast(3294740812u), + static_cast(4175194053u), + static_cast(3041332341u), + static_cast(199851601u), + static_cast(3422518480u) }; bool sameSequence = true; for (const auto i : expected) @@ -88,7 +88,7 @@ itkMersenneTwisterRandomVariateGeneratorTest(int, char *[]) // NB: requires a large number of iterations to have variance converge... double sum = 0.0; double sum2 = 0.0; - constexpr int count = 500000; + constexpr int count{ 500000 }; for (int i = 0; i < count; ++i) { const double v = twister->GetNormalVariate(); diff --git a/Modules/Core/Common/test/itkMinimumMaximumImageCalculatorTest.cxx b/Modules/Core/Common/test/itkMinimumMaximumImageCalculatorTest.cxx index cec059b7442..d9320511e32 100644 --- a/Modules/Core/Common/test/itkMinimumMaximumImageCalculatorTest.cxx +++ b/Modules/Core/Common/test/itkMinimumMaximumImageCalculatorTest.cxx @@ -30,9 +30,9 @@ itkMinimumMaximumImageCalculatorTest(int, char *[]) using MinMaxCalculatorType = itk::MinimumMaximumImageCalculator; /* Define the image size and physical coordinates */ - constexpr SizeType size = { { 20, 20, 20 } }; - constexpr double origin[3] = { 0.0, 0.0, 0.0 }; - constexpr double spacing[3] = { 1, 1, 1 }; + constexpr SizeType size{ 20, 20, 20 }; + constexpr double origin[3]{ 0.0, 0.0, 0.0 }; + constexpr double spacing[3]{ 1, 1, 1 }; std::cout << "Testing Minimum and Maximum Image Calculator:\n"; @@ -97,8 +97,8 @@ itkMinimumMaximumImageCalculatorTest(int, char *[]) ITK_TEST_SET_GET_VALUE(maxIntensityValueIndex, calculator->GetIndexOfMaximum()); // Set the region over which perform the computations - constexpr itk::Size<3> regionSize = { { 4, 4, 4 } }; - constexpr itk::Index<3> idx = { { 0, 0, 0 } }; + constexpr itk::Size<3> regionSize{ { 4, 4, 4 } }; + constexpr itk::Index<3> idx{ { 0, 0, 0 } }; const MinMaxCalculatorType::RegionType computationRegion{ idx, regionSize }; calculator->SetRegion(computationRegion); diff --git a/Modules/Core/Common/test/itkMultiThreaderExceptionsTest.cxx b/Modules/Core/Common/test/itkMultiThreaderExceptionsTest.cxx index 96aff8d33fc..cbc9c102637 100644 --- a/Modules/Core/Common/test/itkMultiThreaderExceptionsTest.cxx +++ b/Modules/Core/Common/test/itkMultiThreaderExceptionsTest.cxx @@ -81,7 +81,7 @@ int itkMultiThreaderExceptionsTest(int, char *[]) { using OutputPixelType = float; - constexpr unsigned int Dimension = 1; + constexpr unsigned int Dimension{ 1 }; using OutputImageType = itk::Image; diff --git a/Modules/Core/Common/test/itkMultiThreaderParallelizeArrayTest.cxx b/Modules/Core/Common/test/itkMultiThreaderParallelizeArrayTest.cxx index ee248fa5a33..0567134ab69 100644 --- a/Modules/Core/Common/test/itkMultiThreaderParallelizeArrayTest.cxx +++ b/Modules/Core/Common/test/itkMultiThreaderParallelizeArrayTest.cxx @@ -63,7 +63,7 @@ itkMultiThreaderParallelizeArrayTest(int argc, char * argv[]) mt->SetNumberOfWorkUnits(workUnitCount); } - constexpr unsigned int size = 1029; + constexpr unsigned int size{ 1029 }; std::vector vec(size); using SomeProcessObject = itk::AbsImageFilter, itk::Image>; diff --git a/Modules/Core/Common/test/itkMultithreadingTest.cxx b/Modules/Core/Common/test/itkMultithreadingTest.cxx index 28d5fa86690..9f3abf9429d 100644 --- a/Modules/Core/Common/test/itkMultithreadingTest.cxx +++ b/Modules/Core/Common/test/itkMultithreadingTest.cxx @@ -42,7 +42,7 @@ execute(void * ptr) } sharedMutex->unlock(); - constexpr int n = 10; + constexpr int n{ 10 }; const int m = *data; double sum = 1.0; diff --git a/Modules/Core/Common/test/itkNeighborhoodOperatorTest.cxx b/Modules/Core/Common/test/itkNeighborhoodOperatorTest.cxx index a1891462f57..1f8dea1bcb7 100644 --- a/Modules/Core/Common/test/itkNeighborhoodOperatorTest.cxx +++ b/Modules/Core/Common/test/itkNeighborhoodOperatorTest.cxx @@ -73,10 +73,10 @@ int itkNeighborhoodOperatorTest(int, char *[]) { using PixelType = float; - constexpr unsigned int Dimension1D = 1; - constexpr unsigned int Dimension2D = 2; - constexpr unsigned int Dimension3D = 3; - constexpr unsigned int Dimension4D = 4; + constexpr unsigned int Dimension1D{ 1 }; + constexpr unsigned int Dimension2D{ 2 }; + constexpr unsigned int Dimension3D{ 3 }; + constexpr unsigned int Dimension4D{ 4 }; std::cout << "Testing derivative operator" << std::endl; itk::DerivativeOperator> d; @@ -84,7 +84,7 @@ itkNeighborhoodOperatorTest(int, char *[]) ITK_EXERCISE_BASIC_OBJECT_METHODS((&d), DerivativeOperator, NeighborhoodOperator); - constexpr unsigned int order = 2; + constexpr unsigned int order{ 2 }; d.SetOrder(order); ITK_TEST_SET_GET_VALUE(order, d.GetOrder()); @@ -101,11 +101,11 @@ itkNeighborhoodOperatorTest(int, char *[]) ITK_EXERCISE_BASIC_OBJECT_METHODS((&g), GaussianOperator, NeighborhoodOperator); - constexpr double variance = 2.3; + constexpr double variance{ 2.3 }; g.SetVariance(variance); ITK_TEST_SET_GET_VALUE(variance, g.GetVariance()); - constexpr double maximumError = .01; + constexpr double maximumError{ .01 }; g.SetMaximumError(maximumError); ITK_TEST_SET_GET_VALUE(maximumError, g.GetMaximumError()); @@ -145,7 +145,7 @@ itkNeighborhoodOperatorTest(int, char *[]) ITK_EXERCISE_BASIC_OBJECT_METHODS((&a1), LaplacianOperator, NeighborhoodOperator); - constexpr double scales_1d[] = { 1.0 / 2.0 }; + constexpr double scales_1d[]{ 1.0 / 2.0 }; a1.SetDerivativeScalings(scales_1d); ITK_TEST_SET_GET_VALUE(*scales_1d, *(a1.GetDerivativeScalings())); @@ -165,7 +165,7 @@ itkNeighborhoodOperatorTest(int, char *[]) std::cout << "Testing 2D LaplacianOperator" << std::endl; itk::LaplacianOperator> a2; - constexpr double scales_2d[] = { 1.0 / 2.0, 1.0 / 4.0 }; + constexpr double scales_2d[]{ 1.0 / 2.0, 1.0 / 4.0 }; a2.SetDerivativeScalings(scales_2d); ITK_TEST_SET_GET_VALUE(*scales_2d, *(a2.GetDerivativeScalings())); @@ -185,7 +185,7 @@ itkNeighborhoodOperatorTest(int, char *[]) std::cout << "Testing 3D LaplacianOperator" << std::endl; itk::LaplacianOperator> a3; - constexpr double scales_3d[] = { 1.0 / 2.0, 1.0 / 4.0, 1.0 / 5.0 }; + constexpr double scales_3d[]{ 1.0 / 2.0, 1.0 / 4.0, 1.0 / 5.0 }; a3.SetDerivativeScalings(scales_3d); ITK_TEST_SET_GET_VALUE(*scales_3d, *(a3.GetDerivativeScalings())); diff --git a/Modules/Core/Common/test/itkObjectFactoryBaseGTest.cxx b/Modules/Core/Common/test/itkObjectFactoryBaseGTest.cxx index 91cdbe53580..1e686b97f3f 100644 --- a/Modules/Core/Common/test/itkObjectFactoryBaseGTest.cxx +++ b/Modules/Core/Common/test/itkObjectFactoryBaseGTest.cxx @@ -31,7 +31,7 @@ namespace { // The name of the test object type, as stored by the test object factory. -constexpr const char * testObjectTypeName = "Test Object"; +constexpr const char * testObjectTypeName{ "Test Object" }; // A "dummy" object type, just for unit test purposes. class TestObject : public itk::LightObject diff --git a/Modules/Core/Common/test/itkObjectFactoryOnlyNewTest.cxx b/Modules/Core/Common/test/itkObjectFactoryOnlyNewTest.cxx index 6271e9c1a61..188c3279bbc 100644 --- a/Modules/Core/Common/test/itkObjectFactoryOnlyNewTest.cxx +++ b/Modules/Core/Common/test/itkObjectFactoryOnlyNewTest.cxx @@ -141,7 +141,7 @@ itkObjectFactoryOnlyNewTest(int, char *[]) // Verify that interface class cannot be instantiated // if no implementation factory is registered using PixelType = short; - constexpr size_t Dimension = 2; + constexpr size_t Dimension{ 2 }; using TestImageInterfaceType = TestImageInterfaceClass; ITK_TRY_EXPECT_EXCEPTION(TestImageInterfaceType::New()); diff --git a/Modules/Core/Common/test/itkObjectFactoryTest2.cxx b/Modules/Core/Common/test/itkObjectFactoryTest2.cxx index 81c44299768..c6892ba5048 100644 --- a/Modules/Core/Common/test/itkObjectFactoryTest2.cxx +++ b/Modules/Core/Common/test/itkObjectFactoryTest2.cxx @@ -73,12 +73,12 @@ ReallocateImage() auto testImage = ImageType::New(); - constexpr SizeType size = { { 5, 3 } }; + constexpr SizeType size{ 5, 3 }; testImage->SetRegions(size); testImage->AllocateInitialized(); - constexpr SizeType size2 = { { 100, 100 } }; + constexpr SizeType size2{ 100, 100 }; testImage->SetRegions(size2); testImage->AllocateInitialized(); } @@ -186,7 +186,7 @@ itkObjectFactoryTest2(int argc, char * argv[]) ReallocateImage(); - constexpr int status = EXIT_SUCCESS; + constexpr int status{ EXIT_SUCCESS }; return status; } diff --git a/Modules/Core/Common/test/itkOctreeTest.cxx b/Modules/Core/Common/test/itkOctreeTest.cxx index b70f5c79d9f..7c057cae7b4 100644 --- a/Modules/Core/Common/test/itkOctreeTest.cxx +++ b/Modules/Core/Common/test/itkOctreeTest.cxx @@ -40,8 +40,8 @@ int itkOctreeTest(int, char *[]) { using ImageType = itk::Image; - constexpr ImageType::SizeType imageSize = { { 4, 4, 4 } }; - constexpr ImageType::IndexType imageIndex = { { 0, 0, 0 } }; + constexpr ImageType::SizeType imageSize{ 4, 4, 4 }; + constexpr ImageType::IndexType imageIndex{ 0, 0, 0 }; const ImageType::RegionType region{ imageIndex, imageSize }; auto img = ImageType::New(); img->SetRegions(region); diff --git a/Modules/Core/Common/test/itkOptimizerParametersTest.cxx b/Modules/Core/Common/test/itkOptimizerParametersTest.cxx index 6dd1c156381..ad1d011ab90 100644 --- a/Modules/Core/Common/test/itkOptimizerParametersTest.cxx +++ b/Modules/Core/Common/test/itkOptimizerParametersTest.cxx @@ -35,7 +35,7 @@ runTestByType() /* Test different ctors */ // Construct by size - constexpr itk::SizeValueType dim = 20; + constexpr itk::SizeValueType dim{ 20 }; const itk::OptimizerParameters paramsSize(dim); if (paramsSize.GetSize() != dim) { diff --git a/Modules/Core/Common/test/itkPeriodicBoundaryConditionTest.cxx b/Modules/Core/Common/test/itkPeriodicBoundaryConditionTest.cxx index 976f9f4e234..ae2b3e9d506 100644 --- a/Modules/Core/Common/test/itkPeriodicBoundaryConditionTest.cxx +++ b/Modules/Core/Common/test/itkPeriodicBoundaryConditionTest.cxx @@ -124,8 +124,8 @@ itkPeriodicBoundaryConditionTest(int, char *[]) // Test an image to cover one operator() method. auto image = ImageType::New(); - constexpr SizeType imageSize = { { 5, 5 } }; - constexpr IndexType imageIndex = { { 0, 0 } }; + constexpr SizeType imageSize{ 5, 5 }; + constexpr IndexType imageIndex{ 0, 0 }; const RegionType imageRegion(imageIndex, imageSize); image->SetRegions(imageRegion); image->Allocate(); diff --git a/Modules/Core/Common/test/itkPointGeometryTest.cxx b/Modules/Core/Common/test/itkPointGeometryTest.cxx index a6887722cea..a67ae21ea28 100644 --- a/Modules/Core/Common/test/itkPointGeometryTest.cxx +++ b/Modules/Core/Common/test/itkPointGeometryTest.cxx @@ -36,7 +36,7 @@ itkPointGeometryTest(int, char *[]) { // Dimension & Type - constexpr unsigned int N = 3; + constexpr unsigned int N{ 3 }; using ValueType = double; // Vector & Point Classes @@ -113,7 +113,7 @@ itkPointGeometryTest(int, char *[]) { std::cout << "Test for CastFrom() method... "; - constexpr float tolerance = 1e-7; + constexpr float tolerance{ 1e-7 }; // Point Classes using DoublePointType = itk::Point; @@ -150,8 +150,8 @@ itkPointGeometryTest(int, char *[]) // Test the MeanPoint { PointType midpoint; - constexpr PointType::ValueType aInit[3] = { 2.0, 4.0, 7.0 }; - constexpr PointType::ValueType bInit[3] = { 6.0, 2.0, 9.0 }; + constexpr PointType::ValueType aInit[3]{ 2.0, 4.0, 7.0 }; + constexpr PointType::ValueType bInit[3]{ 6.0, 2.0, 9.0 }; PointType A = aInit; PointType B = bInit; midpoint.SetToMidPoint(A, B); @@ -173,13 +173,13 @@ itkPointGeometryTest(int, char *[]) // Test the Barycentric combination { - constexpr double tolerance = 1e-10; + constexpr double tolerance{ 1e-10 }; PointType combination; - constexpr PointType::ValueType aInit[3] = { 2.0, 4.0, 7.0 }; - constexpr PointType::ValueType bInit[3] = { 6.0, 2.0, 9.0 }; + constexpr PointType::ValueType aInit[3]{ 2.0, 4.0, 7.0 }; + constexpr PointType::ValueType bInit[3]{ 6.0, 2.0, 9.0 }; PointType A = aInit; PointType B = bInit; - constexpr double alpha = 0.5; + constexpr double alpha{ 0.5 }; combination.SetToBarycentricCombination(A, B, alpha); std::cout << "Test for Barycentric combination" << std::endl; std::cout << "PA = " << A << std::endl; @@ -200,16 +200,16 @@ itkPointGeometryTest(int, char *[]) // Test the Barycentric combination { - constexpr double tolerance = 1e-10; + constexpr double tolerance{ 1e-10 }; PointType combination; - constexpr PointType::ValueType aInit[3] = { 12.0, 0.0, 0.0 }; - constexpr PointType::ValueType bInit[3] = { 0.0, 0.0, 12.0 }; - constexpr PointType::ValueType cInit[3] = { 0.0, 12.0, 0.0 }; + constexpr PointType::ValueType aInit[3]{ 12.0, 0.0, 0.0 }; + constexpr PointType::ValueType bInit[3]{ 0.0, 0.0, 12.0 }; + constexpr PointType::ValueType cInit[3]{ 0.0, 12.0, 0.0 }; PointType A = aInit; PointType B = bInit; PointType C = cInit; - constexpr double alpha = 1.0 / 3.0; - constexpr double beta = 1.0 / 3.0; + constexpr double alpha{ 1.0 / 3.0 }; + constexpr double beta{ 1.0 / 3.0 }; combination.SetToBarycentricCombination(A, B, C, alpha, beta); std::cout << "Test for Barycentric combination" << std::endl; std::cout << "PA = " << A << std::endl; @@ -232,12 +232,12 @@ itkPointGeometryTest(int, char *[]) // Test the Barycentric combination for an array { - constexpr double tolerance = 1e-10; + constexpr double tolerance{ 1e-10 }; PointType combination; - constexpr unsigned int NP = 3; + constexpr unsigned int NP{ 3 }; PointType A[NP]; double w[NP - 1]; - constexpr double K = 12.0; + constexpr double K{ 12.0 }; PointType::ValueType aInit0[3] = { K, 0.0, 0.0 }; PointType::ValueType aInit1[3] = { 0.0, K, 0.0 }; PointType::ValueType aInit2[3] = { 0.0, 0.0, K }; @@ -262,12 +262,12 @@ itkPointGeometryTest(int, char *[]) // Test the Barycentric combination for an VectorContainer of Points { - constexpr double tolerance = 1e-10; - constexpr unsigned int NP = 3; + constexpr double tolerance{ 1e-10 }; + constexpr unsigned int NP{ 3 }; using VectorOfPoints = itk::VectorContainer; auto points = VectorOfPoints::New(); points->Reserve(NP); - constexpr double K = 12.0; + constexpr double K{ 12.0 }; VectorOfPoints::Iterator point = points->Begin(); PointType::ValueType vInit0[3] = { K, 0.0, 0.0 }; diff --git a/Modules/Core/Common/test/itkPointSetTest.cxx b/Modules/Core/Common/test/itkPointSetTest.cxx index 9e9fcfbfe58..e5c55ffb0a9 100644 --- a/Modules/Core/Common/test/itkPointSetTest.cxx +++ b/Modules/Core/Common/test/itkPointSetTest.cxx @@ -37,8 +37,8 @@ using PointsVectorContainerPointer = typename PointsVectorContainer::Pointer; int itkPointSetTest(int, char *[]) { - constexpr int pointDimension = 3; - constexpr int numOfPoints = 100; + constexpr int pointDimension{ 3 }; + constexpr int numOfPoints{ 100 }; /** * Define the 3d geometric positions for 8 points in a cube. @@ -82,7 +82,7 @@ itkPointSetTest(int, char *[]) // Test non-existing point id exception ITK_TRY_EXPECT_EXCEPTION(pset->GetPoint(pId)); - constexpr PointSet::RegionType region = 0; + constexpr PointSet::RegionType region{ 0 }; pset->SetRequestedRegion(region); pset->SetBufferedRegion(region); diff --git a/Modules/Core/Common/test/itkPointSetToImageFilterTest1.cxx b/Modules/Core/Common/test/itkPointSetToImageFilterTest1.cxx index cf4d2b07e57..49045cbdd10 100644 --- a/Modules/Core/Common/test/itkPointSetToImageFilterTest1.cxx +++ b/Modules/Core/Common/test/itkPointSetToImageFilterTest1.cxx @@ -33,8 +33,8 @@ itkPointSetToImageFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int PointSetDimension = 2; - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int PointSetDimension{ 2 }; + constexpr unsigned int ImageDimension{ 2 }; using PointSetPointType = float; using PixelType = unsigned char; @@ -67,7 +67,7 @@ itkPointSetToImageFilterTest1(int argc, char * argv[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, PointSetToImageFilter, ImageSource); - constexpr BinaryImageType::SpacingType::ValueType spacingValue = 1.0; + constexpr BinaryImageType::SpacingType::ValueType spacingValue{ 1.0 }; auto spacing = itk::MakeFilled(spacingValue); filter->SetSpacing(spacing); ITK_TEST_SET_GET_VALUE(spacing, filter->GetSpacing()); @@ -81,8 +81,9 @@ itkPointSetToImageFilterTest1(int argc, char * argv[]) filter->SetDirection(direction); ITK_TEST_SET_GET_VALUE(direction, filter->GetDirection()); - constexpr typename BinaryImageType::ValueType insideValue = - itk::NumericTraits::OneValue(); + constexpr typename BinaryImageType::ValueType insideValue{ + itk::NumericTraits::OneValue() + }; filter->SetInsideValue(insideValue); ITK_TEST_SET_GET_VALUE(insideValue, filter->GetInsideValue()); @@ -97,7 +98,7 @@ itkPointSetToImageFilterTest1(int argc, char * argv[]) filter->SetInput(pointSet); ITK_TEST_SET_GET_VALUE(pointSet, filter->GetInput()); - constexpr unsigned int idx = 0; + constexpr unsigned int idx{ 0 }; ITK_TEST_SET_GET_VALUE(pointSet, filter->GetInput(idx)); ITK_TRY_EXPECT_NO_EXCEPTION(filter->Update()); diff --git a/Modules/Core/Common/test/itkPointSetToImageFilterTest2.cxx b/Modules/Core/Common/test/itkPointSetToImageFilterTest2.cxx index 67a2151976f..39406e5dc34 100644 --- a/Modules/Core/Common/test/itkPointSetToImageFilterTest2.cxx +++ b/Modules/Core/Common/test/itkPointSetToImageFilterTest2.cxx @@ -33,8 +33,8 @@ itkPointSetToImageFilterTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int PointSetDimension = 3; - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int PointSetDimension{ 3 }; + constexpr unsigned int ImageDimension{ 3 }; using PointSetPointType = float; using PixelType = unsigned char; diff --git a/Modules/Core/Common/test/itkRGBPixelTest.cxx b/Modules/Core/Common/test/itkRGBPixelTest.cxx index 79cc333b6cd..373fc9025ba 100644 --- a/Modules/Core/Common/test/itkRGBPixelTest.cxx +++ b/Modules/Core/Common/test/itkRGBPixelTest.cxx @@ -123,7 +123,7 @@ itkRGBPixelTest(int, char *[]) const float luminance = rgbl.GetLuminance(); const float realLuminance = rgbl[0] * 0.30 + rgbl[1] * 0.59 + rgbl[2] * 0.11; - constexpr float tolerance = 1e-4; + constexpr float tolerance{ 1e-4 }; if (itk::Math::abs(luminance - realLuminance) > tolerance) { diff --git a/Modules/Core/Common/test/itkRealTimeClockTest.cxx b/Modules/Core/Common/test/itkRealTimeClockTest.cxx index 03044741ce5..66d23b6f885 100644 --- a/Modules/Core/Common/test/itkRealTimeClockTest.cxx +++ b/Modules/Core/Common/test/itkRealTimeClockTest.cxx @@ -68,7 +68,7 @@ itkRealTimeClockTest(int, char *[]) using TimeRepresentationType = itk::RealTimeStamp::TimeRepresentationType; - constexpr TimeRepresentationType tolerance = 1e6; + constexpr TimeRepresentationType tolerance{ 1e6 }; for (unsigned int i = 0; i < 10; ++i) { diff --git a/Modules/Core/Common/test/itkShapedImageNeighborhoodRangeGTest.cxx b/Modules/Core/Common/test/itkShapedImageNeighborhoodRangeGTest.cxx index f23ee400a15..543e27ce64f 100644 --- a/Modules/Core/Common/test/itkShapedImageNeighborhoodRangeGTest.cxx +++ b/Modules/Core/Common/test/itkShapedImageNeighborhoodRangeGTest.cxx @@ -246,8 +246,8 @@ TEST(ShapedImageNeighborhoodRange, EquivalentBeginOrEndIteratorsCompareEqual) const auto image = CreateImage(2, 3); - constexpr itk::Size radius{ {} }; - constexpr ImageType::IndexType location{ {} }; + constexpr itk::Size radius{}; + constexpr ImageType::IndexType location{}; const std::vector> offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); const itk::ShapedImageNeighborhoodRange range{ *image, location, offsets }; @@ -284,8 +284,8 @@ TEST(ShapedImageNeighborhoodRange, BeginAndEndDoNotCompareEqual) const auto image = CreateImage(2, 3); // Note that even with a radius of zero, the neighborhood still has 1 pixel. - constexpr itk::Size radius{ {} }; - constexpr ImageType::IndexType location{ {} }; + constexpr itk::Size radius{}; + constexpr ImageType::IndexType location{}; const std::vector> offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); const itk::ShapedImageNeighborhoodRange range{ *image, location, offsets }; @@ -302,8 +302,8 @@ TEST(ShapedImageNeighborhoodRange, IteratorConvertsToConstIterator) const auto image = CreateImage(2, 3); - constexpr itk::Size radius{ {} }; - constexpr ImageType::IndexType location{ {} }; + constexpr itk::Size radius{}; + constexpr ImageType::IndexType location{}; const std::vector> offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); const itk::ShapedImageNeighborhoodRange range{ *image, location, offsets }; @@ -330,8 +330,8 @@ TEST(ShapedImageNeighborhoodRange, IteratorsCanBePassedToStdVectorConstructor) }; const auto image = CreateImageFilledWithSequenceOfNaturalNumbers(sizeX, sizeY); - constexpr ImageType::IndexType location{ {} }; - constexpr itk::Size radius = { { 0, 1 } }; + constexpr ImageType::IndexType location{}; + constexpr itk::Size radius{ 0, 1 }; const std::vector> offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); const itk::ShapedImageNeighborhoodRange range{ *image, location, offsets }; @@ -356,13 +356,13 @@ TEST(ShapedImageNeighborhoodRange, IteratorsCanBePassedToStdReverseCopy) }; const auto image = CreateImageFilledWithSequenceOfNaturalNumbers(sizeX, sizeY); - constexpr ImageType::IndexType location{ {} }; - constexpr itk::Size radius = { { 0, 1 } }; + constexpr ImageType::IndexType location{}; + constexpr itk::Size radius{ 0, 1 }; const std::vector> offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); const itk::ShapedImageNeighborhoodRange range{ *image, location, offsets }; - constexpr unsigned int numberOfNeighborhoodPixels = 3; + constexpr unsigned int numberOfNeighborhoodPixels{ 3 }; ASSERT_EQ(numberOfNeighborhoodPixels, range.size()); const std::vector stdVector(range.begin(), range.end()); @@ -401,8 +401,8 @@ TEST(ShapedImageNeighborhoodRange, IteratorsCanBePassedToStdInnerProduct) }; const auto image = CreateImageFilledWithSequenceOfNaturalNumbers(sizeX, sizeY); - constexpr ImageType::IndexType location{ {} }; - constexpr itk::Size radius = { { 0, 1 } }; + constexpr ImageType::IndexType location{}; + constexpr itk::Size radius{ 0, 1 }; const std::vector> offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); const itk::ShapedImageNeighborhoodRange range{ *image, location, offsets }; @@ -426,8 +426,8 @@ TEST(ShapedImageNeighborhoodRange, IteratorsCanBePassedToStdForEach) }; const auto image = CreateImageFilledWithSequenceOfNaturalNumbers(sizeX, sizeY); - constexpr ImageType::IndexType location{ {} }; - constexpr itk::Size radius = { { 0, 1 } }; + constexpr ImageType::IndexType location{}; + constexpr itk::Size radius{ 0, 1 }; const std::vector> offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); const itk::ShapedImageNeighborhoodRange range{ *image, location, offsets }; @@ -451,12 +451,12 @@ TEST(ShapedImageNeighborhoodRange, CanBeUsedAsExpressionOfRangeBasedForLoop) }; const auto image = CreateImageFilledWithSequenceOfNaturalNumbers(sizeX, sizeY); - constexpr ImageType::IndexType location{ {} }; - constexpr itk::Size radius = { { 0, 1 } }; + constexpr ImageType::IndexType location{}; + constexpr itk::Size radius{ 0, 1 }; const std::vector> offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); const RangeType range{ *image, location, offsets }; - constexpr PixelType reference_value = 42; + constexpr PixelType reference_value{ 42 }; for (const PixelType pixel : range) { @@ -496,8 +496,8 @@ TEST(ShapedImageNeighborhoodRange, DistanceBetweenIteratorsCanBeObtainedBySubtra }; const auto image = CreateImage(sizeX, sizeY); - constexpr ImageType::IndexType location{ {} }; - constexpr itk::Size radius = { { 2, 3 } }; + constexpr ImageType::IndexType location{}; + constexpr itk::Size radius{ 2, 3 }; const std::vector> offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); const itk::ShapedImageNeighborhoodRange range{ *image, location, offsets }; @@ -531,9 +531,9 @@ TEST(ShapedImageNeighborhoodRange, IteratorRetrievesSamePixelValuesAsConstNeighb }; const auto image = CreateImageFilledWithSequenceOfNaturalNumbers(sizeX, sizeY); - constexpr ImageType::IndexType initialLocation{ {} }; - constexpr ImageType::IndexType testLocations[] = { { {} }, { { 0, 1 } }, { { 1, 0 } } }; - constexpr itk::Size radius = { { 2, 3 } }; + constexpr ImageType::IndexType initialLocation{}; + constexpr ImageType::IndexType testLocations[]{ {}, { { 0, 1 } }, { { 1, 0 } } }; + constexpr itk::Size radius{ 2, 3 }; const std::vector> offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); itk::ShapedImageNeighborhoodRange range{ *image, initialLocation, offsets }; @@ -569,8 +569,8 @@ TEST(ShapedImageNeighborhoodRange, IteratorReferenceActsLikeARealReference) const auto image = CreateImageFilledWithSequenceOfNaturalNumbers(sizeX, sizeY); using RangeType = itk::ShapedImageNeighborhoodRange; - constexpr ImageType::IndexType location = { { 1, 0 } }; - constexpr itk::Size radius = { { 1, 0 } }; + constexpr ImageType::IndexType location{ 1, 0 }; + constexpr itk::Size radius{ 1, 0 }; const std::vector> offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); const RangeType range{ *image, location, offsets }; @@ -622,7 +622,7 @@ TEST(ShapedImageNeighborhoodRange, SupportsVectorImage) sizeZ = 3 }; const auto image = ImageType::New(); - constexpr typename ImageType::SizeType imageSize = { { sizeX, sizeY, sizeZ } }; + constexpr typename ImageType::SizeType imageSize{ sizeX, sizeY, sizeZ }; image->SetRegions(imageSize); image->SetVectorLength(vectorLength); image->AllocateInitialized(); @@ -630,8 +630,8 @@ TEST(ShapedImageNeighborhoodRange, SupportsVectorImage) fillPixelValue.Fill(42); image->FillBuffer(fillPixelValue); - constexpr ImageType::IndexType location = { { 0, 1 } }; - constexpr itk::Size radius = { { 0, 1 } }; + constexpr ImageType::IndexType location{ 0, 1 }; + constexpr itk::Size radius{ 0, 1 }; const std::vector> offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); @@ -667,8 +667,8 @@ TEST(ShapedImageNeighborhoodRange, IteratorsCanBePassedToStdSort) }; const auto image = CreateImageFilledWithSequenceOfNaturalNumbers(sizeX, sizeY); - constexpr ImageType::IndexType location{ { 1, 1 } }; - constexpr itk::Size radius = { { 1, 1 } }; + constexpr ImageType::IndexType location{ 1, 1 }; + constexpr itk::Size radius{ 1, 1 }; const std::vector> offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); const itk::ShapedImageNeighborhoodRange range{ *image, location, offsets }; @@ -702,8 +702,8 @@ TEST(ShapedImageNeighborhoodRange, IteratorsCanBePassedToStdNthElement) }; const auto image = CreateImageFilledWithSequenceOfNaturalNumbers(sizeX, sizeY); - constexpr ImageType::IndexType location{ { 1, 1 } }; - constexpr itk::Size radius = { { 1, 1 } }; + constexpr ImageType::IndexType location{ 1, 1 }; + constexpr itk::Size radius{ 1, 1 }; const std::vector> offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); const itk::ShapedImageNeighborhoodRange range{ *image, location, offsets }; @@ -745,8 +745,8 @@ TEST(ShapedImageNeighborhoodRange, IteratorsSupportRandomAccess) }; const auto image = CreateImageFilledWithSequenceOfNaturalNumbers(sizeX, sizeY); - constexpr ImageType::IndexType location{ { 1, 1 } }; - constexpr itk::Size radius = { { 1, 1 } }; + constexpr ImageType::IndexType location{ 1, 1 }; + constexpr itk::Size radius{ 1, 1 }; const std::vector> offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); const RangeType range{ *image, location, offsets }; @@ -770,7 +770,7 @@ TEST(ShapedImageNeighborhoodRange, IteratorsSupportRandomAccess) { // Expression to be tested: 'r += n' - constexpr difference_type n = 3; + constexpr difference_type n{ 3 }; static_assert(std::is_same_v, "Return type tested"); @@ -792,7 +792,7 @@ TEST(ShapedImageNeighborhoodRange, IteratorsSupportRandomAccess) } { // Expressions to be tested: 'a + n' and 'n + a' - constexpr difference_type n = 3; + constexpr difference_type n{ 3 }; static_assert(std::is_same_v, "Return type tested"); static_assert(std::is_same_v, "Return type tested"); @@ -808,7 +808,7 @@ TEST(ShapedImageNeighborhoodRange, IteratorsSupportRandomAccess) } { // Expression to be tested: 'r -= n' - constexpr difference_type n = 3; + constexpr difference_type n{ 3 }; static_assert(std::is_same_v, "Return type tested"); @@ -823,7 +823,7 @@ TEST(ShapedImageNeighborhoodRange, IteratorsSupportRandomAccess) } { // Expression to be tested: 'a - n' - constexpr difference_type n = -3; + constexpr difference_type n{ -3 }; static_assert(std::is_same_v, "Return type tested"); @@ -845,7 +845,7 @@ TEST(ShapedImageNeighborhoodRange, IteratorsSupportRandomAccess) } { // Expression to be tested: 'a[n]' - constexpr difference_type n = 3; + constexpr difference_type n{ 3 }; static_assert(std::is_convertible_v, "Return type tested"); EXPECT_EQ(a[n], *(a + n)); } @@ -876,8 +876,8 @@ TEST(ShapedImageNeighborhoodRange, SupportsSubscript) }; const auto image = CreateImageFilledWithSequenceOfNaturalNumbers(sizeX, sizeY); - constexpr ImageType::IndexType location{ { 1, 1 } }; - constexpr itk::Size radius = { { 1, 1 } }; + constexpr ImageType::IndexType location{ 1, 1 }; + constexpr itk::Size radius{ 1, 1 }; const std::vector> offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); const RangeType range{ *image, location, offsets }; @@ -907,13 +907,13 @@ TEST(ShapedImageNeighborhoodRange, ProvidesReverseIterators) }; const auto image = CreateImageFilledWithSequenceOfNaturalNumbers(sizeX, sizeY); - constexpr ImageType::IndexType location{ {} }; - constexpr itk::Size radius = { { 0, 1 } }; + constexpr ImageType::IndexType location{}; + constexpr itk::Size radius{ 0, 1 }; const std::vector> offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); const RangeType range{ *image, location, offsets }; - constexpr unsigned int numberOfNeighborhoodPixels = 3; + constexpr unsigned int numberOfNeighborhoodPixels{ 3 }; ASSERT_EQ(numberOfNeighborhoodPixels, range.size()); const std::vector stdVector(range.begin(), range.end()); @@ -954,7 +954,7 @@ TEST(ShapedImageNeighborhoodRange, ConstructorSupportsRValueShapeOffsets) using OffsetType = ImageType::OffsetType; const auto image = CreateImage(1, 2); - constexpr ImageType::IndexType location{ { 1, 1 } }; + constexpr ImageType::IndexType location{ 1, 1 }; // Note that the expression 'std::vector{1}' is an rvalue. // The code is carefully written so that this rvalue remains alive while @@ -971,10 +971,10 @@ TEST(ShapedImageNeighborhoodRange, ConstructorSupportsCArrayOfShapeOffsets) using OffsetType = ImageType::OffsetType; const auto image = CreateImageFilledWithSequenceOfNaturalNumbers(1, 2); - constexpr ImageType::IndexType location{ { 1, 1 } }; + constexpr ImageType::IndexType location{ 1, 1 }; // A rather arbitrary shape, specified by a C-array of offsets. - constexpr OffsetType arrayOfShapeOffsets[] = { OffsetType{}, itk::MakeFilled(1) }; + constexpr OffsetType arrayOfShapeOffsets[]{ OffsetType{}, itk::MakeFilled(1) }; // An std::vector that represents the very same shape. const std::vector vectorOfShapeOffsets(std::begin(arrayOfShapeOffsets), std::end(arrayOfShapeOffsets)); @@ -1000,12 +1000,12 @@ TEST(ShapedImageNeighborhoodRange, SupportsArbitraryBufferedRegionIndex) using RangeType = itk::ShapedImageNeighborhoodRange; // A minimal radius, and trivial shape offsets (n = 1), just for the test. - constexpr itk::Size radius = { { 0 } }; + constexpr itk::Size radius{ 0 }; const auto offsets = itk::GenerateRectangularImageNeighborhoodOffsets(radius); - constexpr ImageType::IndexType zeroIndex{ { 0 } }; - constexpr ImageType::IndexType arbitraryIndex{ { 10, -1 } }; - constexpr ImageType::SizeType imageSize{ { 2, 3 } }; + constexpr ImageType::IndexType zeroIndex{ 0 }; + constexpr ImageType::IndexType arbitraryIndex{ 10, -1 }; + constexpr ImageType::SizeType imageSize{ 2, 3 }; const ImageType::RegionType bufferedRegion{ arbitraryIndex, imageSize }; @@ -1014,7 +1014,7 @@ TEST(ShapedImageNeighborhoodRange, SupportsArbitraryBufferedRegionIndex) image->AllocateInitialized(); // Set a 'magic value' at the begin of the buffered region. - constexpr ImageType::PixelType magicPixelValue = 42; + constexpr ImageType::PixelType magicPixelValue{ 42 }; ImageType::PixelType * const bufferPointer = image->GetBufferPointer(); *bufferPointer = magicPixelValue; diff --git a/Modules/Core/Common/test/itkShapedNeighborhoodIteratorTest.cxx b/Modules/Core/Common/test/itkShapedNeighborhoodIteratorTest.cxx index 7cd23947e5a..4345f0df876 100644 --- a/Modules/Core/Common/test/itkShapedNeighborhoodIteratorTest.cxx +++ b/Modules/Core/Common/test/itkShapedNeighborhoodIteratorTest.cxx @@ -186,7 +186,7 @@ itkShapedNeighborhoodIteratorTest(int, char *[]) println("Testing interoperability with FlatStructuringElement"); using StructuringElementType = itk::FlatStructuringElement<4>; - constexpr StructuringElementType::RadiusType radius2 = StructuringElementType::RadiusType::Filled(2); + constexpr StructuringElementType::RadiusType radius2{ StructuringElementType::RadiusType::Filled(2) }; const StructuringElementType kernel = StructuringElementType::Cross(radius2); itk::ShapedNeighborhoodIterator iterator(radius2, img, img->GetBufferedRegion()); iterator.CreateActiveListFromNeighborhood(kernel); diff --git a/Modules/Core/Common/test/itkSinRegularizedHeavisideStepFunctionTest1.cxx b/Modules/Core/Common/test/itkSinRegularizedHeavisideStepFunctionTest1.cxx index 9650c9a0fd7..1d56245ad9f 100644 --- a/Modules/Core/Common/test/itkSinRegularizedHeavisideStepFunctionTest1.cxx +++ b/Modules/Core/Common/test/itkSinRegularizedHeavisideStepFunctionTest1.cxx @@ -32,26 +32,26 @@ itkSinRegularizedHeavisideStepFunctionTest1(int, char *[]) std::cout << "GetNameOfClass() = " << functionBase0->GetNameOfClass() << std::endl; functionBase0->Print(std::cout); - constexpr double epsilon = -1.0; + constexpr double epsilon{ -1.0 }; ITK_TRY_EXPECT_EXCEPTION(functionBase0->SetEpsilon(epsilon)); - constexpr double epsilon0 = 1.0; - constexpr double epsilon1 = 1e-4; + constexpr double epsilon0{ 1.0 }; + constexpr double epsilon1{ 1e-4 }; ITK_TEST_SET_GET_VALUE(epsilon0, functionBase0->GetEpsilon()); functionBase0->SetEpsilon(epsilon1); ITK_TEST_SET_GET_VALUE(epsilon1, functionBase0->GetEpsilon()); - constexpr double epsilon2 = 0.5; + constexpr double epsilon2{ 0.5 }; functionBase0->SetEpsilon(epsilon2); - constexpr int minValue = -20; - constexpr int maxValue = 20; + constexpr int minValue{ -20 }; + constexpr int maxValue{ 20 }; - constexpr InputType incValue = 0.1; + constexpr InputType incValue{ 0.1 }; for (int x = minValue; x < maxValue; ++x) { diff --git a/Modules/Core/Common/test/itkSobelOperatorImageConvolutionTest.cxx b/Modules/Core/Common/test/itkSobelOperatorImageConvolutionTest.cxx index d817db0f6a6..ea218084645 100644 --- a/Modules/Core/Common/test/itkSobelOperatorImageConvolutionTest.cxx +++ b/Modules/Core/Common/test/itkSobelOperatorImageConvolutionTest.cxx @@ -47,7 +47,7 @@ typename ImageType::Pointer DoConvolution(typename ImageType::Pointer inputImage, unsigned long int direction) { using PixelType = typename ImageType::PixelType; - constexpr std::size_t Dimension = ImageType::ImageDimension; + constexpr std::size_t Dimension{ ImageType::ImageDimension }; using SobelOperatorType = itk::SobelOperator; @@ -110,7 +110,7 @@ itkSobelOperatorImageConvolutionTest(int argc, char * argv[]) const auto direction = std::stoul(argv[2]); int return_status = EXIT_SUCCESS; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; /* Sanity Checking For Sobel Operator */ //{ /* diff --git a/Modules/Core/Common/test/itkSobelOperatorImageFilterTest.cxx b/Modules/Core/Common/test/itkSobelOperatorImageFilterTest.cxx index 12ea327c791..4ffee7e4b54 100644 --- a/Modules/Core/Common/test/itkSobelOperatorImageFilterTest.cxx +++ b/Modules/Core/Common/test/itkSobelOperatorImageFilterTest.cxx @@ -34,7 +34,7 @@ itkSobelOperatorImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using SobelPixelType = int16_t; using SobelImageType = itk::Image; diff --git a/Modules/Core/Common/test/itkSobelOperatorTest.cxx b/Modules/Core/Common/test/itkSobelOperatorTest.cxx index d44f4c7e455..97d643c912b 100644 --- a/Modules/Core/Common/test/itkSobelOperatorTest.cxx +++ b/Modules/Core/Common/test/itkSobelOperatorTest.cxx @@ -24,14 +24,14 @@ int itkSobelOperatorTest(int, char *[]) { - constexpr unsigned int Dimension2D = 2; - constexpr unsigned int Dimension3D = 3; - constexpr unsigned int Dimension4D = 4; + constexpr unsigned int Dimension2D{ 2 }; + constexpr unsigned int Dimension3D{ 3 }; + constexpr unsigned int Dimension4D{ 4 }; using PixelType = float; { - constexpr unsigned int Length = 9; + constexpr unsigned int Length{ 9 }; using SobelOperatorType = itk::SobelOperator; SobelOperatorType sobelOperator; @@ -76,7 +76,7 @@ itkSobelOperatorTest(int, char *[]) } { - constexpr unsigned int Length = 27; + constexpr unsigned int Length{ 27 }; using SobelOperatorType = itk::SobelOperator; SobelOperatorType sobelOperator; @@ -136,7 +136,7 @@ itkSobelOperatorTest(int, char *[]) using SobelOperatorType = itk::SobelOperator; SobelOperatorType sobelOperator; - constexpr unsigned long direction = 0; + constexpr unsigned long direction{ 0 }; sobelOperator.SetDirection(direction); auto radius = itk::Size::Filled(1); ITK_TRY_EXPECT_EXCEPTION(sobelOperator.CreateToRadius(radius)); diff --git a/Modules/Core/Common/test/itkSparseImageTest.cxx b/Modules/Core/Common/test/itkSparseImageTest.cxx index 93fbd8baaad..b27f9feafed 100644 --- a/Modules/Core/Common/test/itkSparseImageTest.cxx +++ b/Modules/Core/Common/test/itkSparseImageTest.cxx @@ -48,8 +48,8 @@ itkSparseImageTest(int, char *[]) auto im = SparseImageType::New(); - constexpr ImageType::SizeType sz = { { 24, 24 } }; - constexpr ImageType::IndexType idx = { { 0, 0 } }; + constexpr ImageType::SizeType sz{ 24, 24 }; + constexpr ImageType::IndexType idx{ 0, 0 }; ImageType::RegionType r = { idx, sz }; im->SetRegions(r); diff --git a/Modules/Core/Common/test/itkSpatialFunctionTest.cxx b/Modules/Core/Common/test/itkSpatialFunctionTest.cxx index db209170d4d..eb04f5cc778 100644 --- a/Modules/Core/Common/test/itkSpatialFunctionTest.cxx +++ b/Modules/Core/Common/test/itkSpatialFunctionTest.cxx @@ -25,7 +25,7 @@ int itkSpatialFunctionTest(int, char *[]) { // Change this parameter (and the positions, below) to work in higher or lower dimensions - constexpr unsigned int dim = 3; + constexpr unsigned int dim{ 3 }; //---------Create and initialize a spatial function----------- diff --git a/Modules/Core/Common/test/itkStdStreamStateSaveTest.cxx b/Modules/Core/Common/test/itkStdStreamStateSaveTest.cxx index e523f0e6eba..a1b8381122a 100644 --- a/Modules/Core/Common/test/itkStdStreamStateSaveTest.cxx +++ b/Modules/Core/Common/test/itkStdStreamStateSaveTest.cxx @@ -40,16 +40,16 @@ itkStdStreamStateSaveTest(int, char *[]) // Change some representative state variables std::cout.precision(14); std::cout.width(25); - constexpr int anInt = 123; + constexpr int anInt{ 123 }; std::cout.fill('%'); std::cout << std::left << anInt << std::endl; std::cout << std::showpos << anInt << std::endl; std::cout << std::hex << anInt << std::endl; std::cout << std::showbase << std::hex << anInt << std::endl; - constexpr bool aBool = false; + constexpr bool aBool{ false }; std::cout << aBool << std::endl; std::cout << std::boolalpha << aBool << std::endl; - constexpr double aDouble = 123.e-5; + constexpr double aDouble{ 123.e-5 }; std::cout << aDouble << std::endl; std::cout << std::scientific << aDouble << std::endl; @@ -59,23 +59,23 @@ itkStdStreamStateSaveTest(int, char *[]) // Set the fillch of std::stringstream with an explicit default fill character stream.fill(' '); - constexpr int originalInt = 10; + constexpr int originalInt{ 10 }; { const itk::StdStreamStateSave sstreamState(stream); // Change some representative state variables stream.precision(14); stream.width(25); - constexpr int anInt = originalInt; + constexpr int anInt{ originalInt }; stream.fill('%'); stream << std::left << anInt << std::endl; stream << std::showpos << anInt << std::endl; stream << std::hex << anInt << std::endl; stream << std::showbase << std::hex << anInt << std::endl; - constexpr bool aBool = false; + constexpr bool aBool{ false }; stream << aBool << std::endl; stream << std::boolalpha << aBool << std::endl; - constexpr double aDouble = 123.e-5; + constexpr double aDouble{ 123.e-5 }; stream << aDouble << std::endl; stream << std::scientific << aDouble << std::endl; diff --git a/Modules/Core/Common/test/itkStreamingImageFilterTest.cxx b/Modules/Core/Common/test/itkStreamingImageFilterTest.cxx index e1161199427..4c63ff2503f 100644 --- a/Modules/Core/Common/test/itkStreamingImageFilterTest.cxx +++ b/Modules/Core/Common/test/itkStreamingImageFilterTest.cxx @@ -25,7 +25,7 @@ int itkStreamingImageFilterTest(int, char *[]) { - constexpr unsigned int numberOfStreamDivisions = 4; + constexpr unsigned int numberOfStreamDivisions{ 4 }; // type alias to simplify the syntax using ShortImage = itk::Image; @@ -34,8 +34,8 @@ itkStreamingImageFilterTest(int, char *[]) auto if2 = ShortImage::New(); // fill in an image - constexpr ShortImage::IndexType index = { { 0, 0 } }; - constexpr ShortImage::SizeType size = { { 80, 122 } }; + constexpr ShortImage::IndexType index{ 0, 0 }; + constexpr ShortImage::SizeType size{ 80, 122 }; const ShortImage::RegionType region{ index, size }; if2->SetLargestPossibleRegion(region); if2->SetBufferedRegion(region); diff --git a/Modules/Core/Common/test/itkStreamingImageFilterTest2.cxx b/Modules/Core/Common/test/itkStreamingImageFilterTest2.cxx index c69026dd734..ac63bcb49d5 100644 --- a/Modules/Core/Common/test/itkStreamingImageFilterTest2.cxx +++ b/Modules/Core/Common/test/itkStreamingImageFilterTest2.cxx @@ -28,7 +28,7 @@ int itkStreamingImageFilterTest2(int, char *[]) { - constexpr unsigned int numberOfStreamDivisions = 25; + constexpr unsigned int numberOfStreamDivisions{ 25 }; const itk::XMLFileOutputWindow::Pointer logger = itk::XMLFileOutputWindow::New(); logger->SetInstance(logger); @@ -39,8 +39,8 @@ itkStreamingImageFilterTest2(int, char *[]) auto if2 = ShortImage::New(); // fill in an image - constexpr ShortImage::IndexType index = { { 0, 0 } }; - constexpr ShortImage::SizeType size = { { 42, 64 } }; + constexpr ShortImage::IndexType index{ 0, 0 }; + constexpr ShortImage::SizeType size{ 42, 64 }; const ShortImage::RegionType region{ index, size }; if2->SetLargestPossibleRegion(region); if2->SetBufferedRegion(region); diff --git a/Modules/Core/Common/test/itkSymmetricEigenAnalysisTest.cxx b/Modules/Core/Common/test/itkSymmetricEigenAnalysisTest.cxx index 0f1a264d5cf..375790d4653 100644 --- a/Modules/Core/Common/test/itkSymmetricEigenAnalysisTest.cxx +++ b/Modules/Core/Common/test/itkSymmetricEigenAnalysisTest.cxx @@ -99,10 +99,10 @@ itkSymmetricEigenAnalysisTest(int argc, char * argv[]) std::cout << "EigenVectors (each row is an an eigen vector): " << std::endl; std::cout << eigenvectors << std::endl; - constexpr double eigvec3[6] = { 0.5236407, -0.0013422, -0.4199706, -0.5942299, 0.4381326, 0.0659837 }; - constexpr double eigvals[6] = { 0.170864, 2.16934, 3.79272, 15.435, 24.6083, 78.2994 }; + constexpr double eigvec3[6]{ 0.5236407, -0.0013422, -0.4199706, -0.5942299, 0.4381326, 0.0659837 }; + constexpr double eigvals[6]{ 0.170864, 2.16934, 3.79272, 15.435, 24.6083, 78.2994 }; - constexpr double tolerance = 0.01; + constexpr double tolerance{ 0.01 }; for (unsigned int i = 0; i < 6; ++i) { if (itk::Math::abs(eigvals[i] - eigenvalues[i]) > tolerance) @@ -130,7 +130,7 @@ itkSymmetricEigenAnalysisTest(int argc, char * argv[]) using SymmetricEigenAnalysisType = itk::SymmetricEigenAnalysis; - constexpr double Sdata[36] = { + constexpr double Sdata[36]{ 30.0000, -3.4273, 13.9254, 13.7049, -2.4446, 20.2380, -3.4273, 13.7049, -2.4446, 1.3659, 3.6702, -0.2282, 13.9254, -2.4446, 20.2380, 3.6702, -0.2282, 28.6779, 13.7049, 1.3659, 3.6702, 12.5273, -1.6045, 3.9419, -2.4446, 3.6702, -0.2282, -1.6045, 3.9419, 2.5821, 20.2380, -0.2282, 28.6779, 3.9419, 2.5821, 44.0636, @@ -162,10 +162,10 @@ itkSymmetricEigenAnalysisTest(int argc, char * argv[]) std::cout << "EigenVectors (each row is an an eigen vector): " << std::endl; std::cout << eigenvectors << std::endl; - constexpr double eigvec3[6] = { 0.5236407, -0.0013422, -0.4199706, -0.5942299, 0.4381326, 0.0659837 }; - constexpr double eigvals[6] = { 0.170864, 2.16934, 3.79272, 15.435, 24.6083, 78.2994 }; + constexpr double eigvec3[6]{ 0.5236407, -0.0013422, -0.4199706, -0.5942299, 0.4381326, 0.0659837 }; + constexpr double eigvals[6]{ 0.170864, 2.16934, 3.79272, 15.435, 24.6083, 78.2994 }; - constexpr double tolerance = 0.01; + constexpr double tolerance{ 0.01 }; for (unsigned int i = 0; i < 6; ++i) { if (itk::Math::abs(eigvals[i] - eigenvalues[i]) > tolerance) @@ -193,7 +193,7 @@ itkSymmetricEigenAnalysisTest(int argc, char * argv[]) using SymmetricEigenAnalysisType = itk::SymmetricEigenAnalysisFixedDimension<6, InputMatrixType, EigenValuesArrayType, EigenVectorMatrixType>; - constexpr double Sdata[36] = { + constexpr double Sdata[36]{ 30.0000, -3.4273, 13.9254, 13.7049, -2.4446, 20.2380, -3.4273, 13.7049, -2.4446, 1.3659, 3.6702, -0.2282, 13.9254, -2.4446, 20.2380, 3.6702, -0.2282, 28.6779, 13.7049, 1.3659, 3.6702, 12.5273, -1.6045, 3.9419, -2.4446, 3.6702, -0.2282, -1.6045, 3.9419, 2.5821, 20.2380, -0.2282, 28.6779, 3.9419, 2.5821, 44.0636, @@ -219,10 +219,10 @@ itkSymmetricEigenAnalysisTest(int argc, char * argv[]) std::cout << "EigenVectors (each row is an an eigen vector): " << std::endl; std::cout << eigenvectors << std::endl; - constexpr double eigvec3[6] = { 0.5236407, -0.0013422, -0.4199706, -0.5942299, 0.4381326, 0.0659837 }; - constexpr double eigvals[6] = { 0.170864, 2.16934, 3.79272, 15.435, 24.6083, 78.2994 }; + constexpr double eigvec3[6]{ 0.5236407, -0.0013422, -0.4199706, -0.5942299, 0.4381326, 0.0659837 }; + constexpr double eigvals[6]{ 0.170864, 2.16934, 3.79272, 15.435, 24.6083, 78.2994 }; - constexpr double tolerance = 0.01; + constexpr double tolerance{ 0.01 }; for (unsigned int i = 0; i < 6; ++i) { if (itk::Math::abs(eigvals[i] - eigenvalues[i]) > tolerance) @@ -251,7 +251,7 @@ itkSymmetricEigenAnalysisTest(int argc, char * argv[]) using SymmetricEigenAnalysisType = itk::SymmetricEigenAnalysis; - constexpr double Sdata[36] = { + constexpr double Sdata[36]{ 30.0000, -3.4273, 13.9254, 13.7049, -2.4446, 20.2380, -3.4273, 13.7049, -2.4446, 1.3659, 3.6702, -0.2282, 13.9254, -2.4446, 20.2380, 3.6702, -0.2282, 28.6779, 13.7049, 1.3659, 3.6702, 12.5273, -1.6045, 3.9419, -2.4446, 3.6702, -0.2282, -1.6045, 3.9419, 2.5821, 20.2380, -0.2282, 28.6779, 3.9419, 2.5821, 44.0636, @@ -282,10 +282,10 @@ itkSymmetricEigenAnalysisTest(int argc, char * argv[]) std::cout << "EigenVectors (each row is an an eigen vector): " << std::endl; std::cout << eigenvectors << std::endl; - constexpr double eigvec3[6] = { 0.5236407, -0.0013422, -0.4199706, -0.5942299, 0.4381326, 0.0659837 }; - constexpr double eigvals[6] = { 0.170864, 2.16934, 3.79272, 15.435, 24.6083, 78.2994 }; + constexpr double eigvec3[6]{ 0.5236407, -0.0013422, -0.4199706, -0.5942299, 0.4381326, 0.0659837 }; + constexpr double eigvals[6]{ 0.170864, 2.16934, 3.79272, 15.435, 24.6083, 78.2994 }; - constexpr double tolerance = 0.01; + constexpr double tolerance{ 0.01 }; for (unsigned int i = 0; i < 6; ++i) { if (itk::Math::abs(eigvals[i] - eigenvalues[i]) > tolerance) @@ -313,7 +313,7 @@ itkSymmetricEigenAnalysisTest(int argc, char * argv[]) using SymmetricEigenAnalysisType = itk::SymmetricEigenAnalysis; - constexpr double Sdata[9] = { + constexpr double Sdata[9]{ -3.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, -1.0, }; @@ -343,10 +343,10 @@ itkSymmetricEigenAnalysisTest(int argc, char * argv[]) std::cout << "EigenVectors (each row is an an eigen vector): " << std::endl; std::cout << eigenvectors << std::endl; - constexpr double eigvec3[3] = { 0.0, 1.0, 0.0 }; - constexpr double eigvals[3] = { -1.0, -3.0, 5.0 }; + constexpr double eigvec3[3]{ 0.0, 1.0, 0.0 }; + constexpr double eigvals[3]{ -1.0, -3.0, 5.0 }; - constexpr double tolerance = 0.01; + constexpr double tolerance{ 0.01 }; for (unsigned int i = 0; i < 3; ++i) { if (itk::Math::abs(eigvals[i] - eigenvalues[i]) > tolerance) @@ -375,8 +375,8 @@ itkSymmetricEigenAnalysisTest(int argc, char * argv[]) using SymmetricEigenAnalysisType = itk::SymmetricEigenAnalysis; - constexpr float Sdata[9] = { -7.31129000e+00f, 2.33080000e+01f, 0.00000000e+00f, 2.33080000e+01f, -4.64210000e-01f, - 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, -3.26256000e-06f }; + constexpr float Sdata[9]{ -7.31129000e+00f, 2.33080000e+01f, 0.00000000e+00f, 2.33080000e+01f, -4.64210000e-01f, + 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, -3.26256000e-06f }; InputMatrixType S; @@ -404,10 +404,10 @@ itkSymmetricEigenAnalysisTest(int argc, char * argv[]) std::cout << "EigenVectors (each row is an an eigen vector): " << std::endl; std::cout << eigenvectors << std::endl; - constexpr float eigvec2[3] = { 0.75674412f, -0.6537112f, 0.0f }; - constexpr float eigvals[3] = { -3.26256000e-06f, 1.96703376e+01f, -2.74458376e+01f }; + constexpr float eigvec2[3]{ 0.75674412f, -0.6537112f, 0.0f }; + constexpr float eigvals[3]{ -3.26256000e-06f, 1.96703376e+01f, -2.74458376e+01f }; - constexpr float tolerance = 0.01; + constexpr float tolerance{ 0.01 }; for (unsigned int i = 0; i < 3; ++i) { if (itk::Math::abs(eigvals[i] - eigenvalues[i]) > tolerance) diff --git a/Modules/Core/Common/test/itkSymmetricEllipsoidInteriorExteriorSpatialFunctionTest.cxx b/Modules/Core/Common/test/itkSymmetricEllipsoidInteriorExteriorSpatialFunctionTest.cxx index c85c63f2c5f..c9c90a71810 100644 --- a/Modules/Core/Common/test/itkSymmetricEllipsoidInteriorExteriorSpatialFunctionTest.cxx +++ b/Modules/Core/Common/test/itkSymmetricEllipsoidInteriorExteriorSpatialFunctionTest.cxx @@ -24,7 +24,7 @@ itkSymmetricEllipsoidInteriorExteriorSpatialFunctionTest(int, char *[]) std::cout << "itkSymmetricEllipsoidInteriorExteriorSpatialFunction test start" << std::endl; // Test will create an ellipsoid (3-dimensional) - constexpr unsigned int dimension = 3; + constexpr unsigned int dimension{ 3 }; // Symmetric Ellipsoid spatial function type alias using TSymEllipsoidFunctionType = itk::SymmetricEllipsoidInteriorExteriorSpatialFunction<3>; @@ -36,9 +36,9 @@ itkSymmetricEllipsoidInteriorExteriorSpatialFunctionTest(int, char *[]) auto spatialFunc = TSymEllipsoidFunctionType::New(); // Define function doitkSymmetricEllipsoidInteriorExteriorSpatialFunctionTest, which encapsulates ellipsoid. - constexpr int xExtent = 50; - constexpr int yExtent = 50; - constexpr int zExtent = 50; + constexpr int xExtent{ 50 }; + constexpr int yExtent{ 50 }; + constexpr int zExtent{ 50 }; // Define and set the center of the ellipsoid in the center of // the function doitkSymmetricEllipsoidInteriorExteriorSpatialFunctionTest @@ -55,8 +55,8 @@ itkSymmetricEllipsoidInteriorExteriorSpatialFunctionTest(int, char *[]) orientation[1] = 1 / std::sqrt(2.0); orientation[2] = 0; - constexpr double uniqueAxisLength = 45; - constexpr double symmetricAxesLength = 30; + constexpr double uniqueAxisLength{ 45 }; + constexpr double symmetricAxesLength{ 30 }; spatialFunc->SetOrientation(orientation, uniqueAxisLength, symmetricAxesLength); @@ -93,8 +93,8 @@ itkSymmetricEllipsoidInteriorExteriorSpatialFunctionTest(int, char *[]) testPosition[2] = center[2]; // Volume of ellipsoid using V=(4/3)*pi*(a/2)*(b/2)*(c/2) - constexpr double volume = - 4.18879013333 * (uniqueAxisLength / 2) * (symmetricAxesLength / 2) * (symmetricAxesLength / 2); + constexpr double volume{ 4.18879013333 * (uniqueAxisLength / 2) * (symmetricAxesLength / 2) * + (symmetricAxesLength / 2) }; // Percent difference in volume measurement and calculation const double volumeError = (itk::Math::abs(volume - interiorPixelCounter) / volume) * 100; diff --git a/Modules/Core/Common/test/itkSymmetricSecondRankTensorImageReadTest.cxx b/Modules/Core/Common/test/itkSymmetricSecondRankTensorImageReadTest.cxx index 488a72e5b65..b09f19c2c96 100644 --- a/Modules/Core/Common/test/itkSymmetricSecondRankTensorImageReadTest.cxx +++ b/Modules/Core/Common/test/itkSymmetricSecondRankTensorImageReadTest.cxx @@ -85,7 +85,7 @@ itkSymmetricSecondRankTensorImageReadTest(int argc, char * argv[]) const TensorImageType::ConstPointer tensorImage = itk::ReadImage(argv[1]); // Compare the read values to the original values - constexpr float tolerance = 1e-5; + constexpr float tolerance{ 1e-5 }; itk::ImageRegionConstIterator tItr(tensorImage, region); itk::ImageRegionConstIterator mItr(matrixImage, region); diff --git a/Modules/Core/Common/test/itkSymmetricSecondRankTensorImageWriteReadTest.cxx b/Modules/Core/Common/test/itkSymmetricSecondRankTensorImageWriteReadTest.cxx index 4629b5fce6c..9546ff0ff8e 100644 --- a/Modules/Core/Common/test/itkSymmetricSecondRankTensorImageWriteReadTest.cxx +++ b/Modules/Core/Common/test/itkSymmetricSecondRankTensorImageWriteReadTest.cxx @@ -72,7 +72,7 @@ itkSymmetricSecondRankTensorImageWriteReadTest(int argc, char * argv[]) const TensorImageType::ConstPointer tensorImageOutput = itk::ReadImage(argv[1]); // Compare the read values to the original values - constexpr float tolerance = 1e-5; + constexpr float tolerance{ 1e-5 }; itk::ImageRegionConstIterator inIt(tensorImageInput, region); itk::ImageRegionConstIterator outIt(tensorImageOutput, region); diff --git a/Modules/Core/Common/test/itkSymmetricSecondRankTensorTest.cxx b/Modules/Core/Common/test/itkSymmetricSecondRankTensorTest.cxx index b52f55843c4..c78723e0d3f 100644 --- a/Modules/Core/Common/test/itkSymmetricSecondRankTensorTest.cxx +++ b/Modules/Core/Common/test/itkSymmetricSecondRankTensorTest.cxx @@ -214,7 +214,7 @@ itkSymmetricSecondRankTensorTest(int, char *[]) std::cout << "EigenVectors = " << std::endl; std::cout << eigenVectors << std::endl; - constexpr double tolerance = 1e-4; + constexpr double tolerance{ 1e-4 }; { Double3DTensorType::EigenValuesArrayType expectedValues; @@ -376,7 +376,7 @@ itkSymmetricSecondRankTensorTest(int, char *[]) expectedTrace += tensor3D(1, 1); expectedTrace += tensor3D(2, 2); - constexpr double tolerance = 1e-4; + constexpr double tolerance{ 1e-4 }; const AccumulateValueType computedTrace = tensor3D.GetTrace(); if (itk::Math::abs(computedTrace - expectedTrace) > tolerance) @@ -471,7 +471,7 @@ itkSymmetricSecondRankTensorTest(int, char *[]) auto floatTensor3 = static_cast(intTensor); // Check that all floatTensors have are the same - constexpr float precision = 1e-6; + constexpr float precision{ 1e-6 }; for (unsigned int i = 0; i < Float3DTensorType::InternalDimension; ++i) { auto intVal = static_cast(intTensor[i]); diff --git a/Modules/Core/Common/test/itkThreadedImageRegionPartitionerTest.cxx b/Modules/Core/Common/test/itkThreadedImageRegionPartitionerTest.cxx index 24178401126..df12df4977b 100644 --- a/Modules/Core/Common/test/itkThreadedImageRegionPartitionerTest.cxx +++ b/Modules/Core/Common/test/itkThreadedImageRegionPartitionerTest.cxx @@ -24,7 +24,7 @@ int itkThreadedImageRegionPartitionerTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ThreadedImageRegionPartitionerType = itk::ThreadedImageRegionPartitioner; const ThreadedImageRegionPartitionerType::Pointer threadedImageRegionPartitioner = @@ -65,7 +65,7 @@ itkThreadedImageRegionPartitionerTest(int, char *[]) expectedRegion.SetSize(size); expectedSubRegions.push_back(expectedRegion); - constexpr itk::ThreadIdType totalThreads = 4; + constexpr itk::ThreadIdType totalThreads{ 4 }; ImageRegionType subRegion; for (itk::ThreadIdType i = 0; i < totalThreads; ++i) { diff --git a/Modules/Core/Common/test/itkTimeProbeTest2.cxx b/Modules/Core/Common/test/itkTimeProbeTest2.cxx index 2e1384c0061..1f6fc46bbc9 100644 --- a/Modules/Core/Common/test/itkTimeProbeTest2.cxx +++ b/Modules/Core/Common/test/itkTimeProbeTest2.cxx @@ -62,7 +62,7 @@ itkTimeProbeTest2(int, char *[]) std::cout << "Maximum: " << localTimer.GetMaximum() << std::endl; std::cout << "StandardDeviation: " << localTimer.GetStandardDeviation() << std::endl; - constexpr unsigned int iteration(100); + constexpr unsigned int iteration{ 100 }; for (unsigned int it = 0; it < iteration; ++it) { diff --git a/Modules/Core/Common/test/itkTimeProbesTest.cxx b/Modules/Core/Common/test/itkTimeProbesTest.cxx index 768f10f17f1..237f3f424bf 100644 --- a/Modules/Core/Common/test/itkTimeProbesTest.cxx +++ b/Modules/Core/Common/test/itkTimeProbesTest.cxx @@ -87,7 +87,7 @@ itkTimeProbesTest(int, char *[]) const unsigned int N = 1000L; const unsigned int M = 10000L; - constexpr unsigned int iteration = 3; + constexpr unsigned int iteration{ 3 }; for (unsigned int it = 0; it < iteration; ++it) { @@ -131,7 +131,7 @@ itkTimeProbesTest(int, char *[]) using Region3DType = itk::ImageRegion<3>; using Size3DType = Region3DType::SizeType; Region3DType region3D; - constexpr Size3DType size3D = { { 1000, 1000, 1000 } }; + constexpr Size3DType size3D{ 1000, 1000, 1000 }; region3D.SetSize(size3D); collector.Start("i:TransformIndexToPhysicalPoint"); diff --git a/Modules/Core/Common/test/itkTimeStampTest.cxx b/Modules/Core/Common/test/itkTimeStampTest.cxx index ed0c8634cdd..1ca0f03404a 100644 --- a/Modules/Core/Common/test/itkTimeStampTest.cxx +++ b/Modules/Core/Common/test/itkTimeStampTest.cxx @@ -100,7 +100,7 @@ itkTimeStampTest(int, char *[]) itk::ModifiedTimeType prev_mtime = init_mtime; - constexpr unsigned int num_exp = 500; + constexpr unsigned int num_exp{ 500 }; for (unsigned int i = 0; i < num_exp; ++i) { diff --git a/Modules/Core/Common/test/itkTorusInteriorExteriorSpatialFunctionTest.cxx b/Modules/Core/Common/test/itkTorusInteriorExteriorSpatialFunctionTest.cxx index 2a770b27f1a..50247a1c1ae 100644 --- a/Modules/Core/Common/test/itkTorusInteriorExteriorSpatialFunctionTest.cxx +++ b/Modules/Core/Common/test/itkTorusInteriorExteriorSpatialFunctionTest.cxx @@ -25,7 +25,7 @@ itkTorusInteriorExteriorSpatialFunctionTest(int, char *[]) { // Define the dimensionality - constexpr unsigned int PointDimension = 3; + constexpr unsigned int PointDimension{ 3 }; // Define the point coordinate representation type using PointCoordinateType = float; @@ -49,11 +49,11 @@ itkTorusInteriorExteriorSpatialFunctionTest(int, char *[]) torusInteriorExteriorSpatialFunction->SetOrigin(origin); ITK_TEST_SET_GET_VALUE(origin, torusInteriorExteriorSpatialFunction->GetOrigin()); - constexpr double majorRadius = 10.0; + constexpr double majorRadius{ 10.0 }; torusInteriorExteriorSpatialFunction->SetMajorRadius(majorRadius); ITK_TEST_SET_GET_VALUE(majorRadius, torusInteriorExteriorSpatialFunction->GetMajorRadius()); - constexpr double minorRadius = 4.0; + constexpr double minorRadius{ 4.0 }; torusInteriorExteriorSpatialFunction->SetMinorRadius(minorRadius); ITK_TEST_SET_GET_VALUE(minorRadius, torusInteriorExteriorSpatialFunction->GetMinorRadius()); diff --git a/Modules/Core/Common/test/itkVNLRoundProfileTest1.cxx b/Modules/Core/Common/test/itkVNLRoundProfileTest1.cxx index f17f16480f6..17990eb1798 100644 --- a/Modules/Core/Common/test/itkVNLRoundProfileTest1.cxx +++ b/Modules/Core/Common/test/itkVNLRoundProfileTest1.cxx @@ -55,11 +55,11 @@ itkVNLRoundProfileTest1(int, char *[]) ArrayType output3; ArrayType output4; - constexpr unsigned long numberOfValues = 1000000L; + constexpr unsigned long numberOfValues{ 1000000L }; - constexpr double initialValue = -10.0; + constexpr double initialValue{ -10.0 }; - constexpr double valueIncrement = (-initialValue - initialValue) / numberOfValues; + constexpr double valueIncrement{ (-initialValue - initialValue) / numberOfValues }; std::cout << "Initial Value = " << initialValue << std::endl; std::cout << "Value Increment = " << valueIncrement << std::endl; @@ -204,7 +204,7 @@ itkVNLRoundProfileTest1(int, char *[]) auto outItr1 = output1.begin(); auto outItr2 = output2.begin(); - constexpr double tolerance = 1e-5; + constexpr double tolerance{ 1e-5 }; bool roundUp = true; bool roundMismatch = false; diff --git a/Modules/Core/Common/test/itkVectorContainerGTest.cxx b/Modules/Core/Common/test/itkVectorContainerGTest.cxx index 14599d35351..b67b05b604a 100644 --- a/Modules/Core/Common/test/itkVectorContainerGTest.cxx +++ b/Modules/Core/Common/test/itkVectorContainerGTest.cxx @@ -87,7 +87,7 @@ ExpectContainerHasValueOfCreatedElementAtIdentifier(const itk::SizeValueType ide TEST(VectorContainer, HasValueOfCreatedElementAtIdentifier) { // Just pick a "pseudo-random" (magic) number as ElementIdentifier. - constexpr itk::SizeValueType magicIdentifier = 42; + constexpr itk::SizeValueType magicIdentifier{ 42 }; ExpectContainerHasValueOfCreatedElementAtIdentifier(magicIdentifier, true); ExpectContainerHasValueOfCreatedElementAtIdentifier(magicIdentifier, false); diff --git a/Modules/Core/Common/test/itkVectorGeometryTest.cxx b/Modules/Core/Common/test/itkVectorGeometryTest.cxx index b3820457865..a4d5dad4cd4 100644 --- a/Modules/Core/Common/test/itkVectorGeometryTest.cxx +++ b/Modules/Core/Common/test/itkVectorGeometryTest.cxx @@ -36,7 +36,7 @@ itkVectorGeometryTest(int, char *[]) { // Dimension & Type - constexpr unsigned int N = 3; + constexpr unsigned int N{ 3 }; using ValueType = double; // Vector type @@ -191,7 +191,7 @@ itkVectorGeometryTest(int, char *[]) { std::cout << "Test for CastFrom() method... "; - constexpr float tolerance = 1e-7; + constexpr float tolerance{ 1e-7 }; // Vector Classes using DoubleVectorType = itk::Vector; diff --git a/Modules/Core/Common/test/itkVectorTest.cxx b/Modules/Core/Common/test/itkVectorTest.cxx index 522471fc08c..4c016983193 100644 --- a/Modules/Core/Common/test/itkVectorTest.cxx +++ b/Modules/Core/Common/test/itkVectorTest.cxx @@ -35,7 +35,7 @@ itkVectorTest(int, char *[]) using RealVector = itk::Vector; - constexpr int i = 4; + constexpr int i{ 4 }; Real f = 2.1; auto s = itk::MakeFilled(3.0); diff --git a/Modules/Core/Common/test/itkVersionTest.cxx b/Modules/Core/Common/test/itkVersionTest.cxx index 1c015148758..48781a2126d 100644 --- a/Modules/Core/Common/test/itkVersionTest.cxx +++ b/Modules/Core/Common/test/itkVersionTest.cxx @@ -25,7 +25,7 @@ int itkVersionTest(int, char *[]) { - constexpr int testPassStatus = EXIT_SUCCESS; + constexpr int testPassStatus{ EXIT_SUCCESS }; const itk::Version::Pointer version = itk::Version::New(); diff --git a/Modules/Core/Common/test/itkVersorTest.cxx b/Modules/Core/Common/test/itkVersorTest.cxx index 3190363eb39..4038d03f2d3 100644 --- a/Modules/Core/Common/test/itkVersorTest.cxx +++ b/Modules/Core/Common/test/itkVersorTest.cxx @@ -97,7 +97,7 @@ RotationMatrixToVersorTest() { int errorCount = 0; // const double onedegree=1e-10*itk::Math::pi/180.0; - constexpr double onedegree = itk::Math::pi / 180.0; + constexpr double onedegree{ itk::Math::pi / 180.0 }; // const double td=180.0/itk::Math::pi; double centers[6]; centers[0] = 0; @@ -107,8 +107,8 @@ RotationMatrixToVersorTest() centers[4] = itk::Math::pi * 1.5; centers[5] = itk::Math::pi * 2.0; - constexpr double steps = 0; - constexpr double small_degree_steps = onedegree / 1000.0; // 1/1000 of a degree + constexpr double steps{ 0 }; + constexpr double small_degree_steps{ onedegree / 1000.0 }; // 1/1000 of a degree for (const double center : centers) { for (double alpha = center - steps * small_degree_steps; alpha <= center + steps * small_degree_steps; @@ -142,7 +142,7 @@ RotationMatrixToVersorTest() const double error_newVRFROMMRPoint_newVRFROMMRTransformPoint = (newVRFROMMRPoint - newVRFROMMRTransformPoint).GetNorm(); - constexpr double maxAllowedPointError = 1e-5; + constexpr double maxAllowedPointError{ 1e-5 }; if ((error_newMRtestPoint_newVRtestPoint + error_newMRtestPoint_newVRFROMMRPoint + error_newVRFROMMRPoint_newVRFROMMRTransformPoint) > maxAllowedPointError) { @@ -177,7 +177,7 @@ itkVersorTest(int, char *[]) using ValueType = double; - constexpr ValueType epsilon = 1e-12; + constexpr ValueType epsilon{ 1e-12 }; // Versor type using VersorType = itk::Versor; @@ -243,7 +243,7 @@ itkVersorTest(int, char *[]) xa[0] = 0.0; xa[1] = 0.0; xa[2] = 0.0; - constexpr ValueType angle = 0; + constexpr ValueType angle{ 0 }; try { qa.Set(xa, angle); @@ -412,7 +412,7 @@ itkVersorTest(int, char *[]) VersorType qa; qa.Set(xa, angle); - constexpr PointType::ValueType xbInit[3] = { 3.0, 7.0, 9.0 }; + constexpr PointType::ValueType xbInit[3]{ 3.0, 7.0, 9.0 }; PointType xb = xbInit; PointType xc = qa.Transform(xb); @@ -522,7 +522,7 @@ itkVersorTest(int, char *[]) v1.Set(x1, angle1); // Get the components and scale them - constexpr ValueType scale = 5.5; + constexpr ValueType scale{ 5.5 }; ValueType x = v1.GetX() * scale; ValueType y = v1.GetY() * scale; ValueType z = v1.GetZ() * scale; diff --git a/Modules/Core/Common/test/itkXMLFileOutputWindowTest.cxx b/Modules/Core/Common/test/itkXMLFileOutputWindowTest.cxx index 4590a68dbad..a6078c48324 100644 --- a/Modules/Core/Common/test/itkXMLFileOutputWindowTest.cxx +++ b/Modules/Core/Common/test/itkXMLFileOutputWindowTest.cxx @@ -120,7 +120,7 @@ itkXMLFileOutputWindowTest(int argc, char * argv[]) } // First test with no filename given, to test autogenerating the filename - constexpr unsigned int numLinesExpected = 7; + constexpr unsigned int numLinesExpected{ 7 }; bool status = DoTestXMLFileOutputWindow("", numLinesExpected); const std::string test1Message{ status ? "TEST ONE PASSED" : "TEST ONE FAILED" }; std::cout << test1Message << "\n\n" << std::endl; diff --git a/Modules/Core/Common/test/itkXMLFilterWatcherTest.cxx b/Modules/Core/Common/test/itkXMLFilterWatcherTest.cxx index f08cf282e5e..635ae7da43e 100644 --- a/Modules/Core/Common/test/itkXMLFilterWatcherTest.cxx +++ b/Modules/Core/Common/test/itkXMLFilterWatcherTest.cxx @@ -33,7 +33,7 @@ itkXMLFilterWatcherTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using ImageType = itk::Image; diff --git a/Modules/Core/Common/test/itkZeroFluxBoundaryConditionTest.cxx b/Modules/Core/Common/test/itkZeroFluxBoundaryConditionTest.cxx index 6262ccaf05c..d8db671c640 100644 --- a/Modules/Core/Common/test/itkZeroFluxBoundaryConditionTest.cxx +++ b/Modules/Core/Common/test/itkZeroFluxBoundaryConditionTest.cxx @@ -124,8 +124,8 @@ itkZeroFluxBoundaryConditionTest(int, char *[]) // Test an image to cover one operator() method. auto image = ImageType::New(); - constexpr SizeType imageSize = { { 5, 5 } }; - constexpr IndexType imageIndex = { { 0, 0 } }; + constexpr SizeType imageSize{ 5, 5 }; + constexpr IndexType imageIndex{ 0, 0 }; const RegionType imageRegion{ imageIndex, imageSize }; image->SetRegions(imageRegion); image->Allocate(); diff --git a/Modules/Core/GPUCommon/src/itkOpenCLUtil.cxx b/Modules/Core/GPUCommon/src/itkOpenCLUtil.cxx index a5063e78b05..66df55eaff5 100644 --- a/Modules/Core/GPUCommon/src/itkOpenCLUtil.cxx +++ b/Modules/Core/GPUCommon/src/itkOpenCLUtil.cxx @@ -334,7 +334,7 @@ OpenCLCheckError(cl_int error, const char * filename, int lineno, const char * l "CL_INVALID_GLOBAL_WORK_SIZE", }; // print error message - constexpr int errorCount = std::size(errorString); + constexpr int errorCount{ std::size(errorString) }; const int index = -error; std::ostringstream errorMsg; diff --git a/Modules/Core/ImageAdaptors/test/itkComplexConjugateImageAdaptorTest.cxx b/Modules/Core/ImageAdaptors/test/itkComplexConjugateImageAdaptorTest.cxx index 2625218503d..49d17e62139 100644 --- a/Modules/Core/ImageAdaptors/test/itkComplexConjugateImageAdaptorTest.cxx +++ b/Modules/Core/ImageAdaptors/test/itkComplexConjugateImageAdaptorTest.cxx @@ -30,7 +30,7 @@ itkComplexConjugateImageAdaptorTest(int, char *[]) { // Create a test image. auto image = ImageType::New(); - constexpr ImageType::SizeType size = { { 10, 10 } }; + constexpr ImageType::SizeType size{ 10, 10 }; image->SetRegions(size); image->Allocate(); const ImageType::RegionType region = image->GetLargestPossibleRegion(); diff --git a/Modules/Core/ImageAdaptors/test/itkNthElementPixelAccessorTest.cxx b/Modules/Core/ImageAdaptors/test/itkNthElementPixelAccessorTest.cxx index b14a7b2f9f0..e9b5dd05f26 100644 --- a/Modules/Core/ImageAdaptors/test/itkNthElementPixelAccessorTest.cxx +++ b/Modules/Core/ImageAdaptors/test/itkNthElementPixelAccessorTest.cxx @@ -46,8 +46,8 @@ itkNthElementPixelAccessorTest(int, char *[]) { // Typedefs for convenience - constexpr unsigned int Dimension = 2; - constexpr unsigned int VectorLength = 3; + constexpr unsigned int Dimension{ 2 }; + constexpr unsigned int VectorLength{ 3 }; using myImageType = itk::Image, Dimension>; using myNthAccessorType = itk::NthElementPixelAccessor>; @@ -107,7 +107,7 @@ itkNthElementPixelAccessorTest(int, char *[]) // Set the values of the first component of myImage, using myAdaptor - constexpr float MY_VALUE = 0.4F; + constexpr float MY_VALUE{ 0.4F }; it2.GoToBegin(); while (!it2.IsAtEnd()) { diff --git a/Modules/Core/ImageAdaptors/test/itkRGBToVectorImageAdaptorTest.cxx b/Modules/Core/ImageAdaptors/test/itkRGBToVectorImageAdaptorTest.cxx index c62eb20321a..e4836bbab8e 100644 --- a/Modules/Core/ImageAdaptors/test/itkRGBToVectorImageAdaptorTest.cxx +++ b/Modules/Core/ImageAdaptors/test/itkRGBToVectorImageAdaptorTest.cxx @@ -46,7 +46,7 @@ itkRGBToVectorImageAdaptorTest(int, char *[]) using RGBPixelType = itk::RGBPixel; - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using ImageType = itk::Image; diff --git a/Modules/Core/ImageAdaptors/test/itkVectorImageTest.cxx b/Modules/Core/ImageAdaptors/test/itkVectorImageTest.cxx index 5124815ee58..89f3ce2a051 100644 --- a/Modules/Core/ImageAdaptors/test/itkVectorImageTest.cxx +++ b/Modules/Core/ImageAdaptors/test/itkVectorImageTest.cxx @@ -51,8 +51,8 @@ testVectorImageAdaptor(typename TAdaptor::Pointer & std::cout << " to extract a component from the vector image" << std::endl; using PixelType = TPixel; - constexpr unsigned int Dimension = VDimension; - constexpr unsigned int VectorLength = VVectorLength; + constexpr unsigned int Dimension{ VDimension }; + constexpr unsigned int VectorLength{ VVectorLength }; bool failed = false; @@ -87,7 +87,7 @@ testVectorImageAdaptor(typename TAdaptor::Pointer & CovariantVectorType output1; vectorImageAdaptor->TransformLocalVectorToPhysicalVector(input, output1); const CovariantVectorType output2 = vectorImageAdaptor->TransformLocalVectorToPhysicalVector(input); - constexpr double diff_tolerance = 1e-13; + constexpr double diff_tolerance{ 1e-13 }; if ((input - output1).GetSquaredNorm() > diff_tolerance || (input - output2).GetSquaredNorm() > diff_tolerance) { std::cerr << "[FAILED] "; @@ -102,7 +102,7 @@ testVectorImageAdaptor(typename TAdaptor::Pointer & CovariantVectorType output1; vectorImageAdaptor->TransformPhysicalVectorToLocalVector(input, output1); const CovariantVectorType output2 = vectorImageAdaptor->TransformPhysicalVectorToLocalVector(input); - constexpr double diff_tolerance = 1e-13; + constexpr double diff_tolerance{ 1e-13 }; if ((input - output1).GetSquaredNorm() > diff_tolerance || (input - output2).GetSquaredNorm() > diff_tolerance) { std::cerr << "[FAILED] "; @@ -264,7 +264,7 @@ itkVectorImageTest(int, char * argv[]) { bool failed = false; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; constexpr unsigned int VectorLength = 2 * Dimension; using PixelType = float; diff --git a/Modules/Core/ImageAdaptors/test/itkVectorImageToImageAdaptorTest.cxx b/Modules/Core/ImageAdaptors/test/itkVectorImageToImageAdaptorTest.cxx index 554025560d8..76c3eff4989 100644 --- a/Modules/Core/ImageAdaptors/test/itkVectorImageToImageAdaptorTest.cxx +++ b/Modules/Core/ImageAdaptors/test/itkVectorImageToImageAdaptorTest.cxx @@ -30,9 +30,9 @@ itkVectorImageToImageAdaptorTest(int, char *[]) { // image type alias - constexpr unsigned int Dimension = 3; - constexpr unsigned int VectorLength = 4; - constexpr unsigned int componentToExtract = 3; + constexpr unsigned int Dimension{ 3 }; + constexpr unsigned int VectorLength{ 4 }; + constexpr unsigned int componentToExtract{ 3 }; using PixelType = float; using VectorImageType = itk::VectorImage; @@ -88,7 +88,7 @@ itkVectorImageToImageAdaptorTest(int, char *[]) auto index = VectorImageToImageAdaptorType::IndexType::Filled(10); ITK_TEST_EXPECT_EQUAL(PixelType(componentToExtract), vectorImageToImageAdaptor->GetPixel(index)); - constexpr PixelType v = 4.4f; + constexpr PixelType v{ 4.4f }; vectorImageToImageAdaptor->SetPixel(index, v); ITK_TEST_EXPECT_EQUAL(v, vectorImageToImageAdaptor->GetPixel(index)); diff --git a/Modules/Core/ImageFunction/include/itkBSplineInterpolateImageFunction.hxx b/Modules/Core/ImageFunction/include/itkBSplineInterpolateImageFunction.hxx index b9221445d21..c16dd892b06 100644 --- a/Modules/Core/ImageFunction/include/itkBSplineInterpolateImageFunction.hxx +++ b/Modules/Core/ImageFunction/include/itkBSplineInterpolateImageFunction.hxx @@ -47,7 +47,7 @@ BSplineInterpolateImageFunction::BSpl , m_CoefficientFilter(CoefficientFilter::New()) , m_NumberOfWorkUnits(1) { - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int SplineOrder{ 3 }; this->SetSplineOrder(SplineOrder); } diff --git a/Modules/Core/ImageFunction/include/itkRayCastInterpolateImageFunction.hxx b/Modules/Core/ImageFunction/include/itkRayCastInterpolateImageFunction.hxx index 4f754bd7b60..510db822390 100644 --- a/Modules/Core/ImageFunction/include/itkRayCastInterpolateImageFunction.hxx +++ b/Modules/Core/ImageFunction/include/itkRayCastInterpolateImageFunction.hxx @@ -450,7 +450,7 @@ template bool RayCastInterpolateImageFunction::RayCastHelper::CalcRayIntercepts() { - constexpr unsigned int numSides = 6; // =6 to allow truncation: =4 to remove truncated rays + constexpr unsigned int numSides{ 6 }; // =6 to allow truncation: =4 to remove truncated rays // Calculate intercept of ray with planes double interceptx[6]; diff --git a/Modules/Core/ImageFunction/test/itkBSplineDecompositionImageFilterTest.cxx b/Modules/Core/ImageFunction/test/itkBSplineDecompositionImageFilterTest.cxx index abe94245880..784dc69391d 100644 --- a/Modules/Core/ImageFunction/test/itkBSplineDecompositionImageFilterTest.cxx +++ b/Modules/Core/ImageFunction/test/itkBSplineDecompositionImageFilterTest.cxx @@ -81,7 +81,7 @@ itkBSplineDecompositionImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = float; using ImageType = itk::Image; using BSplineInterpolatorFunctionType = itk::BSplineInterpolateImageFunction; @@ -100,7 +100,7 @@ itkBSplineDecompositionImageFilterTest(int argc, char * argv[]) filter->SetInput(randImage); - constexpr int unsupportedSplineOrder = 6; + constexpr int unsupportedSplineOrder{ 6 }; ITK_TRY_EXPECT_EXCEPTION(filter->SetSplineOrder(unsupportedSplineOrder)); @@ -112,7 +112,7 @@ itkBSplineDecompositionImageFilterTest(int argc, char * argv[]) ITK_TEST_EXPECT_EQUAL(filter->GetNumberOfPoles(), expectedSplinePoles.size()); FilterType::SplinePolesVectorType resultSplinePoles = filter->GetSplinePoles(); - constexpr double tolerance1 = 1e-10; + constexpr double tolerance1{ 1e-10 }; for (unsigned int i = 0; i < resultSplinePoles.size(); ++i) { const FilterType::SplinePolesVectorType::value_type expectedSplinePole = expectedSplinePoles[i]; @@ -149,7 +149,7 @@ itkBSplineDecompositionImageFilterTest(int argc, char * argv[]) const double minValue = randImage->GetOrigin()[0]; const double maxValue = lastPhysicalLocation[0]; - constexpr double tolerance2 = 1e-5; + constexpr double tolerance2{ 1e-5 }; for (unsigned int k = 0; k < 10; ++k) { ResampleFunctionType::PointType point; diff --git a/Modules/Core/ImageFunction/test/itkBSplineInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkBSplineInterpolateImageFunctionTest.cxx index 63209b9bdb2..7b152ecfe71 100644 --- a/Modules/Core/ImageFunction/test/itkBSplineInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkBSplineInterpolateImageFunctionTest.cxx @@ -268,11 +268,11 @@ test1DCubicSpline() ITK_EXERCISE_BASIC_OBJECT_METHODS(interp, BSplineInterpolateImageFunction, InterpolateImageFunction); - constexpr itk::ThreadIdType numberOfWorkUnits = 1; + constexpr itk::ThreadIdType numberOfWorkUnits{ 1 }; interp->SetNumberOfWorkUnits(numberOfWorkUnits); ITK_TEST_SET_GET_VALUE(numberOfWorkUnits, interp->GetNumberOfWorkUnits()); - constexpr bool useImageDirection = true; + constexpr bool useImageDirection{ true }; ITK_TEST_SET_GET_BOOLEAN(interp, UseImageDirection, useImageDirection); interp->SetInputImage(image); @@ -290,8 +290,8 @@ test1DCubicSpline() // 4) outside image #define NPOINTS 5 // number of points constexpr itk::SpacePrecisionType darray1[NPOINTS] = { 1.4, 8.9, 10.0, 40.0, -0.3 }; - constexpr double truth[NPOINTS] = { 334.41265437584, 18.158173426944, 4.0000, 0, 442.24157192006658 }; - constexpr bool b_Inside[NPOINTS] = { true, true, true, false, true }; + constexpr double truth[NPOINTS]{ 334.41265437584, 18.158173426944, 4.0000, 0, 442.24157192006658 }; + constexpr bool b_Inside[NPOINTS]{ true, true, true, false, true }; // an integer position inside the image for (int ii = 0; ii < NPOINTS; ++ii) @@ -329,8 +329,8 @@ test2DSpline() set2DInterpData(image); /* Set origin and spacing of physical coordinates */ - constexpr double origin[] = { 0.5, 1.0 }; - constexpr double spacing[] = { 0.1, 0.5 }; + constexpr double origin[]{ 0.5, 1.0 }; + constexpr double spacing[]{ 0.1, 0.5 }; image->SetOrigin(origin); image->SetSpacing(spacing); @@ -366,7 +366,7 @@ test2DSpline() { 36.2, 36.2, 36.2, 36.2, 36.2, 36.2 }, { 0, 0, 0, 0, 0, 0 } }; - constexpr bool b_Inside[NPOINTS2] = { true, true, true, false }; + constexpr bool b_Inside[NPOINTS2]{ true, true, true, false }; // an integer position inside the image for (int ii = 0; ii < NPOINTS2; ++ii) @@ -407,8 +407,8 @@ test3DSpline() set3DInterpData(image); /* Set origin and spacing of physical coordinates */ - constexpr double origin[] = { 0.5, 1.0, 1.333 }; - constexpr double spacing[] = { 0.1, 0.5, 0.75 }; + constexpr double origin[]{ 0.5, 1.0, 1.333 }; + constexpr double spacing[]{ 0.1, 0.5, 0.75 }; image->SetOrigin(origin); image->SetSpacing(spacing); @@ -442,7 +442,7 @@ test3DSpline() { 0, 0, 0, 0 }, { 2.2545584407825165, 2.2722384004239382, 2.2533523347849744, 2.2516795363567588 } }; - constexpr bool b_Inside[NPOINTS3] = { true, true, true, false, true }; + constexpr bool b_Inside[NPOINTS3]{ true, true, true, false, true }; // an integer position inside the image for (int ii = 0; ii < NPOINTS3; ++ii) @@ -482,8 +482,8 @@ test3DSplineDerivative() set3DDerivativeData(image); /* Set origin and spacing of physical coordinates */ - constexpr double origin[] = { 0.0, 0.0, 0.0 }; - constexpr double spacing[] = { 1, 1, 1 }; + constexpr double origin[]{ 0.0, 0.0, 0.0 }; + constexpr double spacing[]{ 1, 1, 1 }; image->SetOrigin(origin); image->SetSpacing(spacing); @@ -520,7 +520,7 @@ test3DSplineDerivative() { { 19.4164, 5, -24 }, { 0.9, 4.9925, 94.5082 }, { -7.2, 5.00044, 33.9976 }, { 0, 0, 0 } }, { { 19.4223, 5, -24 }, { 0.900157, 5.0544, 93.8607 }, { -7.19929, 5.00189, 33.9879 }, { 0, 0, 0 } } }; - constexpr bool b_Inside[NPOINTS4] = { true, true, true, false }; + constexpr bool b_Inside[NPOINTS4]{ true, true, true, false }; // an integer position inside the image for (int ii = 0; ii < NPOINTS4; ++ii) @@ -549,8 +549,8 @@ testInteger3DSpline() set3DInterpData(image); /* Set origin and spacing of physical coordinates */ - constexpr double origin[] = { 0.5, 1.0, 1.333 }; - constexpr double spacing[] = { 0.1, 0.5, 0.75 }; + constexpr double origin[]{ 0.5, 1.0, 1.333 }; + constexpr double spacing[]{ 0.1, 0.5, 0.75 }; image->SetOrigin(origin); image->SetSpacing(spacing); @@ -582,7 +582,7 @@ testInteger3DSpline() { 73.280126903, 73.280816965, 73.282780615, 73.285315943 }, { 42.0, 42.0, 42.0, 42.0 }, { 0, 0, 0, 0 } }; - constexpr bool b_Inside[NPOINTS4b] = { true, true, true, false }; + constexpr bool b_Inside[NPOINTS4b]{ true, true, true, false }; // an integer position inside the image for (int ii = 0; ii < NPOINTS4b; ++ii) @@ -615,12 +615,12 @@ testInteger3DSpline() int testEvaluateValueAndDerivative() { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = float; using ImageType = itk::Image; using BSplineInterpolatorFunctionType = itk::BSplineInterpolateImageFunction; - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int SplineOrder{ 3 }; const BSplineInterpolatorFunctionType::Pointer interpolator = makeRandomImageInterpolator(SplineOrder); @@ -685,12 +685,12 @@ itkBSplineInterpolateImageFunctionTest(int itkNotUsed(argc), char * itkNotUsed(a void set1DInterpData(ImageType1D::Pointer imgPtr) { - constexpr SizeType1D size = { { 36 } }; - constexpr double mydata[36] = { 454.0000, 369.4000, 295.2000, 230.8000, 175.6000, 129.0000, 90.4000, 59.2000, - 34.8000, 16.6000, 4.0000, -3.6000, -6.8000, -6.2000, -2.4000, 4.0000, - 12.4000, 22.2000, 32.8000, 43.6000, 54.0000, 63.4000, 71.2000, 76.8000, - 79.6000, 79.0000, 74.4000, 65.2000, 50.8000, 30.6000, 4.0000, -29.6000, - -70.8000, -120.2000, -178.4000, -246.0000 }; + constexpr SizeType1D size{ 36 }; + constexpr double mydata[36]{ 454.0000, 369.4000, 295.2000, 230.8000, 175.6000, 129.0000, 90.4000, 59.2000, + 34.8000, 16.6000, 4.0000, -3.6000, -6.8000, -6.2000, -2.4000, 4.0000, + 12.4000, 22.2000, 32.8000, 43.6000, 54.0000, 63.4000, 71.2000, 76.8000, + 79.6000, 79.0000, 74.4000, 65.2000, 50.8000, 30.6000, 4.0000, -29.6000, + -70.8000, -120.2000, -178.4000, -246.0000 }; ImageType1D::RegionType region; region.SetSize(size); @@ -715,8 +715,8 @@ set1DInterpData(ImageType1D::Pointer imgPtr) void set2DInterpData(ImageType2D::Pointer imgPtr) { - constexpr SizeType2D size = { { 7, 7 } }; - constexpr double mydata[49] = { + constexpr SizeType2D size{ 7, 7 }; + constexpr double mydata[49]{ 154.5000, 82.4000, 30.9000, 0, -10.3000, 0, 30.9000, 117.0000, 62.4000, 23.4000, 0, -7.8000, 0, 23.4000, 18.0000, 9.6000, 3.6000, 0, -1.2000, 0, 3.6000, -120.0000, -64.0000, -24.0000, 0, 8.0000, 0, -24.0000, -274.5000, -146.4000, -54.9000, 0, 18.3000, 0, -54.9000, -423.0000, -225.6000, -84.6000, 0, 28.2000, 0, -84.6000, diff --git a/Modules/Core/ImageFunction/test/itkBSplineResampleImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkBSplineResampleImageFunctionTest.cxx index 2400ed5c893..989a65e3126 100644 --- a/Modules/Core/ImageFunction/test/itkBSplineResampleImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkBSplineResampleImageFunctionTest.cxx @@ -37,12 +37,12 @@ int itkBSplineResampleImageFunctionTest(int, char *[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = float; using ImageType = itk::Image; using BSplineInterpolatorFunctionType = itk::BSplineInterpolateImageFunction; - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int SplineOrder{ 3 }; const BSplineInterpolatorFunctionType::Pointer interpolator = makeRandomImageInterpolator(SplineOrder); const ImageType::ConstPointer randImage = interpolator->GetInputImage(); diff --git a/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionOnVectorSpeedTest.cxx b/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionOnVectorSpeedTest.cxx index 7ac17917d41..394a04af763 100644 --- a/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionOnVectorSpeedTest.cxx +++ b/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionOnVectorSpeedTest.cxx @@ -34,7 +34,7 @@ itkCentralDifferenceImageFunctionOnVectorSpeedTestRun(char * argv[]) << ", " << doE << std::endl; std::cout << "vecLength: " << vecLength << std::endl; - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = itk::Vector; using ImageType = itk::Image; diff --git a/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionOnVectorTest.cxx b/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionOnVectorTest.cxx index 9f702326992..aeabeb819d9 100644 --- a/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionOnVectorTest.cxx +++ b/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionOnVectorTest.cxx @@ -48,7 +48,7 @@ itkCentralDifferenceImageFunctionOnVectorTestRun() int result = EXIT_SUCCESS; - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = itk::Vector; using ImageType = itk::Image; diff --git a/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionSpeedTest.cxx b/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionSpeedTest.cxx index 222526dcc72..a40f9225e19 100644 --- a/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionSpeedTest.cxx +++ b/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionSpeedTest.cxx @@ -38,7 +38,7 @@ itkCentralDifferenceImageFunctionSpeedTest(int argc, char * argv[]) std::cout << "imageSize: " << imageSize << " reps: " << reps << " doEAI, doEACI, doE: " << doEAI << ", " << doEACI << ", " << doE << std::endl; - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned int; using ImageType = itk::Image; diff --git a/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionTest.cxx index 0a0dd4b1754..0abe5c4313b 100644 --- a/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionTest.cxx @@ -26,7 +26,7 @@ itkCentralDifferenceImageFunctionTest(int, char *[]) { int result = EXIT_SUCCESS; - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned int; using ImageType = itk::Image; @@ -295,7 +295,7 @@ itkCentralDifferenceImageFunctionTest(int, char *[]) // with image direction disabled, result should be same as with // identity direction - constexpr bool useImageDirection = false; + constexpr bool useImageDirection{ false }; ITK_TEST_SET_GET_BOOLEAN(function, UseImageDirection, useImageDirection); const OutputType directionOffDerivative = function->Evaluate(point); diff --git a/Modules/Core/ImageFunction/test/itkCovarianceImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkCovarianceImageFunctionTest.cxx index dc13544ba54..8893699262b 100644 --- a/Modules/Core/ImageFunction/test/itkCovarianceImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkCovarianceImageFunctionTest.cxx @@ -24,9 +24,9 @@ int itkCovarianceImageFunctionTest(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelComponentType = unsigned char; - constexpr unsigned int VectorDimension = 4; + constexpr unsigned int VectorDimension{ 4 }; using PixelType = itk::FixedArray; using ImageType = itk::Image; @@ -50,7 +50,7 @@ itkCovarianceImageFunctionTest(int, char *[]) function->SetInputImage(image); - constexpr unsigned int neighborhoodRadius = 5; + constexpr unsigned int neighborhoodRadius{ 5 }; function->SetNeighborhoodRadius(neighborhoodRadius); ITK_TEST_SET_GET_VALUE(neighborhoodRadius, function->GetNeighborhoodRadius()); @@ -69,7 +69,7 @@ itkCovarianceImageFunctionTest(int, char *[]) const FunctionType::OutputType covariance3 = function->EvaluateAtContinuousIndex(cindex); std::cout << "function->EvaluateAtContinuousIndex(cindex): " << covariance3 << std::endl; - constexpr ImageType::IndexValueType imageValue = 0; + constexpr ImageType::IndexValueType imageValue{ 0 }; // Since the input image is constant, the covariance should be equal to // the initial value for (unsigned int ix = 0; ix < VectorDimension; ++ix) diff --git a/Modules/Core/ImageFunction/test/itkGaussianBlurImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkGaussianBlurImageFunctionTest.cxx index e903801acd9..e39f3edab6e 100644 --- a/Modules/Core/ImageFunction/test/itkGaussianBlurImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkGaussianBlurImageFunctionTest.cxx @@ -23,7 +23,7 @@ int itkGaussianBlurImageFunctionTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using ImageType = itk::Image; using GFunctionType = itk::GaussianBlurImageFunction; @@ -111,7 +111,7 @@ itkGaussianBlurImageFunctionTest(int, char *[]) // Testing Set/GetMaximumKernelWidth() { std::cout << "Testing Set/GetMaximumKernelWidth(): "; - constexpr int setKernelWidth = 47; + constexpr int setKernelWidth{ 47 }; gaussianFunction->SetMaximumKernelWidth(setKernelWidth); diff --git a/Modules/Core/ImageFunction/test/itkGaussianDerivativeImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkGaussianDerivativeImageFunctionTest.cxx index e1a67c53777..3db0b5a1392 100644 --- a/Modules/Core/ImageFunction/test/itkGaussianDerivativeImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkGaussianDerivativeImageFunctionTest.cxx @@ -24,7 +24,7 @@ template int TestGaussianDerivativeImageFunction() { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = TPixel; using ImageType = itk::Image; @@ -50,7 +50,7 @@ TestGaussianDerivativeImageFunction() using DoGFunctionType = itk::GaussianDerivativeImageFunction; auto DoG = DoGFunctionType::New(); - constexpr bool useImageSpacing = true; + constexpr bool useImageSpacing{ true }; ITK_TEST_SET_GET_BOOLEAN(DoG, UseImageSpacing, useImageSpacing); DoG->SetInputImage(image); @@ -143,7 +143,7 @@ itkGaussianDerivativeImageFunctionTest(int, char *[]) // Exercise basic object methods // Done outside the helper function in the test because GCC is limited // when calling overloaded base class functions. - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using ImageType = itk::Image; diff --git a/Modules/Core/ImageFunction/test/itkGaussianInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkGaussianInterpolateImageFunctionTest.cxx index 63b30a4fc07..503afb87fd8 100644 --- a/Modules/Core/ImageFunction/test/itkGaussianInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkGaussianInterpolateImageFunctionTest.cxx @@ -36,7 +36,7 @@ itkGaussianInterpolateImageFunctionTest(int, char *[]) interpolator->SetSigma(sigma); ITK_TEST_SET_GET_VALUE(sigma, interpolator->GetSigma()); - constexpr InterpolatorType::RealType alpha = 1.0; + constexpr InterpolatorType::RealType alpha{ 1.0 }; interpolator->SetAlpha(alpha); ITK_TEST_SET_GET_VALUE(alpha, interpolator->GetAlpha()); diff --git a/Modules/Core/ImageFunction/test/itkImageAdaptorInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkImageAdaptorInterpolateImageFunctionTest.cxx index 1e7455c31e6..d3c8f399aeb 100644 --- a/Modules/Core/ImageFunction/test/itkImageAdaptorInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkImageAdaptorInterpolateImageFunctionTest.cxx @@ -152,9 +152,9 @@ itkImageAdaptorInterpolateImageFunctionTest(int, char *[]) constexpr unsigned int ImageDimension = ImageAdaptorInterpolate::ImageDimension; - constexpr ImageType::SizeType size = { { 20, 40, 80 } }; - constexpr double origin[3] = { 0.5, 0.5, 0.5 }; - constexpr double spacing[3] = { 0.1, 0.05, 0.025 }; + constexpr ImageType::SizeType size{ 20, 40, 80 }; + constexpr double origin[3]{ 0.5, 0.5, 0.5 }; + constexpr double spacing[3]{ 0.1, 0.05, 0.025 }; // Create a test image @@ -215,7 +215,7 @@ itkImageAdaptorInterpolateImageFunctionTest(int, char *[]) // an integer position inside the image { itk::SpacePrecisionType darray[3] = { 10, 20, 40 }; - constexpr double temp = 70.0; + constexpr double temp{ 70.0 }; output = static_cast(temp); cindex = ContinuousIndexType(darray); passed = ImageAdaptorInterpolate::TestContinuousIndex(interp, cindex, true, output); @@ -237,7 +237,7 @@ itkImageAdaptorInterpolateImageFunctionTest(int, char *[]) // position at the image border { itk::SpacePrecisionType darray[3] = { 0, 20, 40 }; - constexpr double temp = 60.0; + constexpr double temp{ 60.0 }; output = static_cast(temp); cindex = ContinuousIndexType(darray); passed = ImageAdaptorInterpolate::TestContinuousIndex(interp, cindex, true, output); @@ -258,9 +258,9 @@ itkImageAdaptorInterpolateImageFunctionTest(int, char *[]) // position near image border { - constexpr itk::SpacePrecisionType epsilon = 1.0e-10; + constexpr itk::SpacePrecisionType epsilon{ 1.0e-10 }; itk::SpacePrecisionType darray[3] = { 19 - epsilon, 20, 40 }; - constexpr double temp = 79.0; + constexpr double temp{ 79.0 }; output = static_cast(temp); cindex = ContinuousIndexType(darray); passed = ImageAdaptorInterpolate::TestContinuousIndex(interp, cindex, true, output); @@ -282,7 +282,7 @@ itkImageAdaptorInterpolateImageFunctionTest(int, char *[]) // position outside the image { itk::SpacePrecisionType darray[3] = { 20, 20, 40 }; - constexpr double temp = 1.0; + constexpr double temp{ 1.0 }; output = static_cast(temp); cindex = ContinuousIndexType(darray); passed = ImageAdaptorInterpolate::TestContinuousIndex(interp, cindex, false, output); @@ -304,7 +304,7 @@ itkImageAdaptorInterpolateImageFunctionTest(int, char *[]) // at non-integer position { itk::SpacePrecisionType darray[3] = { 5.25, 12.5, 42.0 }; - constexpr double temp = 59.75; + constexpr double temp{ 59.75 }; output = static_cast(temp); cindex = ContinuousIndexType(darray); passed = ImageAdaptorInterpolate::TestContinuousIndex(interp, cindex, true, output); diff --git a/Modules/Core/ImageFunction/test/itkInterpolateTest.cxx b/Modules/Core/ImageFunction/test/itkInterpolateTest.cxx index 7bcfcd3b51d..1897580eb62 100644 --- a/Modules/Core/ImageFunction/test/itkInterpolateTest.cxx +++ b/Modules/Core/ImageFunction/test/itkInterpolateTest.cxx @@ -206,7 +206,7 @@ itkInterpolateTest(int, char *[]) } // position near image border - constexpr itk::SpacePrecisionType epsilon = 1.0e-10; + constexpr itk::SpacePrecisionType epsilon{ 1.0e-10 }; itk::SpacePrecisionType darray3[3] = { 19 - epsilon, 20, 40 }; cindex = ContinuousIndexType(darray3); passed = TestContinuousIndex(interp, cindex, true, 79); diff --git a/Modules/Core/ImageFunction/test/itkLabelImageGaussianInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkLabelImageGaussianInterpolateImageFunctionTest.cxx index ccc8d565427..a4713b30e9f 100644 --- a/Modules/Core/ImageFunction/test/itkLabelImageGaussianInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkLabelImageGaussianInterpolateImageFunctionTest.cxx @@ -26,7 +26,7 @@ int itkLabelImageGaussianInterpolateImageFunctionTest(int, char *[]) { int test_status = EXIT_SUCCESS; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned short; // Label images should be integer value types using ImageType = itk::Image; using RegionType = ImageType::RegionType; @@ -36,9 +36,9 @@ itkLabelImageGaussianInterpolateImageFunctionTest(int, char *[]) using CoordinateType = float; // The ImageSizeToCompute - constexpr double FOV = 10.0; - constexpr itk::IndexValueType small_xSize = 3; - constexpr itk::IndexValueType small_ySize = 3; + constexpr double FOV{ 10.0 }; + constexpr itk::IndexValueType small_xSize{ 3 }; + constexpr itk::IndexValueType small_ySize{ 3 }; auto small_image = ImageType::New(); { constexpr IndexType start{}; @@ -87,7 +87,7 @@ itkLabelImageGaussianInterpolateImageFunctionTest(int, char *[]) { d = 1.0; } - constexpr double alpha = 1.0; + constexpr double alpha{ 1.0 }; interpolator->SetParameters(sigma, alpha); } interpolator->Print(std::cout, 3); @@ -100,9 +100,9 @@ itkLabelImageGaussianInterpolateImageFunctionTest(int, char *[]) // ######################## // Now check the results // The ImageSizeToCompute - constexpr unsigned char default_background_value = 17; - constexpr itk::IndexValueType large_xSize = 5 + 1; - constexpr itk::IndexValueType large_ySize = 5; + constexpr unsigned char default_background_value{ 17 }; + constexpr itk::IndexValueType large_xSize{ 5 + 1 }; + constexpr itk::IndexValueType large_ySize{ 5 }; auto large_image = ImageType::New(); { RegionType region; @@ -209,7 +209,7 @@ itkLabelImageGaussianInterpolateImageFunctionTest(int, char *[]) } } #if 0 - constexpr double incr = 0.1; + constexpr double incr{ 0.1 }; PointType point; for (double yy = 0; yy < static_cast(small_ySize-1); ++yy) { diff --git a/Modules/Core/ImageFunction/test/itkLinearInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkLinearInterpolateImageFunctionTest.cxx index 7c4328ceb40..39ef6e89267 100644 --- a/Modules/Core/ImageFunction/test/itkLinearInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkLinearInterpolateImageFunctionTest.cxx @@ -30,7 +30,7 @@ RunLinearInterpolateTest() { using PixelType = float; const unsigned int Dimensions = TDimension; - constexpr unsigned int VectorDimension = 4; + constexpr unsigned int VectorDimension{ 4 }; using VectorPixelType = itk::Vector; using ImageType = itk::Image; using VectorImageType = itk::Image; @@ -63,7 +63,7 @@ RunLinearInterpolateTest() constexpr IndexType start{}; SizeType size; - constexpr int dimMaxLength = 3; + constexpr int dimMaxLength{ 3 }; size.Fill(dimMaxLength); const RegionType region{ start, size }; @@ -156,9 +156,9 @@ RunLinearInterpolateTest() ITK_TEST_SET_GET_VALUE(radius[d], interpolator->GetRadius()[d]); } - constexpr AccumulatorType incr = 0.2; + constexpr AccumulatorType incr{ 0.2 }; - constexpr AccumulatorType tolerance = 5e-6; + constexpr AccumulatorType tolerance{ 5e-6 }; // The tolerance of the norm must be greater than the tolerance for individual items. const AccumulatorType normTolerance = std::sqrt(4.0f * tolerance * tolerance); diff --git a/Modules/Core/ImageFunction/test/itkMahalanobisDistanceThresholdImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkMahalanobisDistanceThresholdImageFunctionTest.cxx index 79745ab31f3..7cd4fb76f99 100644 --- a/Modules/Core/ImageFunction/test/itkMahalanobisDistanceThresholdImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkMahalanobisDistanceThresholdImageFunctionTest.cxx @@ -27,7 +27,7 @@ int itkMahalanobisDistanceThresholdImageFunctionTest(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelComponentType = unsigned char; using PixelType = itk::RGBPixel; @@ -57,7 +57,7 @@ itkMahalanobisDistanceThresholdImageFunctionTest(int, char *[]) function->SetInputImage(image); - constexpr double threshold = 5.0; + constexpr double threshold{ 5.0 }; function->SetThreshold(threshold); FunctionType::CovarianceMatrixType covariance(Dimension, Dimension); @@ -89,7 +89,7 @@ itkMahalanobisDistanceThresholdImageFunctionTest(int, char *[]) const double distance = function->EvaluateDistanceAtIndex(index); std::cout << "function->EvaluateDistanceAtIndex( index ): " << distance << std::endl; - constexpr double expectedDistance = 0.244949; + constexpr double expectedDistance{ 0.244949 }; if (!itk::Math::FloatAlmostEqual(distance, expectedDistance, 10, 1e-5)) { std::cerr << "Error in distance computation in EvaluateDistanceAtIndex() !!" << std::endl; diff --git a/Modules/Core/ImageFunction/test/itkMeanImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkMeanImageFunctionTest.cxx index 2382c29a161..73df7abe6d4 100644 --- a/Modules/Core/ImageFunction/test/itkMeanImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkMeanImageFunctionTest.cxx @@ -26,7 +26,7 @@ itkMeanImageFunctionTest(int, char *[]) { int testStatus = EXIT_SUCCESS; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = unsigned char; using ImageType = itk::Image; @@ -42,7 +42,7 @@ itkMeanImageFunctionTest(int, char *[]) image->SetRegions(region); image->Allocate(); - constexpr ImageType::PixelType initialValue = 27; + constexpr ImageType::PixelType initialValue{ 27 }; image->FillBuffer(initialValue); @@ -52,7 +52,7 @@ itkMeanImageFunctionTest(int, char *[]) function->SetInputImage(image); - constexpr unsigned int neighborhoodRadius = 5; + constexpr unsigned int neighborhoodRadius{ 5 }; function->SetNeighborhoodRadius(neighborhoodRadius); ITK_TEST_SET_GET_VALUE(neighborhoodRadius, function->GetNeighborhoodRadius()); @@ -64,7 +64,7 @@ itkMeanImageFunctionTest(int, char *[]) const FunctionType::RealType mean = function->EvaluateAtIndex(index); - constexpr double epsilon = 1e-7; + constexpr double epsilon{ 1e-7 }; if (!itk::Math::FloatAlmostEqual(static_cast(initialValue), mean, 10, epsilon)) { std::cout.precision(static_cast(itk::Math::abs(std::log10(epsilon)))); diff --git a/Modules/Core/ImageFunction/test/itkMedianImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkMedianImageFunctionTest.cxx index 10ccdf1a197..97af3aeb0dc 100644 --- a/Modules/Core/ImageFunction/test/itkMedianImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkMedianImageFunctionTest.cxx @@ -24,7 +24,7 @@ int itkMedianImageFunctionTest(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = unsigned char; using ImageType = itk::Image; @@ -42,7 +42,7 @@ itkMedianImageFunctionTest(int, char *[]) image->SetRegions(region); image->Allocate(); - constexpr ImageType::PixelType initialValue = 27; + constexpr ImageType::PixelType initialValue{ 27 }; image->FillBuffer(initialValue); @@ -119,7 +119,7 @@ itkMedianImageFunctionTest(int, char *[]) } // now set the radius - constexpr unsigned int neighborhoodRadius = 2; + constexpr unsigned int neighborhoodRadius{ 2 }; function->SetNeighborhoodRadius(neighborhoodRadius); ITK_TEST_SET_GET_VALUE(neighborhoodRadius, function->GetNeighborhoodRadius()); diff --git a/Modules/Core/ImageFunction/test/itkNearestNeighborExtrapolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkNearestNeighborExtrapolateImageFunctionTest.cxx index 99b2c9beb22..9dfb797bb10 100644 --- a/Modules/Core/ImageFunction/test/itkNearestNeighborExtrapolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkNearestNeighborExtrapolateImageFunctionTest.cxx @@ -30,9 +30,9 @@ int itkNearestNeighborExtrapolateImageFunctionTest(int, char *[]) { using CoordRep = double; - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; - constexpr unsigned int VectorDimension = 4; + constexpr unsigned int VectorDimension{ 4 }; using VectorPixelType = itk::Vector; using ImageType = itk::Image; using VectorImageType = itk::Image; diff --git a/Modules/Core/ImageFunction/test/itkNearestNeighborInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkNearestNeighborInterpolateImageFunctionTest.cxx index b1e4b337bbd..e773b067b29 100644 --- a/Modules/Core/ImageFunction/test/itkNearestNeighborInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkNearestNeighborInterpolateImageFunctionTest.cxx @@ -30,9 +30,9 @@ itkNearestNeighborInterpolateImageFunctionTest(int, char *[]) { int result = EXIT_SUCCESS; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; - constexpr unsigned int VectorDimension = 4; + constexpr unsigned int VectorDimension{ 4 }; using VectorPixelType = itk::Vector; using ImageType = itk::Image; using VectorImageType = itk::Image; @@ -90,8 +90,8 @@ itkNearestNeighborInterpolateImageFunctionTest(int, char *[]) image->Print(std::cout); - constexpr unsigned int maxx = 3; - constexpr unsigned int maxy = 3; + constexpr unsigned int maxx{ 3 }; + constexpr unsigned int maxy{ 3 }; // // Fill up the image values with the function @@ -140,7 +140,7 @@ itkNearestNeighborInterpolateImageFunctionTest(int, char *[]) auto variablevectorinterpolator = VariableVectorInterpolatorType::New(); variablevectorinterpolator->SetInputImage(variablevectorimage); - constexpr double incr = 0.1; + constexpr double incr{ 0.1 }; PointType point; for (double yy = 0; yy < static_cast(maxy - 1); ++yy) diff --git a/Modules/Core/ImageFunction/test/itkNeighborhoodOperatorImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkNeighborhoodOperatorImageFunctionTest.cxx index f0d06be55c9..c131a3058d3 100644 --- a/Modules/Core/ImageFunction/test/itkNeighborhoodOperatorImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkNeighborhoodOperatorImageFunctionTest.cxx @@ -25,7 +25,7 @@ int itkNeighborhoodOperatorImageFunctionTest(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = float; using ImageType = itk::Image; using NeighborhoodOperatorType = itk::GaussianOperator; @@ -40,7 +40,7 @@ itkNeighborhoodOperatorImageFunctionTest(int, char *[]) image->SetRegions(region); image->Allocate(); - constexpr ImageType::PixelType initialValue = 27; + constexpr ImageType::PixelType initialValue{ 27 }; image->FillBuffer(initialValue); diff --git a/Modules/Core/ImageFunction/test/itkRGBInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkRGBInterpolateImageFunctionTest.cxx index 365b4ecd599..9f74a1ca4f0 100644 --- a/Modules/Core/ImageFunction/test/itkRGBInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkRGBInterpolateImageFunctionTest.cxx @@ -177,9 +177,9 @@ itkRGBInterpolateImageFunctionTest(int, char *[]) constexpr unsigned int ImageDimension = RGBInterpolate::ImageDimension; - constexpr ImageType::SizeType size = { { 20, 40, 80 } }; - constexpr double origin[3] = { 0.5, 0.5, 0.5 }; - constexpr double spacing[3] = { 0.1, 0.05, 0.025 }; + constexpr ImageType::SizeType size{ 20, 40, 80 }; + constexpr double origin[3]{ 0.5, 0.5, 0.5 }; + constexpr double spacing[3]{ 0.1, 0.05, 0.025 }; // Create a test image @@ -270,7 +270,7 @@ itkRGBInterpolateImageFunctionTest(int, char *[]) } // position near image border { - constexpr itk::SpacePrecisionType epsilon = 1.0e-10; + constexpr itk::SpacePrecisionType epsilon{ 1.0e-10 }; itk::SpacePrecisionType darray[3] = { 19 - epsilon, 20, 40 }; double temp[3] = { 79, 158, 237 }; auto output = OutputType(temp); diff --git a/Modules/Core/ImageFunction/test/itkRayCastInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkRayCastInterpolateImageFunctionTest.cxx index 2a3ed1c1c49..83471461841 100644 --- a/Modules/Core/ImageFunction/test/itkRayCastInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkRayCastInterpolateImageFunctionTest.cxx @@ -30,7 +30,7 @@ itkRayCastInterpolateImageFunctionTest(int itkNotUsed(argc), char * itkNotUsed(a { using PixelType = unsigned char; - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using ImageType = itk::Image; @@ -103,7 +103,7 @@ itkRayCastInterpolateImageFunctionTest(int itkNotUsed(argc), char * itkNotUsed(a ITK_TEST_SET_GET_VALUE(auxInterpolator, interp->GetInterpolator()); /* Exercise the SetThreshold() method */ - constexpr double threshold = 1.0; + constexpr double threshold{ 1.0 }; interp->SetThreshold(threshold); ITK_TEST_SET_GET_VALUE(threshold, interp->GetThreshold()); diff --git a/Modules/Core/ImageFunction/test/itkScatterMatrixImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkScatterMatrixImageFunctionTest.cxx index 09644492bb0..7f87f850bab 100644 --- a/Modules/Core/ImageFunction/test/itkScatterMatrixImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkScatterMatrixImageFunctionTest.cxx @@ -24,9 +24,9 @@ int itkScatterMatrixImageFunctionTest(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelComponentType = unsigned char; - constexpr unsigned int VectorDimension = 4; + constexpr unsigned int VectorDimension{ 4 }; using PixelType = itk::FixedArray; using ImageType = itk::Image; @@ -55,7 +55,7 @@ itkScatterMatrixImageFunctionTest(int, char *[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(function, ScatterMatrixImageFunction, ImageFunction); - constexpr unsigned int neighborhoodRadius = 5; + constexpr unsigned int neighborhoodRadius{ 5 }; function->SetNeighborhoodRadius(neighborhoodRadius); ITK_TEST_SET_GET_VALUE(neighborhoodRadius, function->GetNeighborhoodRadius()); diff --git a/Modules/Core/ImageFunction/test/itkSumOfSquaresImageFunctionGTest.cxx b/Modules/Core/ImageFunction/test/itkSumOfSquaresImageFunctionGTest.cxx index 5454eb00522..444b75d9309 100644 --- a/Modules/Core/ImageFunction/test/itkSumOfSquaresImageFunctionGTest.cxx +++ b/Modules/Core/ImageFunction/test/itkSumOfSquaresImageFunctionGTest.cxx @@ -102,7 +102,7 @@ TestBasicObjectProperties() ITK_EXERCISE_BASIC_OBJECT_METHODS(imageFunction, SumOfSquaresImageFunction, ImageFunction); - constexpr unsigned int radius = 1; + constexpr unsigned int radius{ 1 }; imageFunction->SetNeighborhoodRadius(radius); EXPECT_EQ(radius, imageFunction->GetNeighborhoodRadius()); diff --git a/Modules/Core/ImageFunction/test/itkVarianceImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkVarianceImageFunctionTest.cxx index a9cad4bc9d5..95a2040c561 100644 --- a/Modules/Core/ImageFunction/test/itkVarianceImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkVarianceImageFunctionTest.cxx @@ -25,7 +25,7 @@ int itkVarianceImageFunctionTest(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Core/ImageFunction/test/itkVectorInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkVectorInterpolateImageFunctionTest.cxx index 90adca9e8ca..22ac95f372c 100644 --- a/Modules/Core/ImageFunction/test/itkVectorInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkVectorInterpolateImageFunctionTest.cxx @@ -165,9 +165,9 @@ itkVectorInterpolateImageFunctionTest(int, char *[]) std::cout << "Testing vector image interpolation: " << std::endl; - constexpr ImageType::SizeType size = { { 20, 40, 80 } }; - constexpr double origin[3] = { 0.5, 0.5, 0.5 }; - constexpr double spacing[3] = { 0.1, 0.05, 0.025 }; + constexpr ImageType::SizeType size{ 20, 40, 80 }; + constexpr double origin[3]{ 0.5, 0.5, 0.5 }; + constexpr double spacing[3]{ 0.1, 0.05, 0.025 }; // Create a test image auto image = ImageType::New(); @@ -277,9 +277,9 @@ itkVectorInterpolateImageFunctionTest(int, char *[]) // position near image border { - constexpr itk::SpacePrecisionType epsilon = 1.0e-10; + constexpr itk::SpacePrecisionType epsilon{ 1.0e-10 }; constexpr itk::SpacePrecisionType darray[3] = { 19 - epsilon, 20, 40 }; - constexpr double temp[3] = { 79, 158, 237 }; + constexpr double temp[3]{ 79, 158, 237 }; output = OutputType(temp); cindex = ContinuousIndexType(darray); passed = TestContinuousIndex(interp, cindex, true, output); @@ -300,8 +300,8 @@ itkVectorInterpolateImageFunctionTest(int, char *[]) // position outside the image { - constexpr itk::SpacePrecisionType darray[3] = { 20, 20, 40 }; - constexpr double temp[3] = { 1, 1, 1 }; + constexpr itk::SpacePrecisionType darray[3]{ 20, 20, 40 }; + constexpr double temp[3]{ 1, 1, 1 }; output = OutputType(temp); cindex = ContinuousIndexType(darray); passed = TestContinuousIndex(interp, cindex, false, output); @@ -322,8 +322,8 @@ itkVectorInterpolateImageFunctionTest(int, char *[]) // at non-integer position { - constexpr itk::SpacePrecisionType darray[3] = { 5.25, 12.5, 42.0 }; - constexpr double temp[3] = { 59.75, 119.5, 179.25 }; + constexpr itk::SpacePrecisionType darray[3]{ 5.25, 12.5, 42.0 }; + constexpr double temp[3]{ 59.75, 119.5, 179.25 }; output = OutputType(temp); cindex = ContinuousIndexType(darray); passed = TestContinuousIndex(interp, cindex, true, output); diff --git a/Modules/Core/ImageFunction/test/itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunctionTest.cxx index 4d1002042a6..50ad9ac19cd 100644 --- a/Modules/Core/ImageFunction/test/itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunctionTest.cxx @@ -175,9 +175,9 @@ itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunctionTest(int, char std::cout << "Testing vector image interpolation: " << std::endl; - constexpr ImageType::SizeType size = { { 20, 40, 80 } }; - constexpr double origin[3] = { 0.5, 0.5, 0.5 }; - constexpr double spacing[3] = { 0.1, 0.05, 0.025 }; + constexpr ImageType::SizeType size{ 20, 40, 80 }; + constexpr double origin[3]{ 0.5, 0.5, 0.5 }; + constexpr double spacing[3]{ 0.1, 0.05, 0.025 }; // Create a test image auto image = ImageType::New(); @@ -286,9 +286,9 @@ itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunctionTest(int, char // position near image border { - constexpr itk::SpacePrecisionType epsilon = 1.0e-10; + constexpr itk::SpacePrecisionType epsilon{ 1.0e-10 }; constexpr itk::SpacePrecisionType darray[3] = { 19 - epsilon, 20, 40 }; - constexpr double temp[3] = { 79, 158, 237 }; + constexpr double temp[3]{ 79, 158, 237 }; output = OutputType(temp); cindex = ContinuousIndexType(darray); passed = TestContinuousIndex(interp, cindex, true, output); @@ -309,8 +309,8 @@ itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunctionTest(int, char // position outside the image { - constexpr itk::SpacePrecisionType darray[3] = { 20, 20, 40 }; - constexpr double temp[3] = { 79, 158, 237 }; + constexpr itk::SpacePrecisionType darray[3]{ 20, 20, 40 }; + constexpr double temp[3]{ 79, 158, 237 }; output = OutputType(temp); cindex = ContinuousIndexType(darray); passed = TestContinuousIndex(interp, cindex, false, output); diff --git a/Modules/Core/ImageFunction/test/itkVectorMeanImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkVectorMeanImageFunctionTest.cxx index cd541d242c0..f5a3aa5f540 100644 --- a/Modules/Core/ImageFunction/test/itkVectorMeanImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkVectorMeanImageFunctionTest.cxx @@ -24,9 +24,9 @@ int itkVectorMeanImageFunctionTest(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelComponentType = unsigned char; - constexpr unsigned int VectorDimension = 4; + constexpr unsigned int VectorDimension{ 4 }; using PixelType = itk::FixedArray; diff --git a/Modules/Core/ImageFunction/test/itkWindowedSincInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkWindowedSincInterpolateImageFunctionTest.cxx index c2b0443850b..6fd211bff52 100644 --- a/Modules/Core/ImageFunction/test/itkWindowedSincInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkWindowedSincInterpolateImageFunctionTest.cxx @@ -145,9 +145,9 @@ itkWindowedSincInterpolateImageFunctionTest(int, char *[]) constexpr unsigned int ImageDimension = SincInterpolate::ImageDimension; - constexpr ImageType::SizeType size = { { 20, 40, 80 } }; - constexpr double origin[3] = { 0.5, 0.5, 0.5 }; - constexpr double spacing[3] = { 0.1, 0.05, 0.025 }; + constexpr ImageType::SizeType size{ 20, 40, 80 }; + constexpr double origin[3]{ 0.5, 0.5, 0.5 }; + constexpr double spacing[3]{ 0.1, 0.05, 0.025 }; // Create a test image @@ -241,7 +241,7 @@ itkWindowedSincInterpolateImageFunctionTest(int, char *[]) // position near image border { - constexpr double epsilon = 1.0e-10; + constexpr double epsilon{ 1.0e-10 }; CoordinateType darray[3] = { 19 - epsilon, 20, 40 }; output = static_cast(79); cindex = ContinuousIndexType(darray); diff --git a/Modules/Core/Mesh/include/itkAutomaticTopologyMeshSource.hxx b/Modules/Core/Mesh/include/itkAutomaticTopologyMeshSource.hxx index 5a5aec3c2be..55efc977526 100644 --- a/Modules/Core/Mesh/include/itkAutomaticTopologyMeshSource.hxx +++ b/Modules/Core/Mesh/include/itkAutomaticTopologyMeshSource.hxx @@ -142,7 +142,7 @@ AutomaticTopologyMeshSource::AddLine(const IdentifierArrayType & po } else { - constexpr IdentifierType pointIdsEnd = 2; + constexpr IdentifierType pointIdsEnd{ 2 }; // Construct the cell. CellAutoPointer newCell(new LineCell, true); @@ -191,8 +191,8 @@ AutomaticTopologyMeshSource::AddTriangle(const IdentifierArrayType { // Create and add a new cell. - constexpr IdentifierType pointIdsEnd = 3; - constexpr IdentifierType lineIdsEnd = 3; + constexpr IdentifierType pointIdsEnd{ 3 }; + constexpr IdentifierType lineIdsEnd{ 3 }; // Construct the cell. CellAutoPointer newCell(new TriangleCell, true); @@ -252,8 +252,8 @@ AutomaticTopologyMeshSource::AddQuadrilateral(const IdentifierArray { // Create and add a new cell. - constexpr IdentifierType pointIdsEnd = 4; - constexpr IdentifierType lineIdsEnd = 4; + constexpr IdentifierType pointIdsEnd{ 4 }; + constexpr IdentifierType lineIdsEnd{ 4 }; // Construct the cell. CellAutoPointer newCell(new QuadrilateralCell, true); @@ -312,9 +312,9 @@ AutomaticTopologyMeshSource::AddTetrahedron(const IdentifierArrayTy { // Create and add a new cell. - constexpr IdentifierType pointIdsEnd = 4; - constexpr IdentifierType lineIdsEnd = 6; - constexpr IdentifierType faceIdsEnd = 4; + constexpr IdentifierType pointIdsEnd{ 4 }; + constexpr IdentifierType lineIdsEnd{ 6 }; + constexpr IdentifierType faceIdsEnd{ 4 }; // Construct the cell. CellAutoPointer newCell(new TetrahedronCell, true); @@ -388,9 +388,9 @@ AutomaticTopologyMeshSource::AddHexahedron(const IdentifierArrayTyp { // Create and add a new cell. - constexpr IdentifierType pointIdsEnd = 8; - constexpr IdentifierType lineIdsEnd = 12; - constexpr IdentifierType faceIdsEnd = 6; + constexpr IdentifierType pointIdsEnd{ 8 }; + constexpr IdentifierType lineIdsEnd{ 12 }; + constexpr IdentifierType faceIdsEnd{ 6 }; // Construct the cell. CellAutoPointer newCell(new HexahedronCell, true); diff --git a/Modules/Core/Mesh/include/itkRegularSphereMeshSource.hxx b/Modules/Core/Mesh/include/itkRegularSphereMeshSource.hxx index d1b6c7ffe98..6617125bfe2 100644 --- a/Modules/Core/Mesh/include/itkRegularSphereMeshSource.hxx +++ b/Modules/Core/Mesh/include/itkRegularSphereMeshSource.hxx @@ -87,12 +87,12 @@ RegularSphereMeshSource::GenerateData() outputMesh->SetPoint(idx++, p1); /* Six equidistant points lying on the unit sphere */ - constexpr IdentifierType XPLUS = 0; - constexpr IdentifierType XMIN = 1; - constexpr IdentifierType YPLUS = 2; - constexpr IdentifierType YMIN = 3; - constexpr IdentifierType ZPLUS = 4; - constexpr IdentifierType ZMIN = 5; + constexpr IdentifierType XPLUS{ 0 }; + constexpr IdentifierType XMIN{ 1 }; + constexpr IdentifierType YPLUS{ 2 }; + constexpr IdentifierType YMIN{ 3 }; + constexpr IdentifierType ZPLUS{ 4 }; + constexpr IdentifierType ZMIN{ 5 }; tripoints[0] = YPLUS; tripoints[1] = ZPLUS; diff --git a/Modules/Core/Mesh/src/itkSimplexMeshGeometry.cxx b/Modules/Core/Mesh/src/itkSimplexMeshGeometry.cxx index b83df6b560a..614f9e3e188 100644 --- a/Modules/Core/Mesh/src/itkSimplexMeshGeometry.cxx +++ b/Modules/Core/Mesh/src/itkSimplexMeshGeometry.cxx @@ -26,7 +26,7 @@ namespace itk SimplexMeshGeometry::SimplexMeshGeometry() { - constexpr double c = 1.0 / 3.0; + constexpr double c{ 1.0 / 3.0 }; constexpr PointType p{}; pos.Fill(0); diff --git a/Modules/Core/Mesh/test/itkBinaryMask3DMeshSourceTest.cxx b/Modules/Core/Mesh/test/itkBinaryMask3DMeshSourceTest.cxx index 80eb8e95fc6..6b33e4d0831 100644 --- a/Modules/Core/Mesh/test/itkBinaryMask3DMeshSourceTest.cxx +++ b/Modules/Core/Mesh/test/itkBinaryMask3DMeshSourceTest.cxx @@ -22,7 +22,7 @@ #include "itkTestingMacros.h" // Define the dimension of the images -constexpr unsigned int Dimension = 3; +constexpr unsigned int Dimension{ 3 }; // Declare the types of the output images using ImageType = itk::Image; @@ -72,8 +72,8 @@ itkBinaryMask3DMeshSourceTest(int argc, char * argv[]) using MeshType = itk::Mesh; using MeshSourceType = itk::BinaryMask3DMeshSource; - constexpr PixelType backgroundValue = 0; - constexpr PixelType internalValue = 1; + constexpr PixelType backgroundValue{ 0 }; + constexpr PixelType internalValue{ 1 }; SizeType size; size[0] = 128; diff --git a/Modules/Core/Mesh/test/itkConnectedRegionsMeshFilterTest1.cxx b/Modules/Core/Mesh/test/itkConnectedRegionsMeshFilterTest1.cxx index c312b08bfe7..d5a2318a094 100644 --- a/Modules/Core/Mesh/test/itkConnectedRegionsMeshFilterTest1.cxx +++ b/Modules/Core/Mesh/test/itkConnectedRegionsMeshFilterTest1.cxx @@ -44,7 +44,7 @@ itkConnectedRegionsMeshFilterTest1(int, char *[]) // Pass the mesh through the filter in a variety of ways. // - constexpr PointType::ValueType pInit[3] = { 1, 2, 3 }; + constexpr PointType::ValueType pInit[3]{ 1, 2, 3 }; PointType p = pInit; auto connect = ConnectFilterType::New(); @@ -97,7 +97,7 @@ itkConnectedRegionsMeshFilterTest1(int, char *[]) auto meshSource = SphereMeshSourceType::New(); constexpr PointType center{}; - constexpr PointType::ValueType scaleInit[3] = { 1, 1, 1 }; + constexpr PointType::ValueType scaleInit[3]{ 1, 1, 1 }; const PointType scale = scaleInit; meshSource->SetCenter(center); diff --git a/Modules/Core/Mesh/test/itkConnectedRegionsMeshFilterTest2.cxx b/Modules/Core/Mesh/test/itkConnectedRegionsMeshFilterTest2.cxx index f41dc9209a9..38c79b8ea62 100644 --- a/Modules/Core/Mesh/test/itkConnectedRegionsMeshFilterTest2.cxx +++ b/Modules/Core/Mesh/test/itkConnectedRegionsMeshFilterTest2.cxx @@ -45,7 +45,7 @@ itkConnectedRegionsMeshFilterTest2(int argc, char * argv[]) imageSource = false; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using MeshType = itk::Mesh; MeshType::Pointer mesh; diff --git a/Modules/Core/Mesh/test/itkImageToParametricSpaceFilterTest.cxx b/Modules/Core/Mesh/test/itkImageToParametricSpaceFilterTest.cxx index cb1ba5fb976..6a435b0027d 100644 --- a/Modules/Core/Mesh/test/itkImageToParametricSpaceFilterTest.cxx +++ b/Modules/Core/Mesh/test/itkImageToParametricSpaceFilterTest.cxx @@ -111,7 +111,7 @@ itkImageToParametricSpaceFilterTest(int, char *[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, ImageToParametricSpaceFilter, ImageToMeshFilter); - constexpr bool computeIndices = true; + constexpr bool computeIndices{ true }; ITK_TEST_SET_GET_BOOLEAN(filter, ComputeIndices, computeIndices); // Connect the inputs diff --git a/Modules/Core/Mesh/test/itkInteriorExteriorMeshFilterTest.cxx b/Modules/Core/Mesh/test/itkInteriorExteriorMeshFilterTest.cxx index f04bea2dd4d..5cf43ffe0e3 100644 --- a/Modules/Core/Mesh/test/itkInteriorExteriorMeshFilterTest.cxx +++ b/Modules/Core/Mesh/test/itkInteriorExteriorMeshFilterTest.cxx @@ -51,7 +51,7 @@ itkInteriorExteriorMeshFilterTest(int, char *[]) const PointsContainerPointer points = inputMesh->GetPoints(); // Fill a cube with points , just to get some data - constexpr int n = 3; // let's start with a few of them + constexpr int n{ 3 }; // let's start with a few of them PointsContainerType::ElementIdentifier count = 0; // count them for (int x = -n; x <= n; ++x) @@ -96,7 +96,7 @@ itkInteriorExteriorMeshFilterTest(int, char *[]) center[1] = 0; center[2] = 2; // Here we are assuming 3D !!! - constexpr double radius = 1.1f; + constexpr double radius{ 1.1f }; spatialFunction->SetCenter(center); spatialFunction->SetRadius(radius); diff --git a/Modules/Core/Mesh/test/itkMeshCellDataTest.cxx b/Modules/Core/Mesh/test/itkMeshCellDataTest.cxx index fd325eb5031..54bf6e9198f 100644 --- a/Modules/Core/Mesh/test/itkMeshCellDataTest.cxx +++ b/Modules/Core/Mesh/test/itkMeshCellDataTest.cxx @@ -24,7 +24,7 @@ int itkMeshCellDataTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using TPixel = float; using TMeshTraits = itk::DefaultDynamicMeshTraits; using TMesh = itk::Mesh; diff --git a/Modules/Core/Mesh/test/itkMeshRegionTest.cxx b/Modules/Core/Mesh/test/itkMeshRegionTest.cxx index c7aa34ec9cd..7f538f65dd5 100644 --- a/Modules/Core/Mesh/test/itkMeshRegionTest.cxx +++ b/Modules/Core/Mesh/test/itkMeshRegionTest.cxx @@ -31,11 +31,11 @@ itkMeshRegionTest(int, char *[]) ITK_TEST_SET_GET_VALUE(itk::MeshRegion::Superclass::RegionEnum::ITK_UNSTRUCTURED_REGION, meshRegion.GetRegionType()); - constexpr itk::SizeValueType numRegions = 10; + constexpr itk::SizeValueType numRegions{ 10 }; meshRegion.SetNumberOfRegions(numRegions); ITK_TEST_SET_GET_VALUE(numRegions, meshRegion.GetNumberOfRegions()); - constexpr itk::SizeValueType idx = 1; + constexpr itk::SizeValueType idx{ 1 }; meshRegion.SetRegion(idx); ITK_TEST_SET_GET_VALUE(idx, meshRegion.GetRegion()); diff --git a/Modules/Core/Mesh/test/itkMeshSourceGraftOutputTest.cxx b/Modules/Core/Mesh/test/itkMeshSourceGraftOutputTest.cxx index 1c9951b2d17..aa5d16ff87c 100644 --- a/Modules/Core/Mesh/test/itkMeshSourceGraftOutputTest.cxx +++ b/Modules/Core/Mesh/test/itkMeshSourceGraftOutputTest.cxx @@ -209,7 +209,7 @@ itkMeshSourceGraftOutputTest(int, char *[]) const PointsContainerPointer points = inputMesh->GetPoints(); // Fill a cube with points , just to get some data - constexpr int n = 1; // let's start with a few of them + constexpr int n{ 1 }; // let's start with a few of them PointsContainerType::ElementIdentifier count = 0; // count them for (int x = -n; x <= n; ++x) diff --git a/Modules/Core/Mesh/test/itkMeshTest.cxx b/Modules/Core/Mesh/test/itkMeshTest.cxx index 107424f10fa..13b85ef6f91 100644 --- a/Modules/Core/Mesh/test/itkMeshTest.cxx +++ b/Modules/Core/Mesh/test/itkMeshTest.cxx @@ -241,7 +241,7 @@ itkMeshTest(int, char *[]) // Test the SetCellsArray with same cell type functionality index = 0; - constexpr unsigned int numOfCells = 3; + constexpr unsigned int numOfCells{ 3 }; cellVectorContainer->Initialize(); for (unsigned int i = 0; i < numOfCells; ++i) diff --git a/Modules/Core/Mesh/test/itkParametricSpaceToImageSpaceMeshFilterTest.cxx b/Modules/Core/Mesh/test/itkParametricSpaceToImageSpaceMeshFilterTest.cxx index 7879515a788..595f504353e 100644 --- a/Modules/Core/Mesh/test/itkParametricSpaceToImageSpaceMeshFilterTest.cxx +++ b/Modules/Core/Mesh/test/itkParametricSpaceToImageSpaceMeshFilterTest.cxx @@ -201,7 +201,7 @@ InternalTest(int argc, char * argv[]) int itkParametricSpaceToImageSpaceMeshFilterTest(int argc, char * argv[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; using IndexType = ImageType::IndexType; diff --git a/Modules/Core/Mesh/test/itkQuadrilateralCellTest.cxx b/Modules/Core/Mesh/test/itkQuadrilateralCellTest.cxx index 6888220d8a4..97b106da70a 100644 --- a/Modules/Core/Mesh/test/itkQuadrilateralCellTest.cxx +++ b/Modules/Core/Mesh/test/itkQuadrilateralCellTest.cxx @@ -82,11 +82,11 @@ itkQuadrilateralCellTest(int, char *[]) auto mesh = MeshType::New(); mesh->DebugOn(); - constexpr unsigned int numberOfPoints = 6; + constexpr unsigned int numberOfPoints{ 6 }; /** * Define the 3D geometric positions for 6 points in two neighbouring squares. */ - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Test points are on a plane at an angle (3^2 + 4^2 = 5^2) with xy plane const MeshType::CoordinateType testPointCoords[numberOfPoints][Dimension] = { { 0, 0, 0 }, { 10, 0, 0 }, { 0, 8, 6 }, { 10, 8, 6 }, @@ -150,7 +150,7 @@ itkQuadrilateralCellTest(int, char *[]) // QuadrilateralCellType::PointsContainer * points = mesh->GetPoints(); - constexpr double toleance = 1e-5; + constexpr double toleance{ 1e-5 }; // Test 1: point on quad1 QuadrilateralCellType::CoordinateType inputPoint[3]; inputPoint[0] = 4.0; diff --git a/Modules/Core/Mesh/test/itkRegularSphereMeshSourceTest.cxx b/Modules/Core/Mesh/test/itkRegularSphereMeshSourceTest.cxx index 51c21f45554..d4f30cef07c 100644 --- a/Modules/Core/Mesh/test/itkRegularSphereMeshSourceTest.cxx +++ b/Modules/Core/Mesh/test/itkRegularSphereMeshSourceTest.cxx @@ -39,15 +39,15 @@ itkRegularSphereMeshSourceTest(int, char *[]) auto center = itk::MakeFilled(7.4); - constexpr double radius = 1.5; - constexpr double tolerance = 1e-5; + constexpr double radius{ 1.5 }; + constexpr double tolerance{ 1e-5 }; auto scale = itk::MakeFilled(radius); mySphereMeshSource->SetCenter(center); ITK_TEST_SET_GET_VALUE(center, mySphereMeshSource->GetCenter()); - constexpr unsigned int resolution = 1; + constexpr unsigned int resolution{ 1 }; mySphereMeshSource->SetResolution(resolution); ITK_TEST_SET_GET_VALUE(resolution, mySphereMeshSource->GetResolution()); diff --git a/Modules/Core/Mesh/test/itkRegularSphereMeshSourceTest2.cxx b/Modules/Core/Mesh/test/itkRegularSphereMeshSourceTest2.cxx index 488443aace6..c2e6e6e0978 100644 --- a/Modules/Core/Mesh/test/itkRegularSphereMeshSourceTest2.cxx +++ b/Modules/Core/Mesh/test/itkRegularSphereMeshSourceTest2.cxx @@ -21,7 +21,7 @@ int itkRegularSphereMeshSourceTest2(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = float; using MeshType = itk::Mesh; diff --git a/Modules/Core/Mesh/test/itkSphereMeshSourceTest.cxx b/Modules/Core/Mesh/test/itkSphereMeshSourceTest.cxx index 9edaa822904..1ce7061906b 100644 --- a/Modules/Core/Mesh/test/itkSphereMeshSourceTest.cxx +++ b/Modules/Core/Mesh/test/itkSphereMeshSourceTest.cxx @@ -32,7 +32,7 @@ itkSphereMeshSourceTest(int, char *[]) constexpr fPointType center{}; - constexpr fPointType::ValueType scaleInit[3] = { 1, 1, 1 }; + constexpr fPointType::ValueType scaleInit[3]{ 1, 1, 1 }; const fPointType scale = scaleInit; mySphereMeshSource->SetCenter(center); @@ -40,10 +40,10 @@ itkSphereMeshSourceTest(int, char *[]) mySphereMeshSource->SetResolutionY(10); mySphereMeshSource->SetScale(scale); - constexpr double squareness1 = 1.0; + constexpr double squareness1{ 1.0 }; mySphereMeshSource->SetSquareness1(squareness1); - constexpr double squareness2 = 1.0; + constexpr double squareness2{ 1.0 }; mySphereMeshSource->SetSquareness2(squareness2); mySphereMeshSource->Modified(); diff --git a/Modules/Core/Mesh/test/itkTransformMeshFilterTest.cxx b/Modules/Core/Mesh/test/itkTransformMeshFilterTest.cxx index 6e463e40ce4..2eb5e38711d 100644 --- a/Modules/Core/Mesh/test/itkTransformMeshFilterTest.cxx +++ b/Modules/Core/Mesh/test/itkTransformMeshFilterTest.cxx @@ -56,7 +56,7 @@ itkTransformMeshFilterTest(int, char *[]) const PointsContainerPointer points = inputMesh->GetPoints(); // Fill a cube with points , just to get some data - constexpr int n = 1; // let's start with a few of them + constexpr int n{ 1 }; // let's start with a few of them PointsContainerType::ElementIdentifier count = 0; // count them for (int x = -n; x <= n; ++x) diff --git a/Modules/Core/Mesh/test/itkTriangleCellTest.cxx b/Modules/Core/Mesh/test/itkTriangleCellTest.cxx index 157b288b208..b735b693710 100644 --- a/Modules/Core/Mesh/test/itkTriangleCellTest.cxx +++ b/Modules/Core/Mesh/test/itkTriangleCellTest.cxx @@ -84,11 +84,11 @@ itkTriangleCellTest(int, char *[]) auto mesh = MeshType::New(); mesh->DebugOn(); - constexpr unsigned int numberOfPoints = 4; + constexpr unsigned int numberOfPoints{ 4 }; /** * Define the 3d geometric positions for 4 points in a square. */ - constexpr MeshType::CoordinateType testPointCoords[numberOfPoints][3] = { + constexpr MeshType::CoordinateType testPointCoords[numberOfPoints][3]{ { 0, 0, 0 }, { 10, 0, 0 }, { 10, 10, 0 }, { 0, 10, 0 } }; @@ -158,7 +158,7 @@ itkTriangleCellTest(int, char *[]) TriangleCellType::CoordinateType pcoords[3]; TriangleCellType::InterpolationWeightType weights[3]; - constexpr double tolerance = 1e-5; + constexpr double tolerance{ 1e-5 }; // Test 1: inputPoint[0] = 5.0; diff --git a/Modules/Core/Mesh/test/itkTriangleMeshCurvatureCalculatorTest.cxx b/Modules/Core/Mesh/test/itkTriangleMeshCurvatureCalculatorTest.cxx index a97bf1ad340..db979681021 100644 --- a/Modules/Core/Mesh/test/itkTriangleMeshCurvatureCalculatorTest.cxx +++ b/Modules/Core/Mesh/test/itkTriangleMeshCurvatureCalculatorTest.cxx @@ -28,7 +28,7 @@ int itkTriangleMeshCurvatureCalculatorTest(int argc, char * argv[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = double; // Declare the type of the input mesh. @@ -95,8 +95,8 @@ itkTriangleMeshCurvatureCalculatorTest(int argc, char * argv[]) gaussCurvatureData = curvCalculator->GetGaussCurvatureData(); // Values obtained using the VTK Gaussian Curvature - constexpr float v1 = 0.06087285; - constexpr float v2 = 0.04463759; + constexpr float v1{ 0.06087285 }; + constexpr float v2{ 0.04463759 }; // Test if values are correct for scale 5 and resolution 1 sphere for (unsigned int k = 0; k < triangleMesh->GetNumberOfPoints(); ++k) @@ -128,8 +128,8 @@ itkTriangleMeshCurvatureCalculatorTest(int argc, char * argv[]) gaussCurvatureData = curvCalculator->GetGaussCurvatureData(); - constexpr float v3 = 0.00015218; - constexpr float v4 = 0.00011159; + constexpr float v3{ 0.00015218 }; + constexpr float v4{ 0.00011159 }; // Test if values are correct for scale 100 and resolution 1 sphere. for (unsigned int k = 0; k < triangleMesh->GetNumberOfPoints(); ++k) diff --git a/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest.cxx b/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest.cxx index 20aefe75a6c..b9fe08fc37f 100644 --- a/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest.cxx +++ b/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest.cxx @@ -79,16 +79,16 @@ itkTriangleMeshToBinaryImageFilterTest(int argc, char * argv[]) size[2] = 100; imageFilter->SetSize(size); - constexpr double dspacing[3] = { 2.0, 2.0, 2.0 }; - constexpr float fspacing[3] = { 3.0, 3.0, 3.0 }; - constexpr double defaultSpacing[3] = { 1.0, 1.0, 1.0 }; + constexpr double dspacing[3]{ 2.0, 2.0, 2.0 }; + constexpr float fspacing[3]{ 3.0, 3.0, 3.0 }; + constexpr double defaultSpacing[3]{ 1.0, 1.0, 1.0 }; imageFilter->SetSpacing(dspacing); imageFilter->SetSpacing(fspacing); imageFilter->SetSpacing(defaultSpacing); - constexpr double dorigin[3] = { 2.0, 2.0, 2.0 }; - constexpr float forigin[3] = { 3.0, 3.0, 3.0 }; - constexpr double defaultOrigin[3] = { 0.0, 0.0, 0.0 }; + constexpr double dorigin[3]{ 2.0, 2.0, 2.0 }; + constexpr float forigin[3]{ 3.0, 3.0, 3.0 }; + constexpr double defaultOrigin[3]{ 0.0, 0.0, 0.0 }; imageFilter->SetOrigin(dorigin); imageFilter->SetOrigin(forigin); imageFilter->SetOrigin(defaultOrigin); diff --git a/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest3.cxx b/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest3.cxx index c19fb8b6c02..3faa1df7364 100644 --- a/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest3.cxx +++ b/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest3.cxx @@ -36,7 +36,7 @@ itkTriangleMeshToBinaryImageFilterTest3(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using MeshType = itk::Mesh; using ReaderType = itk::MeshFileReader; diff --git a/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest4.cxx b/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest4.cxx index 3b88f64e11e..151f49d0c0c 100644 --- a/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest4.cxx +++ b/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest4.cxx @@ -38,7 +38,7 @@ itkTriangleMeshToBinaryImageFilterTest4(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using MeshType = itk::Mesh; using ReaderType = itk::MeshFileReader; @@ -86,7 +86,7 @@ itkTriangleMeshToBinaryImageFilterTest4(int argc, char * argv[]) spacing[2] = std::stod(argv[11]); - constexpr ImageType::IndexType index3D = { { 0, 0, 0 } }; + constexpr ImageType::IndexType index3D{ 0, 0, 0 }; const ImageType::RegionType region3D{ index3D, size }; auto inputImage = ImageType::New(); diff --git a/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest01.cxx b/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest01.cxx index 28748a1aac7..4308b8610a3 100644 --- a/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest01.cxx +++ b/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest01.cxx @@ -29,7 +29,7 @@ itkVTKPolyDataWriterTest01(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int PointDimension = 3; + constexpr unsigned int PointDimension{ 3 }; using PointType = float; @@ -44,12 +44,12 @@ itkVTKPolyDataWriterTest01(int argc, char * argv[]) auto mesh = MeshType::New(); - constexpr unsigned int numberOfPoints = 4; - constexpr unsigned int numberOfCells = 9; + constexpr unsigned int numberOfPoints{ 4 }; + constexpr unsigned int numberOfCells{ 9 }; - constexpr float rawPoints[12] = { 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0 }; + constexpr float rawPoints[12]{ 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0 }; - constexpr unsigned long rawCells[24] = { 0, 2, 1, 0, 1, 3, 0, 3, 2, 1, 2, 3, 0, 1, 0, 2, 0, 3, 1, 2, 1, 3, 2, 3 }; + constexpr unsigned long rawCells[24]{ 0, 2, 1, 0, 1, 3, 0, 3, 2, 1, 2, 3, 0, 1, 0, 2, 0, 3, 1, 2, 1, 3, 2, 3 }; mesh->GetPoints()->Reserve(numberOfPoints); mesh->GetCells()->Reserve(numberOfCells); diff --git a/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest02.cxx b/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest02.cxx index 8c21eec6c08..6c352847217 100644 --- a/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest02.cxx +++ b/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest02.cxx @@ -44,8 +44,8 @@ itkVTKPolyDataWriterTest02(int argc, char * argv[]) auto center = itk::MakeFilled(7.4); - constexpr double radius = 1.5; - constexpr double tolerance = 1e-5; + constexpr double radius{ 1.5 }; + constexpr double tolerance{ 1e-5 }; auto scale = itk::MakeFilled(radius); diff --git a/Modules/Core/Mesh/test/itkWarpMeshFilterTest.cxx b/Modules/Core/Mesh/test/itkWarpMeshFilterTest.cxx index c7e3a16ddc7..df64e878041 100644 --- a/Modules/Core/Mesh/test/itkWarpMeshFilterTest.cxx +++ b/Modules/Core/Mesh/test/itkWarpMeshFilterTest.cxx @@ -24,7 +24,7 @@ int itkWarpMeshFilterTest(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Declare the type of the input and output mesh using MeshTraits = itk::DefaultStaticMeshTraits; @@ -130,7 +130,7 @@ itkWarpMeshFilterTest(int, char *[]) const MeshType::PointsContainer::ConstIterator lastInputPoint = inPoints->End(); const MeshType::PointsContainer::ConstIterator lastOutputPoint = outPoints->End(); - constexpr double tolerance = 1e-8; + constexpr double tolerance{ 1e-8 }; while (inputPoint != lastInputPoint && outputPoint != lastOutputPoint) { diff --git a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshEulerOperatorsTestHelper.h b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshEulerOperatorsTestHelper.h index 59bb059f4cd..1513173efe1 100644 --- a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshEulerOperatorsTestHelper.h +++ b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshEulerOperatorsTestHelper.h @@ -83,8 +83,8 @@ CreateSquareQuadMesh(typename TMesh::Pointer mesh) } ///////////////////////////////////////////////////////////// - constexpr int expectedNumPts = 25; - constexpr int expectedNumCells = 16; + constexpr int expectedNumPts{ 25 }; + constexpr int expectedNumCells{ 16 }; const int simpleSquareCells[64] = { 0, 1, 6, 5, 1, 2, 7, 6, 2, 3, 8, 7, 3, 4, 9, 8, 5, 6, 11, 10, 6, 7, 12, 11, 7, 8, 13, 12, 8, 9, 14, 13, 10, 11, 16, 15, 11, 12, 17, 16, 12, 13, 18, 17, 13, 14, 19, 18, @@ -129,8 +129,8 @@ CreateSquareTriangularMesh(typename TMesh::Pointer mesh) } ///////////////////////////////////////////////////////////// - constexpr int expectedNumPts = 25; - constexpr int expectedNumCells = 32; + constexpr int expectedNumPts{ 25 }; + constexpr int expectedNumCells{ 32 }; const int simpleSquareCells[96] = { 0, 1, 6, 0, 6, 5, 1, 2, 7, 1, 7, 6, 2, 3, 8, 2, 8, 7, 3, 4, 9, 3, 9, 8, 5, 6, 11, 5, 11, 10, 6, 7, 12, 6, 12, 11, 7, 8, 13, 7, 13, 12, 8, 9, 14, 8, 14, 13, 10, 11, 16, 10, 16, 15, 11, 12, 17, 11, 17, 16, @@ -174,8 +174,8 @@ CreateTetraedronMesh(typename TMesh::Pointer mesh) } ///////////////////////////////////////////////////////////// - constexpr int expectedNumPts = 4; - constexpr int expectedNumCells = 4; + constexpr int expectedNumPts{ 4 }; + constexpr int expectedNumCells{ 4 }; const int simpleSquareCells[12] = { 0, 1, 2, 1, 0, 3, 1, 3, 2, 2, 3, 0 }; using PointType = typename TMesh::PointType; @@ -231,8 +231,8 @@ CreateSamosa(typename TMesh::Pointer mesh) } ///////////////////////////////////////////////////////////// - constexpr int expectedNumPts = 3; - constexpr int expectedNumCells = 2; + constexpr int expectedNumPts{ 3 }; + constexpr int expectedNumCells{ 2 }; const int simpleSquareCells[6] = { 0, 1, 2, 1, 0, 2 }; using PointType = typename TMesh::PointType; diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshAddFaceTest1.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshAddFaceTest1.cxx index 1c2ca6f6fa5..2f725fcb0e1 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshAddFaceTest1.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshAddFaceTest1.cxx @@ -67,7 +67,7 @@ itkQuadEdgeMeshAddFaceTest1(int argc, char * argv[]) // \ / \ / // // p5---------------p6 // /// // - constexpr int NumPoints = 7; + constexpr int NumPoints{ 7 }; PointIdentifier pid[NumPoints]; PointType::CoordinateType a = std::sqrt(3.0) / 2.0; @@ -580,7 +580,7 @@ itkQuadEdgeMeshAddFaceTest1(int argc, char * argv[]) auto moebiusMesh = MeshType::New(); - constexpr int moebNumPoints = 6; + constexpr int moebNumPoints{ 6 }; PointIdentifier moebPid[moebNumPoints]; ValueArrayType moebPointCoordinates[moebNumPoints] = { { 0.0, 0.0, 0.0 }, { 0.0, 1.0, 0.0 }, { 1.0, 0.0, 0.0 }, diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshAddFaceTest2.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshAddFaceTest2.cxx index 90cd07c4f9b..52af4f2cd0b 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshAddFaceTest2.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshAddFaceTest2.cxx @@ -27,8 +27,8 @@ itkQuadEdgeMeshAddFaceTest2(int, char *[]) using CellType = MeshType::CellType; using QEPolygonCellType = itk::QuadEdgeMeshPolygonCell; - constexpr int numPts = 7; - constexpr int numCells = 4; + constexpr int numPts{ 7 }; + constexpr int numCells{ 4 }; std::cout << "numPts= " << numPts << std::endl; std::cout << "numCells= " << numCells << std::endl; diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshBasicLayerTest.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshBasicLayerTest.cxx index bcf9717150c..b99c34e931d 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshBasicLayerTest.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshBasicLayerTest.cxx @@ -193,7 +193,7 @@ itkQuadEdgeMeshBasicLayerTest(int, char *[]) } std::cout << "on Sym()... " << std::endl; - constexpr int lnextDestinationOnSym[3] = { 2, 0, 1 }; + constexpr int lnextDestinationOnSym[3]{ 2, 0, 1 }; int test = 0; for (IteratorGeom itLnext = e[4]->GetSym()->BeginGeomLnext(); itLnext != e[4]->GetSym()->EndGeomLnext(); itLnext++, test++) diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshDeleteEdgeTest.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshDeleteEdgeTest.cxx index 0b3caadbfe4..47c4494a563 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshDeleteEdgeTest.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshDeleteEdgeTest.cxx @@ -88,7 +88,7 @@ itkQuadEdgeMeshDeleteEdgeTest(int, char *[]) mesh->DeleteEdge(pid0, pid5); std::cout << indent << "Trying to remove only two edges..."; - constexpr itk::IdentifierType expectedEdgeCount = 2; + constexpr itk::IdentifierType expectedEdgeCount{ 2 }; const itk::IdentifierType obtainedEdgeCount = edgesBefore - mesh->ComputeNumberOfEdges(); if (obtainedEdgeCount != expectedEdgeCount) { diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshDeletePointAndReorderIDsTest.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshDeletePointAndReorderIDsTest.cxx index 6e9cdb3d474..78b78171fd6 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshDeletePointAndReorderIDsTest.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshDeletePointAndReorderIDsTest.cxx @@ -24,7 +24,7 @@ itkQuadEdgeMeshDeletePointAndReorderIDsTest(int, char *[]) { using PixelType = double; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using MeshType = itk::QuadEdgeMesh; using CellType = MeshType::CellType; using QEPolygonCellType = itk::QuadEdgeMeshPolygonCell; diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshFrontIteratorTest.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshFrontIteratorTest.cxx index cae8b06a02e..71cb7b73b34 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshFrontIteratorTest.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshFrontIteratorTest.cxx @@ -45,8 +45,8 @@ itkQuadEdgeMeshFrontIteratorTest(int, char *[]) using FrontIterator = MeshType::FrontIterator; using QEType = FrontIterator::QEType; - constexpr int expectedNumPts = 25; - constexpr int expectedNumCells = 32; + constexpr int expectedNumPts{ 25 }; + constexpr int expectedNumCells{ 32 }; std::cout << "expectedNumPts= " << expectedNumPts << std::endl; std::cout << "expectedNumCells= " << expectedNumCells << std::endl; diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshNoPointConstTest.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshNoPointConstTest.cxx index 433e039b2d5..68d8e609b24 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshNoPointConstTest.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshNoPointConstTest.cxx @@ -26,9 +26,9 @@ itkQuadEdgeMeshNoPointConstTest(int, char *[]) using QEType = MeshType::QEType; using OriginRefType = QEType::OriginRefType; - constexpr OriginRefType NUM_LIMIT = std::numeric_limits::max(); - constexpr OriginRefType GQE_LIMIT = QEType::m_NoPoint; - constexpr OriginRefType QEM_LIMIT = MeshType::m_NoPoint; + constexpr OriginRefType NUM_LIMIT{ std::numeric_limits::max() }; + constexpr OriginRefType GQE_LIMIT{ QEType::m_NoPoint }; + constexpr OriginRefType QEM_LIMIT{ MeshType::m_NoPoint }; std::cout << "VCL limit: " << NUM_LIMIT << std::endl; std::cout << "Geom QE limit: " << GQE_LIMIT << std::endl; diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshPointTest1.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshPointTest1.cxx index e04a1f732e6..78d7075e76a 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshPointTest1.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshPointTest1.cxx @@ -35,7 +35,7 @@ itkQuadEdgeMeshPointTest1(int, char *[]) using PrimalDataType = bool; using DualDataType = bool; - constexpr bool ThisIsDual = true; + constexpr bool ThisIsDual{ true }; using QuadEdgeType = itk::GeometricalQuadEdge; diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshTest1.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshTest1.cxx index bc076a90ce0..bd43b16acf6 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshTest1.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshTest1.cxx @@ -24,7 +24,7 @@ itkQuadEdgeMeshTest1(int, char *[]) std::cout << "Testing points..." << std::endl; using PixelType = double; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using MeshType = itk::QuadEdgeMesh; using CellTraits = MeshType::CellTraits; using QEType = CellTraits::QuadEdgeType; diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeTest1.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeTest1.cxx index eec8af04136..98031207d67 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeTest1.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeTest1.cxx @@ -1378,7 +1378,7 @@ itkQuadEdgeTest1(int, char *[]) quadEdgeB2->SetOnext(quadEdgeA2); const unsigned int quadEdgeA1Order = quadEdgeA1c->GetOrder(); - constexpr unsigned int quadEdgeA1ExpectedOrder = 2; + constexpr unsigned int quadEdgeA1ExpectedOrder{ 2 }; if (quadEdgeA1Order != quadEdgeA1ExpectedOrder) { std::cerr << "Error in GetOrder() A" << std::endl; @@ -1388,7 +1388,7 @@ itkQuadEdgeTest1(int, char *[]) } const unsigned int quadEdgeB1Order = quadEdgeB1c->GetOrder(); - constexpr unsigned int quadEdgeB1ExpectedOrder = 2; + constexpr unsigned int quadEdgeB1ExpectedOrder{ 2 }; if (quadEdgeB1Order != quadEdgeB1ExpectedOrder) { std::cerr << "Error in GetOrder() B" << std::endl; @@ -1398,7 +1398,7 @@ itkQuadEdgeTest1(int, char *[]) } const unsigned int quadEdgeC1Order = quadEdgeC1c->GetOrder(); - constexpr unsigned int quadEdgeC1ExpectedOrder = 2; + constexpr unsigned int quadEdgeC1ExpectedOrder{ 2 }; if (quadEdgeC1Order != quadEdgeC1ExpectedOrder) { std::cerr << "Error in GetOrder() C" << std::endl; @@ -1408,7 +1408,7 @@ itkQuadEdgeTest1(int, char *[]) } const unsigned int quadEdgeA4Order = quadEdgeA4c->GetOrder(); - constexpr unsigned int quadEdgeA4ExpectedOrder = 3; + constexpr unsigned int quadEdgeA4ExpectedOrder{ 3 }; if (quadEdgeA4Order != quadEdgeA4ExpectedOrder) { std::cerr << "Error in GetOrder() D" << std::endl; diff --git a/Modules/Core/SpatialObjects/test/itkArrowSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkArrowSpatialObjectTest.cxx index 268f39881a2..fb55ae72003 100644 --- a/Modules/Core/SpatialObjects/test/itkArrowSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkArrowSpatialObjectTest.cxx @@ -43,7 +43,7 @@ itkArrowSpatialObjectTest(int, char *[]) // Testing the length std::cout << "Testing length : "; - constexpr double length = 2; + constexpr double length{ 2 }; myArrow->SetLengthInObjectSpace(length); ITK_TEST_SET_GET_VALUE(length, myArrow->GetLengthInObjectSpace()); diff --git a/Modules/Core/SpatialObjects/test/itkBoxSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkBoxSpatialObjectTest.cxx index 9f0f0a752d6..ca3eaa2256b 100644 --- a/Modules/Core/SpatialObjects/test/itkBoxSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkBoxSpatialObjectTest.cxx @@ -33,7 +33,7 @@ itkBoxSpatialObjectTest(int argc, char * argv[]) std::cerr << "Missing Parameters: Usage " << itkNameOfTestExecutableMacro(argv) << "OutputImageFile" << std::endl; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using SceneType = itk::GroupSpatialObject; using BoxType = itk::BoxSpatialObject; using OutputImageType = itk::Image; diff --git a/Modules/Core/SpatialObjects/test/itkContourSpatialObjectPointTest.cxx b/Modules/Core/SpatialObjects/test/itkContourSpatialObjectPointTest.cxx index a7bcbb1ac1b..431f20cbb30 100644 --- a/Modules/Core/SpatialObjects/test/itkContourSpatialObjectPointTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkContourSpatialObjectPointTest.cxx @@ -31,8 +31,8 @@ itkContourSpatialObjectPointTest(int, char *[]) contourSpatialObjectPoint2D.Print(std::cout); - constexpr double pickedPointX = 4.35; - constexpr double pickedPointY = 7.56; + constexpr double pickedPointX{ 4.35 }; + constexpr double pickedPointY{ 7.56 }; ContourSpatialObjectPoint2DType::PointType pickedPoint2D; pickedPoint2D[0] = pickedPointX; pickedPoint2D[1] = pickedPointY; @@ -40,8 +40,8 @@ itkContourSpatialObjectPointTest(int, char *[]) contourSpatialObjectPoint2D.SetPickedPointInObjectSpace(pickedPoint2D); ITK_TEST_SET_GET_VALUE(pickedPoint2D, contourSpatialObjectPoint2D.GetPickedPointInObjectSpace()); - constexpr double normalX = 1.0; - constexpr double normalY = 1.0; + constexpr double normalX{ 1.0 }; + constexpr double normalY{ 1.0 }; ContourSpatialObjectPoint2DType::CovariantVectorType normal2D; normal2D[0] = normalX; normal2D[1] = normalY; @@ -53,8 +53,8 @@ itkContourSpatialObjectPointTest(int, char *[]) ContourSpatialObjectPoint2DType contourSpatialObjectPoint2DAlt; - constexpr double pickedPointXAlt = 25.89; - constexpr double pickedPointYAlt = 57.26; + constexpr double pickedPointXAlt{ 25.89 }; + constexpr double pickedPointYAlt{ 57.26 }; ContourSpatialObjectPoint2DType::PointType pickedPoint2DAlt; pickedPoint2DAlt[0] = pickedPointXAlt; pickedPoint2DAlt[1] = pickedPointYAlt; @@ -62,8 +62,8 @@ itkContourSpatialObjectPointTest(int, char *[]) contourSpatialObjectPoint2DAlt.SetPickedPointInObjectSpace(pickedPoint2DAlt); ITK_TEST_SET_GET_VALUE(pickedPoint2DAlt, contourSpatialObjectPoint2DAlt.GetPickedPointInObjectSpace()); - constexpr double normalXAlt = 7.28; - constexpr double normalYAlt = 14.03; + constexpr double normalXAlt{ 7.28 }; + constexpr double normalYAlt{ 14.03 }; ContourSpatialObjectPoint2DType::CovariantVectorType normal2DAlt; normal2DAlt[0] = normalXAlt; normal2DAlt[1] = normalYAlt; @@ -84,7 +84,7 @@ itkContourSpatialObjectPointTest(int, char *[]) ContourSpatialObjectPoint3DType contourSpatialObjectPoint3D; - constexpr double pickedPointZ = 23.78; + constexpr double pickedPointZ{ 23.78 }; ContourSpatialObjectPoint3DType::PointType pickedPoint3D; pickedPoint3D[0] = pickedPointX; pickedPoint3D[1] = pickedPointY; @@ -93,7 +93,7 @@ itkContourSpatialObjectPointTest(int, char *[]) contourSpatialObjectPoint3D.SetPickedPointInObjectSpace(pickedPoint3D); ITK_TEST_SET_GET_VALUE(pickedPoint3D, contourSpatialObjectPoint3D.GetPickedPointInObjectSpace()); - constexpr double normalZ = 1.0; + constexpr double normalZ{ 1.0 }; ContourSpatialObjectPoint3DType::CovariantVectorType normal3D; normal3D[0] = normalX; normal3D[1] = normalY; @@ -106,7 +106,7 @@ itkContourSpatialObjectPointTest(int, char *[]) ContourSpatialObjectPoint3DType contourSpatialObjectPoint3DAlt; - constexpr double pickedPointZAlt = 19.6; + constexpr double pickedPointZAlt{ 19.6 }; ContourSpatialObjectPoint3DType::PointType pickedPoint3DAlt; pickedPoint3DAlt[0] = pickedPointXAlt; pickedPoint3DAlt[1] = pickedPointYAlt; @@ -115,7 +115,7 @@ itkContourSpatialObjectPointTest(int, char *[]) contourSpatialObjectPoint3DAlt.SetPickedPointInObjectSpace(pickedPoint3DAlt); ITK_TEST_SET_GET_VALUE(pickedPoint3DAlt, contourSpatialObjectPoint3DAlt.GetPickedPointInObjectSpace()); - constexpr double normalZAlt = 1.4; + constexpr double normalZAlt{ 1.4 }; ContourSpatialObjectPoint3DType::CovariantVectorType normal3DAlt; normal3DAlt[0] = normalXAlt; normal3DAlt[1] = normalYAlt; @@ -184,7 +184,7 @@ itkContourSpatialObjectPointTest(int, char *[]) ContourSpatialObjectPoint4DType contourSpatialObjectPoint4D; - constexpr double pickedPointW = 4.63; + constexpr double pickedPointW{ 4.63 }; ContourSpatialObjectPoint4DType::PointType pickedPoint4D; pickedPoint4D[0] = pickedPointX; pickedPoint4D[1] = pickedPointY; @@ -194,7 +194,7 @@ itkContourSpatialObjectPointTest(int, char *[]) contourSpatialObjectPoint4D.SetPickedPointInObjectSpace(pickedPoint4D); ITK_TEST_SET_GET_VALUE(pickedPoint4D, contourSpatialObjectPoint4D.GetPickedPointInObjectSpace()); - constexpr double normalW = 3.1; + constexpr double normalW{ 3.1 }; ContourSpatialObjectPoint4DType::CovariantVectorType normal4D; normal4D[0] = normalX; normal4D[1] = normalY; @@ -208,7 +208,7 @@ itkContourSpatialObjectPointTest(int, char *[]) ContourSpatialObjectPoint4DType contourSpatialObjectPoint4DAlt; - constexpr double pickedPointWAlt = 8.71; + constexpr double pickedPointWAlt{ 8.71 }; ContourSpatialObjectPoint4DType::PointType pickedPoint4DAlt; pickedPoint4DAlt[0] = pickedPointXAlt; pickedPoint4DAlt[1] = pickedPointYAlt; @@ -218,7 +218,7 @@ itkContourSpatialObjectPointTest(int, char *[]) contourSpatialObjectPoint4DAlt.SetPickedPointInObjectSpace(pickedPoint4DAlt); ITK_TEST_SET_GET_VALUE(pickedPoint4DAlt, contourSpatialObjectPoint4DAlt.GetPickedPointInObjectSpace()); - constexpr double normalWAlt = 4.23; + constexpr double normalWAlt{ 4.23 }; ContourSpatialObjectPoint4DType::CovariantVectorType normal4DAlt; normal4DAlt[0] = normalXAlt; normal4DAlt[1] = normalYAlt; diff --git a/Modules/Core/SpatialObjects/test/itkContourSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkContourSpatialObjectTest.cxx index 038918569db..bff1f126090 100644 --- a/Modules/Core/SpatialObjects/test/itkContourSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkContourSpatialObjectTest.cxx @@ -35,7 +35,7 @@ itkContourSpatialObjectTest(int, char *[]) // // Set up data // - constexpr unsigned int NumDimensions = 2; + constexpr unsigned int NumDimensions{ 2 }; using SpatialObjectType = itk::ContourSpatialObject; // contour is a unit square diff --git a/Modules/Core/SpatialObjects/test/itkDTITubeSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkDTITubeSpatialObjectTest.cxx index 3a5cc29dd25..3b9f990c75d 100644 --- a/Modules/Core/SpatialObjects/test/itkDTITubeSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkDTITubeSpatialObjectTest.cxx @@ -417,7 +417,7 @@ itkDTITubeSpatialObjectTest(int, char *[]) const Point t_known(itk::MakePoint(0.57735, 0.57735, 0.57735)); const Point n1_known(itk::MakePoint(0.707107, 0.707107, 0.0)); const Point n2_known(itk::MakePoint(0.408248, 0.408248, 0.816497)); - constexpr double tol = 0.0001; + constexpr double tol{ 0.0001 }; if ((itk::Math::abs(t[0] - t_known[0]) > tol) || (itk::Math::abs(t[1] - t_known[1]) > tol) || (itk::Math::abs(t[2] - t_known[2]) > tol)) diff --git a/Modules/Core/SpatialObjects/test/itkGaussianSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkGaussianSpatialObjectTest.cxx index 72dfe014846..0e53c348c27 100644 --- a/Modules/Core/SpatialObjects/test/itkGaussianSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkGaussianSpatialObjectTest.cxx @@ -29,15 +29,15 @@ itkGaussianSpatialObjectTest(int, char *[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(myGaussian, GaussianSpatialObject, SpatialObject); - constexpr GaussianType::ScalarType maximum = 2; + constexpr GaussianType::ScalarType maximum{ 2 }; myGaussian->SetMaximum(maximum); ITK_TEST_SET_GET_VALUE(maximum, myGaussian->GetMaximum()); - constexpr GaussianType::ScalarType radius = 3; + constexpr GaussianType::ScalarType radius{ 3 }; myGaussian->SetRadiusInObjectSpace(radius); ITK_TEST_SET_GET_VALUE(radius, myGaussian->GetRadiusInObjectSpace()); - constexpr GaussianType::ScalarType sigma = 1.5; + constexpr GaussianType::ScalarType sigma{ 1.5 }; myGaussian->SetSigmaInObjectSpace(sigma); ITK_TEST_SET_GET_VALUE(sigma, myGaussian->GetSigmaInObjectSpace()); @@ -97,7 +97,7 @@ itkGaussianSpatialObjectTest(int, char *[]) myGaussian->Update(); std::cout << "SetOffset" << std::endl; - constexpr GaussianType::TransformType::OffsetType::ValueType offset10 = 10.0; + constexpr GaussianType::TransformType::OffsetType::ValueType offset10{ 10.0 }; auto offset = itk::MakeFilled(offset10); myGaussian->GetModifiableObjectToWorldTransform()->SetOffset(offset); myGaussian->ComputeObjectToParentTransform(); @@ -107,7 +107,7 @@ itkGaussianSpatialObjectTest(int, char *[]) myGaussian->Update(); std::cout << "SetOffset2" << std::endl; - constexpr GaussianType::TransformType::OffsetType::ValueType offset15 = 15.0; + constexpr GaussianType::TransformType::OffsetType::ValueType offset15{ 15.0 }; auto offset2 = itk::MakeFilled(offset15); myGaussian2->GetModifiableObjectToWorldTransform()->SetOffset(offset2); myGaussian2->ComputeObjectToParentTransform(); diff --git a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectGTest.cxx b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectGTest.cxx index 2d3aaee7042..7077419e0a0 100644 --- a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectGTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectGTest.cxx @@ -319,7 +319,7 @@ TEST(ImageMaskSpatialObject, CornerPointIsNotInsideMaskOfZeroValues) const auto imageMaskSpatialObject = itk::ImageMaskSpatialObject<2>::New(); imageMaskSpatialObject->SetImage(image); - constexpr double cornerPoint[] = { 1.5, 1.5 }; + constexpr double cornerPoint[]{ 1.5, 1.5 }; ASSERT_FALSE(imageMaskSpatialObject->IsInsideInObjectSpace(cornerPoint)); } diff --git a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest.cxx index 4a08994e8de..b584b0c34e3 100644 --- a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest.cxx @@ -34,7 +34,7 @@ int itkImageMaskSpatialObjectTest(int, char *[]) { - constexpr unsigned int VDimension = 3; + constexpr unsigned int VDimension{ 3 }; using ImageMaskSpatialObject = itk::ImageMaskSpatialObject; using PixelType = ImageMaskSpatialObject::PixelType; @@ -42,15 +42,15 @@ itkImageMaskSpatialObjectTest(int, char *[]) using Iterator = itk::ImageRegionIterator; auto image = ImageType::New(); - constexpr ImageType::SizeType size = { { 50, 50, 50 } }; - constexpr ImageType::IndexType index = { { 0, 0, 0 } }; + constexpr ImageType::SizeType size{ 50, 50, 50 }; + constexpr ImageType::IndexType index{ 0, 0, 0 }; ImageType::RegionType region{ index, size }; image->SetRegions(region); image->AllocateInitialized(); - constexpr ImageType::SizeType insideSize = { { 30, 30, 30 } }; - constexpr ImageType::IndexType insideIndex = { { 10, 10, 10 } }; + constexpr ImageType::SizeType insideSize{ 30, 30, 30 }; + constexpr ImageType::IndexType insideIndex{ 10, 10, 10 }; ImageType::RegionType insideRegion = { insideIndex, insideSize }; diff --git a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest2.cxx b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest2.cxx index e189034d393..b8e692ed6e5 100644 --- a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest2.cxx +++ b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest2.cxx @@ -38,7 +38,7 @@ int itkImageMaskSpatialObjectTest2(int, char *[]) { - constexpr unsigned int VDimension = 3; + constexpr unsigned int VDimension{ 3 }; int retval = EXIT_SUCCESS; using ImageMaskSpatialObject = itk::ImageMaskSpatialObject; @@ -61,7 +61,7 @@ itkImageMaskSpatialObjectTest2(int, char *[]) const ImageType::DirectionType direction = tfm->GetMatrix(); image->SetDirection(direction); - constexpr ImageType::SizeType size = { { 50, 50, 50 } }; + constexpr ImageType::SizeType size{ 50, 50, 50 }; ImageType::PointType origin; origin[0] = 1.51; origin[1] = 2.10; @@ -73,22 +73,22 @@ itkImageMaskSpatialObjectTest2(int, char *[]) spacing[1] = 0.7; spacing[2] = 1.1; image->SetSpacing(spacing); - constexpr unsigned int index_offset = 6543; - constexpr ImageType::IndexType index = { { index_offset, index_offset, index_offset } }; + constexpr unsigned int index_offset{ 6543 }; + constexpr ImageType::IndexType index{ index_offset, index_offset, index_offset }; const ImageType::RegionType region{ index, size }; image->SetRegions(region); image->AllocateInitialized(); ImageType::RegionType insideRegion; - constexpr unsigned int INSIDE_SIZE = 30; + constexpr unsigned int INSIDE_SIZE{ 30 }; constexpr unsigned int INSIDE_INDEX = index_offset + 10; { - constexpr ImageType::SizeType insideSize = { { INSIDE_SIZE, INSIDE_SIZE, INSIDE_SIZE } }; + constexpr ImageType::SizeType insideSize{ INSIDE_SIZE, INSIDE_SIZE, INSIDE_SIZE }; insideRegion.SetSize(insideSize); } { - constexpr ImageType::IndexType insideIndex = { { INSIDE_INDEX, INSIDE_INDEX, INSIDE_INDEX } }; + constexpr ImageType::IndexType insideIndex{ INSIDE_INDEX, INSIDE_INDEX, INSIDE_INDEX }; insideRegion.SetIndex(insideIndex); } { @@ -176,7 +176,7 @@ itkImageMaskSpatialObjectTest2(int, char *[]) // Check if insideregion is properly computed at the image boundary { - constexpr ImageType::IndexType startPointIndex = { { INSIDE_SIZE - 2, INSIDE_SIZE - 2, INSIDE_SIZE - 2 } }; + constexpr ImageType::IndexType startPointIndex{ INSIDE_SIZE - 2, INSIDE_SIZE - 2, INSIDE_SIZE - 2 }; constexpr ImageType::IndexType endPointIndex = { { INSIDE_INDEX + INSIDE_SIZE + 2, INSIDE_INDEX + INSIDE_SIZE + 2, INSIDE_INDEX + INSIDE_SIZE + 2 } }; diff --git a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest3.cxx b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest3.cxx index d281ac3ae7b..d719cda5b0f 100644 --- a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest3.cxx +++ b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest3.cxx @@ -36,14 +36,14 @@ int itkImageMaskSpatialObjectTest3(int, char *[]) { - constexpr unsigned int VDimension = 3; + constexpr unsigned int VDimension{ 3 }; using ImageMaskSpatialObjectType = itk::ImageMaskSpatialObject; using PixelType = ImageMaskSpatialObjectType::PixelType; using ImageType = itk::Image; auto image = ImageType::New(); - constexpr ImageType::SizeType size = { { 5, 5, 5 } }; + constexpr ImageType::SizeType size{ 5, 5, 5 }; constexpr ImageType::PointType origin{}; image->SetOrigin(origin); diff --git a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest5.cxx b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest5.cxx index 2d4908530df..1b05065c5d5 100644 --- a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest5.cxx +++ b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest5.cxx @@ -34,7 +34,7 @@ int itkImageMaskSpatialObjectTest5(int, char *[]) { - constexpr unsigned int VDimension = 3; + constexpr unsigned int VDimension{ 3 }; using ImageMaskSpatialObject = itk::ImageMaskSpatialObject; using PixelType = ImageMaskSpatialObject::PixelType; @@ -42,15 +42,15 @@ itkImageMaskSpatialObjectTest5(int, char *[]) using Iterator = itk::ImageRegionIterator; auto image = ImageType::New(); - constexpr ImageType::SizeType size = { { 50, 50, 50 } }; - constexpr ImageType::IndexType index = { { 0, 0, 0 } }; + constexpr ImageType::SizeType size{ 50, 50, 50 }; + constexpr ImageType::IndexType index{ 0, 0, 0 }; ImageType::RegionType region{ index, size }; image->SetRegions(region); image->AllocateInitialized(); - constexpr ImageType::SizeType insideSize = { { 30, 30, 30 } }; - constexpr ImageType::IndexType insideIndex = { { 10, 10, 10 } }; + constexpr ImageType::SizeType insideSize{ 30, 30, 30 }; + constexpr ImageType::IndexType insideIndex{ 10, 10, 10 }; ImageType::RegionType insideRegion = { insideIndex, insideSize }; diff --git a/Modules/Core/SpatialObjects/test/itkImageSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkImageSpatialObjectTest.cxx index 064cfb6e058..b94df2f6b3f 100644 --- a/Modules/Core/SpatialObjects/test/itkImageSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkImageSpatialObjectTest.cxx @@ -45,8 +45,8 @@ itkImageSpatialObjectTest(int, char *[]) using PointType = itk::Point; auto image = ImageType::New(); - constexpr ImageType::SizeType size = { { 10, 10, 10 } }; - constexpr ImageType::IndexType index = { { 0, 0, 0 } }; + constexpr ImageType::SizeType size{ 10, 10, 10 }; + constexpr ImageType::IndexType index{ 0, 0, 0 }; auto origin = itk::MakeFilled(5); ImageType::RegionType region = { index, size }; diff --git a/Modules/Core/SpatialObjects/test/itkMeshSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkMeshSpatialObjectTest.cxx index 762aefbe469..077e5678195 100644 --- a/Modules/Core/SpatialObjects/test/itkMeshSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkMeshSpatialObjectTest.cxx @@ -60,7 +60,7 @@ itkMeshSpatialObjectTest(int, char *[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(meshSO, MeshSpatialObject, SpatialObject); - constexpr double isInsidePrecisionInObjectSpace = 1; + constexpr double isInsidePrecisionInObjectSpace{ 1 }; meshSO->SetIsInsidePrecisionInObjectSpace(isInsidePrecisionInObjectSpace); ITK_TEST_SET_GET_VALUE(isInsidePrecisionInObjectSpace, meshSO->GetIsInsidePrecisionInObjectSpace()); diff --git a/Modules/Core/SpatialObjects/test/itkMetaArrowConverterTest.cxx b/Modules/Core/SpatialObjects/test/itkMetaArrowConverterTest.cxx index e82b8783535..eade63c0d3f 100644 --- a/Modules/Core/SpatialObjects/test/itkMetaArrowConverterTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkMetaArrowConverterTest.cxx @@ -48,7 +48,7 @@ itkMetaArrowConverterTest(int argc, char * argv[]) } // type alias - constexpr unsigned int Dimensions = 3; + constexpr unsigned int Dimensions{ 3 }; using SpatialObjectType = itk::ArrowSpatialObject; using SpatialObjectParentType = itk::GroupSpatialObject; using ConverterType = itk::MetaArrowConverter; @@ -94,7 +94,7 @@ itkMetaArrowConverterTest(int argc, char * argv[]) mPosition[2] = -3; // length - constexpr double length = 2.3; + constexpr double length{ 2.3 }; // color float color[4]; @@ -129,7 +129,7 @@ itkMetaArrowConverterTest(int argc, char * argv[]) metaArrow->ParentID(itkParent->GetId()); // precision limit for comparing floats and doubles - constexpr double precisionLimit = .000001; + constexpr double precisionLimit{ .000001 }; // // test itk to metaArrow diff --git a/Modules/Core/SpatialObjects/test/itkMetaGaussianConverterTest.cxx b/Modules/Core/SpatialObjects/test/itkMetaGaussianConverterTest.cxx index 0e55c15372e..f4464fd06a8 100644 --- a/Modules/Core/SpatialObjects/test/itkMetaGaussianConverterTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkMetaGaussianConverterTest.cxx @@ -51,7 +51,7 @@ itkMetaGaussianConverterTest(int argc, char * argv[]) // type alias - constexpr unsigned int Dimensions = 3; + constexpr unsigned int Dimensions{ 3 }; using SpatialObjectType = itk::GaussianSpatialObject; using SpatialObjectParentType = itk::GroupSpatialObject; using ConverterType = itk::MetaGaussianConverter; @@ -67,9 +67,9 @@ itkMetaGaussianConverterTest(int argc, char * argv[]) auto GaussianSpatialObj = SpatialObjectType::New(); // Gaussian spatial object properties - constexpr SpatialObjectType::ScalarType maximum = 2; - constexpr SpatialObjectType::ScalarType radius = 3; - constexpr SpatialObjectType::ScalarType sigma = 1.5; + constexpr SpatialObjectType::ScalarType maximum{ 2 }; + constexpr SpatialObjectType::ScalarType radius{ 3 }; + constexpr SpatialObjectType::ScalarType sigma{ 1.5 }; GaussianSpatialObj->SetMaximum(maximum); GaussianSpatialObj->SetRadiusInObjectSpace(radius); @@ -100,7 +100,7 @@ itkMetaGaussianConverterTest(int argc, char * argv[]) metaGaussian->ParentID(parentSpatialObj->GetId()); // Precision limit for comparing floats and doubles - constexpr double precisionLimit = .000001; + constexpr double precisionLimit{ .000001 }; // // Test GaussianSpatialObject to MetaGaussian diff --git a/Modules/Core/SpatialObjects/test/itkNewMetaObjectTypeTest.cxx b/Modules/Core/SpatialObjects/test/itkNewMetaObjectTypeTest.cxx index 71a80136b5c..c4b02055db5 100644 --- a/Modules/Core/SpatialObjects/test/itkNewMetaObjectTypeTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkNewMetaObjectTypeTest.cxx @@ -247,7 +247,7 @@ itkNewMetaObjectTypeTest(int, char *[]) auto binaryPoints = false; ITK_TEST_SET_GET_BOOLEAN(converter, BinaryPoints, binaryPoints); - constexpr unsigned int transformPrecision = 6; + constexpr unsigned int transformPrecision{ 6 }; converter->SetTransformPrecision(transformPrecision); ITK_TEST_SET_GET_VALUE(transformPrecision, converter->GetTransformPrecision()); diff --git a/Modules/Core/SpatialObjects/test/itkPolygonSpatialObjectIsInsideInObjectSpaceTest.cxx b/Modules/Core/SpatialObjects/test/itkPolygonSpatialObjectIsInsideInObjectSpaceTest.cxx index 811f0ce0338..e35aa19470d 100644 --- a/Modules/Core/SpatialObjects/test/itkPolygonSpatialObjectIsInsideInObjectSpaceTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkPolygonSpatialObjectIsInsideInObjectSpaceTest.cxx @@ -49,7 +49,7 @@ itkPolygonSpatialObjectIsInsideInObjectSpaceTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PointType = itk::ImageBase::PointType; using PolygonPointType = itk::PolygonSpatialObject::PolygonPointType; using PolygonPointListType = itk::PolygonSpatialObject::PolygonPointListType; diff --git a/Modules/Core/SpatialObjects/test/itkPolygonSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkPolygonSpatialObjectTest.cxx index 94e8ebc58ef..c2ef98336d7 100644 --- a/Modules/Core/SpatialObjects/test/itkPolygonSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkPolygonSpatialObjectTest.cxx @@ -33,13 +33,13 @@ itkPolygonSpatialObjectTest(int, char *[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(rectangle, PolygonSpatialObject, PointBasedSpatialObject); - constexpr double d1[3] = { 0.0, 0.0, 0.0 }; + constexpr double d1[3]{ 0.0, 0.0, 0.0 }; const PolygonType::PointType p1(d1); - constexpr double d2[3] = { 2.0, 0.0, 0.0 }; + constexpr double d2[3]{ 2.0, 0.0, 0.0 }; const PolygonType::PointType p2(d2); - constexpr double d3[3] = { 2.0, 1.0, 0.0 }; + constexpr double d3[3]{ 2.0, 1.0, 0.0 }; const PolygonType::PointType p3(d3); - constexpr double d4[3] = { 0.0, 1.0, 0.0 }; + constexpr double d4[3]{ 0.0, 1.0, 0.0 }; const PolygonType::PointType p4(d4); PolygonType::PolygonPointListType pList; @@ -55,11 +55,11 @@ itkPolygonSpatialObjectTest(int, char *[]) pList.push_back(pPoint); rectangle->SetPoints(pList); - constexpr double objectSpaceThickness = 10; + constexpr double objectSpaceThickness{ 10 }; rectangle->SetThicknessInObjectSpace(objectSpaceThickness); ITK_TEST_SET_GET_VALUE(objectSpaceThickness, rectangle->GetThicknessInObjectSpace()); - constexpr bool isClosed = true; + constexpr bool isClosed{ true }; rectangle->SetIsClosed(isClosed); ITK_TEST_SET_GET_BOOLEAN(rectangle, IsClosed, isClosed); @@ -131,7 +131,7 @@ itkPolygonSpatialObjectTest(int, char *[]) // // test number of points std::cout << "Testing closest point for rectangle: "; - constexpr double tp1[3] = { 0.25, 0.0, 0.0 }; + constexpr double tp1[3]{ 0.25, 0.0, 0.0 }; const PolygonType::PointType testPoint1(tp1); const PolygonType::PolygonPointType closestPoint = rectangle->ClosestPointInWorldSpace(testPoint1); if (closestPoint.GetPositionInObjectSpace() != p1) @@ -148,7 +148,7 @@ itkPolygonSpatialObjectTest(int, char *[]) // // test number of points std::cout << "Testing closest point for rectangle (2): "; - constexpr double tp2[3] = { 0.25, 5.0, 5.0 }; + constexpr double tp2[3]{ 0.25, 5.0, 5.0 }; const PolygonType::PointType testPoint2(tp2); const PolygonType::PolygonPointType closestPoint2 = rectangle->ClosestPointInWorldSpace(testPoint2); if (closestPoint2.GetPositionInObjectSpace() != p4) diff --git a/Modules/Core/SpatialObjects/test/itkSpatialObjectToImageFilterTest.cxx b/Modules/Core/SpatialObjects/test/itkSpatialObjectToImageFilterTest.cxx index 2519e55a12a..5c3a2679ab5 100644 --- a/Modules/Core/SpatialObjects/test/itkSpatialObjectToImageFilterTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkSpatialObjectToImageFilterTest.cxx @@ -56,15 +56,15 @@ itkSpatialObjectToImageFilterTest(int, char *[]) imageFilter->SetInput(ellipse); - constexpr SpatialObjectToImageFilterType::ValueType insideValue = 2; + constexpr SpatialObjectToImageFilterType::ValueType insideValue{ 2 }; imageFilter->SetInsideValue(insideValue); ITK_TEST_SET_GET_VALUE(insideValue, imageFilter->GetInsideValue()); - constexpr SpatialObjectToImageFilterType::ValueType outsideValue = 0; + constexpr SpatialObjectToImageFilterType::ValueType outsideValue{ 0 }; imageFilter->SetOutsideValue(0); ITK_TEST_SET_GET_VALUE(outsideValue, imageFilter->GetOutsideValue()); - constexpr unsigned int childrenDepth = 1; + constexpr unsigned int childrenDepth{ 1 }; imageFilter->SetChildrenDepth(childrenDepth); ITK_TEST_SET_GET_VALUE(childrenDepth, imageFilter->GetChildrenDepth()); @@ -83,10 +83,10 @@ itkSpatialObjectToImageFilterTest(int, char *[]) // Testing spacing std::cout << "Testing Spacing: "; - constexpr float floatCheckValue = 1.5; - constexpr double doubleCheckValue = 1.25; - constexpr float vspacingFloat[2] = { floatCheckValue, floatCheckValue }; - constexpr double vspacingDouble[2] = { doubleCheckValue, doubleCheckValue }; + constexpr float floatCheckValue{ 1.5 }; + constexpr double doubleCheckValue{ 1.25 }; + constexpr float vspacingFloat[2]{ floatCheckValue, floatCheckValue }; + constexpr double vspacingDouble[2]{ doubleCheckValue, doubleCheckValue }; { imageFilter->SetSpacing(vspacingFloat); const double * spacing_result = imageFilter->GetSpacing(); @@ -160,8 +160,8 @@ itkSpatialObjectToImageFilterTest(int, char *[]) // Testing Origin std::cout << "Testing Origin: "; - constexpr float voriginFloat[2] = { floatCheckValue, floatCheckValue }; - constexpr double voriginDouble[2] = { doubleCheckValue, doubleCheckValue }; + constexpr float voriginFloat[2]{ floatCheckValue, floatCheckValue }; + constexpr double voriginDouble[2]{ doubleCheckValue, doubleCheckValue }; { @@ -204,8 +204,8 @@ itkSpatialObjectToImageFilterTest(int, char *[]) std::cout << "[PASSED]" << std::endl; // Now test with common values - constexpr double spacingDouble[2] = { 1.0, 1.0 }; - constexpr double originDouble[2] = { 0.0, 0.0 }; + constexpr double spacingDouble[2]{ 1.0, 1.0 }; + constexpr double originDouble[2]{ 0.0, 0.0 }; imageFilter->SetSpacing(spacingDouble); imageFilter->SetOrigin(originDouble); // Testing PrintSelf @@ -245,7 +245,7 @@ itkSpatialObjectToImageFilterTest(int, char *[]) std::cout << "[PASSED]" << std::endl; // Test the UseObjectValue - constexpr bool useObjectValue = true; + constexpr bool useObjectValue{ true }; imageFilter->SetUseObjectValue(useObjectValue); ITK_TEST_SET_GET_BOOLEAN(imageFilter, UseObjectValue, useObjectValue); diff --git a/Modules/Core/SpatialObjects/test/itkSpatialObjectToPointSetFilterTest.cxx b/Modules/Core/SpatialObjects/test/itkSpatialObjectToPointSetFilterTest.cxx index 09f1c1803d1..fe5c8c753d7 100644 --- a/Modules/Core/SpatialObjects/test/itkSpatialObjectToPointSetFilterTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkSpatialObjectToPointSetFilterTest.cxx @@ -58,7 +58,7 @@ itkSpatialObjectToPointSetFilterTest(int, char *[]) pointSetFilter->SetChildrenDepth(childrenDepth); ITK_TEST_SET_GET_VALUE(childrenDepth, pointSetFilter->GetChildrenDepth()); - constexpr unsigned int samplingFactor = 1; + constexpr unsigned int samplingFactor{ 1 }; pointSetFilter->SetSamplingFactor(samplingFactor); ITK_TEST_SET_GET_VALUE(samplingFactor, pointSetFilter->GetSamplingFactor()); diff --git a/Modules/Core/SpatialObjects/test/itkTubeSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkTubeSpatialObjectTest.cxx index 31120d11e4a..d0e52079c7b 100644 --- a/Modules/Core/SpatialObjects/test/itkTubeSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkTubeSpatialObjectTest.cxx @@ -430,7 +430,7 @@ itkTubeSpatialObjectTest(int, char *[]) const Point t_known(itk::MakePoint(0.57735, 0.57735, 0.57735)); const Point n1_known(itk::MakePoint(0.707107, 0.707107, 0.0)); const Point n2_known(itk::MakePoint(0.408248, 0.408248, 0.816497)); - constexpr double tol = 0.0001; + constexpr double tol{ 0.0001 }; if ((itk::Math::abs(t[0] - t_known[0]) > tol) || (itk::Math::abs(t[1] - t_known[1]) > tol) || (itk::Math::abs(t[2] - t_known[2]) > tol)) diff --git a/Modules/Core/TestKernel/include/itkGTestTypedefsAndConstructors.h b/Modules/Core/TestKernel/include/itkGTestTypedefsAndConstructors.h index 3265d35263d..aa74d9a6362 100644 --- a/Modules/Core/TestKernel/include/itkGTestTypedefsAndConstructors.h +++ b/Modules/Core/TestKernel/include/itkGTestTypedefsAndConstructors.h @@ -34,7 +34,7 @@ namespace itk::GTest::TypedefsAndConstructors namespace Dimension2 { -constexpr unsigned int Dimension = 2; +constexpr unsigned int Dimension{ 2 }; using ImageBaseType = itk::ImageBase; @@ -56,7 +56,7 @@ using RegionType = ImageBaseType::RegionType; namespace Dimension3 { -constexpr unsigned int Dimension = 3; +constexpr unsigned int Dimension{ 3 }; using ImageBaseType = itk::ImageBase; diff --git a/Modules/Core/TestKernel/include/itkTestDriverInclude.h b/Modules/Core/TestKernel/include/itkTestDriverInclude.h index f0d567ccaec..cb768c73f56 100644 --- a/Modules/Core/TestKernel/include/itkTestDriverInclude.h +++ b/Modules/Core/TestKernel/include/itkTestDriverInclude.h @@ -52,7 +52,7 @@ #include "itkIntTypes.h" #include "itkWin32Header.h" -constexpr int ITK_TEST_DIMENSION_MAX = 6; +constexpr int ITK_TEST_DIMENSION_MAX{ 6 }; extern int RegressionTestImage(const char * testImageFilename, diff --git a/Modules/Core/TestKernel/test/itkGoogleTest.cxx b/Modules/Core/TestKernel/test/itkGoogleTest.cxx index afcffc1ad4a..f1bf9cef1c8 100644 --- a/Modules/Core/TestKernel/test/itkGoogleTest.cxx +++ b/Modules/Core/TestKernel/test/itkGoogleTest.cxx @@ -49,13 +49,13 @@ TEST(GoogleTest, TypedefsAndConstructors_Dimension2) ITK_EXPECT_VECTOR_NEAR(vec1, vec2, 1e-10); ITK_EXPECT_VECTOR_NEAR(vec1, itk::MakeVector(1.1, 2.2), 1e-10); - constexpr IndexType idx1 = { { 0, 1 } }; + constexpr IndexType idx1{ 0, 1 }; const IndexType idx2 = itk::MakeIndex(0, 1); EXPECT_TRUE(idx1 == idx2); ITK_EXPECT_VECTOR_NEAR(idx1, idx2, 1e-10); ITK_EXPECT_VECTOR_NEAR(idx1, itk::MakeIndex(0, 1), 1e-10); - constexpr SizeType sz1 = { { 0u, 1u } }; + constexpr SizeType sz1{ 0u, 1u }; const SizeType sz2 = itk::MakeSize(0u, 1u); EXPECT_TRUE(sz1 == sz2); ITK_EXPECT_VECTOR_NEAR(sz1, sz2, 1e-10); @@ -87,12 +87,12 @@ TEST(GoogleTest, TypedefsAndConstructors_Dimension3) ITK_EXPECT_VECTOR_NEAR(vec1, vec2, 1e-10); ITK_EXPECT_VECTOR_NEAR(vec1, itk::MakeVector(1.1, 2.2, 3.3), 1e-10); - constexpr IndexType idx1 = { { 0, 1, 2 } }; + constexpr IndexType idx1{ 0, 1, 2 }; const IndexType idx2 = itk::MakeIndex(0, 1, 2); EXPECT_TRUE(idx1 == idx2); ITK_EXPECT_VECTOR_NEAR(idx1, idx2, 1e-10); - constexpr SizeType sz1 = { { 0u, 1u, 2u } }; + constexpr SizeType sz1{ 0u, 1u, 2u }; const SizeType sz2 = itk::MakeSize(0u, 1u, 2u); EXPECT_TRUE(sz1 == sz2); ITK_EXPECT_VECTOR_NEAR(sz1, itk::MakeSize(0u, 1u, 2u), 1e-10); diff --git a/Modules/Core/TestKernel/test/itkRandomImageSourceAttributesTest.cxx b/Modules/Core/TestKernel/test/itkRandomImageSourceAttributesTest.cxx index c501a91c04f..c45c6cb75d0 100644 --- a/Modules/Core/TestKernel/test/itkRandomImageSourceAttributesTest.cxx +++ b/Modules/Core/TestKernel/test/itkRandomImageSourceAttributesTest.cxx @@ -63,8 +63,8 @@ int itkRandomImageSourceAttributesTest(int, char *[]) { - constexpr unsigned int Dimension2D = 2; - constexpr unsigned int Dimension3D = 3; + constexpr unsigned int Dimension2D{ 2 }; + constexpr unsigned int Dimension3D{ 3 }; using PixelType = float; @@ -73,10 +73,10 @@ itkRandomImageSourceAttributesTest(int, char *[]) { using ImageType2D = itk::Image; - constexpr ImageType2D::SizeType size{ { 25, 25 } }; + constexpr ImageType2D::SizeType size{ 25, 25 }; const ImageType2D::SpacingType spacing{ { { 0.7, 2.1 } } }; const ImageType2D::PointType origin{ { { -1.7, 5.2 } } }; - constexpr itk::SpacePrecisionType d[4] = { 0, 1.0, 1.0, 0 }; + constexpr itk::SpacePrecisionType d[4]{ 0, 1.0, 1.0, 0 }; const ImageType2D::DirectionType direction = ImageType2D::DirectionType::InternalMatrixType(d); constexpr ImageType2D::ValueType min{ 0.0 }; constexpr ImageType2D::ValueType max{ 1000.0 }; @@ -87,10 +87,10 @@ itkRandomImageSourceAttributesTest(int, char *[]) { using ImageType3D = itk::Image; - constexpr ImageType3D::SizeType size{ { 14, 17, 36 } }; + constexpr ImageType3D::SizeType size{ 14, 17, 36 }; const ImageType3D::SpacingType spacing{ { { 0.7, 0.4, 1.2 } } }; const ImageType3D::PointType origin{ { { -1.7, 5.2, 3.4 } } }; - constexpr itk::SpacePrecisionType d[9] = { 0, 1.0, 0, 1.0, 0, 0, 0, 1.0, 0 }; + constexpr itk::SpacePrecisionType d[9]{ 0, 1.0, 0, 1.0, 0, 0, 0, 1.0, 0 }; const ImageType3D::DirectionType direction = ImageType3D::DirectionType::InternalMatrixType(d); constexpr ImageType3D::ValueType min{ 0.0 }; constexpr ImageType3D::ValueType max{ 10.0 }; diff --git a/Modules/Core/TestKernel/test/itkRandomImageSourceValuesTest.cxx b/Modules/Core/TestKernel/test/itkRandomImageSourceValuesTest.cxx index 12a4c7011c9..918c9396312 100644 --- a/Modules/Core/TestKernel/test/itkRandomImageSourceValuesTest.cxx +++ b/Modules/Core/TestKernel/test/itkRandomImageSourceValuesTest.cxx @@ -31,7 +31,7 @@ itkRandomImageSourceValuesTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using ImageType = itk::Image; @@ -39,7 +39,7 @@ itkRandomImageSourceValuesTest(int argc, char * argv[]) using ImageSourceType = itk::RandomImageSource; auto randomImageSource = ImageSourceType::New(); - constexpr ImageType::SizeType size{ { 10, 10 } }; + constexpr ImageType::SizeType size{ 10, 10 }; randomImageSource->SetSize(size); randomImageSource->SetMin(0.0); diff --git a/Modules/Core/TestKernel/test/itkTestingComparisonImageFilterGTest.cxx b/Modules/Core/TestKernel/test/itkTestingComparisonImageFilterGTest.cxx index e6d9a1e65e6..fdb0c38850f 100644 --- a/Modules/Core/TestKernel/test/itkTestingComparisonImageFilterGTest.cxx +++ b/Modules/Core/TestKernel/test/itkTestingComparisonImageFilterGTest.cxx @@ -42,7 +42,7 @@ TEST(itkTestingComparisonImageFilterTest, TestZeroImages) using ImageType = itk::Image; auto image1 = ImageType::New(); auto image2 = ImageType::New(); - constexpr ImageType::SizeType size = { { 16, 16 } }; + constexpr ImageType::SizeType size{ 16, 16 }; image1->SetRegions(size); image2->SetRegions(size); image1->AllocateInitialized(); @@ -72,7 +72,7 @@ TEST(itkTestingComparisonImageFilterTest, TestOneDifferentPixel) using ImageType = itk::Image; auto image1 = ImageType::New(); auto image2 = ImageType::New(); - constexpr ImageType::SizeType size = { { 16, 16 } }; + constexpr ImageType::SizeType size{ 16, 16 }; image1->SetRegions(size); image2->SetRegions(size); image1->AllocateInitialized(); diff --git a/Modules/Core/TestKernel/test/itkTestingExtractSliceImageFilterTest.cxx b/Modules/Core/TestKernel/test/itkTestingExtractSliceImageFilterTest.cxx index e3909bbc288..24bcbd1fcee 100644 --- a/Modules/Core/TestKernel/test/itkTestingExtractSliceImageFilterTest.cxx +++ b/Modules/Core/TestKernel/test/itkTestingExtractSliceImageFilterTest.cxx @@ -27,8 +27,8 @@ itkTestingExtractSliceImageFilterTest(int, char *[]) { using PixelType = unsigned char; - constexpr unsigned int InputDimension = 3; - constexpr unsigned int OutputDimension = 2; + constexpr unsigned int InputDimension{ 3 }; + constexpr unsigned int OutputDimension{ 2 }; using InputImageType = itk::Image; using OutputImageType = itk::Image; diff --git a/Modules/Core/TestKernel/test/itkTestingStretchIntensityImageFilterTest.cxx b/Modules/Core/TestKernel/test/itkTestingStretchIntensityImageFilterTest.cxx index 73349c5e34c..9d9fd15d6b9 100644 --- a/Modules/Core/TestKernel/test/itkTestingStretchIntensityImageFilterTest.cxx +++ b/Modules/Core/TestKernel/test/itkTestingStretchIntensityImageFilterTest.cxx @@ -24,13 +24,13 @@ int itkTestingStretchIntensityImageFilterTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = short; using ImageType = itk::Image; using StretchFilterType = itk::Testing::StretchIntensityImageFilter; using StatsFilterType = itk::StatisticsImageFilter; - constexpr ImageType::SizeType imageSize = { { 32, 32 } }; + constexpr ImageType::SizeType imageSize{ 32, 32 }; auto image = ImageType::New(); image->SetRegions(imageSize); image->Allocate(); diff --git a/Modules/Core/Transform/include/itkComposeScaleSkewVersor3DTransform.hxx b/Modules/Core/Transform/include/itkComposeScaleSkewVersor3DTransform.hxx index e48eefa9ead..40065d47dcc 100644 --- a/Modules/Core/Transform/include/itkComposeScaleSkewVersor3DTransform.hxx +++ b/Modules/Core/Transform/include/itkComposeScaleSkewVersor3DTransform.hxx @@ -103,7 +103,7 @@ ComposeScaleSkewVersor3DTransform::SetParameters(const Par norm = std::sqrt(norm); } - constexpr double epsilon = 1e-10; + constexpr double epsilon{ 1e-10 }; if (norm >= 1.0 - epsilon) { axis = axis / (norm + epsilon * norm); diff --git a/Modules/Core/Transform/include/itkEuler3DTransform.hxx b/Modules/Core/Transform/include/itkEuler3DTransform.hxx index a105d65f11d..3056c5effdd 100644 --- a/Modules/Core/Transform/include/itkEuler3DTransform.hxx +++ b/Modules/Core/Transform/include/itkEuler3DTransform.hxx @@ -333,7 +333,7 @@ Euler3DTransform::ComputeJacobianWithRespectToParameters(c } // compute derivatives for the translation part - constexpr unsigned int blockOffset = 3; + constexpr unsigned int blockOffset{ 3 }; for (unsigned int dim = 0; dim < SpaceDimension; ++dim) { jacobian[dim][blockOffset + dim] = 1.0; diff --git a/Modules/Core/Transform/include/itkQuaternionRigidTransform.hxx b/Modules/Core/Transform/include/itkQuaternionRigidTransform.hxx index a62c5cc10e2..cf99af49f3b 100644 --- a/Modules/Core/Transform/include/itkQuaternionRigidTransform.hxx +++ b/Modules/Core/Transform/include/itkQuaternionRigidTransform.hxx @@ -166,7 +166,7 @@ QuaternionRigidTransform::ComputeJacobianWithRespectToPara jacobian[2][3] = jacobian[0][1]; // compute derivatives for the translation part - constexpr unsigned int blockOffset = 4; + constexpr unsigned int blockOffset{ 4 }; for (unsigned int dim = 0; dim < SpaceDimension; ++dim) { jacobian[dim][blockOffset + dim] = 1.0; diff --git a/Modules/Core/Transform/include/itkRigid2DTransform.hxx b/Modules/Core/Transform/include/itkRigid2DTransform.hxx index f97c0313870..bf00e2a43c4 100644 --- a/Modules/Core/Transform/include/itkRigid2DTransform.hxx +++ b/Modules/Core/Transform/include/itkRigid2DTransform.hxx @@ -289,7 +289,7 @@ Rigid2DTransform::ComputeJacobianWithRespectToParameters(c j[1][0] = ca * (p[0] - cx) - sa * (p[1] - cy); // compute derivatives for the translation part - constexpr unsigned int blockOffset = 1; + constexpr unsigned int blockOffset{ 1 }; for (unsigned int dim = 0; dim < OutputSpaceDimension; ++dim) { j[dim][blockOffset + dim] = 1.0; diff --git a/Modules/Core/Transform/include/itkRigid3DPerspectiveTransform.hxx b/Modules/Core/Transform/include/itkRigid3DPerspectiveTransform.hxx index f430241dc0a..c838d2f6539 100644 --- a/Modules/Core/Transform/include/itkRigid3DPerspectiveTransform.hxx +++ b/Modules/Core/Transform/include/itkRigid3DPerspectiveTransform.hxx @@ -80,7 +80,7 @@ Rigid3DPerspectiveTransform::SetParameters(const Parameter norm = std::sqrt(norm); } - constexpr double epsilon = 1e-10; + constexpr double epsilon{ 1e-10 }; if (norm >= 1.0 - epsilon) { axis = axis / (norm + epsilon * norm); diff --git a/Modules/Core/Transform/include/itkScaleSkewVersor3DTransform.hxx b/Modules/Core/Transform/include/itkScaleSkewVersor3DTransform.hxx index 68681af8ef0..0e7347faa6a 100644 --- a/Modules/Core/Transform/include/itkScaleSkewVersor3DTransform.hxx +++ b/Modules/Core/Transform/include/itkScaleSkewVersor3DTransform.hxx @@ -99,7 +99,7 @@ ScaleSkewVersor3DTransform::SetParameters(const Parameters norm = std::sqrt(norm); } - constexpr double epsilon = 1e-10; + constexpr double epsilon{ 1e-10 }; if (norm >= 1.0 - epsilon) { axis = axis / (norm + epsilon * norm); diff --git a/Modules/Core/Transform/include/itkScaleVersor3DTransform.hxx b/Modules/Core/Transform/include/itkScaleVersor3DTransform.hxx index a6574957bc9..27a81d944fe 100644 --- a/Modules/Core/Transform/include/itkScaleVersor3DTransform.hxx +++ b/Modules/Core/Transform/include/itkScaleVersor3DTransform.hxx @@ -96,7 +96,7 @@ ScaleVersor3DTransform::SetParameters(const ParametersType norm = std::sqrt(norm); } - constexpr double epsilon = 1e-10; + constexpr double epsilon{ 1e-10 }; if (norm >= 1.0 - epsilon) { axis = axis / (norm + epsilon * norm); diff --git a/Modules/Core/Transform/include/itkSimilarity3DTransform.hxx b/Modules/Core/Transform/include/itkSimilarity3DTransform.hxx index 1d5b3e7a6bb..ac57b74c6b4 100644 --- a/Modules/Core/Transform/include/itkSimilarity3DTransform.hxx +++ b/Modules/Core/Transform/include/itkSimilarity3DTransform.hxx @@ -147,7 +147,7 @@ Similarity3DTransform::SetParameters(const ParametersType norm = std::sqrt(norm); } - constexpr double epsilon = 1e-10; + constexpr double epsilon{ 1e-10 }; if (norm >= 1.0 - epsilon) { axis = axis / (norm + epsilon * norm); diff --git a/Modules/Core/Transform/include/itkVersorRigid3DTransform.hxx b/Modules/Core/Transform/include/itkVersorRigid3DTransform.hxx index a7a0b2cd3ae..5c6c0ccf465 100644 --- a/Modules/Core/Transform/include/itkVersorRigid3DTransform.hxx +++ b/Modules/Core/Transform/include/itkVersorRigid3DTransform.hxx @@ -65,7 +65,7 @@ VersorRigid3DTransform::SetParameters(const ParametersType const double norm = std::sqrt(parameters[0] * parameters[0] + parameters[1] * parameters[1] + parameters[2] * parameters[2]); - constexpr double epsilon = 1e-10; + constexpr double epsilon{ 1e-10 }; if (norm >= 1.0 - epsilon) { axis = axis / (norm + epsilon * norm); diff --git a/Modules/Core/Transform/test/itkAffineTransformTest.cxx b/Modules/Core/Transform/test/itkAffineTransformTest.cxx index 1e655c55b48..80bedeb9d40 100644 --- a/Modules/Core/Transform/test/itkAffineTransformTest.cxx +++ b/Modules/Core/Transform/test/itkAffineTransformTest.cxx @@ -544,8 +544,8 @@ itkAffineTransformTest(int, char *[]) std::cout << "ComputeJacobianWithRespectToParameters: " << std::endl; std::cout << jaffJacobian << std::endl; - constexpr double data[] = { 5, 10, 15, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 5, 10, 15, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 5, 10, 15, 0, 0, 1 }; + constexpr double data[]{ 5, 10, 15, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 5, 10, 15, + 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 5, 10, 15, 0, 0, 1 }; const vnl_matrix vnlData(data, 3, 12); Affine3DType::JacobianType expectedJacobian(vnlData); @@ -734,7 +734,7 @@ itkAffineTransformTest(int, char *[]) } } /* Update with a non-unit scaling factor */ - constexpr double factor = 0.5; + constexpr double factor{ 0.5 }; for (unsigned int i = 0; i < paff->GetNumberOfParameters(); ++i) { update[i] = i; diff --git a/Modules/Core/Transform/test/itkAzimuthElevationToCartesianTransformTest.cxx b/Modules/Core/Transform/test/itkAzimuthElevationToCartesianTransformTest.cxx index 20e4bf50728..47af2e591de 100644 --- a/Modules/Core/Transform/test/itkAzimuthElevationToCartesianTransformTest.cxx +++ b/Modules/Core/Transform/test/itkAzimuthElevationToCartesianTransformTest.cxx @@ -46,7 +46,7 @@ itkAzimuthElevationToCartesianTransformTest(int argc, char * argv[]) using CoordinateRepresentationType = double; using PointType = itk::Point; - constexpr CoordinateRepresentationType ACCEPTABLE_ERROR = 1E-10; + constexpr CoordinateRepresentationType ACCEPTABLE_ERROR{ 1E-10 }; using AzimuthElevationToCartesianTransformType = itk::AzimuthElevationToCartesianTransform; diff --git a/Modules/Core/Transform/test/itkBSplineDeformableTransformTest.cxx b/Modules/Core/Transform/test/itkBSplineDeformableTransformTest.cxx index 909f6f61ce1..4e473ed57d7 100644 --- a/Modules/Core/Transform/test/itkBSplineDeformableTransformTest.cxx +++ b/Modules/Core/Transform/test/itkBSplineDeformableTransformTest.cxx @@ -47,8 +47,8 @@ itkBSplineDeformableTransformTest1() // Uncomment the following if you want to see each message independently // itk::OutputWindow::GetInstance()->PromptUserOn(); - constexpr unsigned int SpaceDimension = 3; - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int SpaceDimension{ 3 }; + constexpr unsigned int SplineOrder{ 3 }; using CoordinateRepType = double; using TransformType = itk::BSplineDeformableTransform; @@ -442,10 +442,10 @@ itkBSplineDeformableTransformTest2() /** * Define a vector field as Dimension number of images */ - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; // Set up the transform - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int SplineOrder{ 3 }; using CoordRep = double; using TransformType = itk::BSplineDeformableTransform; using ImageType = TransformType::ImageType; @@ -571,8 +571,8 @@ itkBSplineDeformableTransformTest3() // Comment the following if you want to use the itk text output window itk::OutputWindow::SetInstance(itk::TextOutput::New()); - constexpr unsigned int SpaceDimension = 3; - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int SpaceDimension{ 3 }; + constexpr unsigned int SplineOrder{ 3 }; using CoordinateRepType = double; using TransformType = itk::BSplineDeformableTransform; diff --git a/Modules/Core/Transform/test/itkBSplineDeformableTransformTest2.cxx b/Modules/Core/Transform/test/itkBSplineDeformableTransformTest2.cxx index cd06457f92e..3693a98b9e9 100644 --- a/Modules/Core/Transform/test/itkBSplineDeformableTransformTest2.cxx +++ b/Modules/Core/Transform/test/itkBSplineDeformableTransformTest2.cxx @@ -67,7 +67,7 @@ class BSplineDeformableTransformTest2Helper static int RunTest(int argc, char * argv[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; using FixedImageType = itk::Image; @@ -116,7 +116,7 @@ class BSplineDeformableTransformTest2Helper resampler->SetInput(movingReader->GetOutput()); - constexpr unsigned int SpaceDimension = ImageDimension; + constexpr unsigned int SpaceDimension{ ImageDimension }; using CoordinateRepType = double; using TransformType = itk::BSplineDeformableTransform; @@ -130,7 +130,7 @@ class BSplineDeformableTransformTest2Helper const unsigned int numberOfGridNodesOutsideTheImageSupport = VSplineOrder; - constexpr unsigned int numberOfGridNodesInsideTheImageSupport = 5; + constexpr unsigned int numberOfGridNodesInsideTheImageSupport{ 5 }; const unsigned int numberOfGridNodes = numberOfGridNodesInsideTheImageSupport + numberOfGridNodesOutsideTheImageSupport; diff --git a/Modules/Core/Transform/test/itkBSplineDeformableTransformTest3.cxx b/Modules/Core/Transform/test/itkBSplineDeformableTransformTest3.cxx index 099bf78b7ff..c8bf0cbba1a 100644 --- a/Modules/Core/Transform/test/itkBSplineDeformableTransformTest3.cxx +++ b/Modules/Core/Transform/test/itkBSplineDeformableTransformTest3.cxx @@ -68,7 +68,7 @@ class BSplineDeformableTransformTest3Helper static int RunTest(int argc, char * argv[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; using FixedImageType = itk::Image; @@ -117,7 +117,7 @@ class BSplineDeformableTransformTest3Helper resampler->SetInput(movingReader->GetOutput()); - constexpr unsigned int SpaceDimension = ImageDimension; + constexpr unsigned int SpaceDimension{ ImageDimension }; using CoordinateRepType = double; using TransformType = itk::BSplineDeformableTransform; @@ -131,7 +131,7 @@ class BSplineDeformableTransformTest3Helper const unsigned int numberOfGridNodesOutsideTheImageSupport = VSplineOrder; - constexpr unsigned int numberOfGridNodesInsideTheImageSupport = 5; + constexpr unsigned int numberOfGridNodesInsideTheImageSupport{ 5 }; const unsigned int numberOfGridNodes = numberOfGridNodesInsideTheImageSupport + numberOfGridNodesOutsideTheImageSupport; diff --git a/Modules/Core/Transform/test/itkBSplineTransformInitializerTest1.cxx b/Modules/Core/Transform/test/itkBSplineTransformInitializerTest1.cxx index da74ebc1356..2a6b1623553 100644 --- a/Modules/Core/Transform/test/itkBSplineTransformInitializerTest1.cxx +++ b/Modules/Core/Transform/test/itkBSplineTransformInitializerTest1.cxx @@ -43,7 +43,7 @@ itkBSplineTransformInitializerTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; using FixedImageType = itk::Image; @@ -89,8 +89,8 @@ itkBSplineTransformInitializerTest1(int argc, char * argv[]) resampler->SetInput(movingReader->GetOutput()); - constexpr unsigned int SpaceDimension = ImageDimension; - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int SpaceDimension{ ImageDimension }; + constexpr unsigned int SplineOrder{ 3 }; using CoordinateRepType = double; using TransformType = itk::BSplineTransform; diff --git a/Modules/Core/Transform/test/itkBSplineTransformInitializerTest2.cxx b/Modules/Core/Transform/test/itkBSplineTransformInitializerTest2.cxx index 848219d6a54..5ab25672316 100644 --- a/Modules/Core/Transform/test/itkBSplineTransformInitializerTest2.cxx +++ b/Modules/Core/Transform/test/itkBSplineTransformInitializerTest2.cxx @@ -52,7 +52,7 @@ itkBSplineTransformInitializerTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; using FixedImageType = itk::Image; @@ -69,8 +69,8 @@ itkBSplineTransformInitializerTest2(int argc, char * argv[]) const FixedImageType::ConstPointer fixedImage = fixedReader->GetOutput(); - constexpr unsigned int SpaceDimension = ImageDimension; - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int SpaceDimension{ ImageDimension }; + constexpr unsigned int SplineOrder{ 3 }; using CoordinateRepType = double; using TransformType = itk::BSplineTransform; diff --git a/Modules/Core/Transform/test/itkBSplineTransformTest.cxx b/Modules/Core/Transform/test/itkBSplineTransformTest.cxx index 80f10a934bf..cd1cd048115 100644 --- a/Modules/Core/Transform/test/itkBSplineTransformTest.cxx +++ b/Modules/Core/Transform/test/itkBSplineTransformTest.cxx @@ -45,8 +45,8 @@ itkBSplineTransformTest1() // Uncomment the following if you want to see each message independently // itk::OutputWindow::GetInstance()->PromptUserOn(); - constexpr unsigned int SpaceDimension = 3; - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int SpaceDimension{ 3 }; + constexpr unsigned int SplineOrder{ 3 }; using CoordinateRepType = double; using TransformType = itk::BSplineTransform; @@ -472,13 +472,13 @@ itkBSplineTransformTest2() /** * Define a vector field as Dimension number of images */ - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = double; using ImageType = itk::Image; // Set up the transform - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int SplineOrder{ 3 }; using CoordRep = double; using TransformType = itk::BSplineTransform; @@ -588,8 +588,8 @@ itkBSplineTransformTest3() // Comment the following if you want to use the itk text output window itk::OutputWindow::SetInstance(itk::TextOutput::New()); - constexpr unsigned int SpaceDimension = 3; - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int SpaceDimension{ 3 }; + constexpr unsigned int SplineOrder{ 3 }; using CoordinateRepType = double; using TransformType = itk::BSplineTransform; diff --git a/Modules/Core/Transform/test/itkBSplineTransformTest2.cxx b/Modules/Core/Transform/test/itkBSplineTransformTest2.cxx index db2d05c7717..f6ac9d387af 100644 --- a/Modules/Core/Transform/test/itkBSplineTransformTest2.cxx +++ b/Modules/Core/Transform/test/itkBSplineTransformTest2.cxx @@ -67,7 +67,7 @@ class BSplineTransformTest2Helper static int RunTest(int argc, char * argv[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; using FixedImageType = itk::Image; @@ -116,7 +116,7 @@ class BSplineTransformTest2Helper resampler->SetInput(movingReader->GetOutput()); - constexpr unsigned int SpaceDimension = ImageDimension; + constexpr unsigned int SpaceDimension{ ImageDimension }; using CoordinateRepType = double; using TransformType = itk::BSplineTransform; diff --git a/Modules/Core/Transform/test/itkBSplineTransformTest3.cxx b/Modules/Core/Transform/test/itkBSplineTransformTest3.cxx index 7df941b4ac3..b581a79398a 100644 --- a/Modules/Core/Transform/test/itkBSplineTransformTest3.cxx +++ b/Modules/Core/Transform/test/itkBSplineTransformTest3.cxx @@ -67,7 +67,7 @@ class BSplineTransformTest3Helper static int RunTest(int argc, char * argv[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; using FixedImageType = itk::Image; @@ -116,7 +116,7 @@ class BSplineTransformTest3Helper resampler->SetInput(movingReader->GetOutput()); - constexpr unsigned int SpaceDimension = ImageDimension; + constexpr unsigned int SpaceDimension{ ImageDimension }; using CoordinateRepType = double; using TransformType = itk::BSplineTransform; @@ -130,7 +130,7 @@ class BSplineTransformTest3Helper const unsigned int numberOfGridNodesOutsideTheImageSupport = VSplineOrder; - constexpr unsigned int numberOfGridNodesInsideTheImageSupport = 5; + constexpr unsigned int numberOfGridNodesInsideTheImageSupport{ 5 }; const unsigned int numberOfGridNodes = numberOfGridNodesInsideTheImageSupport + numberOfGridNodesOutsideTheImageSupport; diff --git a/Modules/Core/Transform/test/itkCenteredAffineTransformTest.cxx b/Modules/Core/Transform/test/itkCenteredAffineTransformTest.cxx index 2f42b256bbc..cf646121ff1 100644 --- a/Modules/Core/Transform/test/itkCenteredAffineTransformTest.cxx +++ b/Modules/Core/Transform/test/itkCenteredAffineTransformTest.cxx @@ -258,6 +258,6 @@ itkCenteredAffineTransformTest(int, char *[]) std::cout << "A transform after SetParameters:" << std::endl; jaff->Print(std::cout); - constexpr int any = 0; // Any errors detected in testing? + constexpr int any{ 0 }; // Any errors detected in testing? return any; } diff --git a/Modules/Core/Transform/test/itkCenteredEuler3DTransformTest.cxx b/Modules/Core/Transform/test/itkCenteredEuler3DTransformTest.cxx index a56b3f0608a..8436b408791 100644 --- a/Modules/Core/Transform/test/itkCenteredEuler3DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkCenteredEuler3DTransformTest.cxx @@ -27,8 +27,8 @@ itkCenteredEuler3DTransformTest(int, char *[]) std::cout << "==================================" << std::endl; std::cout << "Testing Centered Euler Angles 3D Transform" << std::endl << std::endl; - constexpr double epsilon = 1e-10; - constexpr unsigned int N = 3; + constexpr double epsilon{ 1e-10 }; + constexpr unsigned int N{ 3 }; bool Ok = true; using EulerTransformType = itk::CenteredEuler3DTransform; @@ -248,7 +248,7 @@ itkCenteredEuler3DTransformTest(int, char *[]) EulerTransformType::JacobianType approxJacobian = jacobian; for (unsigned int k = 0; k < eulerTransform->GetNumberOfParameters(); ++k) { - constexpr double delta = 0.001; + constexpr double delta{ 0.001 }; EulerTransformType::ParametersType plusParameters; EulerTransformType::ParametersType minusParameters; @@ -374,7 +374,7 @@ itkCenteredEuler3DTransformTest(int, char *[]) (outputTestPoint[2] - testPoint[2]) * (outputTestPoint[2] - testPoint[2]); computeError = std::sqrt(computeError); - constexpr double errorTolerance = 0.001; + constexpr double errorTolerance{ 0.001 }; if (computeError > errorTolerance) { std::cout << " [ FAILED ] " << std::endl; diff --git a/Modules/Core/Transform/test/itkCenteredRigid2DTransformTest.cxx b/Modules/Core/Transform/test/itkCenteredRigid2DTransformTest.cxx index 711be68ac9a..b090ee0daf0 100644 --- a/Modules/Core/Transform/test/itkCenteredRigid2DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkCenteredRigid2DTransformTest.cxx @@ -27,7 +27,7 @@ namespace static bool CheckEqual(const itk::Point & p1, const itk::Point & p2) { - constexpr double epsilon = 1e-5; + constexpr double epsilon{ 1e-5 }; for (unsigned int i = 0; i < 2; ++i) { @@ -49,8 +49,8 @@ itkCenteredRigid2DTransformTest(int, char *[]) std::cout << "==================================" << std::endl; std::cout << "Testing CenteredRigid 2D Transform" << std::endl << std::endl; - constexpr double epsilon = 1e-10; - constexpr unsigned int N = 2; + constexpr double epsilon{ 1e-10 }; + constexpr unsigned int N{ 2 }; bool Ok = true; using CenteredRigidTransformType = itk::CenteredRigid2DTransform; @@ -65,7 +65,7 @@ itkCenteredRigid2DTransformTest(int, char *[]) transform->SetAngle(angle); // Rotate an itk::Point - constexpr CenteredRigidTransformType::InputPointType::ValueType pInit[2] = { 10, 10 }; + constexpr CenteredRigidTransformType::InputPointType::ValueType pInit[2]{ 10, 10 }; CenteredRigidTransformType::InputPointType p = pInit; CenteredRigidTransformType::InputPointType q; @@ -128,7 +128,7 @@ itkCenteredRigid2DTransformTest(int, char *[]) // Populate the transform with some parameters auto transform2 = CenteredRigidTransformType::New(); - constexpr double a = 0.175; + constexpr double a{ 0.175 }; transform2->SetAngle(a); CenteredRigidTransformType::InputPointType c; @@ -324,7 +324,7 @@ itkCenteredRigid2DTransformTest(int, char *[]) TransformType::JacobianType approxJacobian = jacobian; for (unsigned int k = 0; k < t1->GetNumberOfParameters(); ++k) { - constexpr double delta = 0.001; + constexpr double delta{ 0.001 }; TransformType::ParametersType plusParameters; TransformType::ParametersType minusParameters; diff --git a/Modules/Core/Transform/test/itkComposeScaleSkewVersor3DTransformTest.cxx b/Modules/Core/Transform/test/itkComposeScaleSkewVersor3DTransformTest.cxx index b6f885be71a..2a308ace534 100644 --- a/Modules/Core/Transform/test/itkComposeScaleSkewVersor3DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkComposeScaleSkewVersor3DTransformTest.cxx @@ -40,7 +40,7 @@ itkComposeScaleSkewVersor3DTransformTest(int, char *[]) using ValueType = double; - constexpr ValueType epsilon = 1e-12; + constexpr ValueType epsilon{ 1e-12 }; // Versor Transform type using TransformType = itk::ComposeScaleSkewVersor3DTransform; @@ -134,7 +134,7 @@ itkComposeScaleSkewVersor3DTransformTest(int, char *[]) { // Rotate an itk::Point - constexpr TransformType::InputPointType::ValueType pInit[3] = { 1, 4, 9 }; + constexpr TransformType::InputPointType::ValueType pInit[3]{ 1, 4, 9 }; const TransformType::InputPointType p = pInit; TransformType::OutputPointType q; q = versor.Transform(p); @@ -313,7 +313,7 @@ itkComposeScaleSkewVersor3DTransformTest(int, char *[]) ParametersType parameters2 = transform->GetParameters(); - constexpr double tolerance = 1e-8; + constexpr double tolerance{ 1e-8 }; for (unsigned int p = 0; p < np; ++p) { if (itk::Math::abs(parameters[p] - parameters2[p]) > tolerance) @@ -365,7 +365,7 @@ itkComposeScaleSkewVersor3DTransformTest(int, char *[]) ParametersType parameters2 = transform->GetParameters(); - constexpr double tolerance = 1e-8; + constexpr double tolerance{ 1e-8 }; for (unsigned int p = 0; p < np; ++p) { std::cout << parameters[p] << " = " << parameters2[p] << std::endl; @@ -408,7 +408,7 @@ itkComposeScaleSkewVersor3DTransformTest(int, char *[]) TransformType::ScaleVectorType rscale = transform->GetScale(); - constexpr double tolerance = 1e-8; + constexpr double tolerance{ 1e-8 }; for (unsigned int j = 0; j < 3; ++j) { if (itk::Math::abs(rscale[j] - scale[j]) > tolerance) diff --git a/Modules/Core/Transform/test/itkCompositeTransformTest.cxx b/Modules/Core/Transform/test/itkCompositeTransformTest.cxx index 71d83e67489..6848606da99 100644 --- a/Modules/Core/Transform/test/itkCompositeTransformTest.cxx +++ b/Modules/Core/Transform/test/itkCompositeTransformTest.cxx @@ -27,7 +27,7 @@ namespace { -constexpr double epsilon = 1e-10; +constexpr double epsilon{ 1e-10 }; template bool @@ -106,7 +106,7 @@ testVectorArray(const TVector & v1, const TVector & v2) int itkCompositeTransformTest(int, char *[]) { - constexpr unsigned int VDimension = 2; + constexpr unsigned int VDimension{ 2 }; /* Create composite transform */ using CompositeType = itk::CompositeTransform; @@ -777,7 +777,7 @@ itkCompositeTransformTest(int, char *[]) compositeTransform->SetNthTransformToOptimizeOff(1); truth = compositeTransform->GetParameters(); update.SetSize(compositeTransform->GetNumberOfParameters()); - constexpr AffineType::ScalarType factor = 0.5; + constexpr AffineType::ScalarType factor{ 0.5 }; for (unsigned int i = 0; i < compositeTransform->GetNumberOfParameters(); ++i) { update[i] = i; diff --git a/Modules/Core/Transform/test/itkEuler2DTransformTest.cxx b/Modules/Core/Transform/test/itkEuler2DTransformTest.cxx index 7f87c14c79a..eb275e071e1 100644 --- a/Modules/Core/Transform/test/itkEuler2DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkEuler2DTransformTest.cxx @@ -28,7 +28,7 @@ namespace bool CheckEqual(const itk::Point & p1, const itk::Point & p2) { - constexpr double epsilon = 1e-5; + constexpr double epsilon{ 1e-5 }; for (unsigned int i = 0; i < 2; ++i) { @@ -50,8 +50,8 @@ itkEuler2DTransformTest(int, char *[]) std::cout << "==================================" << std::endl; std::cout << "Testing Euler Angles 2D Transform" << std::endl << std::endl; - constexpr double epsilon = 1e-10; - constexpr unsigned int N = 2; + constexpr double epsilon{ 1e-10 }; + constexpr unsigned int N{ 2 }; bool Ok = true; using EulerTransformType = itk::Euler2DTransform; @@ -79,7 +79,7 @@ itkEuler2DTransformTest(int, char *[]) eulerTransform->SetRotation(angle); // Rotate an itk::Point - constexpr EulerTransformType::InputPointType::ValueType pInit[2] = { 10, 10 }; + constexpr EulerTransformType::InputPointType::ValueType pInit[2]{ 10, 10 }; EulerTransformType::InputPointType p = pInit; EulerTransformType::InputPointType q; @@ -300,7 +300,7 @@ itkEuler2DTransformTest(int, char *[]) TransformType::JacobianType approxJacobian = jacobian2; for (unsigned int k = 0; k < t1->GetNumberOfParameters(); ++k) { - constexpr double delta = 0.001; + constexpr double delta{ 0.001 }; TransformType::ParametersType plusParameters; TransformType::ParametersType minusParameters; diff --git a/Modules/Core/Transform/test/itkEuler3DTransformTest.cxx b/Modules/Core/Transform/test/itkEuler3DTransformTest.cxx index 0cf4604eb7a..686488edb33 100644 --- a/Modules/Core/Transform/test/itkEuler3DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkEuler3DTransformTest.cxx @@ -27,8 +27,8 @@ itkEuler3DTransformTest(int, char *[]) std::cout << "==================================" << std::endl; std::cout << "Testing Euler Angles 3D Transform" << std::endl << std::endl; - constexpr double epsilon = 1e-10; - constexpr unsigned int N = 3; + constexpr double epsilon{ 1e-10 }; + constexpr unsigned int N{ 3 }; bool Ok = true; using EulerTransformType = itk::Euler3DTransform; @@ -290,7 +290,7 @@ itkEuler3DTransformTest(int, char *[]) EulerTransformType::JacobianType approxJacobian = jacobian; for (unsigned int k = 0; k < eulerTransform->GetNumberOfParameters(); ++k) { - constexpr double delta = 0.001; + constexpr double delta{ 0.001 }; EulerTransformType::ParametersType plusParameters; EulerTransformType::ParametersType minusParameters; @@ -408,7 +408,7 @@ itkEuler3DTransformTest(int, char *[]) // attempt to set an orthogonal matrix matrix.GetVnlMatrix().set_identity(); - constexpr double a = 1.0 / 180.0 * itk::Math::pi; + constexpr double a{ 1.0 / 180.0 * itk::Math::pi }; matrix[0][0] = std::cos(a); matrix[0][1] = -1.0 * std::sin(a); matrix[1][0] = std::sin(a); diff --git a/Modules/Core/Transform/test/itkIdentityTransformTest.cxx b/Modules/Core/Transform/test/itkIdentityTransformTest.cxx index 45904347e88..47aaefd35df 100644 --- a/Modules/Core/Transform/test/itkIdentityTransformTest.cxx +++ b/Modules/Core/Transform/test/itkIdentityTransformTest.cxx @@ -28,8 +28,8 @@ itkIdentityTransformTest(int, char *[]) std::cout << "==================================" << std::endl; std::cout << "Testing Identity Transform " << std::endl << std::endl; - constexpr double epsilon = 1e-10; - constexpr unsigned int N = 2; + constexpr double epsilon{ 1e-10 }; + constexpr unsigned int N{ 2 }; bool Ok = true; using IdentityTransformType = itk::IdentityTransform; diff --git a/Modules/Core/Transform/test/itkMultiTransformTest.cxx b/Modules/Core/Transform/test/itkMultiTransformTest.cxx index cec7bfef8e6..f029451ac89 100644 --- a/Modules/Core/Transform/test/itkMultiTransformTest.cxx +++ b/Modules/Core/Transform/test/itkMultiTransformTest.cxx @@ -27,7 +27,7 @@ namespace { -constexpr double epsilon = 1e-10; +constexpr double epsilon{ 1e-10 }; template bool @@ -68,7 +68,7 @@ testVectorArray(const TVector & v1, const TVector & v2) /******/ -constexpr unsigned int itkMultiTransformTestNDimensions = 2; +constexpr unsigned int itkMultiTransformTestNDimensions{ 2 }; template class MultiTransformTestTransform : public itk::MultiTransform @@ -120,7 +120,7 @@ class MultiTransformTestTransform : public itk::MultiTransform; @@ -324,7 +324,7 @@ itkMultiTransformTest(int, char *[]) auto field = FieldType::New(); // This is based on itk::Image - constexpr int dimLength = 4; + constexpr int dimLength{ 4 }; constexpr auto size = itk::MakeFilled(dimLength); constexpr FieldType::IndexType start{}; FieldType::RegionType region{ start, size }; @@ -587,7 +587,7 @@ itkMultiTransformTest(int, char *[]) Superclass::ParametersType truth = multiTransform->GetParameters(); Superclass::DerivativeType update(multiTransform->GetNumberOfParameters()); update.Fill(10.0); - constexpr AffineType::ScalarType factor = 0.5; + constexpr AffineType::ScalarType factor{ 0.5 }; truth += update * factor; multiTransform->UpdateTransformParameters(update, factor); const Superclass::ParametersType updateResult = multiTransform->GetParameters(); diff --git a/Modules/Core/Transform/test/itkQuaternionRigidTransformTest.cxx b/Modules/Core/Transform/test/itkQuaternionRigidTransformTest.cxx index 8ce322f2bd3..5c57f438d9d 100644 --- a/Modules/Core/Transform/test/itkQuaternionRigidTransformTest.cxx +++ b/Modules/Core/Transform/test/itkQuaternionRigidTransformTest.cxx @@ -27,8 +27,8 @@ itkQuaternionRigidTransformTest(int, char *[]) using CoordinateType = double; using TransformType = itk::QuaternionRigidTransform; - constexpr double epsilon = 1e-10; - constexpr unsigned int N = 3; + constexpr double epsilon{ 1e-10 }; + constexpr unsigned int N{ 3 }; bool Ok = true; @@ -84,7 +84,7 @@ itkQuaternionRigidTransformTest(int, char *[]) { // Translate an itk::Point - constexpr TransformType::InputPointType::ValueType pInit[3] = { 10, 10, 10 }; + constexpr TransformType::InputPointType::ValueType pInit[3]{ 10, 10, 10 }; const TransformType::InputPointType p = pInit; TransformType::InputPointType q; q = p + itransVector; @@ -257,7 +257,7 @@ itkQuaternionRigidTransformTest(int, char *[]) { // Rotate an itk::Point - constexpr TransformType::InputPointType::ValueType pInit[3] = { 10, 10, 10 }; + constexpr TransformType::InputPointType::ValueType pInit[3]{ 10, 10, 10 }; TransformType::InputPointType p = pInit; TransformType::InputPointType q; @@ -392,7 +392,7 @@ itkQuaternionRigidTransformTest(int, char *[]) parameters.Fill(0.0); - constexpr double angle = 0.62 / 180.0 * itk::Math::pi; + constexpr double angle{ 0.62 / 180.0 * itk::Math::pi }; parameters[0] = 2.0 * std::sin(0.5 * angle); parameters[1] = 5.0 * std::sin(0.5 * angle); @@ -416,7 +416,7 @@ itkQuaternionRigidTransformTest(int, char *[]) TransformType::JacobianType approxJacobian = jacobian; for (unsigned int k = 0; k < quaternionRigid->GetNumberOfParameters(); ++k) { - constexpr double delta = 0.001; + constexpr double delta{ 0.001 }; TransformType::ParametersType plusParameters; TransformType::ParametersType minusParameters; @@ -583,7 +583,7 @@ itkQuaternionRigidTransformTest(int, char *[]) { // Rotate an itk::Point - constexpr TransformType::InputPointType::ValueType pInit[3] = { 10, 10, 10 }; + constexpr TransformType::InputPointType::ValueType pInit[3]{ 10, 10, 10 }; TransformType::InputPointType p = pInit; TransformType::InputPointType q; @@ -763,7 +763,7 @@ itkQuaternionRigidTransformTest(int, char *[]) // attempt to set an orthogonal matrix matrix.GetVnlMatrix().set_identity(); - constexpr double a = 1.0 / 180.0 * itk::Math::pi; + constexpr double a{ 1.0 / 180.0 * itk::Math::pi }; matrix[0][0] = std::cos(a); matrix[0][1] = -1.0 * std::sin(a); matrix[1][0] = std::sin(a); diff --git a/Modules/Core/Transform/test/itkRigid2DTransformTest.cxx b/Modules/Core/Transform/test/itkRigid2DTransformTest.cxx index c57bcdb744a..c8e6e146d13 100644 --- a/Modules/Core/Transform/test/itkRigid2DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkRigid2DTransformTest.cxx @@ -25,7 +25,7 @@ namespace bool CheckEqual(const itk::Point & p1, const itk::Point & p2) { - constexpr double epsilon = 1e-10; + constexpr double epsilon{ 1e-10 }; for (unsigned int i = 0; i < 2; ++i) { if (itk::Math::abs(p1[i] - p2[i]) > epsilon) @@ -48,8 +48,8 @@ itkRigid2DTransformTest(int, char *[]) using TransformType = itk::Rigid2DTransform; - constexpr double epsilon = 1e-10; - constexpr unsigned int N = 2; + constexpr double epsilon{ 1e-10 }; + constexpr unsigned int N{ 2 }; bool Ok = true; @@ -124,7 +124,7 @@ itkRigid2DTransformTest(int, char *[]) { // Translate an itk::Point - constexpr TransformType::InputPointType::ValueType pInit[2] = { 10, 10 }; + constexpr TransformType::InputPointType::ValueType pInit[2]{ 10, 10 }; const TransformType::InputPointType p = pInit; TransformType::InputPointType q = p + ioffset; TransformType::OutputPointType r = translation->TransformPoint(p); @@ -323,7 +323,7 @@ itkRigid2DTransformTest(int, char *[]) { // Rotate an itk::Point - constexpr TransformType::InputPointType::ValueType pInit[2] = { 10, 10 }; + constexpr TransformType::InputPointType::ValueType pInit[2]{ 10, 10 }; TransformType::InputPointType p = pInit; TransformType::InputPointType q; diff --git a/Modules/Core/Transform/test/itkRigid3DPerspectiveTransformTest.cxx b/Modules/Core/Transform/test/itkRigid3DPerspectiveTransformTest.cxx index ca650c25298..1de7c6e75ca 100644 --- a/Modules/Core/Transform/test/itkRigid3DPerspectiveTransformTest.cxx +++ b/Modules/Core/Transform/test/itkRigid3DPerspectiveTransformTest.cxx @@ -28,10 +28,10 @@ itkRigid3DPerspectiveTransformTest(int, char *[]) using TransformType = itk::Rigid3DPerspectiveTransform; - constexpr double epsilon = 1e-10; - constexpr unsigned int N = 3; + constexpr double epsilon{ 1e-10 }; + constexpr unsigned int N{ 3 }; - constexpr double focal = 100.0; + constexpr double focal{ 100.0 }; bool Ok = true; diff --git a/Modules/Core/Transform/test/itkRigid3DTransformTest.cxx b/Modules/Core/Transform/test/itkRigid3DTransformTest.cxx index 2b2924ab5cc..fc5e6cbe8c8 100644 --- a/Modules/Core/Transform/test/itkRigid3DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkRigid3DTransformTest.cxx @@ -59,7 +59,7 @@ TestSettingTranslation() itk::Matrix R; R.SetIdentity(); - constexpr double alpha = itk::Math::pi / 180.0; + constexpr double alpha{ itk::Math::pi / 180.0 }; R[0][0] = std::cos(alpha); R[0][1] = std::sin(alpha); R[1][0] = -1.0 * std::sin(alpha); @@ -126,8 +126,8 @@ itkRigid3DTransformTest(int, char *[]) using TransformType = itk::Rigid3DTransformSurrogate; using ParametersType = TransformType::ParametersType; - constexpr double epsilon = 1e-10; - constexpr unsigned int N = 3; + constexpr double epsilon{ 1e-10 }; + constexpr unsigned int N{ 3 }; bool Ok = true; @@ -181,7 +181,7 @@ itkRigid3DTransformTest(int, char *[]) { // Translate an itk::Point - constexpr TransformType::InputPointType::ValueType pInit[3] = { 10, 10, 10 }; + constexpr TransformType::InputPointType::ValueType pInit[3]{ 10, 10, 10 }; const TransformType::InputPointType p = pInit; TransformType::InputPointType q; q = p + ioffset; @@ -349,7 +349,7 @@ itkRigid3DTransformTest(int, char *[]) { // Rotate an itk::Point - constexpr TransformType::InputPointType::ValueType pInit[3] = { 10, 10, 10 }; + constexpr TransformType::InputPointType::ValueType pInit[3]{ 10, 10, 10 }; TransformType::InputPointType p = pInit; TransformType::InputPointType q; @@ -516,7 +516,7 @@ itkRigid3DTransformTest(int, char *[]) MatrixType matrix; matrix.GetVnlMatrix().set_identity(); - constexpr double a = 1.0 / 180.0 * itk::Math::pi; + constexpr double a{ 1.0 / 180.0 * itk::Math::pi }; matrix[0][0] = std::cos(a); matrix[0][1] = std::sin(a); matrix[1][0] = -1.0 * std::sin(a); @@ -663,7 +663,7 @@ itkRigid3DTransformTest(int, char *[]) // attempt to set an orthogonal matrix matrix.GetVnlMatrix().set_identity(); - constexpr double a = 1.0 / 180.0 * itk::Math::pi; + constexpr double a{ 1.0 / 180.0 * itk::Math::pi }; matrix[0][0] = std::cos(a); matrix[0][1] = std::sin(a); matrix[1][0] = -1.0 * std::sin(a); diff --git a/Modules/Core/Transform/test/itkScaleLogarithmicTransformTest.cxx b/Modules/Core/Transform/test/itkScaleLogarithmicTransformTest.cxx index 26070da8bde..b2e12289178 100644 --- a/Modules/Core/Transform/test/itkScaleLogarithmicTransformTest.cxx +++ b/Modules/Core/Transform/test/itkScaleLogarithmicTransformTest.cxx @@ -26,8 +26,8 @@ itkScaleLogarithmicTransformTest(int, char *[]) { using TransformType = itk::ScaleLogarithmicTransform; - constexpr double epsilon = 1e-10; - constexpr unsigned int N = 3; + constexpr double epsilon{ 1e-10 }; + constexpr unsigned int N{ 3 }; bool testStatus = true; @@ -95,7 +95,7 @@ itkScaleLogarithmicTransformTest(int, char *[]) { // scale an itk::Point - constexpr TransformType::InputPointType::ValueType pInit[3] = { 10, 10, 10 }; + constexpr TransformType::InputPointType::ValueType pInit[3]{ 10, 10, 10 }; TransformType::InputPointType p = pInit; TransformType::InputPointType q; for (unsigned int j = 0; j < N; ++j) diff --git a/Modules/Core/Transform/test/itkScaleSkewVersor3DTransformTest.cxx b/Modules/Core/Transform/test/itkScaleSkewVersor3DTransformTest.cxx index dc480f75eac..1ed44197d0c 100644 --- a/Modules/Core/Transform/test/itkScaleSkewVersor3DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkScaleSkewVersor3DTransformTest.cxx @@ -43,7 +43,7 @@ itkScaleSkewVersor3DTransformTest(int, char *[]) using ValueType = double; - constexpr ValueType epsilon = 1e-12; + constexpr ValueType epsilon{ 1e-12 }; // Versor Transform type using TransformType = itk::ScaleSkewVersor3DTransform; @@ -137,7 +137,7 @@ itkScaleSkewVersor3DTransformTest(int, char *[]) { // Rotate an itk::Point - constexpr TransformType::InputPointType::ValueType pInit[3] = { 1, 4, 9 }; + constexpr TransformType::InputPointType::ValueType pInit[3]{ 1, 4, 9 }; const TransformType::InputPointType p = pInit; TransformType::OutputPointType q; q = versor.Transform(p); @@ -313,7 +313,7 @@ itkScaleSkewVersor3DTransformTest(int, char *[]) ParametersType parameters2 = transform->GetParameters(); - constexpr double tolerance = 1e-8; + constexpr double tolerance{ 1e-8 }; for (unsigned int p = 0; p < np; ++p) { if (itk::Math::abs(parameters[p] - parameters2[p]) > tolerance) @@ -434,7 +434,7 @@ itkScaleSkewVersor3DTransformTest(int, char *[]) ParametersType parameters2 = transform->GetParameters(); - constexpr double tolerance = 1e-8; + constexpr double tolerance{ 1e-8 }; for (unsigned int p = 0; p < np; ++p) { if (itk::Math::abs(parameters[p] - parameters2[p]) > tolerance) @@ -476,7 +476,7 @@ itkScaleSkewVersor3DTransformTest(int, char *[]) TransformType::ScaleVectorType rscale = transform->GetScale(); - constexpr double tolerance = 1e-8; + constexpr double tolerance{ 1e-8 }; for (unsigned int j = 0; j < 3; ++j) { if (itk::Math::abs(rscale[j] - scale[j]) > tolerance) diff --git a/Modules/Core/Transform/test/itkScaleTransformTest.cxx b/Modules/Core/Transform/test/itkScaleTransformTest.cxx index 898e16a2e1f..82dc5bc2830 100644 --- a/Modules/Core/Transform/test/itkScaleTransformTest.cxx +++ b/Modules/Core/Transform/test/itkScaleTransformTest.cxx @@ -30,8 +30,8 @@ itkScaleTransformTest(int, char *[]) using TransformType = itk::ScaleTransform; - constexpr double epsilon = 1e-10; - constexpr unsigned int N = 3; + constexpr double epsilon{ 1e-10 }; + constexpr unsigned int N{ 3 }; bool Ok = true; @@ -111,7 +111,7 @@ itkScaleTransformTest(int, char *[]) { // scale an itk::Point - constexpr TransformType::InputPointType::ValueType pInit[3] = { 10, 10, 10 }; + constexpr TransformType::InputPointType::ValueType pInit[3]{ 10, 10, 10 }; TransformType::InputPointType p = pInit; TransformType::InputPointType q; for (unsigned int j = 0; j < N; ++j) diff --git a/Modules/Core/Transform/test/itkScaleVersor3DTransformTest.cxx b/Modules/Core/Transform/test/itkScaleVersor3DTransformTest.cxx index cf1a40a3706..8e2562a0f6a 100644 --- a/Modules/Core/Transform/test/itkScaleVersor3DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkScaleVersor3DTransformTest.cxx @@ -45,7 +45,7 @@ itkScaleVersor3DTransformTest(int, char *[]) { using ValueType = double; - constexpr ValueType epsilon = 1e-12; + constexpr ValueType epsilon{ 1e-12 }; using TransformType = itk::ScaleVersor3DTransform; using VersorType = TransformType::VersorType; @@ -150,7 +150,7 @@ itkScaleVersor3DTransformTest(int, char *[]) { // Rotate an itk::Point - constexpr TransformType::InputPointType::ValueType pInit[3] = { 1, 4, 9 }; + constexpr TransformType::InputPointType::ValueType pInit[3]{ 1, 4, 9 }; const TransformType::InputPointType p = pInit; TransformType::OutputPointType q; q = versor.Transform(p); @@ -324,7 +324,7 @@ itkScaleVersor3DTransformTest(int, char *[]) ParametersType parameters2 = transform->GetParameters(); - constexpr double tolerance = 1e-8; + constexpr double tolerance{ 1e-8 }; for (unsigned int p = 0; p < np; ++p) { if (itk::Math::abs(parameters[p] - parameters2[p]) > tolerance) @@ -439,7 +439,7 @@ itkScaleVersor3DTransformTest(int, char *[]) ParametersType parameters2 = transform->GetParameters(); - constexpr double tolerance = 1e-8; + constexpr double tolerance{ 1e-8 }; for (unsigned int p = 0; p < np; ++p) { if (itk::Math::abs(parameters[p] - parameters2[p]) > tolerance) @@ -481,7 +481,7 @@ itkScaleVersor3DTransformTest(int, char *[]) TransformType::ScaleVectorType rscale = transform->GetScale(); - constexpr double tolerance = 1e-8; + constexpr double tolerance{ 1e-8 }; for (unsigned int j = 0; j < 3; ++j) { if (itk::Math::abs(rscale[j] - scale[j]) > tolerance) diff --git a/Modules/Core/Transform/test/itkSimilarity2DTransformTest.cxx b/Modules/Core/Transform/test/itkSimilarity2DTransformTest.cxx index 07874805deb..1a4adfbf347 100644 --- a/Modules/Core/Transform/test/itkSimilarity2DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkSimilarity2DTransformTest.cxx @@ -26,7 +26,7 @@ namespace bool CheckEqual(const itk::Point & p1, const itk::Point & p2) { - constexpr double epsilon = 1e-10; + constexpr double epsilon{ 1e-10 }; for (unsigned int i = 0; i < 2; ++i) { @@ -49,8 +49,8 @@ itkSimilarity2DTransformTest(int, char *[]) std::cout << "==================================" << std::endl; std::cout << "Testing Similarity 2D Transform" << std::endl << std::endl; - constexpr double epsilon = 1e-10; - constexpr unsigned int N = 2; + constexpr double epsilon{ 1e-10 }; + constexpr unsigned int N{ 2 }; bool Ok = true; using SimilarityTransformType = itk::CenteredSimilarity2DTransform; @@ -86,11 +86,11 @@ itkSimilarity2DTransformTest(int, char *[]) auto transform1 = SimilarityTransformType::New(); auto transform2 = SimilarityTransformType::New(); transform1->SetIdentity(); - constexpr double angle1 = .125; + constexpr double angle1{ .125 }; transform1->SetAngle(angle1); transform2->SetMatrix(transform1->GetMatrix()); std::cout << "Testing SetAngle(" << angle1 << ")/GetAngle():"; - constexpr double epsilon2 = 1e-5; + constexpr double epsilon2{ 1e-5 }; if (itk::Math::abs(transform2->GetAngle() - angle1) > epsilon2) { std::cerr << "Error with SetAngle/GetAngle:" << std::endl; @@ -378,7 +378,7 @@ itkSimilarity2DTransformTest(int, char *[]) TransformType::JacobianType approxJacobian = jacobian; for (unsigned int k = 0; k < t1->GetNumberOfParameters(); ++k) { - constexpr double delta = 0.001; + constexpr double delta{ 0.001 }; TransformType::ParametersType plusParameters; TransformType::ParametersType minusParameters; @@ -536,7 +536,7 @@ itkSimilarity2DTransformTest(int, char *[]) TransformType::JacobianType approxJacobian = jacobian; for (unsigned int k = 0; k < t1->GetNumberOfParameters(); ++k) { - constexpr double delta = 0.001; + constexpr double delta{ 0.001 }; TransformType::ParametersType plusParameters; TransformType::ParametersType minusParameters; diff --git a/Modules/Core/Transform/test/itkSimilarity3DTransformTest.cxx b/Modules/Core/Transform/test/itkSimilarity3DTransformTest.cxx index 1d23eca1cbf..7ff8e12f098 100644 --- a/Modules/Core/Transform/test/itkSimilarity3DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkSimilarity3DTransformTest.cxx @@ -36,7 +36,7 @@ itkSimilarity3DTransformTest(int, char *[]) using ValueType = double; - constexpr ValueType epsilon = 1e-12; + constexpr ValueType epsilon{ 1e-12 }; // Versor Transform type using TransformType = itk::Similarity3DTransform; @@ -139,7 +139,7 @@ itkSimilarity3DTransformTest(int, char *[]) { // Rotate an itk::Point - constexpr TransformType::InputPointType::ValueType pInit[3] = { 1, 4, 9 }; + constexpr TransformType::InputPointType::ValueType pInit[3]{ 1, 4, 9 }; const TransformType::InputPointType p = pInit; TransformType::OutputPointType q; q = versor.Transform(p); @@ -308,7 +308,7 @@ itkSimilarity3DTransformTest(int, char *[]) ParametersType parameters2 = transform->GetParameters(); - constexpr double tolerance = 1e-8; + constexpr double tolerance{ 1e-8 }; for (unsigned int p = 0; p < np; ++p) { if (itk::Math::abs(parameters[p] - parameters2[p]) > tolerance) @@ -413,7 +413,7 @@ itkSimilarity3DTransformTest(int, char *[]) ParametersType parameters2 = transform->GetParameters(); - constexpr double tolerance = 1e-8; + constexpr double tolerance{ 1e-8 }; for (unsigned int p = 0; p < np; ++p) { if (itk::Math::abs(parameters[p] - parameters2[p]) > tolerance) @@ -449,13 +449,13 @@ itkSimilarity3DTransformTest(int, char *[]) transform->SetTranslation(translation); - constexpr double scale = 2.5; + constexpr double scale{ 2.5 }; transform->SetScale(scale); const double rscale = transform->GetScale(); - constexpr double tolerance = 1e-8; + constexpr double tolerance{ 1e-8 }; if (itk::Math::abs(rscale - scale) > tolerance) { @@ -538,8 +538,8 @@ itkSimilarity3DTransformTest(int, char *[]) // attempt to set an (orthogonal + scale) matrix matrix.GetVnlMatrix().set_identity(); - constexpr double a = 1.0 / 180.0 * itk::Math::pi; - constexpr double s = 0.5; + constexpr double a{ 1.0 / 180.0 * itk::Math::pi }; + constexpr double s{ 0.5 }; matrix[0][0] = std::cos(a) * s; matrix[0][1] = -1.0 * std::sin(a) * s; matrix[1][0] = std::sin(a) * s; diff --git a/Modules/Core/Transform/test/itkSplineKernelTransformTest.cxx b/Modules/Core/Transform/test/itkSplineKernelTransformTest.cxx index 31e1b9131c8..dd58c374949 100644 --- a/Modules/Core/Transform/test/itkSplineKernelTransformTest.cxx +++ b/Modules/Core/Transform/test/itkSplineKernelTransformTest.cxx @@ -35,10 +35,10 @@ int itkSplineKernelTransformTest(int, char *[]) { - constexpr double epsilon = 1e-12; + constexpr double epsilon{ 1e-12 }; // 2-D case - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ParametersValueType = double; using EBSTransform2DType = itk::ElasticBodySplineKernelTransform; @@ -200,7 +200,7 @@ itkSplineKernelTransformTest(int, char *[]) // NOTE: The following should set the default values explicitly { - constexpr double TestValue = 0.012345; + constexpr double TestValue{ 0.012345 }; tps2D->SetStiffness(TestValue); // This value should not change the result at all. if (itk::Math::NotExactlyEquals(tps2D->GetStiffness(), TestValue)) @@ -456,7 +456,7 @@ itkSplineKernelTransformTest(int, char *[]) tps3D->SetParameters(parameters1); TPSTransform3DType::ParametersType parameters2 = tps3D->GetParameters(); const unsigned int numberOfParameters = parameters1.Size(); - constexpr double tolerance = 1e-7; + constexpr double tolerance{ 1e-7 }; for (unsigned int pr = 0; pr < numberOfParameters; ++pr) { if (itk::Math::abs(parameters1[pr] - parameters2[pr]) > tolerance) diff --git a/Modules/Core/Transform/test/itkTransformCloneTest.cxx b/Modules/Core/Transform/test/itkTransformCloneTest.cxx index 15555dd93df..17448a69a01 100644 --- a/Modules/Core/Transform/test/itkTransformCloneTest.cxx +++ b/Modules/Core/Transform/test/itkTransformCloneTest.cxx @@ -17,7 +17,7 @@ *=========================================================================*/ #include "itkAffineTransform.h" #include "itkCompositeTransform.h" -constexpr double epsilon = 1e-10; +constexpr double epsilon{ 1e-10 }; template bool diff --git a/Modules/Core/Transform/test/itkTransformGeometryImageFilterTest.cxx b/Modules/Core/Transform/test/itkTransformGeometryImageFilterTest.cxx index 7b396efaa3e..990ef879fcb 100644 --- a/Modules/Core/Transform/test/itkTransformGeometryImageFilterTest.cxx +++ b/Modules/Core/Transform/test/itkTransformGeometryImageFilterTest.cxx @@ -40,7 +40,7 @@ template bool imagesDifferent(ImageType * baselineImage, ImageType * outputImage) { - constexpr double tol = 1.e-3; // tolerance + constexpr double tol{ 1.e-3 }; // tolerance typename ImageType::PointType origin = outputImage->GetOrigin(); typename ImageType::DirectionType direction = outputImage->GetDirection(); @@ -89,7 +89,7 @@ itkTransformGeometryImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = short; using ImageType = itk::Image; @@ -117,7 +117,7 @@ itkTransformGeometryImageFilterTest(int argc, char * argv[]) rotationAxis[1] = 0.2; rotationAxis[2] = 0.7; - constexpr double rotationAngle = .5; // Radians + constexpr double rotationAngle{ .5 }; // Radians auto transform = TransformType::New(); // Identity by default transform->SetCenter(center); diff --git a/Modules/Core/Transform/test/itkTranslationTransformTest.cxx b/Modules/Core/Transform/test/itkTranslationTransformTest.cxx index ef8e22a4ddf..e267ce104bc 100644 --- a/Modules/Core/Transform/test/itkTranslationTransformTest.cxx +++ b/Modules/Core/Transform/test/itkTranslationTransformTest.cxx @@ -40,7 +40,7 @@ PrintVector(const VectorType & v) int itkTranslationTransformTest(int, char *[]) { - constexpr int any = 0; // Any errors detected in testing? + constexpr int any{ 0 }; // Any errors detected in testing? /* FIXME: This code exercises most of the methods but doesn't actually check that the results are correct. */ diff --git a/Modules/Core/Transform/test/itkVersorRigid3DTransformTest.cxx b/Modules/Core/Transform/test/itkVersorRigid3DTransformTest.cxx index 0f73a522a77..e1a975788d7 100644 --- a/Modules/Core/Transform/test/itkVersorRigid3DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkVersorRigid3DTransformTest.cxx @@ -40,7 +40,7 @@ itkVersorRigid3DTransformTest(int, char *[]) using ValueType = double; - constexpr ValueType epsilon = 1e-12; + constexpr ValueType epsilon{ 1e-12 }; // Versor Transform type using TransformType = itk::VersorRigid3DTransform; @@ -131,7 +131,7 @@ itkVersorRigid3DTransformTest(int, char *[]) { // Rotate an itk::Point - constexpr TransformType::InputPointType::ValueType pInit[3] = { 1, 4, 9 }; + constexpr TransformType::InputPointType::ValueType pInit[3]{ 1, 4, 9 }; const TransformType::InputPointType p = pInit; TransformType::OutputPointType q; q = versor.Transform(p); @@ -301,7 +301,7 @@ itkVersorRigid3DTransformTest(int, char *[]) ParametersType parameters2 = transform->GetParameters(); - constexpr double tolerance = 1e-8; + constexpr double tolerance{ 1e-8 }; for (unsigned int p = 0; p < np; ++p) { if (itk::Math::abs(parameters[p] - parameters2[p]) > tolerance) @@ -401,7 +401,7 @@ itkVersorRigid3DTransformTest(int, char *[]) ParametersType parameters2 = transform->GetParameters(); - constexpr double tolerance = 1e-8; + constexpr double tolerance{ 1e-8 }; for (unsigned int p = 0; p < np; ++p) { if (itk::Math::abs(parameters[p] - parameters2[p]) > tolerance) @@ -457,7 +457,7 @@ itkVersorRigid3DTransformTest(int, char *[]) // attempt to set an orthogonal matrix matrix.GetVnlMatrix().set_identity(); - constexpr double a = 1.0 / 180.0 * itk::Math::pi; + constexpr double a{ 1.0 / 180.0 * itk::Math::pi }; matrix[0][0] = std::cos(a); matrix[0][1] = -1.0 * std::sin(a); matrix[1][0] = std::sin(a); diff --git a/Modules/Core/Transform/test/itkVersorTransformTest.cxx b/Modules/Core/Transform/test/itkVersorTransformTest.cxx index 0bf0b16eba1..96d2f705e2f 100644 --- a/Modules/Core/Transform/test/itkVersorTransformTest.cxx +++ b/Modules/Core/Transform/test/itkVersorTransformTest.cxx @@ -40,7 +40,7 @@ itkVersorTransformTest(int, char *[]) using ValueType = double; - constexpr ValueType epsilon = 1e-12; + constexpr ValueType epsilon{ 1e-12 }; // Versor Transform type using TransformType = itk::VersorTransform; @@ -128,7 +128,7 @@ itkVersorTransformTest(int, char *[]) { // Rotate an itk::Point - constexpr TransformType::InputPointType::ValueType pInit[3] = { 1, 4, 9 }; + constexpr TransformType::InputPointType::ValueType pInit[3]{ 1, 4, 9 }; const TransformType::InputPointType p = pInit; TransformType::OutputPointType q; q = versor.Transform(p); @@ -295,7 +295,7 @@ itkVersorTransformTest(int, char *[]) ParametersType parameters2 = transform->GetParameters(); - constexpr double tolerance = 1e-8; + constexpr double tolerance{ 1e-8 }; for (unsigned int p = 0; p < np; ++p) { if (itk::Math::abs(parameters[p] - parameters2[p]) > tolerance) @@ -393,7 +393,7 @@ itkVersorTransformTest(int, char *[]) // attempt to set an orthogonal matrix matrix.GetVnlMatrix().set_identity(); - constexpr double a = 1.0 / 180.0 * itk::Math::pi; + constexpr double a{ 1.0 / 180.0 * itk::Math::pi }; matrix[0][0] = std::cos(a); matrix[0][1] = -1.0 * std::sin(a); matrix[1][0] = std::sin(a); @@ -466,7 +466,7 @@ itkVersorTransformTest(int, char *[]) t->SetCenter(center); t->SetParameters(q); - constexpr double expectedOffset[] = { 0.0, 12.0, 4.0 }; + constexpr double expectedOffset[]{ 0.0, 12.0, 4.0 }; TransformType::OffsetType offset = t->GetOffset(); for (unsigned int k = 0; k < 3; ++k) diff --git a/Modules/Filtering/AnisotropicSmoothing/test/itkCurvatureAnisotropicDiffusionImageFilterTest.cxx b/Modules/Filtering/AnisotropicSmoothing/test/itkCurvatureAnisotropicDiffusionImageFilterTest.cxx index 5b1a45d5a31..3b198d4fa16 100644 --- a/Modules/Filtering/AnisotropicSmoothing/test/itkCurvatureAnisotropicDiffusionImageFilterTest.cxx +++ b/Modules/Filtering/AnisotropicSmoothing/test/itkCurvatureAnisotropicDiffusionImageFilterTest.cxx @@ -25,7 +25,7 @@ int itkCurvatureAnisotropicDiffusionImageFilterTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using ImageType = itk::Image; @@ -41,7 +41,7 @@ itkCurvatureAnisotropicDiffusionImageFilterTest(int itkNotUsed(argc), char * itk const itk::SimpleFilterWatcher watcher(filter); - constexpr itk::IdentifierType numberOfIterations = 1; + constexpr itk::IdentifierType numberOfIterations{ 1 }; filter->SetNumberOfIterations(numberOfIterations); ITK_TEST_SET_GET_VALUE(numberOfIterations, filter->GetNumberOfIterations()); @@ -49,7 +49,7 @@ itkCurvatureAnisotropicDiffusionImageFilterTest(int itkNotUsed(argc), char * itk filter->SetConductanceParameter(conductanceParameter); ITK_TEST_SET_GET_VALUE(conductanceParameter, filter->GetConductanceParameter()); - constexpr FilterType::TimeStepType timeStep = 0.125; + constexpr FilterType::TimeStepType timeStep{ 0.125 }; filter->SetTimeStep(timeStep); ITK_TEST_SET_GET_VALUE(timeStep, filter->GetTimeStep()); diff --git a/Modules/Filtering/AnisotropicSmoothing/test/itkGradientAnisotropicDiffusionImageFilterTest.cxx b/Modules/Filtering/AnisotropicSmoothing/test/itkGradientAnisotropicDiffusionImageFilterTest.cxx index 78c8e16c70f..46cefbce600 100644 --- a/Modules/Filtering/AnisotropicSmoothing/test/itkGradientAnisotropicDiffusionImageFilterTest.cxx +++ b/Modules/Filtering/AnisotropicSmoothing/test/itkGradientAnisotropicDiffusionImageFilterTest.cxx @@ -24,7 +24,7 @@ int itkGradientAnisotropicDiffusionImageFilterTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using ImageType = itk::Image; @@ -37,11 +37,11 @@ itkGradientAnisotropicDiffusionImageFilterTest(int itkNotUsed(argc), char * itkN ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, GradientAnisotropicDiffusionImageFilter, AnisotropicDiffusionImageFilter); - constexpr itk::IdentifierType numberOfIterations = 1; + constexpr itk::IdentifierType numberOfIterations{ 1 }; filter->SetNumberOfIterations(numberOfIterations); ITK_TEST_SET_GET_VALUE(numberOfIterations, filter->GetNumberOfIterations()); - constexpr FilterType::TimeStepType timeStep = 0.125; + constexpr FilterType::TimeStepType timeStep{ 0.125 }; filter->SetTimeStep(timeStep); ITK_TEST_SET_GET_VALUE(timeStep, filter->GetTimeStep()); @@ -49,7 +49,7 @@ itkGradientAnisotropicDiffusionImageFilterTest(int itkNotUsed(argc), char * itkN filter->SetConductanceParameter(conductanceParameter); ITK_TEST_SET_GET_VALUE(conductanceParameter, filter->GetConductanceParameter()); - constexpr unsigned int conductanceScalingUpdateInterval = 1; + constexpr unsigned int conductanceScalingUpdateInterval{ 1 }; filter->SetConductanceScalingUpdateInterval(conductanceScalingUpdateInterval); ITK_TEST_SET_GET_VALUE(conductanceScalingUpdateInterval, filter->GetConductanceScalingUpdateInterval()); diff --git a/Modules/Filtering/AnisotropicSmoothing/test/itkGradientAnisotropicDiffusionImageFilterTest2.cxx b/Modules/Filtering/AnisotropicSmoothing/test/itkGradientAnisotropicDiffusionImageFilterTest2.cxx index 92350560a6d..0d2137c12c0 100644 --- a/Modules/Filtering/AnisotropicSmoothing/test/itkGradientAnisotropicDiffusionImageFilterTest2.cxx +++ b/Modules/Filtering/AnisotropicSmoothing/test/itkGradientAnisotropicDiffusionImageFilterTest2.cxx @@ -38,9 +38,9 @@ namespace bool SameImage(ImagePointer testImage, ImagePointer baselineImage) { - constexpr PixelType intensityTolerance = .001; - constexpr int radiusTolerance = 0; - constexpr unsigned long numberOfPixelTolerance = 0; + constexpr PixelType intensityTolerance{ .001 }; + constexpr int radiusTolerance{ 0 }; + constexpr unsigned long numberOfPixelTolerance{ 0 }; using DiffType = itk::Testing::ComparisonImageFilter; auto diff = DiffType::New(); diff --git a/Modules/Filtering/AnisotropicSmoothing/test/itkMinMaxCurvatureFlowImageFilterTest.cxx b/Modules/Filtering/AnisotropicSmoothing/test/itkMinMaxCurvatureFlowImageFilterTest.cxx index a1c34ee08e6..4a44567531d 100644 --- a/Modules/Filtering/AnisotropicSmoothing/test/itkMinMaxCurvatureFlowImageFilterTest.cxx +++ b/Modules/Filtering/AnisotropicSmoothing/test/itkMinMaxCurvatureFlowImageFilterTest.cxx @@ -38,7 +38,7 @@ class ShowProgressObject }; } // namespace -constexpr unsigned int MAXRUNS = 5; // maximum number of runs +constexpr unsigned int MAXRUNS{ 5 }; // maximum number of runs template int @@ -141,9 +141,9 @@ testMinMaxCurvatureFlow(itk::Size & size, // ND image s * and background of 255 with added salt and pepper noise. */ const double sqrRadius = itk::Math::sqr(radius); // radius of the circle/sphere - constexpr double fractionNoise = 0.30; // salt & pepper noise fraction - constexpr PixelType foreground = 0.0; // intensity value of the foreground - constexpr PixelType background = 255.0; // intensity value of the background + constexpr double fractionNoise{ 0.30 }; // salt & pepper noise fraction + constexpr PixelType foreground{ 0.0 }; // intensity value of the foreground + constexpr PixelType background{ 255.0 }; // intensity value of the background std::cout << "Create an image of circle/sphere with noise" << std::endl; auto circleImage = ImageType::New(); diff --git a/Modules/Filtering/AntiAlias/test/itkAntiAliasBinaryImageFilterTest.cxx b/Modules/Filtering/AntiAlias/test/itkAntiAliasBinaryImageFilterTest.cxx index db63764f3f0..1b96e2490c4 100644 --- a/Modules/Filtering/AntiAlias/test/itkAntiAliasBinaryImageFilterTest.cxx +++ b/Modules/Filtering/AntiAlias/test/itkAntiAliasBinaryImageFilterTest.cxx @@ -33,9 +33,9 @@ namespace AntiAliasBinaryImageFilterTestNamespace { -constexpr int V_WIDTH = 64; -constexpr int V_HEIGHT = 64; -constexpr int V_DEPTH = 64; +constexpr int V_WIDTH{ 64 }; +constexpr int V_HEIGHT{ 64 }; +constexpr int V_DEPTH{ 64 }; float sphere(float x, float y, float z) diff --git a/Modules/Filtering/BiasCorrection/test/itkMRIBiasFieldCorrectionFilterTest.cxx b/Modules/Filtering/BiasCorrection/test/itkMRIBiasFieldCorrectionFilterTest.cxx index 8381e7200b5..c77b0a4e881 100644 --- a/Modules/Filtering/BiasCorrection/test/itkMRIBiasFieldCorrectionFilterTest.cxx +++ b/Modules/Filtering/BiasCorrection/test/itkMRIBiasFieldCorrectionFilterTest.cxx @@ -28,7 +28,7 @@ int itkMRIBiasFieldCorrectionFilterTest(int, char *[]) { - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using InputImagePixelType = float; @@ -46,9 +46,9 @@ itkMRIBiasFieldCorrectionFilterTest(int, char *[]) auto imageWithBias = ImageType::New(); imageWithBias->SetBufferedRegion(imageRegion); imageWithBias->SetLargestPossibleRegion(imageRegion); - constexpr float spacing[ImageDimension] = { 1.0, 1.0, 1.0 }; + constexpr float spacing[ImageDimension]{ 1.0, 1.0, 1.0 }; imageWithBias->SetSpacing(spacing); - constexpr float origin[ImageDimension] = { 0, 0, 0 }; + constexpr float origin[ImageDimension]{ 0, 0, 0 }; imageWithBias->SetOrigin(origin); imageWithBias->Allocate(); @@ -114,7 +114,7 @@ itkMRIBiasFieldCorrectionFilterTest(int, char *[]) // creates a bias field using BiasFieldType = itk::MultivariateLegendrePolynomial; BiasFieldType::DomainSizeType biasSize(3); - constexpr int biasDegree = 3; + constexpr int biasDegree{ 3 }; biasSize[0] = imageSize[0]; biasSize[1] = imageSize[1]; biasSize[2] = imageSize[2]; @@ -178,18 +178,18 @@ itkMRIBiasFieldCorrectionFilterTest(int, char *[]) filter->SetInput(imageWithBias); - constexpr int slicingDirection = 2; - constexpr bool isBiasFieldMultiplicative = true; + constexpr int slicingDirection{ 2 }; + constexpr bool isBiasFieldMultiplicative{ true }; bool usingSlabIdentification = true; - constexpr bool usingBiasFieldCorrection = true; - constexpr bool generatingOutput = true; - constexpr unsigned int slabNumberOfSamples = 10; - constexpr InputImagePixelType slabBackgroundMinimumThreshold = 0; - constexpr double slabTolerance = 0.0; + constexpr bool usingBiasFieldCorrection{ true }; + constexpr bool generatingOutput{ true }; + constexpr unsigned int slabNumberOfSamples{ 10 }; + constexpr InputImagePixelType slabBackgroundMinimumThreshold{ 0 }; + constexpr double slabTolerance{ 0.0 }; int volumeCorrectionMaximumIteration = 200; int interSliceCorrectionMaximumIteration = 100; double optimizerInitialRadius = 0.02; - constexpr double optimizerGrowthFactor = 1.01; + constexpr double optimizerGrowthFactor{ 1.01 }; const double optimizerShrinkFactor = std::pow(optimizerGrowthFactor, -0.25); bool usingInterSliceIntensityCorrection = true; diff --git a/Modules/Filtering/BiasCorrection/test/itkN4BiasFieldCorrectionImageFilterTest.cxx b/Modules/Filtering/BiasCorrection/test/itkN4BiasFieldCorrectionImageFilterTest.cxx index 434b73ab127..6cc0cedadee 100644 --- a/Modules/Filtering/BiasCorrection/test/itkN4BiasFieldCorrectionImageFilterTest.cxx +++ b/Modules/Filtering/BiasCorrection/test/itkN4BiasFieldCorrectionImageFilterTest.cxx @@ -169,7 +169,7 @@ N4(int argc, char * argv[]) using CorrecterType = itk::N4BiasFieldCorrectionImageFilter; auto correcter = CorrecterType::New(); - constexpr unsigned int splineOrder = 3; + constexpr unsigned int splineOrder{ 3 }; correcter->SetSplineOrder(splineOrder); ITK_TEST_SET_GET_VALUE(splineOrder, correcter->GetSplineOrder()); @@ -183,7 +183,7 @@ N4(int argc, char * argv[]) correcter->SetConvergenceThreshold(convergenceThreshold); ITK_TEST_SET_GET_VALUE(convergenceThreshold, correcter->GetConvergenceThreshold()); - constexpr unsigned int numberOfHistogramBins = 200; + constexpr unsigned int numberOfHistogramBins{ 200 }; correcter->SetNumberOfHistogramBins(numberOfHistogramBins); ITK_TEST_SET_GET_VALUE(numberOfHistogramBins, correcter->GetNumberOfHistogramBins()); @@ -196,7 +196,7 @@ N4(int argc, char * argv[]) correcter->SetMaskLabel(maskLabel); ITK_TEST_SET_GET_VALUE(maskLabel, correcter->GetMaskLabel()); - constexpr bool useMaskLabel = false; + constexpr bool useMaskLabel{ false }; ITK_TEST_SET_GET_BOOLEAN(correcter, UseMaskLabel, useMaskLabel); // Handle the number of iterations @@ -338,7 +338,7 @@ itkN4BiasFieldCorrectionImageFilterTest(int argc, char * argv[]) // Exercise the object's basic methods outside the templated test helper to // avoid the Superclass name not being found. - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using RealType = float; using MaskPixelType = unsigned char; diff --git a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryDilateImageFilter.hxx b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryDilateImageFilter.hxx index bf1be3deb76..5786bf95a41 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryDilateImageFilter.hxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryDilateImageFilter.hxx @@ -124,10 +124,10 @@ BinaryDilateImageFilter::GenerateData() // one means pixel on but not treated // two means border pixel // three means inner pixel - constexpr unsigned char backgroundTag = 0; - constexpr unsigned char onTag = 1; - constexpr unsigned char borderTag = 2; - constexpr unsigned char innerTag = 3; + constexpr unsigned char backgroundTag{ 0 }; + constexpr unsigned char onTag{ 1 }; + constexpr unsigned char borderTag{ 2 }; + constexpr unsigned char innerTag{ 3 }; if (this->m_BoundaryToForeground) { diff --git a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryErodeImageFilter.hxx b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryErodeImageFilter.hxx index f8bf236db45..d85924e2719 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryErodeImageFilter.hxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryErodeImageFilter.hxx @@ -114,10 +114,10 @@ BinaryErodeImageFilter::GenerateData() // one means pixel on but not treated // two means border pixel // three means inner pixel - constexpr unsigned char backgroundTag = 0; - constexpr unsigned char onTag = 1; - constexpr unsigned char borderTag = 2; - constexpr unsigned char innerTag = 3; + constexpr unsigned char backgroundTag{ 0 }; + constexpr unsigned char onTag{ 1 }; + constexpr unsigned char borderTag{ 2 }; + constexpr unsigned char innerTag{ 3 }; if (!this->m_BoundaryToForeground) { diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryClosingByReconstructionImageFilterTest.cxx b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryClosingByReconstructionImageFilterTest.cxx index fa3189c9a13..aa50dc4cc16 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryClosingByReconstructionImageFilterTest.cxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryClosingByReconstructionImageFilterTest.cxx @@ -36,7 +36,7 @@ itkBinaryClosingByReconstructionImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryDilateImageFilterTest.cxx b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryDilateImageFilterTest.cxx index d4599537da5..d61f8b05c2b 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryDilateImageFilterTest.cxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryDilateImageFilterTest.cxx @@ -26,11 +26,11 @@ itkBinaryDilateImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 2; + constexpr unsigned int myDimension{ 2 }; // Define the values of the input images - constexpr unsigned short fgValue = 1; - constexpr unsigned short bgValue = 0; + constexpr unsigned short fgValue{ 1 }; + constexpr unsigned short bgValue{ 0 }; // Declare the types of the images using myImageType = itk::Image; diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryDilateImageFilterTest3.cxx b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryDilateImageFilterTest3.cxx index 7834b3ae020..4f2995c7c48 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryDilateImageFilterTest3.cxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryDilateImageFilterTest3.cxx @@ -33,7 +33,7 @@ itkBinaryDilateImageFilterTest3(int argc, char * argv[]) std::cerr << " InputImage OutputImage Foreground Background BoundaryToForeground Radius" << std::endl; return EXIT_FAILURE; } - constexpr int dim = 2; + constexpr int dim{ 2 }; using PType = unsigned char; using IType = itk::Image; diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryErodeImageFilterTest.cxx b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryErodeImageFilterTest.cxx index 24ae1be785d..745a6a34444 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryErodeImageFilterTest.cxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryErodeImageFilterTest.cxx @@ -26,11 +26,11 @@ itkBinaryErodeImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 2; + constexpr unsigned int myDimension{ 2 }; // Define the values of the input images - constexpr unsigned short fgValue = 1; - constexpr unsigned short bgValue = 0; + constexpr unsigned short fgValue{ 1 }; + constexpr unsigned short bgValue{ 0 }; // Declare the types of the images using myImageType = itk::Image; diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryErodeImageFilterTest3.cxx b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryErodeImageFilterTest3.cxx index bf0dcd21948..80a64803f21 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryErodeImageFilterTest3.cxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryErodeImageFilterTest3.cxx @@ -33,7 +33,7 @@ itkBinaryErodeImageFilterTest3(int argc, char * argv[]) std::cerr << " InputImage OutputImage Foreground Background BoundaryToForeground Radius" << std::endl; return EXIT_FAILURE; } - constexpr int dim = 2; + constexpr int dim{ 2 }; using PType = unsigned char; using IType = itk::Image; diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryMorphologicalClosingImageFilterTest.cxx b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryMorphologicalClosingImageFilterTest.cxx index 4b190efaa23..b5716054bef 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryMorphologicalClosingImageFilterTest.cxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryMorphologicalClosingImageFilterTest.cxx @@ -34,7 +34,7 @@ itkBinaryMorphologicalClosingImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 2; + constexpr int dim{ 2 }; // Verify that the input and output pixel types can be different using InputPixelType = unsigned short; diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryMorphologicalOpeningImageFilterTest.cxx b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryMorphologicalOpeningImageFilterTest.cxx index 1039990eb48..65f71c0af9b 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryMorphologicalOpeningImageFilterTest.cxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryMorphologicalOpeningImageFilterTest.cxx @@ -34,7 +34,7 @@ itkBinaryMorphologicalOpeningImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 2; + constexpr int dim{ 2 }; // Verify that the input and output pixel types can be different using InputPixelType = unsigned short; diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryOpeningByReconstructionImageFilterTest.cxx b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryOpeningByReconstructionImageFilterTest.cxx index 294cf34d9f2..16cb2d3c7d8 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryOpeningByReconstructionImageFilterTest.cxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryOpeningByReconstructionImageFilterTest.cxx @@ -36,7 +36,7 @@ itkBinaryOpeningByReconstructionImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 2; + constexpr int dim{ 2 }; using PixelType = unsigned char; using IType = itk::Image; diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/itkErodeObjectMorphologyImageFilterTest.cxx b/Modules/Filtering/BinaryMathematicalMorphology/test/itkErodeObjectMorphologyImageFilterTest.cxx index 1e3756dab09..69e54ac3719 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/test/itkErodeObjectMorphologyImageFilterTest.cxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/test/itkErodeObjectMorphologyImageFilterTest.cxx @@ -26,12 +26,12 @@ itkErodeObjectMorphologyImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 2; + constexpr unsigned int myDimension{ 2 }; // Define the values of the input images - constexpr unsigned short fgValue = 25; - constexpr unsigned short bgValue = 0; - constexpr unsigned short randomValue = 10; + constexpr unsigned short fgValue{ 25 }; + constexpr unsigned short bgValue{ 0 }; + constexpr unsigned short randomValue{ 10 }; // Declare the types of the images using myImageType = itk::Image; @@ -143,7 +143,7 @@ itkErodeObjectMorphologyImageFilterTest(int, char *[]) filter->SetErodeValue(fgValue); ITK_TEST_SET_GET_VALUE(fgValue, filter->GetErodeValue()); - constexpr unsigned short backgroundValue = 5; + constexpr unsigned short backgroundValue{ 5 }; filter->SetBackgroundValue(backgroundValue); ITK_TEST_SET_GET_VALUE(backgroundValue, filter->GetBackgroundValue()); diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/itkFastIncrementalBinaryDilateImageFilterTest.cxx b/Modules/Filtering/BinaryMathematicalMorphology/test/itkFastIncrementalBinaryDilateImageFilterTest.cxx index b7807a66a85..ab608efcc6e 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/test/itkFastIncrementalBinaryDilateImageFilterTest.cxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/test/itkFastIncrementalBinaryDilateImageFilterTest.cxx @@ -26,11 +26,11 @@ itkFastIncrementalBinaryDilateImageFilterTest(int, char *[]) unsigned int i = 0; // Define the dimension of the images - constexpr unsigned int myDimension = 2; + constexpr unsigned int myDimension{ 2 }; // Define the values of the input images - constexpr unsigned short fgValue = 1; - constexpr unsigned short bgValue = 0; + constexpr unsigned short fgValue{ 1 }; + constexpr unsigned short bgValue{ 0 }; // Declare the types of the images using myImageType = itk::Image; diff --git a/Modules/Filtering/Colormap/include/itkAutumnColormapFunction.hxx b/Modules/Filtering/Colormap/include/itkAutumnColormapFunction.hxx index 45634ff14a3..eb9efbd7f0d 100644 --- a/Modules/Filtering/Colormap/include/itkAutumnColormapFunction.hxx +++ b/Modules/Filtering/Colormap/include/itkAutumnColormapFunction.hxx @@ -28,11 +28,11 @@ AutumnColormapFunction::operator()(const TScalar & v) const const RealType value = this->RescaleInputValue(v); // Apply the color mapping. - constexpr RealType red = 1.0; + constexpr RealType red{ 1.0 }; const RealType green = value; - constexpr RealType blue = 0.0; + constexpr RealType blue{ 0.0 }; // Set the rgb components after rescaling the values. RGBPixelType pixel; diff --git a/Modules/Filtering/Colormap/include/itkCoolColormapFunction.hxx b/Modules/Filtering/Colormap/include/itkCoolColormapFunction.hxx index 70c1b084bb4..c4599d67f45 100644 --- a/Modules/Filtering/Colormap/include/itkCoolColormapFunction.hxx +++ b/Modules/Filtering/Colormap/include/itkCoolColormapFunction.hxx @@ -32,7 +32,7 @@ CoolColormapFunction::operator()(const TScalar & v) const -> const RealType green = 1.0 - value; - constexpr RealType blue = 1.0; + constexpr RealType blue{ 1.0 }; // Set the rgb components after rescaling the values. RGBPixelType pixel; diff --git a/Modules/Filtering/Colormap/include/itkSpringColormapFunction.hxx b/Modules/Filtering/Colormap/include/itkSpringColormapFunction.hxx index d023bb0614c..e04ca545be6 100644 --- a/Modules/Filtering/Colormap/include/itkSpringColormapFunction.hxx +++ b/Modules/Filtering/Colormap/include/itkSpringColormapFunction.hxx @@ -28,7 +28,7 @@ SpringColormapFunction::operator()(const TScalar & v) const const RealType value = this->RescaleInputValue(v); // Apply the color mapping. - constexpr RealType red = 1.0; + constexpr RealType red{ 1.0 }; const RealType green = value; diff --git a/Modules/Filtering/Colormap/include/itkSummerColormapFunction.hxx b/Modules/Filtering/Colormap/include/itkSummerColormapFunction.hxx index 22440ebecec..c1723aeaeac 100644 --- a/Modules/Filtering/Colormap/include/itkSummerColormapFunction.hxx +++ b/Modules/Filtering/Colormap/include/itkSummerColormapFunction.hxx @@ -32,7 +32,7 @@ SummerColormapFunction::operator()(const TScalar & v) const const RealType green = 0.5 * value + 0.5; - constexpr RealType blue = 0.4; + constexpr RealType blue{ 0.4 }; // Set the rgb components after rescaling the values. RGBPixelType pixel; diff --git a/Modules/Filtering/Colormap/include/itkWinterColormapFunction.hxx b/Modules/Filtering/Colormap/include/itkWinterColormapFunction.hxx index 61487b6df72..8e310f18c8b 100644 --- a/Modules/Filtering/Colormap/include/itkWinterColormapFunction.hxx +++ b/Modules/Filtering/Colormap/include/itkWinterColormapFunction.hxx @@ -28,7 +28,7 @@ WinterColormapFunction::operator()(const TScalar & v) const const RealType value = this->RescaleInputValue(v); // Apply the color map. - constexpr RealType red = 0.0; + constexpr RealType red{ 0.0 }; const RealType green = value; diff --git a/Modules/Filtering/Colormap/test/itkScalarToRGBColormapImageFilterTest.cxx b/Modules/Filtering/Colormap/test/itkScalarToRGBColormapImageFilterTest.cxx index db9879c48e9..323a39e4106 100644 --- a/Modules/Filtering/Colormap/test/itkScalarToRGBColormapImageFilterTest.cxx +++ b/Modules/Filtering/Colormap/test/itkScalarToRGBColormapImageFilterTest.cxx @@ -39,7 +39,7 @@ itkScalarToRGBColormapImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned int; using RGBPixelType = itk::RGBPixel; diff --git a/Modules/Filtering/Convolution/test/itkConvolutionImageFilterDeltaFunctionTest.cxx b/Modules/Filtering/Convolution/test/itkConvolutionImageFilterDeltaFunctionTest.cxx index 70e55a7f4a1..169ed5d2185 100644 --- a/Modules/Filtering/Convolution/test/itkConvolutionImageFilterDeltaFunctionTest.cxx +++ b/Modules/Filtering/Convolution/test/itkConvolutionImageFilterDeltaFunctionTest.cxx @@ -30,7 +30,7 @@ itkConvolutionImageFilterDeltaFunctionTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/Convolution/test/itkConvolutionImageFilterStreamingTest.cxx b/Modules/Filtering/Convolution/test/itkConvolutionImageFilterStreamingTest.cxx index 32fca31707f..e83efa091cf 100644 --- a/Modules/Filtering/Convolution/test/itkConvolutionImageFilterStreamingTest.cxx +++ b/Modules/Filtering/Convolution/test/itkConvolutionImageFilterStreamingTest.cxx @@ -34,7 +34,7 @@ GenerateKernelForStreamingTest() using SourceType = itk::GaussianImageSource; using KernelSizeType = typename SourceType::SizeType; auto source = SourceType::New(); - constexpr KernelSizeType kernelSize{ { 3, 5 } }; + constexpr KernelSizeType kernelSize{ 3, 5 }; source->SetSize(kernelSize); source->SetMean(2); source->SetSigma(3.0); @@ -48,7 +48,7 @@ template int doConvolutionImageFilterStreamingTest(int argc, char * argv[]) { - constexpr int ImageDimension = 2; + constexpr int ImageDimension{ 2 }; using PixelType = float; using ImageType = itk::Image; @@ -98,7 +98,7 @@ doConvolutionImageFilterStreamingTest(int argc, char * argv[]) using StreamingFilterType = itk::StreamingImageFilter; auto streamer = StreamingFilterType::New(); streamer->SetInput(outputMonitor->GetOutput()); - constexpr unsigned int numStreamDivisions = 10; + constexpr unsigned int numStreamDivisions{ 10 }; streamer->SetNumberOfStreamDivisions(numStreamDivisions); streamer->GetOutput()->SetRequestedRegion(requestedRegion); ITK_TRY_EXPECT_NO_EXCEPTION(streamer->Update()); @@ -106,7 +106,7 @@ doConvolutionImageFilterStreamingTest(int argc, char * argv[]) // Verify the pipeline executed as expected // Expect requested region propagates twice due to ConvolutionImageFilter having // two inputs (Primary and KernelImage) - constexpr unsigned int requestsPerStream = 2; + constexpr unsigned int requestsPerStream{ 2 }; // Verify ConvolutionImageFilter upstream requests ITK_TEST_EXPECT_EQUAL(inputMonitor->GetOutputRequestedRegions().size(), requestsPerStream * numStreamDivisions); ITK_TEST_EXPECT_EQUAL(inputMonitor->GetNumberOfUpdates(), numStreamDivisions); @@ -150,7 +150,7 @@ itkConvolutionImageFilterStreamingTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int ImageDimension = 2; + constexpr int ImageDimension{ 2 }; using PixelType = float; using ImageType = itk::Image; diff --git a/Modules/Filtering/Convolution/test/itkConvolutionImageFilterSubregionTest.cxx b/Modules/Filtering/Convolution/test/itkConvolutionImageFilterSubregionTest.cxx index 80831e399e9..454632d7c63 100644 --- a/Modules/Filtering/Convolution/test/itkConvolutionImageFilterSubregionTest.cxx +++ b/Modules/Filtering/Convolution/test/itkConvolutionImageFilterSubregionTest.cxx @@ -32,7 +32,7 @@ GenerateGaussianKernelForSubregionTest() using SourceType = itk::GaussianImageSource; using KernelSizeType = typename SourceType::SizeType; auto source = SourceType::New(); - constexpr KernelSizeType kernelSize{ { 3, 5 } }; + constexpr KernelSizeType kernelSize{ 3, 5 }; source->SetSize(kernelSize); source->SetMean(2); source->SetSigma(3.0); @@ -47,7 +47,7 @@ template int doConvolutionImageFilterSubregionTest(int argc, char * argv[]) { - constexpr int ImageDimension = 2; + constexpr int ImageDimension{ 2 }; using PixelType = float; using ImageType = itk::Image; @@ -139,7 +139,7 @@ itkConvolutionImageFilterSubregionTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int ImageDimension = 2; + constexpr int ImageDimension{ 2 }; using PixelType = float; using ImageType = itk::Image; diff --git a/Modules/Filtering/Convolution/test/itkConvolutionImageFilterTest.cxx b/Modules/Filtering/Convolution/test/itkConvolutionImageFilterTest.cxx index a9c994a2284..02593b376d2 100644 --- a/Modules/Filtering/Convolution/test/itkConvolutionImageFilterTest.cxx +++ b/Modules/Filtering/Convolution/test/itkConvolutionImageFilterTest.cxx @@ -34,7 +34,7 @@ itkConvolutionImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int ImageDimension = 2; + constexpr int ImageDimension{ 2 }; using PixelType = float; using ImageType = itk::Image; diff --git a/Modules/Filtering/Convolution/test/itkConvolutionImageFilterTestInt.cxx b/Modules/Filtering/Convolution/test/itkConvolutionImageFilterTestInt.cxx index c04fa7db791..585927b6593 100644 --- a/Modules/Filtering/Convolution/test/itkConvolutionImageFilterTestInt.cxx +++ b/Modules/Filtering/Convolution/test/itkConvolutionImageFilterTestInt.cxx @@ -36,7 +36,7 @@ itkConvolutionImageFilterTestInt(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int ImageDimension = 2; + constexpr int ImageDimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; @@ -86,7 +86,7 @@ itkConvolutionImageFilterTestInt(int argc, char * argv[]) auto monitor = MonitorFilter::New(); monitor->SetInput(convolver->GetOutput()); - constexpr unsigned int numberOfStreamDivisions = 4; + constexpr unsigned int numberOfStreamDivisions{ 4 }; const itk::StreamingImageFilter::Pointer streamingFilter = itk::StreamingImageFilter::New(); streamingFilter->SetNumberOfStreamDivisions(numberOfStreamDivisions); diff --git a/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterDeltaFunctionTest.cxx b/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterDeltaFunctionTest.cxx index 0bbb76933f3..6d1d8c4466c 100644 --- a/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterDeltaFunctionTest.cxx +++ b/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterDeltaFunctionTest.cxx @@ -40,7 +40,7 @@ itkFFTConvolutionImageFilterDeltaFunctionTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterTest.cxx b/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterTest.cxx index 0eb0e2d6832..c5dcb71f299 100644 --- a/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterTest.cxx +++ b/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterTest.cxx @@ -50,7 +50,7 @@ itkFFTConvolutionImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int ImageDimension = 2; + constexpr int ImageDimension{ 2 }; using PixelType = float; using ImageType = itk::Image; @@ -90,7 +90,7 @@ itkFFTConvolutionImageFilterTest(int argc, char * argv[]) using ChangeInformationFilterType = itk::ChangeInformationImageFilter; auto inputChanger = ChangeInformationFilterType::New(); inputChanger->ChangeRegionOn(); - constexpr ImageType::OffsetType inputOffset = { { -2, 3 } }; + constexpr ImageType::OffsetType inputOffset{ -2, 3 }; inputChanger->SetOutputOffset(inputOffset); inputChanger->SetInput(reader1->GetOutput()); @@ -99,7 +99,7 @@ itkFFTConvolutionImageFilterTest(int argc, char * argv[]) // Test generality of filter by changing the kernel index auto kernelChanger = ChangeInformationFilterType::New(); kernelChanger->ChangeRegionOn(); - constexpr ImageType::OffsetType kernelOffset = { { 3, -5 } }; + constexpr ImageType::OffsetType kernelOffset{ 3, -5 }; kernelChanger->SetOutputOffset(kernelOffset); kernelChanger->SetInput(reader2->GetOutput()); diff --git a/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterTestInt.cxx b/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterTestInt.cxx index e6b79823210..ce3b1126d7e 100644 --- a/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterTestInt.cxx +++ b/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterTestInt.cxx @@ -42,7 +42,7 @@ itkFFTConvolutionImageFilterTestInt(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int ImageDimension = 2; + constexpr int ImageDimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; @@ -66,7 +66,7 @@ itkFFTConvolutionImageFilterTestInt(int argc, char * argv[]) convolver->SetInput(reader1->GetOutput()); convolver->SetKernelImage(reader2->GetOutput()); - constexpr ConvolutionFilterType::SizeValueType sizeGreatestPrimeFactor = 2; + constexpr ConvolutionFilterType::SizeValueType sizeGreatestPrimeFactor{ 2 }; convolver->SetSizeGreatestPrimeFactor(sizeGreatestPrimeFactor); ITK_TEST_SET_GET_VALUE(sizeGreatestPrimeFactor, convolver->GetSizeGreatestPrimeFactor()); diff --git a/Modules/Filtering/Convolution/test/itkFFTNormalizedCorrelationImageFilterTest.cxx b/Modules/Filtering/Convolution/test/itkFFTNormalizedCorrelationImageFilterTest.cxx index bf59e4be804..db89b1b3307 100644 --- a/Modules/Filtering/Convolution/test/itkFFTNormalizedCorrelationImageFilterTest.cxx +++ b/Modules/Filtering/Convolution/test/itkFFTNormalizedCorrelationImageFilterTest.cxx @@ -56,7 +56,7 @@ itkFFTNormalizedCorrelationImageFilterTest(int argc, char * argv[]) char * fixedImageFileName = argv[1]; char * movingImageFileName = argv[2]; const char * outputImageFileName = argv[3]; - constexpr FilterType::SizeValueType requiredNumberOfOverlappingPixels = 0; + constexpr FilterType::SizeValueType requiredNumberOfOverlappingPixels{ 0 }; FilterType::RealPixelType requiredFractionOfOverlappingPixels = 0; if (argc > 4) { diff --git a/Modules/Filtering/Convolution/test/itkMaskedFFTNormalizedCorrelationImageFilterTest.cxx b/Modules/Filtering/Convolution/test/itkMaskedFFTNormalizedCorrelationImageFilterTest.cxx index 90990a34081..5a38238abad 100644 --- a/Modules/Filtering/Convolution/test/itkMaskedFFTNormalizedCorrelationImageFilterTest.cxx +++ b/Modules/Filtering/Convolution/test/itkMaskedFFTNormalizedCorrelationImageFilterTest.cxx @@ -50,7 +50,7 @@ itkMaskedFFTNormalizedCorrelationImageFilterTest(int argc, char * argv[]) char * fixedImageFileName = argv[1]; char * movingImageFileName = argv[2]; const char * outputImageFileName = argv[3]; - constexpr FilterType::SizeValueType requiredNumberOfOverlappingPixels = 0; + constexpr FilterType::SizeValueType requiredNumberOfOverlappingPixels{ 0 }; FilterType::RealPixelType requiredFractionOfOverlappingPixels = 0; if (argc > 4) { diff --git a/Modules/Filtering/Convolution/test/itkNormalizedCorrelationImageFilterTest.cxx b/Modules/Filtering/Convolution/test/itkNormalizedCorrelationImageFilterTest.cxx index 59d135181a0..594f6e6234e 100644 --- a/Modules/Filtering/Convolution/test/itkNormalizedCorrelationImageFilterTest.cxx +++ b/Modules/Filtering/Convolution/test/itkNormalizedCorrelationImageFilterTest.cxx @@ -36,7 +36,7 @@ itkNormalizedCorrelationImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using CorrelationPixelType = float; diff --git a/Modules/Filtering/CurvatureFlow/include/itkMinMaxCurvatureFlowFunction.hxx b/Modules/Filtering/CurvatureFlow/include/itkMinMaxCurvatureFlowFunction.hxx index 554ceb2e91b..8cd0257c02e 100644 --- a/Modules/Filtering/CurvatureFlow/include/itkMinMaxCurvatureFlowFunction.hxx +++ b/Modules/Filtering/CurvatureFlow/include/itkMinMaxCurvatureFlowFunction.hxx @@ -212,7 +212,7 @@ auto MinMaxCurvatureFlowFunction::ComputeThreshold(const Dispatch<2> &, const NeighborhoodType & it) const -> PixelType { - constexpr unsigned int imageDimension = 2; + constexpr unsigned int imageDimension{ 2 }; if (m_StencilRadius == 0) { @@ -271,7 +271,7 @@ auto MinMaxCurvatureFlowFunction::ComputeThreshold(const Dispatch<3> &, const NeighborhoodType & it) const -> PixelType { - constexpr unsigned int imageDimension = 3; + constexpr unsigned int imageDimension{ 3 }; if (m_StencilRadius == 0) { diff --git a/Modules/Filtering/CurvatureFlow/test/itkBinaryMinMaxCurvatureFlowImageFilterTest.cxx b/Modules/Filtering/CurvatureFlow/test/itkBinaryMinMaxCurvatureFlowImageFilterTest.cxx index b705337fa2a..dac5bcf22d4 100644 --- a/Modules/Filtering/CurvatureFlow/test/itkBinaryMinMaxCurvatureFlowImageFilterTest.cxx +++ b/Modules/Filtering/CurvatureFlow/test/itkBinaryMinMaxCurvatureFlowImageFilterTest.cxx @@ -39,7 +39,7 @@ class ShowProgressObject } // namespace -constexpr unsigned int MAXRUNS = 5; // maximum number of runs +constexpr unsigned int MAXRUNS{ 5 }; // maximum number of runs template int @@ -67,8 +67,8 @@ itkBinaryMinMaxCurvatureFlowImageFilterTest(int, char *[]) itk::Size<2> size2D; size2D[0] = 64; size2D[1] = 64; - constexpr double radius = 20.0; - constexpr int numberOfRuns = 2; + constexpr double radius{ 20.0 }; + constexpr int numberOfRuns{ 2 }; unsigned int niter[MAXRUNS] = { 100, 100 }; unsigned long radii[MAXRUNS] = { 1, 3 }; @@ -109,9 +109,9 @@ testBinaryMinMaxCurvatureFlow(itk::Size & size, // ND image siz * and background of 255 with added salt and pepper noise. */ const double sqrRadius = itk::Math::sqr(radius); // radius of the circle/sphere - constexpr double fractionNoise = 0.30; // salt & pepper noise fraction - constexpr PixelType foreground = 0.0; // intensity value of the foreground - constexpr PixelType background = 255.0; // intensity value of the background + constexpr double fractionNoise{ 0.30 }; // salt & pepper noise fraction + constexpr PixelType foreground{ 0.0 }; // intensity value of the foreground + constexpr PixelType background{ 255.0 }; // intensity value of the background std::cout << "Create an image of circle/sphere with noise" << std::endl; auto circleImage = ImageType::New(); diff --git a/Modules/Filtering/Deconvolution/include/itkParametricBlindLeastSquaresDeconvolutionImageFilter.hxx b/Modules/Filtering/Deconvolution/include/itkParametricBlindLeastSquaresDeconvolutionImageFilter.hxx index ce5c48b4f38..bf54f9d9fd8 100644 --- a/Modules/Filtering/Deconvolution/include/itkParametricBlindLeastSquaresDeconvolutionImageFilter.hxx +++ b/Modules/Filtering/Deconvolution/include/itkParametricBlindLeastSquaresDeconvolutionImageFilter.hxx @@ -196,7 +196,7 @@ ParametricBlindLeastSquaresDeconvolutionImageFilter; @@ -79,7 +79,7 @@ itkInverseDeconvolutionImageFilterTest(int argc, char * argv[]) // Check default KernelZeroMagnitudeThreshold value ITK_TEST_SET_GET_VALUE(1.0e-4, deconvolutionFilter->GetKernelZeroMagnitudeThreshold()); - constexpr double zeroMagnitudeThreshold = 1.0e-2; + constexpr double zeroMagnitudeThreshold{ 1.0e-2 }; deconvolutionFilter->SetKernelZeroMagnitudeThreshold(zeroMagnitudeThreshold); ITK_TEST_SET_GET_VALUE(zeroMagnitudeThreshold, deconvolutionFilter->GetKernelZeroMagnitudeThreshold()); diff --git a/Modules/Filtering/Deconvolution/test/itkLandweberDeconvolutionImageFilterTest.cxx b/Modules/Filtering/Deconvolution/test/itkLandweberDeconvolutionImageFilterTest.cxx index 2ed9831c3f5..70deace75db 100644 --- a/Modules/Filtering/Deconvolution/test/itkLandweberDeconvolutionImageFilterTest.cxx +++ b/Modules/Filtering/Deconvolution/test/itkLandweberDeconvolutionImageFilterTest.cxx @@ -37,7 +37,7 @@ itkLandweberDeconvolutionImageFilterTest(int argc, char * argv[]) } using PixelType = float; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; diff --git a/Modules/Filtering/Deconvolution/test/itkParametricBlindLeastSquaresDeconvolutionImageFilterTest.cxx b/Modules/Filtering/Deconvolution/test/itkParametricBlindLeastSquaresDeconvolutionImageFilterTest.cxx index 4a374b6eb84..150632e1a82 100644 --- a/Modules/Filtering/Deconvolution/test/itkParametricBlindLeastSquaresDeconvolutionImageFilterTest.cxx +++ b/Modules/Filtering/Deconvolution/test/itkParametricBlindLeastSquaresDeconvolutionImageFilterTest.cxx @@ -118,7 +118,7 @@ itkParametricBlindLeastSquaresDeconvolutionImageFilterTest(int argc, char * argv } using PixelType = float; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; @@ -212,7 +212,7 @@ itkParametricBlindLeastSquaresDeconvolutionImageFilterTest(int argc, char * argv return EXIT_FAILURE; } - constexpr KernelSourceType::ParametersValueType expectedSigmaX = 2.90243; + constexpr KernelSourceType::ParametersValueType expectedSigmaX{ 2.90243 }; if (itk::Math::abs(kernelSource->GetParameters()[0] - expectedSigmaX) > 1e-5) { std::cerr << "Kernel parameter[0] should have been " << expectedSigmaX << ", was " @@ -220,7 +220,7 @@ itkParametricBlindLeastSquaresDeconvolutionImageFilterTest(int argc, char * argv return EXIT_FAILURE; } - constexpr KernelSourceType::ParametersValueType expectedSigmaY = 2.90597; + constexpr KernelSourceType::ParametersValueType expectedSigmaY{ 2.90597 }; if (itk::Math::abs(kernelSource->GetParameters()[1] - expectedSigmaY) > 1e-5) { std::cerr << "Kernel parameter[1] should have been " << expectedSigmaY << ", was " diff --git a/Modules/Filtering/Deconvolution/test/itkProjectedLandweberDeconvolutionImageFilterTest.cxx b/Modules/Filtering/Deconvolution/test/itkProjectedLandweberDeconvolutionImageFilterTest.cxx index 3e3b27684aa..8ff1fc82cdd 100644 --- a/Modules/Filtering/Deconvolution/test/itkProjectedLandweberDeconvolutionImageFilterTest.cxx +++ b/Modules/Filtering/Deconvolution/test/itkProjectedLandweberDeconvolutionImageFilterTest.cxx @@ -33,7 +33,7 @@ itkProjectedLandweberDeconvolutionImageFilterTest(int argc, char * argv[]) } using PixelType = float; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; diff --git a/Modules/Filtering/Deconvolution/test/itkRichardsonLucyDeconvolutionImageFilterTest.cxx b/Modules/Filtering/Deconvolution/test/itkRichardsonLucyDeconvolutionImageFilterTest.cxx index 11e1b0f6de7..2a847a6b8a2 100644 --- a/Modules/Filtering/Deconvolution/test/itkRichardsonLucyDeconvolutionImageFilterTest.cxx +++ b/Modules/Filtering/Deconvolution/test/itkRichardsonLucyDeconvolutionImageFilterTest.cxx @@ -35,7 +35,7 @@ itkRichardsonLucyDeconvolutionImageFilterTest(int argc, char * argv[]) } using PixelType = float; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; @@ -118,7 +118,7 @@ itkRichardsonLucyDeconvolutionImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int numIterations = 5; + constexpr unsigned int numIterations{ 5 }; deconvolutionFilter->SetNumberOfIterations(numIterations); if (deconvolutionFilter->GetNumberOfIterations() != numIterations) { diff --git a/Modules/Filtering/Deconvolution/test/itkTikhonovDeconvolutionImageFilterTest.cxx b/Modules/Filtering/Deconvolution/test/itkTikhonovDeconvolutionImageFilterTest.cxx index ccf7a7cd22b..f820782ba42 100644 --- a/Modules/Filtering/Deconvolution/test/itkTikhonovDeconvolutionImageFilterTest.cxx +++ b/Modules/Filtering/Deconvolution/test/itkTikhonovDeconvolutionImageFilterTest.cxx @@ -34,7 +34,7 @@ itkTikhonovDeconvolutionImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int ImageDimension = 2; + constexpr int ImageDimension{ 2 }; using PixelType = float; using ImageType = itk::Image; @@ -80,7 +80,7 @@ itkTikhonovDeconvolutionImageFilterTest(int argc, char * argv[]) // Check default RegularizationConstant value ITK_TEST_SET_GET_VALUE(0.0, deconvolutionFilter->GetRegularizationConstant()); - constexpr double regularizationConstant = 1.0e-4; + constexpr double regularizationConstant{ 1.0e-4 }; deconvolutionFilter->SetRegularizationConstant(regularizationConstant); ITK_TEST_SET_GET_VALUE(regularizationConstant, deconvolutionFilter->GetRegularizationConstant()); diff --git a/Modules/Filtering/Deconvolution/test/itkWienerDeconvolutionImageFilterTest.cxx b/Modules/Filtering/Deconvolution/test/itkWienerDeconvolutionImageFilterTest.cxx index 0ace5f43b46..054f8a8f078 100644 --- a/Modules/Filtering/Deconvolution/test/itkWienerDeconvolutionImageFilterTest.cxx +++ b/Modules/Filtering/Deconvolution/test/itkWienerDeconvolutionImageFilterTest.cxx @@ -41,7 +41,7 @@ itkWienerDeconvolutionImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int ImageDimension = 2; + constexpr int ImageDimension{ 2 }; using PixelType = float; using ImageType = itk::Image; @@ -86,7 +86,7 @@ itkWienerDeconvolutionImageFilterTest(int argc, char * argv[]) // Check default NoiseVariance value ITK_TEST_SET_GET_VALUE(0.0, deconvolutionFilter->GetNoiseVariance()); - constexpr double noiseVariance = 1.0; + constexpr double noiseVariance{ 1.0 }; deconvolutionFilter->SetNoiseVariance(noiseVariance); ITK_TEST_SET_GET_VALUE(noiseVariance, deconvolutionFilter->GetNoiseVariance()); diff --git a/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx b/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx index a78eb51f3c8..59d7aba51c5 100644 --- a/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx +++ b/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx @@ -1991,7 +1991,7 @@ PatchBasedDenoisingImageFilter::ThreadedComputeImageU const RealType gradientJointEntropy = this->ComputeGradientJointEntropy(sampleIt.GetInstanceIdentifier(), inList, sampler, threadData); - constexpr RealValueType stepSizeSmoothing = 0.2; + constexpr RealValueType stepSizeSmoothing{ 0.2 }; result = AddUpdate(result, gradientJointEntropy * (smoothingWeight * stepSizeSmoothing)); } // end if smoothingWeight > 0 @@ -2014,7 +2014,7 @@ PatchBasedDenoisingImageFilter::ThreadedComputeImageU for (unsigned int pc = 0; pc < m_NumPixelComponents; ++pc) { const RealValueType gradientFidelity = 2.0 * (this->GetComponent(in, pc) - this->GetComponent(out, pc)); - constexpr RealValueType stepSizeFidelity = 0.5; + constexpr RealValueType stepSizeFidelity{ 0.5 }; const RealValueType noiseVal = fidelityWeight * (stepSizeFidelity * gradientFidelity); this->SetComponent(result, pc, this->GetComponent(result, pc) + noiseVal); } diff --git a/Modules/Filtering/Denoising/test/itkPatchBasedDenoisingImageFilterTest.cxx b/Modules/Filtering/Denoising/test/itkPatchBasedDenoisingImageFilterTest.cxx index 3ad419c5515..ab6a7342566 100644 --- a/Modules/Filtering/Denoising/test/itkPatchBasedDenoisingImageFilterTest.cxx +++ b/Modules/Filtering/Denoising/test/itkPatchBasedDenoisingImageFilterTest.cxx @@ -108,14 +108,14 @@ doDenoising(const std::string & inputFileName, ITK_TEST_SET_GET_BOOLEAN(filter, ComputeConditionalDerivatives, computeConditionalDerivatives); // Patch radius is same for all dimensions of the image - constexpr unsigned int patchRadius = 4; + constexpr unsigned int patchRadius{ 4 }; filter->SetPatchRadius(patchRadius); ITK_TEST_SET_GET_VALUE(patchRadius, filter->GetPatchRadius()); // Instead of directly setting the weights, could also specify type - constexpr bool useSmoothDiscPatchWeights = true; + constexpr bool useSmoothDiscPatchWeights{ true }; ITK_TEST_SET_GET_BOOLEAN(filter, UseSmoothDiscPatchWeights, useSmoothDiscPatchWeights); - constexpr bool useFastTensorComputations = true; + constexpr bool useFastTensorComputations{ true }; ITK_TEST_SET_GET_BOOLEAN(filter, UseFastTensorComputations, useFastTensorComputations); // Noise model to use @@ -140,7 +140,7 @@ doDenoising(const std::string & inputFileName, ITK_TEST_SET_GET_VALUE(noiseModel, filter->GetNoiseModel()); // Stepsize or weight for smoothing term - constexpr double smoothingWeight = 1.0; + constexpr double smoothingWeight{ 1.0 }; filter->SetSmoothingWeight(smoothingWeight); ITK_TEST_SET_GET_VALUE(smoothingWeight, filter->GetSmoothingWeight()); @@ -177,16 +177,16 @@ doDenoising(const std::string & inputFileName, ITK_TEST_SET_GET_VALUE(sampler, filter->GetSampler()); // Automatic estimation of the kernel bandwidth - constexpr bool kernelBandwidthEstimation = true; + constexpr bool kernelBandwidthEstimation{ true }; ITK_TEST_SET_GET_BOOLEAN(filter, KernelBandwidthEstimation, kernelBandwidthEstimation); // Update bandwidth every 'n' iterations - constexpr unsigned int kernelBandwidthUpdateFrequency = 3; + constexpr unsigned int kernelBandwidthUpdateFrequency{ 3 }; filter->SetKernelBandwidthUpdateFrequency(kernelBandwidthUpdateFrequency); ITK_TEST_SET_GET_VALUE(kernelBandwidthUpdateFrequency, filter->GetKernelBandwidthUpdateFrequency()); // Use 20% of the pixels for the sigma update calculation - constexpr double kernelBandwidthFractionPixelsForEstimation = 0.20; + constexpr double kernelBandwidthFractionPixelsForEstimation{ 0.20 }; filter->SetKernelBandwidthFractionPixelsForEstimation(kernelBandwidthFractionPixelsForEstimation); ITK_TEST_SET_GET_VALUE(kernelBandwidthFractionPixelsForEstimation, filter->GetKernelBandwidthFractionPixelsForEstimation()); diff --git a/Modules/Filtering/DiffusionTensorImage/test/itkDiffusionTensor3DReconstructionImageFilterTest.cxx b/Modules/Filtering/DiffusionTensorImage/test/itkDiffusionTensor3DReconstructionImageFilterTest.cxx index 54dd48ea8a3..4abb32e3b62 100644 --- a/Modules/Filtering/DiffusionTensorImage/test/itkDiffusionTensor3DReconstructionImageFilterTest.cxx +++ b/Modules/Filtering/DiffusionTensorImage/test/itkDiffusionTensor3DReconstructionImageFilterTest.cxx @@ -65,15 +65,15 @@ itkDiffusionTensor3DReconstructionImageFilterTest(int argc, char * argv[]) using ReferenceRegionType = ReferenceImageType::RegionType; using ReferenceIndexType = ReferenceRegionType::IndexType; using ReferenceSizeType = ReferenceRegionType::SizeType; - constexpr ReferenceSizeType sizeReferenceImage = { { 4, 4, 4 } }; - constexpr ReferenceIndexType indexReferenceImage = { { 0, 0, 0 } }; + constexpr ReferenceSizeType sizeReferenceImage{ 4, 4, 4 }; + constexpr ReferenceIndexType indexReferenceImage{ 0, 0, 0 }; const ReferenceRegionType regionReferenceImage{ indexReferenceImage, sizeReferenceImage }; referenceImage->SetRegions(regionReferenceImage); referenceImage->Allocate(); referenceImage->FillBuffer(100); - constexpr unsigned int numberOfGradientImages = 6; + constexpr unsigned int numberOfGradientImages{ 6 }; // Assign gradient directions // @@ -93,8 +93,8 @@ itkDiffusionTensor3DReconstructionImageFilterTest(int argc, char * argv[]) for (unsigned int i = 0; i < numberOfGradientImages; ++i) { auto gradientImage = GradientImageType::New(); - constexpr GradientSizeType sizeGradientImage = { { 4, 4, 4 } }; - constexpr GradientIndexType indexGradientImage = { { 0, 0, 0 } }; + constexpr GradientSizeType sizeGradientImage{ 4, 4, 4 }; + constexpr GradientIndexType indexGradientImage{ 0, 0, 0 }; const GradientRegionType regionGradientImage{ indexGradientImage, sizeGradientImage }; gradientImage->SetRegions(regionGradientImage); gradientImage->Allocate(); @@ -115,7 +115,7 @@ itkDiffusionTensor3DReconstructionImageFilterTest(int argc, char * argv[]) tensorReconstructionFilter->AddGradientImage(gradientDirection, gradientImage); std::cout << "Gradient directions: " << gradientDirection << std::endl; - constexpr TensorReconstructionImageFilterType::GradientDirectionType::element_type epsilon = 1e-3; + constexpr TensorReconstructionImageFilterType::GradientDirectionType::element_type epsilon{ 1e-3 }; TensorReconstructionImageFilterType::GradientDirectionType output = tensorReconstructionFilter->GetGradientDirection(i); for (unsigned int j = 0; j < gradientDirection.size(); ++j) @@ -179,9 +179,9 @@ itkDiffusionTensor3DReconstructionImageFilterTest(int argc, char * argv[]) const TensorImageType::Pointer tensorImage = tensorReconstructionFilter->GetOutput(); using TensorImageIndexType = TensorImageType::IndexType; - constexpr TensorImageIndexType tensorImageIndex = { { 3, 3, 3 } }; - constexpr GradientIndexType gradientImageIndex = { { 3, 3, 3 } }; - constexpr ReferenceIndexType referenceImageIndex = { { 3, 3, 3 } }; + constexpr TensorImageIndexType tensorImageIndex{ 3, 3, 3 }; + constexpr GradientIndexType gradientImageIndex{ 3, 3, 3 }; + constexpr ReferenceIndexType referenceImageIndex{ 3, 3, 3 }; std::cout << std::endl << "Pixels at index: " << tensorImageIndex << std::endl; std::cout << "Reference pixel " << referenceImage->GetPixel(referenceImageIndex) << std::endl; @@ -192,13 +192,13 @@ itkDiffusionTensor3DReconstructionImageFilterTest(int argc, char * argv[]) std::cout << "Gradient image " << i << " pixel : " << gradImage->GetPixel(gradientImageIndex) << std::endl; } - constexpr double expectedResult[3][3] = { { 4.60517, -2.6698, -8.4079 }, - { -2.6698, 1.56783, 0.900034 }, - { -8.4079, 0.900034, 2.62504 } }; + constexpr double expectedResult[3][3]{ { 4.60517, -2.6698, -8.4079 }, + { -2.6698, 1.56783, 0.900034 }, + { -8.4079, 0.900034, 2.62504 } }; std::cout << std::endl << "Reconstructed tensor : " << std::endl; bool passed = true; - constexpr double precision = 0.0001; + constexpr double precision{ 0.0001 }; for (unsigned int i = 0; i < 3; ++i) { std::cout << '\t'; diff --git a/Modules/Filtering/DiffusionTensorImage/test/itkDiffusionTensor3DTest.cxx b/Modules/Filtering/DiffusionTensorImage/test/itkDiffusionTensor3DTest.cxx index ea64e84853d..a106dd56307 100644 --- a/Modules/Filtering/DiffusionTensorImage/test/itkDiffusionTensor3DTest.cxx +++ b/Modules/Filtering/DiffusionTensorImage/test/itkDiffusionTensor3DTest.cxx @@ -219,7 +219,7 @@ itkDiffusionTensor3DTest(int, char *[]) std::cout << "EigenVectors = " << std::endl; std::cout << eigenVectors << std::endl; - constexpr double tolerance = 1e-4; + constexpr double tolerance{ 1e-4 }; { Double3DTensorType::EigenValuesArrayType expectedValues; @@ -345,7 +345,7 @@ itkDiffusionTensor3DTest(int, char *[]) expectedTrace += tensor3(1, 1); expectedTrace += tensor3(2, 2); - constexpr double tolerance = 1e-4; + constexpr double tolerance{ 1e-4 }; const AccumulateValueType computedTrace = tensor3.GetTrace(); if (itk::Math::abs(computedTrace - expectedTrace) > tolerance) @@ -357,7 +357,7 @@ itkDiffusionTensor3DTest(int, char *[]) } // Test the value of internal scalar product - constexpr RealValueType expectedInternalScalarProduct = 1829; + constexpr RealValueType expectedInternalScalarProduct{ 1829 }; const RealValueType computedInternalScalarProduct = tensor3.GetInnerScalarProduct(); if (itk::Math::abs(computedInternalScalarProduct - expectedInternalScalarProduct) > tolerance) @@ -370,7 +370,7 @@ itkDiffusionTensor3DTest(int, char *[]) // Test the value of Fractional Anisotropy - constexpr RealValueType expectedFractionalAnisotropy = 0.349177; + constexpr RealValueType expectedFractionalAnisotropy{ 0.349177 }; const RealValueType computedFractionalAnisotropy = tensor3.GetFractionalAnisotropy(); if (itk::Math::abs(computedFractionalAnisotropy - expectedFractionalAnisotropy) > tolerance) @@ -382,7 +382,7 @@ itkDiffusionTensor3DTest(int, char *[]) } // Test the value of Relative Anisotropy - constexpr RealValueType expectedRelativeAnisotropy = 1.9044; + constexpr RealValueType expectedRelativeAnisotropy{ 1.9044 }; const RealValueType computedRelativeAnisotropy = tensor3.GetRelativeAnisotropy(); if (itk::Math::abs(computedRelativeAnisotropy - expectedRelativeAnisotropy) > tolerance) @@ -444,7 +444,7 @@ itkDiffusionTensor3DTest(int, char *[]) auto floatTensor3 = static_cast(intTensor); // Check that all floatTensors have are the same - constexpr float precision = 1e-6; + constexpr float precision{ 1e-6 }; for (unsigned int i = 0; i < Float3DTensorType::InternalDimension; ++i) { auto intVal = static_cast(intTensor[i]); diff --git a/Modules/Filtering/DiffusionTensorImage/test/itkTensorFractionalAnisotropyImageFilterTest.cxx b/Modules/Filtering/DiffusionTensorImage/test/itkTensorFractionalAnisotropyImageFilterTest.cxx index 35ef2a61a38..1f752de0ee7 100644 --- a/Modules/Filtering/DiffusionTensorImage/test/itkTensorFractionalAnisotropyImageFilterTest.cxx +++ b/Modules/Filtering/DiffusionTensorImage/test/itkTensorFractionalAnisotropyImageFilterTest.cxx @@ -27,7 +27,7 @@ itkTensorFractionalAnisotropyImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; // Declare the types of the images using myImageType = itk::Image; diff --git a/Modules/Filtering/DiffusionTensorImage/test/itkTensorRelativeAnisotropyImageFilterTest.cxx b/Modules/Filtering/DiffusionTensorImage/test/itkTensorRelativeAnisotropyImageFilterTest.cxx index 4f2b0f18add..9cc644632e1 100644 --- a/Modules/Filtering/DiffusionTensorImage/test/itkTensorRelativeAnisotropyImageFilterTest.cxx +++ b/Modules/Filtering/DiffusionTensorImage/test/itkTensorRelativeAnisotropyImageFilterTest.cxx @@ -27,7 +27,7 @@ itkTensorRelativeAnisotropyImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; // Declare the types of the images using myImageType = itk::Image; diff --git a/Modules/Filtering/DisplacementField/test/itkBSplineExponentialDiffeomorphicTransformTest.cxx b/Modules/Filtering/DisplacementField/test/itkBSplineExponentialDiffeomorphicTransformTest.cxx index d10557762fe..53cd917d14a 100644 --- a/Modules/Filtering/DisplacementField/test/itkBSplineExponentialDiffeomorphicTransformTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkBSplineExponentialDiffeomorphicTransformTest.cxx @@ -32,7 +32,7 @@ int itkBSplineExponentialDiffeomorphicTransformTest(int, char *[]) { - constexpr unsigned int dimensions = 2; + constexpr unsigned int dimensions{ 2 }; using DisplacementTransformType = itk::BSplineExponentialDiffeomorphicTransform; /* Create a displacement field transform */ @@ -45,7 +45,7 @@ itkBSplineExponentialDiffeomorphicTransformTest(int, char *[]) using FieldType = DisplacementTransformType::DisplacementFieldType; auto field = FieldType::New(); // This is based on itk::Image - constexpr int dimLength = 20; + constexpr int dimLength{ 20 }; FieldType::SizeType size{ dimLength, dimLength }; FieldType::IndexType start{}; FieldType::RegionType region = { start, size }; @@ -61,7 +61,7 @@ itkBSplineExponentialDiffeomorphicTransformTest(int, char *[]) /* Test SmoothDisplacementFieldBSpline */ std::cout << "Test SmoothDisplacementFieldBSpline" << std::endl; DisplacementTransformType::ParametersType paramsFill(displacementTransform->GetNumberOfParameters()); - constexpr DisplacementTransformType::ParametersValueType paramsFillValue = 0.0; + constexpr DisplacementTransformType::ParametersValueType paramsFillValue{ 0.0 }; paramsFill.Fill(paramsFillValue); // Add an outlier to visually see that some smoothing is taking place. constexpr unsigned int outlier = dimLength * dimensions * 4 + dimLength * dimensions / 2; diff --git a/Modules/Filtering/DisplacementField/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformTest.cxx b/Modules/Filtering/DisplacementField/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformTest.cxx index 6dde3a524e5..17040331875 100644 --- a/Modules/Filtering/DisplacementField/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformTest.cxx @@ -32,7 +32,7 @@ int itkBSplineSmoothingOnUpdateDisplacementFieldTransformTest(int, char *[]) { - constexpr unsigned int dimensions = 2; + constexpr unsigned int dimensions{ 2 }; using DisplacementTransformType = itk::BSplineSmoothingOnUpdateDisplacementFieldTransform; /* Create a displacement field transform */ @@ -55,7 +55,7 @@ itkBSplineSmoothingOnUpdateDisplacementFieldTransformTest(int, char *[]) using FieldType = DisplacementTransformType::DisplacementFieldType; auto field = FieldType::New(); // This is based on itk::Image - constexpr int dimLength = 20; + constexpr int dimLength{ 20 }; FieldType::SizeType size{ dimLength, dimLength }; FieldType::IndexType start{}; FieldType::RegionType region = { start, size }; @@ -70,7 +70,7 @@ itkBSplineSmoothingOnUpdateDisplacementFieldTransformTest(int, char *[]) /* Test SmoothDisplacementFieldBSpline */ std::cout << "Test SmoothDisplacementFieldBSpline" << std::endl; DisplacementTransformType::ParametersType paramsFill(displacementTransform->GetNumberOfParameters()); - constexpr DisplacementTransformType::ParametersValueType paramsFillValue = 0.0; + constexpr DisplacementTransformType::ParametersValueType paramsFillValue{ 0.0 }; paramsFill.Fill(paramsFillValue); // Add an outlier to visually see that some smoothing is taking place. constexpr unsigned int outlier = dimLength * dimensions * 4 + dimLength * dimensions / 2; diff --git a/Modules/Filtering/DisplacementField/test/itkComposeDisplacementFieldsImageFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkComposeDisplacementFieldsImageFilterTest.cxx index 213b2316f93..b918177b3b4 100644 --- a/Modules/Filtering/DisplacementField/test/itkComposeDisplacementFieldsImageFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkComposeDisplacementFieldsImageFilterTest.cxx @@ -22,7 +22,7 @@ int itkComposeDisplacementFieldsImageFilterTest(int, char *[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using VectorType = itk::Vector; using DisplacementFieldType = itk::Image; diff --git a/Modules/Filtering/DisplacementField/test/itkDisplacementFieldJacobianDeterminantFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkDisplacementFieldJacobianDeterminantFilterTest.cxx index 7c86fd254fe..c80301d1d32 100644 --- a/Modules/Filtering/DisplacementField/test/itkDisplacementFieldJacobianDeterminantFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkDisplacementFieldJacobianDeterminantFilterTest.cxx @@ -27,7 +27,7 @@ static bool TestDisplacementJacobianDeterminantValue() { bool testPassed = true; - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using VectorType = itk::Vector; using FieldType = itk::Image; @@ -40,7 +40,7 @@ TestDisplacementJacobianDeterminantValue() VectorImageType::RegionType region; // NOTE: Making the image size much larger than necessary in order to get // some meaningful time measurements. Simulate a 256x256x256 image. - constexpr VectorImageType::SizeType size = { { 4096, 4096 } }; + constexpr VectorImageType::SizeType size{ 4096, 4096 }; region.SetSize(size); auto dispacementfield = VectorImageType::New(); @@ -73,7 +73,7 @@ TestDisplacementJacobianDeterminantValue() // // J(1,1) = [ (.625-.125)/2 (.5-.25)/2; (.375-.125)/2 (.75-0.0)/2] =[ .25 .125; .125 .375] // det((J+I)(1,1))=((.25+1.0)*(.375+1.0))-(.125*.125) = 1.703125; - constexpr float expectedJacobianDeterminant = (((.25 + 1.0) * (.375 + 1.0)) - (.125 * .125)); + constexpr float expectedJacobianDeterminant{ (((.25 + 1.0) * (.375 + 1.0)) - (.125 * .125)) }; using FilterType = itk::DisplacementFieldJacobianDeterminantFilter; auto filter = FilterType::New(); @@ -81,7 +81,7 @@ TestDisplacementJacobianDeterminantValue() ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, DisplacementFieldJacobianDeterminantFilter, ImageToImageFilter); - constexpr bool useImageSpacing = true; + constexpr bool useImageSpacing{ true }; #if !defined(ITK_FUTURE_LEGACY_REMOVE) if (useImageSpacing) { @@ -105,7 +105,7 @@ TestDisplacementJacobianDeterminantValue() index[1] = 1; const float jacobianDeterminant = output->GetPixel(index); // std::cout << "Output " << output->GetPixel(index) << std::endl; - constexpr double epsilon = 1e-13; + constexpr double epsilon{ 1e-13 }; if (itk::Math::abs(jacobianDeterminant - expectedJacobianDeterminant) > epsilon) { std::cerr.precision(static_cast(itk::Math::abs(std::log10(epsilon)))); @@ -159,7 +159,7 @@ itkDisplacementFieldJacobianDeterminantFilterTest(int, char *[]) filter->Print(std::cout); // Run the test again with ImageSpacingOn - constexpr bool useImageSpacing = true; + constexpr bool useImageSpacing{ true }; ITK_TEST_SET_GET_BOOLEAN(filter, UseImageSpacing, useImageSpacing); diff --git a/Modules/Filtering/DisplacementField/test/itkDisplacementFieldToBSplineImageFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkDisplacementFieldToBSplineImageFilterTest.cxx index 1310296de11..18ac02b4eb4 100644 --- a/Modules/Filtering/DisplacementField/test/itkDisplacementFieldToBSplineImageFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkDisplacementFieldToBSplineImageFilterTest.cxx @@ -22,7 +22,7 @@ int itkDisplacementFieldToBSplineImageFilterTest(int, char *[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using VectorType = itk::Vector; using DisplacementFieldType = itk::Image; @@ -102,7 +102,7 @@ itkDisplacementFieldToBSplineImageFilterTest(int, char *[]) bspliner->SetNumberOfControlPoints(numberOfControlPoints); ITK_TEST_SET_GET_VALUE(numberOfControlPoints, bspliner->GetNumberOfControlPoints()); - constexpr unsigned int splineOrder = 3; + constexpr unsigned int splineOrder{ 3 }; bspliner->SetSplineOrder(splineOrder); ITK_TEST_SET_GET_VALUE(splineOrder, bspliner->GetSplineOrder()); diff --git a/Modules/Filtering/DisplacementField/test/itkDisplacementFieldTransformCloneTest.cxx b/Modules/Filtering/DisplacementField/test/itkDisplacementFieldTransformCloneTest.cxx index 624ae22ebe5..3add44d7079 100644 --- a/Modules/Filtering/DisplacementField/test/itkDisplacementFieldTransformCloneTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkDisplacementFieldTransformCloneTest.cxx @@ -29,7 +29,7 @@ bool testVector(const TVector & v1, const TVector & v2) { bool pass = true; - constexpr double tolerance = 1e-10; + constexpr double tolerance{ 1e-10 }; for (unsigned int i = 0; i < v1.Size() && i < v2.Size(); ++i) { @@ -44,7 +44,7 @@ testVector(const TVector & v1, const TVector & v2) int itkDisplacementFieldTransformCloneTest(int, char *[]) { - constexpr unsigned int Dimensions = 3; + constexpr unsigned int Dimensions{ 3 }; using ParametersValueType = double; using DisplacementTransformType = itk::DisplacementFieldTransform; @@ -55,7 +55,7 @@ itkDisplacementFieldTransformCloneTest(int, char *[]) auto field = FieldType::New(); - constexpr int dimLength = 20; + constexpr int dimLength{ 20 }; constexpr FieldType::SizeType size{ dimLength, dimLength, dimLength }; constexpr FieldType::IndexType start{}; diff --git a/Modules/Filtering/DisplacementField/test/itkDisplacementFieldTransformTest.cxx b/Modules/Filtering/DisplacementField/test/itkDisplacementFieldTransformTest.cxx index d1897ab3a09..fcc32d59d8c 100644 --- a/Modules/Filtering/DisplacementField/test/itkDisplacementFieldTransformTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkDisplacementFieldTransformTest.cxx @@ -175,7 +175,7 @@ itkDisplacementFieldTransformTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimensions = 2; + constexpr unsigned int Dimensions{ 2 }; using ParametersValueType = double; @@ -196,7 +196,7 @@ itkDisplacementFieldTransformTest(int argc, char * argv[]) // Test exceptions - constexpr DisplacementTransformType::InputVnlVectorType::element_type vectorValue = 1.0; + constexpr DisplacementTransformType::InputVnlVectorType::element_type vectorValue{ 1.0 }; DisplacementTransformType::InputVnlVectorType vector; vector.fill(vectorValue); ITK_TRY_EXPECT_EXCEPTION(displacementTransform->TransformVector(vector)); @@ -237,7 +237,7 @@ itkDisplacementFieldTransformTest(int argc, char * argv[]) auto field = FieldType::New(); - constexpr int dimLength = 20; + constexpr int dimLength{ 20 }; auto size = itk::MakeFilled(dimLength); constexpr FieldType::IndexType start{}; FieldType::RegionType region{ start, size }; @@ -553,7 +553,7 @@ itkDisplacementFieldTransformTest(int argc, char * argv[]) derivative.Fill(1.2); - constexpr ScalarType testFactor = 1.5; + constexpr ScalarType testFactor{ 1.5 }; for (unsigned int i = 0; i < displacementTransform->GetNumberOfParameters(); ++i) { diff --git a/Modules/Filtering/DisplacementField/test/itkExponentialDisplacementFieldImageFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkExponentialDisplacementFieldImageFilterTest.cxx index 574dff62d64..db36876cfda 100644 --- a/Modules/Filtering/DisplacementField/test/itkExponentialDisplacementFieldImageFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkExponentialDisplacementFieldImageFilterTest.cxx @@ -25,7 +25,7 @@ int itkExponentialDisplacementFieldImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using PixelType = itk::Vector; @@ -101,7 +101,7 @@ itkExponentialDisplacementFieldImageFilterTest(int, char *[]) // Check the content of the result image std::cout << "Verification of the output " << std::endl; - constexpr PixelType::ValueType epsilon = 1e-6; + constexpr PixelType::ValueType epsilon{ 1e-6 }; bool testpassed = true; @@ -222,7 +222,7 @@ itkExponentialDisplacementFieldImageFilterTest(int, char *[]) // See if the output is consistent when the spacing is changed // (in an isotropic manner) - constexpr double isospacing = 10; + constexpr double isospacing{ 10 }; using SpacingType = ImageType::SpacingType; SpacingType spacing; for (unsigned int d = 0; d < ImageDimension; ++d) @@ -238,7 +238,7 @@ itkExponentialDisplacementFieldImageFilterTest(int, char *[]) // Random number generator vnl_random rng; - constexpr double power = 5.0; + constexpr double power{ 5.0 }; it.GoToBegin(); while (!it.IsAtEnd()) diff --git a/Modules/Filtering/DisplacementField/test/itkGaussianExponentialDiffeomorphicTransformTest.cxx b/Modules/Filtering/DisplacementField/test/itkGaussianExponentialDiffeomorphicTransformTest.cxx index 06af78ec9c7..1bc6a5c0281 100644 --- a/Modules/Filtering/DisplacementField/test/itkGaussianExponentialDiffeomorphicTransformTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkGaussianExponentialDiffeomorphicTransformTest.cxx @@ -32,7 +32,7 @@ int itkGaussianExponentialDiffeomorphicTransformTest(int, char *[]) { - constexpr unsigned int dimensions = 2; + constexpr unsigned int dimensions{ 2 }; using DisplacementTransformType = itk::GaussianExponentialDiffeomorphicTransform; @@ -46,7 +46,7 @@ itkGaussianExponentialDiffeomorphicTransformTest(int, char *[]) using FieldType = DisplacementTransformType::DisplacementFieldType; auto field = FieldType::New(); // This is based on itk::Image - constexpr int dimLength = 20; + constexpr int dimLength{ 20 }; constexpr FieldType::SizeType size{ dimLength, dimLength }; constexpr FieldType::IndexType start{}; @@ -65,7 +65,7 @@ itkGaussianExponentialDiffeomorphicTransformTest(int, char *[]) using ParametersValueType = DisplacementTransformType::ParametersValueType; constexpr ParametersValueType paramsZero{}; DisplacementTransformType::ParametersType paramsFill(displacementTransform->GetNumberOfParameters()); - constexpr DisplacementTransformType::ParametersValueType paramsFillValue = 0.0; + constexpr DisplacementTransformType::ParametersValueType paramsFillValue{ 0.0 }; paramsFill.Fill(paramsFillValue); // Add an outlier to visually see that some smoothing is taking place. constexpr unsigned int outlier = dimLength * dimensions * 4 + dimLength * dimensions / 2; diff --git a/Modules/Filtering/DisplacementField/test/itkGaussianSmoothingOnUpdateDisplacementFieldTransformTest.cxx b/Modules/Filtering/DisplacementField/test/itkGaussianSmoothingOnUpdateDisplacementFieldTransformTest.cxx index 4cb5e8f66fc..bd266ac74bf 100644 --- a/Modules/Filtering/DisplacementField/test/itkGaussianSmoothingOnUpdateDisplacementFieldTransformTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkGaussianSmoothingOnUpdateDisplacementFieldTransformTest.cxx @@ -33,7 +33,7 @@ int itkGaussianSmoothingOnUpdateDisplacementFieldTransformTest(int, char *[]) { - constexpr unsigned int dimensions = 2; + constexpr unsigned int dimensions{ 2 }; using DisplacementTransformType = itk::GaussianSmoothingOnUpdateDisplacementFieldTransform; /* Create a displacement field transform */ @@ -41,7 +41,7 @@ itkGaussianSmoothingOnUpdateDisplacementFieldTransformTest(int, char *[]) using FieldType = DisplacementTransformType::DisplacementFieldType; auto field = FieldType::New(); // This is based on itk::Image - constexpr int dimLength = 20; + constexpr int dimLength{ 20 }; constexpr FieldType::SizeType size{ dimLength, dimLength }; constexpr FieldType::IndexType start{}; FieldType::RegionType region = { start, size }; @@ -58,7 +58,7 @@ itkGaussianSmoothingOnUpdateDisplacementFieldTransformTest(int, char *[]) using ParametersValueType = DisplacementTransformType::ParametersValueType; constexpr ParametersValueType paramsZero{}; DisplacementTransformType::ParametersType paramsFill(displacementTransform->GetNumberOfParameters()); - constexpr DisplacementTransformType::ParametersValueType paramsFillValue = 0.0; + constexpr DisplacementTransformType::ParametersValueType paramsFillValue{ 0.0 }; paramsFill.Fill(paramsFillValue); // Add an outlier to visually see that some smoothing is taking place. constexpr unsigned int outlier = dimLength * dimensions * 4 + dimLength * dimensions / 2; diff --git a/Modules/Filtering/DisplacementField/test/itkInverseDisplacementFieldImageFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkInverseDisplacementFieldImageFilterTest.cxx index 0ff8dd29c1f..c433d0e8a04 100644 --- a/Modules/Filtering/DisplacementField/test/itkInverseDisplacementFieldImageFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkInverseDisplacementFieldImageFilterTest.cxx @@ -34,7 +34,7 @@ itkInverseDisplacementFieldImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using VectorComponentType = float; using VectorType = itk::Vector; @@ -92,7 +92,7 @@ itkInverseDisplacementFieldImageFilterTest(int argc, char * argv[]) filter->SetInput(field); - constexpr unsigned int subsamplingFactor = 16; + constexpr unsigned int subsamplingFactor{ 16 }; filter->SetSubsamplingFactor(subsamplingFactor); ITK_TEST_SET_GET_VALUE(subsamplingFactor, filter->GetSubsamplingFactor()); diff --git a/Modules/Filtering/DisplacementField/test/itkInvertDisplacementFieldImageFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkInvertDisplacementFieldImageFilterTest.cxx index 60db093f18e..fd39c5077e3 100644 --- a/Modules/Filtering/DisplacementField/test/itkInvertDisplacementFieldImageFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkInvertDisplacementFieldImageFilterTest.cxx @@ -31,7 +31,7 @@ itkInvertDisplacementFieldImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using VectorType = itk::Vector; using DisplacementFieldType = itk::Image; @@ -60,7 +60,7 @@ itkInvertDisplacementFieldImageFilterTest(int argc, char * argv[]) constexpr VectorType zeroVector{}; // make sure boundary does not move - constexpr float weight1 = 1.0; + constexpr float weight1{ 1.0 }; const DisplacementFieldType::RegionType region = field->GetLargestPossibleRegion(); const DisplacementFieldType::IndexType startIndex = region.GetIndex(); diff --git a/Modules/Filtering/DisplacementField/test/itkIterativeInverseDisplacementFieldImageFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkIterativeInverseDisplacementFieldImageFilterTest.cxx index c6abc0b2ef1..0b24f2b6d61 100644 --- a/Modules/Filtering/DisplacementField/test/itkIterativeInverseDisplacementFieldImageFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkIterativeInverseDisplacementFieldImageFilterTest.cxx @@ -34,7 +34,7 @@ itkIterativeInverseDisplacementFieldImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using VectorComponentType = float; using VectorType = itk::Vector; diff --git a/Modules/Filtering/DisplacementField/test/itkLandmarkDisplacementFieldSourceTest.cxx b/Modules/Filtering/DisplacementField/test/itkLandmarkDisplacementFieldSourceTest.cxx index 4bebc3775dc..670bfd9fc49 100644 --- a/Modules/Filtering/DisplacementField/test/itkLandmarkDisplacementFieldSourceTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkLandmarkDisplacementFieldSourceTest.cxx @@ -37,7 +37,7 @@ itkLandmarkDisplacementFieldSourceTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using VectorComponentType = float; using VectorType = itk::Vector; diff --git a/Modules/Filtering/DisplacementField/test/itkTimeVaryingBSplineVelocityFieldTransformTest.cxx b/Modules/Filtering/DisplacementField/test/itkTimeVaryingBSplineVelocityFieldTransformTest.cxx index f08b46b6bca..11c1c0edc04 100644 --- a/Modules/Filtering/DisplacementField/test/itkTimeVaryingBSplineVelocityFieldTransformTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkTimeVaryingBSplineVelocityFieldTransformTest.cxx @@ -27,7 +27,7 @@ itkTimeVaryingBSplineVelocityFieldTransformTest(int, char *[]) using TimeVaryingVelocityFieldControlPointLatticeType = itk::Image; using TimeVaryingVelocityFieldType = itk::Image; - constexpr unsigned int splineOrder = 3; + constexpr unsigned int splineOrder{ 3 }; auto origin = itk::MakeFilled(-2.0); diff --git a/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldIntegrationImageFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldIntegrationImageFilterTest.cxx index 1a3bfe9df95..ff86ed930d2 100644 --- a/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldIntegrationImageFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldIntegrationImageFilterTest.cxx @@ -181,7 +181,7 @@ itkTimeVaryingVelocityFieldIntegrationImageFilterTest(int argc, char * argv[]) origin.Fill(0.); importFilter->SetOrigin(origin); - constexpr double spaceTimeSpan[4] = { 20., 20., 20., 1.5 }; + constexpr double spaceTimeSpan[4]{ 20., 20., 20., 1.5 }; for (unsigned int i = 0; i < 4; i++) { spacing[i] = spaceTimeSpan[i] / (size[i] - 1); @@ -210,7 +210,7 @@ itkTimeVaryingVelocityFieldIntegrationImageFilterTest(int argc, char * argv[]) } } - constexpr bool importImageFilterWillOwnTheBuffer = true; + constexpr bool importImageFilterWillOwnTheBuffer{ true }; importFilter->SetImportPointer(localBuffer, numberOfPixels, importImageFilterWillOwnTheBuffer); const TimeVaryingVelocityFieldType::Pointer timeVaryingVelocityField = importFilter->GetOutput(); diff --git a/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldTransformTest.cxx b/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldTransformTest.cxx index f69efc5a8eb..3fe03c933fc 100644 --- a/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldTransformTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldTransformTest.cxx @@ -23,8 +23,8 @@ int itkTimeVaryingVelocityFieldTransformTest(int, char *[]) { - constexpr unsigned int ComponentDimension = 3; - constexpr unsigned int VelocityFieldDimension = 4; + constexpr unsigned int ComponentDimension{ 3 }; + constexpr unsigned int VelocityFieldDimension{ 4 }; using ComponentType = double; diff --git a/Modules/Filtering/DisplacementField/test/itkTransformToDisplacementFieldFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkTransformToDisplacementFieldFilterTest.cxx index 9b0a9747a7b..9df4aefe8fe 100644 --- a/Modules/Filtering/DisplacementField/test/itkTransformToDisplacementFieldFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkTransformToDisplacementFieldFilterTest.cxx @@ -44,10 +44,10 @@ itkTransformToDisplacementFieldFilterTest(int argc, char * argv[]) } // Typedefs. - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ScalarPixelType = float; using CoordRepresentationType = double; - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int SplineOrder{ 3 }; using VectorPixelType = itk::Vector; diff --git a/Modules/Filtering/DisplacementField/test/itkTransformToDisplacementFieldFilterTest1.cxx b/Modules/Filtering/DisplacementField/test/itkTransformToDisplacementFieldFilterTest1.cxx index 8098d4d267d..49c655dc6b9 100644 --- a/Modules/Filtering/DisplacementField/test/itkTransformToDisplacementFieldFilterTest1.cxx +++ b/Modules/Filtering/DisplacementField/test/itkTransformToDisplacementFieldFilterTest1.cxx @@ -46,7 +46,7 @@ itkTransformToDisplacementFieldFilterTest1(int argc, char * argv[]) const char * displacementFieldFileName = argv[2]; // Typedefs. - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using ScalarPixelType = float; using CoordRepresentationType = double; diff --git a/Modules/Filtering/DistanceMap/include/itkDanielssonDistanceMapImageFilter.hxx b/Modules/Filtering/DistanceMap/include/itkDanielssonDistanceMapImageFilter.hxx index 2a47921e86a..1fb319de479 100644 --- a/Modules/Filtering/DistanceMap/include/itkDanielssonDistanceMapImageFilter.hxx +++ b/Modules/Filtering/DistanceMap/include/itkDanielssonDistanceMapImageFilter.hxx @@ -118,7 +118,7 @@ DanielssonDistanceMapImageFilter::Prep itkDebugMacro("PrepareData: Copy input to output"); if (m_InputIsBinary) { - constexpr VoronoiPixelType npt = 1; + constexpr VoronoiPixelType npt{ 1 }; while (!ot.IsAtEnd()) { if (it.Get()) diff --git a/Modules/Filtering/DistanceMap/include/itkFastChamferDistanceImageFilter.hxx b/Modules/Filtering/DistanceMap/include/itkFastChamferDistanceImageFilter.hxx index 1a5c2ab1f24..a43745829df 100644 --- a/Modules/Filtering/DistanceMap/include/itkFastChamferDistanceImageFilter.hxx +++ b/Modules/Filtering/DistanceMap/include/itkFastChamferDistanceImageFilter.hxx @@ -95,8 +95,8 @@ template void FastChamferDistanceImageFilter::GenerateDataND() { - constexpr int SIGN_MASK = 1; - constexpr int INNER_MASK = 2; + constexpr int SIGN_MASK{ 1 }; + constexpr int INNER_MASK{ 2 }; auto r = MakeFilled::RadiusType>(1); NeighborhoodIterator it(r, this->GetOutput(), m_RegionToProcess); diff --git a/Modules/Filtering/DistanceMap/include/itkIsoContourDistanceImageFilter.hxx b/Modules/Filtering/DistanceMap/include/itkIsoContourDistanceImageFilter.hxx index dfcada275d4..4a7621a8249 100644 --- a/Modules/Filtering/DistanceMap/include/itkIsoContourDistanceImageFilter.hxx +++ b/Modules/Filtering/DistanceMap/include/itkIsoContourDistanceImageFilter.hxx @@ -344,8 +344,8 @@ IsoContourDistanceImageFilter::ComputeValue(const Inp // Interpolate values PixelRealType grad[ImageDimension]; - constexpr PixelRealType alpha0 = 0.5; // Interpolation factor - constexpr PixelRealType alpha1 = 0.5; // Interpolation factor + constexpr PixelRealType alpha0{ 0.5 }; // Interpolation factor + constexpr PixelRealType alpha1{ 0.5 }; // Interpolation factor PixelRealType norm = 0.; diff --git a/Modules/Filtering/DistanceMap/test/itkApproximateSignedDistanceMapImageFilterTest.cxx b/Modules/Filtering/DistanceMap/test/itkApproximateSignedDistanceMapImageFilterTest.cxx index 70eac9a2469..f8563de4e9c 100644 --- a/Modules/Filtering/DistanceMap/test/itkApproximateSignedDistanceMapImageFilterTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkApproximateSignedDistanceMapImageFilterTest.cxx @@ -33,7 +33,7 @@ double SimpleSignedDistance(const TPoint & p) { auto center = itk::MakeFilled(32); - constexpr double radius = 16; + constexpr double radius{ 16 }; double accum = 0.0; for (unsigned int j = 0; j < TPoint::PointDimension; ++j) @@ -56,7 +56,7 @@ itkApproximateSignedDistanceMapImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using InputPixelType = unsigned int; using OutputPixelType = float; @@ -71,7 +71,7 @@ itkApproximateSignedDistanceMapImageFilterTest(int argc, char * argv[]) // Make a binary input image based on the signed distance function // using the inside and outside values const InputPixelType insideValue = std::stoi(argv[1]); - constexpr InputPixelType outsideValue = 0; + constexpr InputPixelType outsideValue{ 0 }; auto image = InputImageType::New(); auto size = InputImageType::SizeType::Filled(64); @@ -158,7 +158,7 @@ itkApproximateSignedDistanceMapImageFilterTest(int argc, char * argv[]) } // Regression test - constexpr OutputPixelType maxAllowedDistance = 2; + constexpr OutputPixelType maxAllowedDistance{ 2 }; if (maxDistance > maxAllowedDistance) { std::cout << "Test failed!" << std::endl; diff --git a/Modules/Filtering/DistanceMap/test/itkContourDirectedMeanDistanceImageFilterTest.cxx b/Modules/Filtering/DistanceMap/test/itkContourDirectedMeanDistanceImageFilterTest.cxx index f0e42c16f22..c97d04b4dc9 100644 --- a/Modules/Filtering/DistanceMap/test/itkContourDirectedMeanDistanceImageFilterTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkContourDirectedMeanDistanceImageFilterTest.cxx @@ -27,7 +27,7 @@ itkContourDirectedMeanDistanceImageFilterTest(int, char *[]) using Pixel1Type = unsigned int; using Pixel2Type = float; - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using Image1Type = itk::Image; using Image2Type = itk::Image; @@ -92,7 +92,7 @@ itkContourDirectedMeanDistanceImageFilterTest(int, char *[]) // Check results - constexpr FilterType::RealType trueDistance = 8.37831; + constexpr FilterType::RealType trueDistance{ 8.37831 }; const FilterType::RealType distance = filter->GetContourDirectedMeanDistance(); std::cout << " True distance: " << trueDistance << std::endl; @@ -121,7 +121,7 @@ itkContourDirectedMeanDistanceImageFilterTest(int, char *[]) // Check results - constexpr FilterType::RealType trueDistance = 4.2053; + constexpr FilterType::RealType trueDistance{ 4.2053 }; const FilterType::RealType distance = filter->GetContourDirectedMeanDistance(); std::cout << " True distance: " << trueDistance << std::endl; diff --git a/Modules/Filtering/DistanceMap/test/itkContourMeanDistanceImageFilterTest.cxx b/Modules/Filtering/DistanceMap/test/itkContourMeanDistanceImageFilterTest.cxx index f34fd45f804..4a851b59c1a 100644 --- a/Modules/Filtering/DistanceMap/test/itkContourMeanDistanceImageFilterTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkContourMeanDistanceImageFilterTest.cxx @@ -100,7 +100,7 @@ itkContourMeanDistanceImageFilterTest(int argc, char * argv[]) // check results - constexpr FilterType::RealType trueDistance = 8.07158; + constexpr FilterType::RealType trueDistance{ 8.07158 }; // std::sqrt( double{ ImageDimension } ); const FilterType::RealType distance = filter->GetMeanDistance(); @@ -125,7 +125,7 @@ itkContourMeanDistanceImageFilterTest(int argc, char * argv[]) // check results - constexpr FilterType::RealType trueDistance = 8.07158; + constexpr FilterType::RealType trueDistance{ 8.07158 }; const FilterType::RealType distance = filter->GetMeanDistance(); std::cout << " True distance: " << trueDistance << std::endl; @@ -163,7 +163,7 @@ itkContourMeanDistanceImageFilterTest(int argc, char * argv[]) filter->Update(); // check results - constexpr FilterType::RealType trueDistance = 8.07158 / 2; + constexpr FilterType::RealType trueDistance{ 8.07158 / 2 }; const FilterType::RealType distance = filter->GetMeanDistance(); std::cout << " True distance: " << trueDistance << std::endl; std::cout << " Computed distance: " << distance << std::endl; diff --git a/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest.cxx b/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest.cxx index 90b0a782d6f..078e2c3fc48 100644 --- a/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest.cxx @@ -38,7 +38,7 @@ itkDanielssonDistanceMapImageFilterTest(int, char *[]) using myImageType2D2 = itk::Image; /* Allocate the 2D image */ - constexpr myImageType2D1::SizeType size2D = { { 9, 9 } }; + constexpr myImageType2D1::SizeType size2D{ 9, 9 }; myImageType2D1::IndexType index2D = { { 0, 0 } }; const myImageType2D1::RegionType region2D{ index2D, size2D }; @@ -125,14 +125,14 @@ itkDanielssonDistanceMapImageFilterTest(int, char *[]) index[1] = 0; const double distance1 = outputDistance2D->GetPixel(index); - constexpr bool squaredDistance = true; + constexpr bool squaredDistance{ true }; ITK_TEST_SET_GET_BOOLEAN(filter2D, SquaredDistance, squaredDistance); ITK_TRY_EXPECT_NO_EXCEPTION(filter2D->Update()); const double distance2 = outputDistance2D->GetPixel(index); - constexpr myImageType2D2::PixelType epsilon = 1e-5; + constexpr myImageType2D2::PixelType epsilon{ 1e-5 }; if (itk::Math::abs(distance2 - distance1 * distance1) > epsilon) { std::cerr << "Error in use of the SetSquaredDistance() method" << std::endl; @@ -159,10 +159,10 @@ itkDanielssonDistanceMapImageFilterTest(int, char *[]) filter2D->SetInput(inputImage2D); - constexpr bool inputIsBinary = true; + constexpr bool inputIsBinary{ true }; ITK_TEST_SET_GET_BOOLEAN(filter2D, InputIsBinary, inputIsBinary); - constexpr bool useImageSpacing = true; + constexpr bool useImageSpacing{ true }; ITK_TEST_SET_GET_BOOLEAN(filter2D, UseImageSpacing, useImageSpacing); ITK_TRY_EXPECT_NO_EXCEPTION(filter2D->Update()); @@ -186,8 +186,8 @@ itkDanielssonDistanceMapImageFilterTest(int, char *[]) // Allocate the 3D image using ImageType3D = itk::Image; - constexpr ImageType3D::SizeType size3D = { { 200, 200, 200 } }; - constexpr ImageType3D::IndexType index3D = { { 0, 0 } }; + constexpr ImageType3D::SizeType size3D{ 200, 200, 200 }; + constexpr ImageType3D::IndexType index3D{ 0, 0 }; const ImageType3D::RegionType region3D{ index3D, size3D }; auto inputImage3D = ImageType3D::New(); inputImage3D->SetRegions(region3D); diff --git a/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest1.cxx b/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest1.cxx index 9650b1edf65..a6da05f32fb 100644 --- a/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest1.cxx +++ b/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest1.cxx @@ -32,7 +32,7 @@ itkDanielssonDistanceMapImageFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using InputPixelType = unsigned char; using OutputPixelType = float; diff --git a/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest2.cxx b/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest2.cxx index eaa567e3a86..c6ce99708eb 100644 --- a/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest2.cxx +++ b/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest2.cxx @@ -34,7 +34,7 @@ itkDanielssonDistanceMapImageFilterTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using InputPixelType = unsigned char; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/DistanceMap/test/itkDirectedHausdorffDistanceImageFilterTest1.cxx b/Modules/Filtering/DistanceMap/test/itkDirectedHausdorffDistanceImageFilterTest1.cxx index 4e8c9df603c..04f370f7bc5 100644 --- a/Modules/Filtering/DistanceMap/test/itkDirectedHausdorffDistanceImageFilterTest1.cxx +++ b/Modules/Filtering/DistanceMap/test/itkDirectedHausdorffDistanceImageFilterTest1.cxx @@ -23,7 +23,7 @@ int itkDirectedHausdorffDistanceImageFilterTest1(int, char *[]) { - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using Pixel1Type = unsigned int; using Pixel2Type = float; diff --git a/Modules/Filtering/DistanceMap/test/itkDirectedHausdorffDistanceImageFilterTest2.cxx b/Modules/Filtering/DistanceMap/test/itkDirectedHausdorffDistanceImageFilterTest2.cxx index 5f2c0cfd630..78d480788dc 100644 --- a/Modules/Filtering/DistanceMap/test/itkDirectedHausdorffDistanceImageFilterTest2.cxx +++ b/Modules/Filtering/DistanceMap/test/itkDirectedHausdorffDistanceImageFilterTest2.cxx @@ -35,7 +35,7 @@ itkDirectedHausdorffDistanceImageFilterTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; @@ -72,10 +72,10 @@ itkDirectedHausdorffDistanceImageFilterTest2(int argc, char * argv[]) ITK_TRY_EXPECT_NO_EXCEPTION(filter->Update()); - constexpr double expecteDirectedHausdorffDistance = 0; + constexpr double expecteDirectedHausdorffDistance{ 0 }; ITK_TEST_EXPECT_EQUAL(expecteDirectedHausdorffDistance, filter->GetDirectedHausdorffDistance()); - constexpr double expecteAverageHausdorffDistance = 0; + constexpr double expecteAverageHausdorffDistance{ 0 }; ITK_TEST_EXPECT_EQUAL(expecteAverageHausdorffDistance, filter->GetAverageHausdorffDistance()); diff --git a/Modules/Filtering/DistanceMap/test/itkFastChamferDistanceImageFilterTest.cxx b/Modules/Filtering/DistanceMap/test/itkFastChamferDistanceImageFilterTest.cxx index 54ca5acd3b1..8deb62d2d60 100644 --- a/Modules/Filtering/DistanceMap/test/itkFastChamferDistanceImageFilterTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkFastChamferDistanceImageFilterTest.cxx @@ -27,7 +27,7 @@ double SimpleSignedDistance(const TPoint & p) { auto center = itk::MakeFilled(16); - constexpr double radius = 10; + constexpr double radius{ 10 }; double accum = 0.0; for (unsigned int j = 0; j < TPoint::PointDimension; ++j) diff --git a/Modules/Filtering/DistanceMap/test/itkHausdorffDistanceImageFilterTest.cxx b/Modules/Filtering/DistanceMap/test/itkHausdorffDistanceImageFilterTest.cxx index 2d7742b3523..3347dcf2227 100644 --- a/Modules/Filtering/DistanceMap/test/itkHausdorffDistanceImageFilterTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkHausdorffDistanceImageFilterTest.cxx @@ -30,7 +30,7 @@ itkHausdorffDistanceImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using Pixel1Type = unsigned int; using Pixel2Type = float; diff --git a/Modules/Filtering/DistanceMap/test/itkIsoContourDistanceImageFilterTest.cxx b/Modules/Filtering/DistanceMap/test/itkIsoContourDistanceImageFilterTest.cxx index ae6e981cbcd..412ebb4bf40 100644 --- a/Modules/Filtering/DistanceMap/test/itkIsoContourDistanceImageFilterTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkIsoContourDistanceImageFilterTest.cxx @@ -48,7 +48,7 @@ double SimpleSignedDistance(const TPoint & p) { auto center = itk::MakeFilled(50); - constexpr double radius = 19.5; + constexpr double radius{ 19.5 }; double accum = 0.0; for (unsigned int j = 0; j < TPoint::PointDimension; ++j) @@ -64,7 +64,7 @@ SimpleSignedDistance(const TPoint & p) int itkIsoContourDistanceImageFilterTest(int, char *[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = float; using ImageType = itk::Image; diff --git a/Modules/Filtering/DistanceMap/test/itkReflectiveImageRegionIteratorTest.cxx b/Modules/Filtering/DistanceMap/test/itkReflectiveImageRegionIteratorTest.cxx index d04a1a60624..8fd9d0ceeba 100644 --- a/Modules/Filtering/DistanceMap/test/itkReflectiveImageRegionIteratorTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkReflectiveImageRegionIteratorTest.cxx @@ -25,7 +25,7 @@ int itkReflectiveImageRegionIteratorTest(int, char *[]) { std::cout << "Creating an image" << std::endl; - constexpr unsigned int Dimension = 4; + constexpr unsigned int Dimension{ 4 }; using PixelType = itk::Index; using ImageType = itk::Image; using ImageVisitsType = itk::Image; @@ -35,7 +35,7 @@ itkReflectiveImageRegionIteratorTest(int, char *[]) auto myImage = ImageType::New(); - constexpr ImageType::SizeType size = { { 4, 4, 4, 4 } }; + constexpr ImageType::SizeType size{ 4, 4, 4, 4 }; constexpr ImageType::IndexType start{}; @@ -96,7 +96,7 @@ itkReflectiveImageRegionIteratorTest(int, char *[]) // Each element should be visited 2 ^ # of dimensions // each left shift = multiply by 2 - constexpr int visits = (1 << (ImageType::ImageDimension)); + constexpr int visits{ (1 << (ImageType::ImageDimension)) }; int failed = 0; // Verify the number of visits diff --git a/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest.cxx b/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest.cxx index 60d8d114e9d..75904764cfb 100644 --- a/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest.cxx @@ -42,7 +42,7 @@ test(int testIdx) // scope. const itk::StdStreamStateSave coutState(std::cout); - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using myImageType2D1 = itk::Image; diff --git a/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest11.cxx b/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest11.cxx index bd7ccb99e3f..52ba636c71a 100644 --- a/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest11.cxx +++ b/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest11.cxx @@ -35,7 +35,7 @@ itkSignedDanielssonDistanceMapImageFilterTest11(int, char *[]) using myImageType2D2 = itk::Image; /* Allocate the 2D image */ - constexpr myImageType2D1::SizeType size2D = { { 5, 5 } }; + constexpr myImageType2D1::SizeType size2D{ 5, 5 }; myImageType2D1::IndexType index2D = { { 0, 0 } }; const myImageType2D1::RegionType region2D{ index2D, size2D }; @@ -87,7 +87,7 @@ itkSignedDanielssonDistanceMapImageFilterTest11(int, char *[]) const double distance2 = outputDistance2D->GetPixel(index); std::cout << "distance2: " << distance2 << std::endl; - constexpr myImageType2D2::PixelType epsilon = 1e-5; + constexpr myImageType2D2::PixelType epsilon{ 1e-5 }; if (itk::Math::abs(distance2 - distance1 * distance1) > epsilon) { std::cerr << "Error in use of the SetSquaredDistance() method" << std::endl; diff --git a/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest2.cxx b/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest2.cxx index 7cae0d7dccd..a8684babca1 100644 --- a/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest2.cxx +++ b/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest2.cxx @@ -34,7 +34,7 @@ itkSignedDanielssonDistanceMapImageFilterTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using InputPixelType = unsigned char; using OutputPixelType = float; diff --git a/Modules/Filtering/DistanceMap/test/itkSignedMaurerDistanceMapImageFilterTest11.cxx b/Modules/Filtering/DistanceMap/test/itkSignedMaurerDistanceMapImageFilterTest11.cxx index c0f49a8cb88..9b064161c26 100644 --- a/Modules/Filtering/DistanceMap/test/itkSignedMaurerDistanceMapImageFilterTest11.cxx +++ b/Modules/Filtering/DistanceMap/test/itkSignedMaurerDistanceMapImageFilterTest11.cxx @@ -35,7 +35,7 @@ itkSignedMaurerDistanceMapImageFilterTest11(int, char *[]) using myImageType2D2 = itk::Image; /* Allocate the 2D image */ - constexpr myImageType2D1::SizeType size2D = { { 5, 5 } }; + constexpr myImageType2D1::SizeType size2D{ 5, 5 }; myImageType2D1::IndexType index2D = { { 0, 0 } }; myImageType2D1::RegionType region2D{ index2D, size2D }; @@ -87,7 +87,7 @@ itkSignedMaurerDistanceMapImageFilterTest11(int, char *[]) const double distance2 = outputDistance2D->GetPixel(index); std::cout << "distance2: " << distance2 << std::endl; - constexpr myImageType2D2::PixelType epsilon = 1e-5; + constexpr myImageType2D2::PixelType epsilon{ 1e-5 }; if (itk::Math::abs(distance2 - distance1 * distance1) > epsilon) { std::cerr << "Error in use of the SetSquaredDistance() method" << std::endl; diff --git a/Modules/Filtering/FFT/test/itkComplexToComplex1DFFTImageFilterTest.cxx b/Modules/Filtering/FFT/test/itkComplexToComplex1DFFTImageFilterTest.cxx index e1b82e9ae35..7a68a55fa0a 100644 --- a/Modules/Filtering/FFT/test/itkComplexToComplex1DFFTImageFilterTest.cxx +++ b/Modules/Filtering/FFT/test/itkComplexToComplex1DFFTImageFilterTest.cxx @@ -89,7 +89,7 @@ itkComplexToComplex1DFFTImageFilterTest(int argc, char * argv[]) } using PixelType = double; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ComplexImageType = itk::Image, Dimension>; int backend = 0; diff --git a/Modules/Filtering/FFT/test/itkComplexToComplexFFTImageFilterTest.cxx b/Modules/Filtering/FFT/test/itkComplexToComplexFFTImageFilterTest.cxx index 88a3da0b458..263fe7c5b86 100644 --- a/Modules/Filtering/FFT/test/itkComplexToComplexFFTImageFilterTest.cxx +++ b/Modules/Filtering/FFT/test/itkComplexToComplexFFTImageFilterTest.cxx @@ -45,7 +45,7 @@ transformImage(const char * inputImageFileName, const char * outputImageFileName { using RealPixelType = TPixel; using ComplexPixelType = std::complex; - constexpr unsigned int Dimension = VDimension; + constexpr unsigned int Dimension{ VDimension }; using RealImageType = itk::Image; using ComplexImageType = itk::Image; diff --git a/Modules/Filtering/FFT/test/itkFFT1DImageFilterTest.cxx b/Modules/Filtering/FFT/test/itkFFT1DImageFilterTest.cxx index ce1b4fa1f3d..146e9e1eaca 100644 --- a/Modules/Filtering/FFT/test/itkFFT1DImageFilterTest.cxx +++ b/Modules/Filtering/FFT/test/itkFFT1DImageFilterTest.cxx @@ -37,7 +37,7 @@ template int doTest(const char * inputImage, const char * outputImage) { - constexpr unsigned int direction = 1; + constexpr unsigned int direction{ 1 }; using ImageType = typename FFTForwardType::InputImageType; @@ -84,7 +84,7 @@ itkFFT1DImageFilterTest(int argc, char * argv[]) } using PixelType = double; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ImageType = itk::Image; using ComplexImageType = itk::Image, Dimension>; diff --git a/Modules/Filtering/FFT/test/itkFFTPadImageFilterTest.cxx b/Modules/Filtering/FFT/test/itkFFTPadImageFilterTest.cxx index 1a1f7b7d93d..990adaa6f3c 100644 --- a/Modules/Filtering/FFT/test/itkFFTPadImageFilterTest.cxx +++ b/Modules/Filtering/FFT/test/itkFFTPadImageFilterTest.cxx @@ -48,7 +48,7 @@ itkFFTPadImageFilterTest(int argc, char * argv[]) // The following code defines the input and output pixel types and their // associated image types. // - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/FFT/test/itkFFTShiftImageFilterTest.cxx b/Modules/Filtering/FFT/test/itkFFTShiftImageFilterTest.cxx index ed94886783d..78b78e4b072 100644 --- a/Modules/Filtering/FFT/test/itkFFTShiftImageFilterTest.cxx +++ b/Modules/Filtering/FFT/test/itkFFTShiftImageFilterTest.cxx @@ -37,7 +37,7 @@ itkFFTShiftImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 3; + constexpr int dim{ 3 }; using PType = itk::RGBPixel; using IType = itk::Image; diff --git a/Modules/Filtering/FFT/test/itkFFTWComplexToComplexFFTImageFilterTest.cxx b/Modules/Filtering/FFT/test/itkFFTWComplexToComplexFFTImageFilterTest.cxx index a5b0489b559..9ec1f11e63d 100644 --- a/Modules/Filtering/FFT/test/itkFFTWComplexToComplexFFTImageFilterTest.cxx +++ b/Modules/Filtering/FFT/test/itkFFTWComplexToComplexFFTImageFilterTest.cxx @@ -49,7 +49,7 @@ transformImage(const char * inputImageFileName, const char * outputImageFileName { using RealPixelType = TPixel; using ComplexPixelType = std::complex; - constexpr unsigned int Dimension = VDimension; + constexpr unsigned int Dimension{ VDimension }; using RealImageType = itk::Image; using ComplexImageType = itk::Image; diff --git a/Modules/Filtering/FFT/test/itkForward1DFFTImageFilterTest.cxx b/Modules/Filtering/FFT/test/itkForward1DFFTImageFilterTest.cxx index e5a7f5d8d46..a14c6682abc 100644 --- a/Modules/Filtering/FFT/test/itkForward1DFFTImageFilterTest.cxx +++ b/Modules/Filtering/FFT/test/itkForward1DFFTImageFilterTest.cxx @@ -85,7 +85,7 @@ itkForward1DFFTImageFilterTest(int argc, char * argv[]) } using PixelType = double; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ImageType = itk::Image; using ComplexImageType = itk::Image, Dimension>; @@ -104,7 +104,7 @@ itkForward1DFFTImageFilterTest(int argc, char * argv[]) auto fft = FFTForwardType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(fft, Forward1DFFTImageFilter, ImageToImageFilter); - constexpr itk::SizeValueType sizeGreatestPrimeFactor = 2; + constexpr itk::SizeValueType sizeGreatestPrimeFactor{ 2 }; ITK_TEST_SET_GET_VALUE(sizeGreatestPrimeFactor, fft->GetSizeGreatestPrimeFactor()); return doTest(argv[1], argv[2]); diff --git a/Modules/Filtering/FFT/test/itkForwardInverseFFTImageFilterTest.cxx b/Modules/Filtering/FFT/test/itkForwardInverseFFTImageFilterTest.cxx index 84d4e3fb65e..40761319428 100644 --- a/Modules/Filtering/FFT/test/itkForwardInverseFFTImageFilterTest.cxx +++ b/Modules/Filtering/FFT/test/itkForwardInverseFFTImageFilterTest.cxx @@ -40,7 +40,7 @@ itkForwardInverseFFTImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using FloatType = float; using DoubleType = double; using FloatImageType = itk::Image; diff --git a/Modules/Filtering/FFT/test/itkForwardInverseFFTTest.h b/Modules/Filtering/FFT/test/itkForwardInverseFFTTest.h index 30adb3f846c..5392f5ff038 100644 --- a/Modules/Filtering/FFT/test/itkForwardInverseFFTTest.h +++ b/Modules/Filtering/FFT/test/itkForwardInverseFFTTest.h @@ -25,7 +25,7 @@ template bool ForwardInverseFullFFTTest(const char * inputFileName) { - constexpr double tolerance = 1.e-3; + constexpr double tolerance{ 1.e-3 }; using ImageType = typename TForwardFFT::InputImageType; using ReaderType = itk::ImageFileReader; auto reader = ReaderType::New(); @@ -66,7 +66,7 @@ template bool ForwardInverseHalfFFTTest(const char * inputFileName) { - constexpr double tolerance = 1.e-3; + constexpr double tolerance{ 1.e-3 }; using ImageType = typename TForwardFFT::InputImageType; using ReaderType = itk::ImageFileReader; auto reader = ReaderType::New(); diff --git a/Modules/Filtering/FFT/test/itkInverse1DFFTImageFilterTest.cxx b/Modules/Filtering/FFT/test/itkInverse1DFFTImageFilterTest.cxx index 9a7467e2328..c050e4679ca 100644 --- a/Modules/Filtering/FFT/test/itkInverse1DFFTImageFilterTest.cxx +++ b/Modules/Filtering/FFT/test/itkInverse1DFFTImageFilterTest.cxx @@ -77,7 +77,7 @@ itkInverse1DFFTImageFilterTest(int argc, char * argv[]) } using PixelType = double; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ImageType = itk::Image; using ComplexImageType = itk::Image, Dimension>; @@ -100,7 +100,7 @@ itkInverse1DFFTImageFilterTest(int argc, char * argv[]) auto fft = FFTInverseType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(fft, Inverse1DFFTImageFilter, ImageToImageFilter); - constexpr itk::SizeValueType sizeGreatestPrimeFactor = 2; + constexpr itk::SizeValueType sizeGreatestPrimeFactor{ 2 }; ITK_TEST_SET_GET_VALUE(sizeGreatestPrimeFactor, fft->GetSizeGreatestPrimeFactor()); diff --git a/Modules/Filtering/FFT/test/itkVnlComplexToComplexFFTImageFilterTest.cxx b/Modules/Filtering/FFT/test/itkVnlComplexToComplexFFTImageFilterTest.cxx index 129afb1ca48..e3657e4dd07 100644 --- a/Modules/Filtering/FFT/test/itkVnlComplexToComplexFFTImageFilterTest.cxx +++ b/Modules/Filtering/FFT/test/itkVnlComplexToComplexFFTImageFilterTest.cxx @@ -33,7 +33,7 @@ transformImage(const char * inputImageFileName, const char * outputImageFileName { using RealPixelType = TPixel; using ComplexPixelType = std::complex; - constexpr unsigned int Dimension = VDimension; + constexpr unsigned int Dimension{ VDimension }; using RealImageType = itk::Image; using ComplexImageType = itk::Image; diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingBaseTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingBaseTest.cxx index f7c0747c0ca..1d1df60c91a 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingBaseTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingBaseTest.cxx @@ -110,7 +110,7 @@ itkFastMarchingBaseTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = float; auto useMeshVsImage = std::stoul(argv[1]); @@ -157,7 +157,7 @@ itkFastMarchingBaseTest(int argc, char * argv[]) auto processedPoints = ImageFastMarching::NodePairContainerType::New(); typename ImageFastMarching::NodePairType node_pair; - constexpr ImageType::OffsetType offset = { { 28, 35 } }; + constexpr ImageType::OffsetType offset{ 28, 35 }; constexpr itk::Index index{}; diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingExtensionImageFilterTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingExtensionImageFilterTest.cxx index f0c496b935c..ed15624f3ac 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingExtensionImageFilterTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingExtensionImageFilterTest.cxx @@ -44,7 +44,7 @@ int itkFastMarchingExtensionImageFilterTest(int, char *[]) { // create a fastmarching object - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using FloatImageType = itk::Image; @@ -74,7 +74,7 @@ itkFastMarchingExtensionImageFilterTest(int, char *[]) // setup alive points auto AlivePoints = NodePairContainerType::New(); - constexpr FloatImageType::OffsetType offset0 = { { 28, 35 } }; + constexpr FloatImageType::OffsetType offset0{ 28, 35 }; itk::Index<2> index{}; @@ -113,7 +113,7 @@ itkFastMarchingExtensionImageFilterTest(int, char *[]) marcher->SetTrialPoints(TrialPoints); // specify the size of the output image - constexpr FloatImageType::SizeType size = { { 64, 64 } }; + constexpr FloatImageType::SizeType size{ 64, 64 }; marcher->SetOutputSize(size); // setup a speed image of ones diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx index 2ecb9570152..20c4bb48e8f 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx @@ -39,7 +39,7 @@ FastMarchingImageFilterBaseTestFunction() using FastMarchingImageFilterType = itk::FastMarchingImageFilterBase; auto fastMarchingFilter = FastMarchingImageFilterType::New(); - constexpr bool overrideOutputInformation = true; + constexpr bool overrideOutputInformation{ true }; ITK_TEST_SET_GET_BOOLEAN(fastMarchingFilter, OverrideOutputInformation, overrideOutputInformation); auto outputSize = FastMarchingImageFilterType::OutputSizeType::Filled(32); @@ -82,7 +82,7 @@ itkFastMarchingImageFilterBaseTest(int, char *[]) // Exercise basic object methods // Done outside the helper function in the test because GCC is limited // when calling overloaded base class functions. - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using ImageType = itk::Image; diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealTest1.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealTest1.cxx index 918dd5b4723..268330c0b58 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealTest1.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealTest1.cxx @@ -49,7 +49,7 @@ itkFastMarchingImageFilterRealTest1(int itkNotUsed(argc), char * itkNotUsed(argv // Create a Fast Marching image filter object using PixelType = float; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using FloatImageType = itk::Image; @@ -85,7 +85,7 @@ itkFastMarchingImageFilterRealTest1(int itkNotUsed(argc), char * itkNotUsed(argv NodePairType node_pair; - constexpr FloatImageType::OffsetType offset0 = { { 28, 35 } }; + constexpr FloatImageType::OffsetType offset0{ 28, 35 }; itk::Index index{}; @@ -137,7 +137,7 @@ itkFastMarchingImageFilterRealTest1(int itkNotUsed(argc), char * itkNotUsed(argv ITK_TEST_SET_GET_VALUE(trial, marcher->GetTrialPoints()); // Specify the size of the output image - constexpr FloatImageType::SizeType size = { { 64, 64 } }; + constexpr FloatImageType::SizeType size{ 64, 64 }; marcher->SetOutputSize(size); // Set up a speed image of ones @@ -174,7 +174,7 @@ itkFastMarchingImageFilterRealTest1(int itkNotUsed(argc), char * itkNotUsed(argv bool passed = true; - constexpr double outputValueThreshold = 1.42; + constexpr double outputValueThreshold{ 1.42 }; while (!iterator.IsAtEnd()) { FloatImageType::IndexType tempIndex = iterator.GetIndex(); diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealTest2.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealTest2.cxx index 366fbf3b824..81d6891c9a7 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealTest2.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealTest2.cxx @@ -50,7 +50,7 @@ itkFastMarchingImageFilterRealTest2(int itkNotUsed(argc), char * itkNotUsed(argv // Create a Fast Marching image filter object using PixelType = float; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using FloatImageType = itk::Image; @@ -75,7 +75,7 @@ itkFastMarchingImageFilterRealTest2(int itkNotUsed(argc), char * itkNotUsed(argv marcher->AddObserver(itk::ProgressEvent(), command); // Specify the size of the output image - constexpr FloatImageType::SizeType size = { { 64, 64 } }; + constexpr FloatImageType::SizeType size{ 64, 64 }; marcher->SetOutputSize(size); // Set up a speed image of ones @@ -93,7 +93,7 @@ itkFastMarchingImageFilterRealTest2(int itkNotUsed(argc), char * itkNotUsed(argv aliveImage->Allocate(); aliveImage->FillBuffer(0.0); - constexpr FloatImageType::OffsetType offset0 = { { 28, 35 } }; + constexpr FloatImageType::OffsetType offset0{ 28, 35 }; itk::Index index{}; index += offset0; @@ -157,7 +157,7 @@ itkFastMarchingImageFilterRealTest2(int itkNotUsed(argc), char * itkNotUsed(argv ITK_EXERCISE_BASIC_OBJECT_METHODS(adaptor, FastMarchingImageToNodePairContainerAdaptor, Object); - constexpr bool isForbiddenImageBinaryMask = true; + constexpr bool isForbiddenImageBinaryMask{ true }; ITK_TEST_SET_GET_BOOLEAN(adaptor, IsForbiddenImageBinaryMask, isForbiddenImageBinaryMask); adaptor->SetAliveImage(aliveImage.GetPointer()); @@ -200,7 +200,7 @@ itkFastMarchingImageFilterRealTest2(int itkNotUsed(argc), char * itkNotUsed(argv bool passed = true; - constexpr double threshold = 1.42; + constexpr double threshold{ 1.42 }; while (!iterator.IsAtEnd()) { FloatImageType::IndexType tempIndex = iterator.GetIndex(); diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealWithNumberOfElementsTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealWithNumberOfElementsTest.cxx index d7be150e66f..a334a7ad087 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealWithNumberOfElementsTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealWithNumberOfElementsTest.cxx @@ -30,7 +30,7 @@ itkFastMarchingImageFilterRealWithNumberOfElementsTest(int, char *[]) { // create a fastmarching object using PixelType = float; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using FloatImageType = itk::Image; @@ -53,7 +53,7 @@ itkFastMarchingImageFilterRealWithNumberOfElementsTest(int, char *[]) NodePairType node_pair; - constexpr FloatImageType::OffsetType offset0 = { { 28, 35 } }; + constexpr FloatImageType::OffsetType offset0{ 28, 35 }; itk::Index<2> index{}; @@ -103,7 +103,7 @@ itkFastMarchingImageFilterRealWithNumberOfElementsTest(int, char *[]) marcher->SetTrialPoints(trial); // specify the size of the output image - constexpr FloatImageType::SizeType size = { { 64, 64 } }; + constexpr FloatImageType::SizeType size{ 64, 64 }; marcher->SetOutputSize(size); // setup a speed image of ones diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest.cxx index a3929eeb875..4e8194322a3 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest.cxx @@ -29,7 +29,7 @@ itkFastMarchingQuadEdgeMeshFilterBaseTest(int, char *[]) using PixelType = float; using CoordType = double; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using Traits = itk::QuadEdgeMeshExtendedTraits; @@ -82,7 +82,7 @@ itkFastMarchingStoppingCriterionBaseTest(int, char *[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension3D = 3; + constexpr unsigned int Dimension3D{ 3 }; using MeshType = itk::QuadEdgeMesh; using MeshStoppingCriterionType = itk::FastMarchingStoppingCriterionBaseHelperTest; diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingTest.cxx index 7914006f6e4..cadae9bf846 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingTest.cxx @@ -78,7 +78,7 @@ itkFastMarchingTest(int argc, char * argv[]) NodeType node; - constexpr FloatImage::OffsetType offset0 = { { 28, 35 } }; + constexpr FloatImage::OffsetType offset0{ 28, 35 }; itk::Index<2> index{}; diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingTest2.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingTest2.cxx index ab608cc4bfb..a274f455c9d 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingTest2.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingTest2.cxx @@ -66,7 +66,7 @@ itkFastMarchingTest2(int, char *[]) NodeType node; - constexpr FloatImage::OffsetType offset0 = { { 28, 35 } }; + constexpr FloatImage::OffsetType offset0{ 28, 35 }; itk::Index<2> index{}; @@ -117,7 +117,7 @@ itkFastMarchingTest2(int, char *[]) marcher->SetTrialPoints(trialPoints); // specify the size of the output image - constexpr FloatImage::SizeType size = { { 64, 64 } }; + constexpr FloatImage::SizeType size{ 64, 64 }; marcher->SetOutputSize(size); // setup a speed image of ones diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingThresholdStoppingCriterionTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingThresholdStoppingCriterionTest.cxx index cd567c8d444..3c5d32a44ac 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingThresholdStoppingCriterionTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingThresholdStoppingCriterionTest.cxx @@ -23,7 +23,7 @@ int itkFastMarchingThresholdStoppingCriterionTest(int, char *[]) { using PixelType = float; - constexpr unsigned int Dimension2D = 2; + constexpr unsigned int Dimension2D{ 2 }; using ImageType = itk::Image; @@ -37,7 +37,7 @@ itkFastMarchingThresholdStoppingCriterionTest(int, char *[]) std::cout << "Description: " << imageCriterion->GetDescription() << std::endl; - constexpr unsigned int Dimension3D = 3; + constexpr unsigned int Dimension3D{ 3 }; using MeshType = itk::QuadEdgeMesh; using MeshStoppingCriterionType = itk::FastMarchingThresholdStoppingCriterion; diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingUpwindGradientBaseTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingUpwindGradientBaseTest.cxx index a42e12026d3..1c227b72bf5 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingUpwindGradientBaseTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingUpwindGradientBaseTest.cxx @@ -46,7 +46,7 @@ itkFastMarchingUpwindGradientBaseTest(int, char *[]) // create a fastmarching object using PixelType = float; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using FloatImageType = itk::Image; @@ -79,7 +79,7 @@ itkFastMarchingUpwindGradientBaseTest(int, char *[]) // setup alive points auto AlivePoints = NodePairContainerType::New(); - constexpr FloatImageType::OffsetType offset0 = { { 28, 35 } }; + constexpr FloatImageType::OffsetType offset0{ 28, 35 }; itk::Index<2> index{}; @@ -115,7 +115,7 @@ itkFastMarchingUpwindGradientBaseTest(int, char *[]) marcher->SetTrialPoints(TrialPoints); // specify the size of the output image - constexpr FloatImageType::SizeType size = { { 64, 64 } }; + constexpr FloatImageType::SizeType size{ 64, 64 }; marcher->SetOutputSize(size); // setup a speed image of ones @@ -189,10 +189,10 @@ itkFastMarchingUpwindGradientBaseTest(int, char *[]) // Set up target points. // The algorithm will stop when it reaches these points. // This point is closest to the AlivePoint: - constexpr FloatImageType::OffsetType offset1 = { { 50, 50 } }; - constexpr FloatImageType::OffsetType offset2 = { { 40, 40 } }; + constexpr FloatImageType::OffsetType offset1{ 50, 50 }; + constexpr FloatImageType::OffsetType offset2{ 40, 40 }; // This point is farthest from the AlivePoint: - constexpr FloatImageType::OffsetType offset3 = { { 0, 0 } }; + constexpr FloatImageType::OffsetType offset3{ 0, 0 }; const std::vector targetOffsets{ offset1, offset2, offset3 }; std::vector TargetNodes; diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingUpwindGradientTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingUpwindGradientTest.cxx index 34628105387..7598cc70120 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingUpwindGradientTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingUpwindGradientTest.cxx @@ -70,7 +70,7 @@ itkFastMarchingUpwindGradientTest(int, char *[]) NodeType node; - constexpr FloatImage::OffsetType offset0 = { { 28, 35 } }; + constexpr FloatImage::OffsetType offset0{ 28, 35 }; itk::Index<2> index{}; @@ -121,7 +121,7 @@ itkFastMarchingUpwindGradientTest(int, char *[]) marcher->SetTrialPoints(trialPoints); // specify the size of the output image - constexpr FloatImage::SizeType size = { { 64, 64 } }; + constexpr FloatImage::SizeType size{ 64, 64 }; marcher->SetOutputSize(size); // setup a speed image of ones @@ -140,17 +140,17 @@ itkFastMarchingUpwindGradientTest(int, char *[]) // speedImage->Print( std::cout ); marcher->SetInput(speedImage); - constexpr double stoppingValue = 100.0; + constexpr double stoppingValue{ 100.0 }; marcher->SetStoppingValue(stoppingValue); ITK_TEST_SET_GET_VALUE(stoppingValue, marcher->GetStoppingValue()); - constexpr bool generateGradientImage = true; + constexpr bool generateGradientImage{ true }; ITK_TEST_SET_GET_BOOLEAN(marcher, GenerateGradientImage, generateGradientImage); // Exercise this member function. // It is also necessary that the TargetOffset be set to 0.0 for the TargetReached // tests to pass. - constexpr double targetOffset = 0.0; + constexpr double targetOffset{ 0.0 }; marcher->SetTargetOffset(targetOffset); ITK_TEST_SET_GET_VALUE(targetOffset, marcher->GetTargetOffset()); @@ -226,10 +226,10 @@ itkFastMarchingUpwindGradientTest(int, char *[]) // Set up target points. // The algorithm will stop when it reaches these points. // This point is closest to the AlivePoint: - constexpr FloatImage::OffsetType offset2 = { { 40, 40 } }; - constexpr FloatImage::OffsetType offset1 = { { 50, 50 } }; + constexpr FloatImage::OffsetType offset2{ 40, 40 }; + constexpr FloatImage::OffsetType offset1{ 50, 50 }; // This point is farthest from the AlivePoint: - constexpr FloatImage::OffsetType offset3 = { { 0, 0 } }; + constexpr FloatImage::OffsetType offset3{ 0, 0 }; using VectorType = std::vector; const VectorType targetOffsets{ offset1, offset2, offset3 }; @@ -349,7 +349,7 @@ itkFastMarchingUpwindGradientTest(int, char *[]) #endif ITK_TEST_SET_GET_VALUE(FloatFMType::TargetConditionEnum::NoTargets, marcher->GetTargetReachedMode()); - constexpr double newStoppingValue = 10.0; + constexpr double newStoppingValue{ 10.0 }; marcher->SetStoppingValue(newStoppingValue); ITK_TRY_EXPECT_NO_EXCEPTION(marcher->Update()); diff --git a/Modules/Filtering/GPUThresholding/test/itkGPUBinaryThresholdImageFilterTest.cxx b/Modules/Filtering/GPUThresholding/test/itkGPUBinaryThresholdImageFilterTest.cxx index 777b954c1fc..644f66b42a1 100644 --- a/Modules/Filtering/GPUThresholding/test/itkGPUBinaryThresholdImageFilterTest.cxx +++ b/Modules/Filtering/GPUThresholding/test/itkGPUBinaryThresholdImageFilterTest.cxx @@ -62,10 +62,10 @@ runGPUBinaryThresholdImageFilterTest(const std::string & inFile, const std::stri using GPUThresholdFilterType = itk::GPUBinaryThresholdImageFilter; // threshold parameters - constexpr InputPixelType upperThreshold = 255; - constexpr InputPixelType lowerThreshold = 175; - constexpr OutputPixelType outsideValue = 0; - constexpr OutputPixelType insideValue = 255; + constexpr InputPixelType upperThreshold{ 255 }; + constexpr InputPixelType lowerThreshold{ 175 }; + constexpr OutputPixelType outsideValue{ 0 }; + constexpr OutputPixelType insideValue{ 255 }; for (int numberOfWorkUnits = 1; numberOfWorkUnits <= 8; ++numberOfWorkUnits) { diff --git a/Modules/Filtering/GPUThresholding/test/itkGPUImageFilterTest.cxx b/Modules/Filtering/GPUThresholding/test/itkGPUImageFilterTest.cxx index 87fa6fc1cd2..5052c0d48e7 100644 --- a/Modules/Filtering/GPUThresholding/test/itkGPUImageFilterTest.cxx +++ b/Modules/Filtering/GPUThresholding/test/itkGPUImageFilterTest.cxx @@ -77,10 +77,10 @@ runGPUImageFilterTest(const std::string & inFile, const std::string & outFile) } // threshold parameters - constexpr InputPixelType upperThreshold = 255; - constexpr InputPixelType lowerThreshold = 175; - constexpr OutputPixelType outsideValue = 0; - constexpr OutputPixelType insideValue = 255; + constexpr InputPixelType upperThreshold{ 255 }; + constexpr InputPixelType lowerThreshold{ 175 }; + constexpr OutputPixelType outsideValue{ 0 }; + constexpr OutputPixelType insideValue{ 255 }; filter1->SetRadius(indexRadius); filter2->SetRadius(indexRadius); diff --git a/Modules/Filtering/ImageCompare/include/itkSTAPLEImageFilter.hxx b/Modules/Filtering/ImageCompare/include/itkSTAPLEImageFilter.hxx index 3c49be845c9..a0c507eadbd 100644 --- a/Modules/Filtering/ImageCompare/include/itkSTAPLEImageFilter.hxx +++ b/Modules/Filtering/ImageCompare/include/itkSTAPLEImageFilter.hxx @@ -47,12 +47,12 @@ template void STAPLEImageFilter::GenerateData() { - constexpr double epsilon = 1.0e-10; + constexpr double epsilon{ 1.0e-10 }; using IteratorType = ImageScanlineConstIterator; using FuzzyIteratorType = ImageScanlineIterator; - constexpr double min_rms_error = 1.0e-14; // 7 digits of precision + constexpr double min_rms_error{ 1.0e-14 }; // 7 digits of precision // Allocate the output "fuzzy" image. this->GetOutput()->SetBufferedRegion(this->GetOutput()->GetRequestedRegion()); diff --git a/Modules/Filtering/ImageCompare/test/itkAbsoluteValueDifferenceImageFilterTest.cxx b/Modules/Filtering/ImageCompare/test/itkAbsoluteValueDifferenceImageFilterTest.cxx index da60bde4489..5bfd914317c 100644 --- a/Modules/Filtering/ImageCompare/test/itkAbsoluteValueDifferenceImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompare/test/itkAbsoluteValueDifferenceImageFilterTest.cxx @@ -26,17 +26,17 @@ itkAbsoluteValueDifferenceImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; // Define the values of the input images - constexpr float input1Value = 3.0; - constexpr float input2Value = 4.0; + constexpr float input1Value{ 3.0 }; + constexpr float input2Value{ 4.0 }; // Define the values of the output images - constexpr float outputValue = 1.0; + constexpr float outputValue{ 1.0 }; // Define the precision for output comparison - constexpr float epsilon = 1e-6; + constexpr float epsilon{ 1e-6 }; // Declare the types of the images using myImageType1 = itk::Image; diff --git a/Modules/Filtering/ImageCompare/test/itkCheckerBoardImageFilterTest.cxx b/Modules/Filtering/ImageCompare/test/itkCheckerBoardImageFilterTest.cxx index 3f0d75bc406..50ddcdfef15 100644 --- a/Modules/Filtering/ImageCompare/test/itkCheckerBoardImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompare/test/itkCheckerBoardImageFilterTest.cxx @@ -32,7 +32,7 @@ itkCheckerBoardImageFilterTest(int argc, char * argv[]) } // Define the dimension of the images - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Declare the pixel types of the images using PixelType = unsigned char; @@ -82,7 +82,7 @@ itkCheckerBoardImageFilterTest(int argc, char * argv[]) IteratorType it1(inputImageA, inputImageA->GetBufferedRegion()); // Initialize the content of Image A - constexpr ImageType::PixelType input1Value = 2; + constexpr ImageType::PixelType input1Value{ 2 }; while (!it1.IsAtEnd()) { it1.Set(input1Value); @@ -93,7 +93,7 @@ itkCheckerBoardImageFilterTest(int argc, char * argv[]) IteratorType it2(inputImageB, inputImageB->GetBufferedRegion()); // Initialize the content of Image B - constexpr ImageType::PixelType input2Value = 3; + constexpr ImageType::PixelType input2Value{ 3 }; while (!it2.IsAtEnd()) { it2.Set(input2Value); diff --git a/Modules/Filtering/ImageCompare/test/itkConstrainedValueDifferenceImageFilterTest.cxx b/Modules/Filtering/ImageCompare/test/itkConstrainedValueDifferenceImageFilterTest.cxx index 7a7a46722fc..447a131ae29 100644 --- a/Modules/Filtering/ImageCompare/test/itkConstrainedValueDifferenceImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompare/test/itkConstrainedValueDifferenceImageFilterTest.cxx @@ -31,7 +31,7 @@ itkConstrainedValueDifferenceImageFilterTest(int argc, char * argv[]) } // Define the dimension of the images - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Define the pixel types using InputImage1PixelType = float; @@ -77,7 +77,7 @@ itkConstrainedValueDifferenceImageFilterTest(int argc, char * argv[]) InputImage1IteratorType it1(inputImageA, inputImageA->GetBufferedRegion()); // Initialize the content of Image A - constexpr InputImage1Type::PixelType valueA = 125; + constexpr InputImage1Type::PixelType valueA{ 125 }; while (!it1.IsAtEnd()) { it1.Set(valueA); diff --git a/Modules/Filtering/ImageCompare/test/itkImageFileReaderIOToRequestedRegionMismatchTest.cxx b/Modules/Filtering/ImageCompare/test/itkImageFileReaderIOToRequestedRegionMismatchTest.cxx index 846a0f2ea60..1e99db3fac7 100644 --- a/Modules/Filtering/ImageCompare/test/itkImageFileReaderIOToRequestedRegionMismatchTest.cxx +++ b/Modules/Filtering/ImageCompare/test/itkImageFileReaderIOToRequestedRegionMismatchTest.cxx @@ -31,7 +31,7 @@ itkImageFileReaderIOToRequestedRegionMismatchTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputImageType = itk::Image; using OutputImageType = itk::Image; diff --git a/Modules/Filtering/ImageCompare/test/itkSTAPLEImageFilterTest.cxx b/Modules/Filtering/ImageCompare/test/itkSTAPLEImageFilterTest.cxx index caa75934cd7..a74aead76ce 100644 --- a/Modules/Filtering/ImageCompare/test/itkSTAPLEImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompare/test/itkSTAPLEImageFilterTest.cxx @@ -222,7 +222,7 @@ itkSTAPLEImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputImageType = itk::Image; using OutputImageType = itk::Image; diff --git a/Modules/Filtering/ImageCompare/test/itkSimilarityIndexImageFilterTest.cxx b/Modules/Filtering/ImageCompare/test/itkSimilarityIndexImageFilterTest.cxx index f64c0bd50ed..3dba30d4a11 100644 --- a/Modules/Filtering/ImageCompare/test/itkSimilarityIndexImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompare/test/itkSimilarityIndexImageFilterTest.cxx @@ -99,7 +99,7 @@ itkSimilarityIndexImageFilterTest(int, char *[]) // check results - constexpr FilterType::RealType trueOverlap = 0.5 / 0.75; + constexpr FilterType::RealType trueOverlap{ 0.5 / 0.75 }; const FilterType::RealType overlap = filter->GetSimilarityIndex(); std::cout << " True index: " << trueOverlap << std::endl; diff --git a/Modules/Filtering/ImageCompare/test/itkSquaredDifferenceImageFilterTest.cxx b/Modules/Filtering/ImageCompare/test/itkSquaredDifferenceImageFilterTest.cxx index 512d9b930b4..e3f7a4b074e 100644 --- a/Modules/Filtering/ImageCompare/test/itkSquaredDifferenceImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompare/test/itkSquaredDifferenceImageFilterTest.cxx @@ -26,17 +26,17 @@ itkSquaredDifferenceImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; // Define the values of the input images - constexpr float input1Value = 3.0; - constexpr float input2Value = 4.0; + constexpr float input1Value{ 3.0 }; + constexpr float input2Value{ 4.0 }; // Define the values of the output images - constexpr float outputValue = 1.0; + constexpr float outputValue{ 1.0 }; // Define the precision for output comparison - constexpr float epsilon = 1e-6; + constexpr float epsilon{ 1e-6 }; // Declare the types of the images using myImageType1 = itk::Image; diff --git a/Modules/Filtering/ImageCompare/test/itkTestingComparisonImageFilterTest.cxx b/Modules/Filtering/ImageCompare/test/itkTestingComparisonImageFilterTest.cxx index e8854270f8a..982f97180eb 100644 --- a/Modules/Filtering/ImageCompare/test/itkTestingComparisonImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompare/test/itkTestingComparisonImageFilterTest.cxx @@ -43,7 +43,7 @@ itkTestingComparisonImageFilterTest(int argc, char * argv[]) using InputPixelType = short; using OutputPixelType = unsigned short; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputImageType = itk::Image; using OutputImageType = itk::Image; @@ -107,7 +107,7 @@ itkTestingComparisonImageFilterTest(int argc, char * argv[]) auto meanDifference = static_cast(std::stod(argv[10])); - constexpr double epsilon = 1e-4; + constexpr double epsilon{ 1e-4 }; std::cout.precision(static_cast(itk::Math::abs(std::log10(epsilon)))); if (!itk::Math::FloatAlmostEqual(meanDifference, filter->GetMeanDifference(), 10, epsilon)) { diff --git a/Modules/Filtering/ImageCompose/test/itkComposeRGBAImageFilterTest.cxx b/Modules/Filtering/ImageCompose/test/itkComposeRGBAImageFilterTest.cxx index 8711133b3e8..36729ca5efe 100644 --- a/Modules/Filtering/ImageCompose/test/itkComposeRGBAImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompose/test/itkComposeRGBAImageFilterTest.cxx @@ -46,7 +46,7 @@ itkComposeRGBAImageFilterTest(int argc, char * argv[]) // Typedefs using ScalarPixelType = unsigned char; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using RGBAPixelType = itk::RGBAPixel; using ScalarImageType = itk::Image; using RGBAImageType = itk::Image; diff --git a/Modules/Filtering/ImageCompose/test/itkImageReadRealAndImaginaryWriteComplexTest.cxx b/Modules/Filtering/ImageCompose/test/itkImageReadRealAndImaginaryWriteComplexTest.cxx index c4eade18bca..632e2ce6de1 100644 --- a/Modules/Filtering/ImageCompose/test/itkImageReadRealAndImaginaryWriteComplexTest.cxx +++ b/Modules/Filtering/ImageCompose/test/itkImageReadRealAndImaginaryWriteComplexTest.cxx @@ -46,7 +46,7 @@ itkImageReadRealAndImaginaryWriteComplexTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = float; using OutputPixelType = float; diff --git a/Modules/Filtering/ImageCompose/test/itkJoinImageFilterTest.cxx b/Modules/Filtering/ImageCompose/test/itkJoinImageFilterTest.cxx index 9b08f6606d7..d582c081a7c 100644 --- a/Modules/Filtering/ImageCompose/test/itkJoinImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompose/test/itkJoinImageFilterTest.cxx @@ -26,7 +26,7 @@ int itkJoinImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 2; + constexpr unsigned int myDimension{ 2 }; // Declare the types of the images using myImageType1 = itk::Image; diff --git a/Modules/Filtering/ImageCompose/test/itkJoinSeriesImageFilterTest.cxx b/Modules/Filtering/ImageCompose/test/itkJoinSeriesImageFilterTest.cxx index 04fa5de8b50..6ccb8e991a4 100644 --- a/Modules/Filtering/ImageCompose/test/itkJoinSeriesImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompose/test/itkJoinSeriesImageFilterTest.cxx @@ -39,14 +39,14 @@ int itkJoinSeriesImageFilterTest(int, char *[]) { - constexpr unsigned int streamDivisions = 2; + constexpr unsigned int streamDivisions{ 2 }; using PixelType = unsigned char; using InputImageType = itk::Image; using OutputImageType = itk::Image; // Expected result - constexpr OutputImageType::IndexType expectedIndex = { { 1, 2, 0, 0 } }; - constexpr OutputImageType::SizeType expectedSize = { { 8, 5, 4, 1 } }; + constexpr OutputImageType::IndexType expectedIndex{ 1, 2, 0, 0 }; + constexpr OutputImageType::SizeType expectedSize{ 8, 5, 4, 1 }; const OutputImageType::RegionType expectedRegion{ expectedIndex, expectedSize }; OutputImageType::SpacingType expectedSpacing; expectedSpacing[0] = 1.1; @@ -60,15 +60,15 @@ itkJoinSeriesImageFilterTest(int, char *[]) expectedOrigin[3] = 0.0; // Create the input images - constexpr int numInputs = 4; - constexpr InputImageType::IndexType index = { { 1, 2 } }; - constexpr InputImageType::SizeType size = { { 8, 5 } }; + constexpr int numInputs{ 4 }; + constexpr InputImageType::IndexType index{ 1, 2 }; + constexpr InputImageType::SizeType size{ 8, 5 }; const InputImageType::RegionType region{ index, size }; - constexpr double spacingValue = 1.3; + constexpr double spacingValue{ 1.3 }; InputImageType::SpacingType spacing; spacing[0] = 1.1; spacing[1] = 1.2; - constexpr double originValue = 0.3; + constexpr double originValue{ 0.3 }; InputImageType::PointType origin; origin[0] = 0.1; origin[1] = 0.2; diff --git a/Modules/Filtering/ImageFeature/include/itkMaskFeaturePointSelectionFilter.hxx b/Modules/Filtering/ImageFeature/include/itkMaskFeaturePointSelectionFilter.hxx index 5c4d5acb877..cbddbd54246 100644 --- a/Modules/Filtering/ImageFeature/include/itkMaskFeaturePointSelectionFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkMaskFeaturePointSelectionFilter.hxx @@ -209,7 +209,7 @@ MaskFeaturePointSelectionFilter::GenerateData() // number of points to select IndexValueType numberOfPointsInserted = -1; // initialize to -1 const IndexValueType maxNumberPointsToInserted = Math::Floor(0.5 + pointMap.size() * m_SelectFraction); - constexpr double TRACE_EPSILON = 1e-8; + constexpr double TRACE_EPSILON{ 1e-8 }; // pick points with highest variance first (inverse iteration) auto rit = pointMap.rbegin(); @@ -286,7 +286,7 @@ MaskFeaturePointSelectionFilter::GenerateData() points->InsertElement(numberOfPointsInserted, point); // mark off connected points - constexpr MapPixelType ineligeblePointCode = 0; + constexpr MapPixelType ineligeblePointCode{ 0 }; for (const auto & m_NonConnectivityOffset : m_NonConnectivityOffsets) { IndexType idx = rit->second; diff --git a/Modules/Filtering/ImageFeature/test/itkBilateralImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkBilateralImageFilterTest.cxx index a15ffd51b11..cd63ad69b82 100644 --- a/Modules/Filtering/ImageFeature/test/itkBilateralImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkBilateralImageFilterTest.cxx @@ -24,7 +24,7 @@ int itkBilateralImageFilterTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using ImageType = itk::Image; @@ -47,18 +47,18 @@ itkBilateralImageFilterTest(int, char *[]) filter->SetDomainSigma(domainSigma); ITK_TEST_SET_GET_VALUE(domainSigma, filter->GetDomainSigma()); - constexpr double domainMu = 2.5; + constexpr double domainMu{ 2.5 }; filter->SetDomainMu(domainMu); ITK_TEST_SET_GET_VALUE(domainMu, filter->GetDomainMu()); - constexpr double rangeSigma = 35.0f; + constexpr double rangeSigma{ 35.0f }; filter->SetRangeSigma(rangeSigma); ITK_TEST_SET_GET_VALUE(rangeSigma, filter->GetRangeSigma()); filter->SetFilterDimensionality(Dimension); ITK_TEST_SET_GET_VALUE(Dimension, filter->GetFilterDimensionality()); - constexpr bool automaticKernelSize = true; + constexpr bool automaticKernelSize{ true }; ITK_TEST_SET_GET_BOOLEAN(filter, AutomaticKernelSize, automaticKernelSize); constexpr typename FilterType::SizeType::SizeValueType radiusVal = 2; @@ -66,7 +66,7 @@ itkBilateralImageFilterTest(int, char *[]) filter->SetRadius(radius); ITK_TEST_SET_GET_VALUE(radius, filter->GetRadius()); - constexpr unsigned long numberOfRangeGaussianSamples = 150; + constexpr unsigned long numberOfRangeGaussianSamples{ 150 }; filter->SetNumberOfRangeGaussianSamples(numberOfRangeGaussianSamples); ITK_TEST_SET_GET_VALUE(numberOfRangeGaussianSamples, filter->GetNumberOfRangeGaussianSamples()); diff --git a/Modules/Filtering/ImageFeature/test/itkBilateralImageFilterTest2.cxx b/Modules/Filtering/ImageFeature/test/itkBilateralImageFilterTest2.cxx index 8ad022219dd..7277fc9a100 100644 --- a/Modules/Filtering/ImageFeature/test/itkBilateralImageFilterTest2.cxx +++ b/Modules/Filtering/ImageFeature/test/itkBilateralImageFilterTest2.cxx @@ -34,7 +34,7 @@ itkBilateralImageFilterTest2(int argc, char * argv[]) } using PixelType = unsigned char; - constexpr unsigned int dimension = 2; + constexpr unsigned int dimension{ 2 }; using myImage = itk::Image; const itk::ImageFileReader::Pointer input = itk::ImageFileReader::New(); input->SetFileName(argv[1]); @@ -78,11 +78,11 @@ itkBilateralImageFilterTest2(int argc, char * argv[]) filter->SetDomainMu(domainMu); ITK_TEST_SET_GET_VALUE(domainMu, filter->GetDomainMu()); - constexpr unsigned int filterDimensionality = dimension; + constexpr unsigned int filterDimensionality{ dimension }; filter->SetFilterDimensionality(filterDimensionality); ITK_TEST_SET_GET_VALUE(filterDimensionality, filter->GetFilterDimensionality()); - constexpr unsigned long numberOfRangeGaussianSamples = 100; + constexpr unsigned long numberOfRangeGaussianSamples{ 100 }; filter->SetNumberOfRangeGaussianSamples(numberOfRangeGaussianSamples); ITK_TEST_SET_GET_VALUE(numberOfRangeGaussianSamples, filter->GetNumberOfRangeGaussianSamples()); diff --git a/Modules/Filtering/ImageFeature/test/itkCannyEdgeDetectionImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkCannyEdgeDetectionImageFilterTest.cxx index 16d8edf668a..48ca178c125 100644 --- a/Modules/Filtering/ImageFeature/test/itkCannyEdgeDetectionImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkCannyEdgeDetectionImageFilterTest.cxx @@ -35,7 +35,7 @@ itkCannyEdgeDetectionImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = float; using InputImage = itk::Image; using OutputPixelType = unsigned char; @@ -55,11 +55,11 @@ itkCannyEdgeDetectionImageFilterTest(int argc, char * argv[]) filter->SetInput(reader->GetOutput()); - constexpr CannyEdgeDetectionImageFilterType::OutputImagePixelType upperThreshold = 30; + constexpr CannyEdgeDetectionImageFilterType::OutputImagePixelType upperThreshold{ 30 }; filter->SetUpperThreshold(upperThreshold); ITK_TEST_SET_GET_VALUE(upperThreshold, filter->GetUpperThreshold()); - constexpr CannyEdgeDetectionImageFilterType::OutputImagePixelType lowerThreshold = 15; + constexpr CannyEdgeDetectionImageFilterType::OutputImagePixelType lowerThreshold{ 15 }; filter->SetLowerThreshold(lowerThreshold); ITK_TEST_SET_GET_VALUE(lowerThreshold, filter->GetLowerThreshold()); diff --git a/Modules/Filtering/ImageFeature/test/itkCannyEdgeDetectionImageFilterTest2.cxx b/Modules/Filtering/ImageFeature/test/itkCannyEdgeDetectionImageFilterTest2.cxx index 9221e778ffd..248a4219d9e 100644 --- a/Modules/Filtering/ImageFeature/test/itkCannyEdgeDetectionImageFilterTest2.cxx +++ b/Modules/Filtering/ImageFeature/test/itkCannyEdgeDetectionImageFilterTest2.cxx @@ -35,7 +35,7 @@ itkCannyEdgeDetectionImageFilterTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = float; using InputImage = itk::Image; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/ImageFeature/test/itkDerivativeImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkDerivativeImageFilterTest.cxx index 87b3dce78aa..b76eec55ad9 100644 --- a/Modules/Filtering/ImageFeature/test/itkDerivativeImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkDerivativeImageFilterTest.cxx @@ -42,7 +42,7 @@ itkDerivativeImageFilterTest(int argc, char * argv[]) using InputPixelType = unsigned short; using OutputPixelType = short; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputImageType = itk::Image; using OutputImageType = itk::Image; diff --git a/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterScaleSpaceTest.cxx b/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterScaleSpaceTest.cxx index 326f727b1c6..6a4f7d8fa1d 100644 --- a/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterScaleSpaceTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterScaleSpaceTest.cxx @@ -29,8 +29,8 @@ NormalizeSineWave(double frequencyPerImage, unsigned int order, double pixelSpac // frequency, this method verifies that the normalized scale-scale // is with in reasonable tolerance of the theoretical value. - constexpr unsigned int ImageDimension = 1; - constexpr unsigned int imageSize = 1024; + constexpr unsigned int ImageDimension{ 1 }; + constexpr unsigned int imageSize{ 1024 }; const double tolerance1 = std::pow(.001, 1.0 / order); // still larger than it should be! @@ -129,7 +129,7 @@ NormalizeSineWave(double frequencyPerImage, unsigned int order, double pixelSpac ++oiter; } - constexpr double tolerance2 = 0.01; + constexpr double tolerance2{ 0.01 }; if (!itk::Math::FloatAlmostEqual(maxLx, expectedMax, 10, tolerance2)) { std::cout << "Error at frequency: " << frequencyPerImage << std::endl; diff --git a/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterTest.cxx index db6444f46ba..f0d8cb05888 100644 --- a/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterTest.cxx @@ -40,7 +40,7 @@ itkDiscreteGaussianDerivativeImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using OutputPixelType = unsigned short; @@ -102,10 +102,10 @@ itkDiscreteGaussianDerivativeImageFilterTest(int argc, char * argv[]) derivativeFilter->SetMaximumKernelWidth(maxKernelWidth); ITK_TEST_SET_GET_VALUE(maxKernelWidth, derivativeFilter->GetMaximumKernelWidth()); - constexpr bool useImageSpacing = true; + constexpr bool useImageSpacing{ true }; ITK_TEST_SET_GET_BOOLEAN(derivativeFilter, UseImageSpacing, useImageSpacing); - constexpr bool normalizeAcrossScale = false; + constexpr bool normalizeAcrossScale{ false }; ITK_TEST_SET_GET_BOOLEAN(derivativeFilter, NormalizeAcrossScale, normalizeAcrossScale); constexpr unsigned int internalNumberOfStreamDivisions = DerivativeFilterType::InputImageType::GetImageDimension() * diff --git a/Modules/Filtering/ImageFeature/test/itkGradientVectorFlowImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkGradientVectorFlowImageFilterTest.cxx index 9f988d0f5da..fd414b82e09 100644 --- a/Modules/Filtering/ImageFeature/test/itkGradientVectorFlowImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkGradientVectorFlowImageFilterTest.cxx @@ -26,7 +26,7 @@ int itkGradientVectorFlowImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 2; + constexpr unsigned int myDimension{ 2 }; // Declare gradient type using myGradientType = itk::CovariantVector; @@ -137,15 +137,15 @@ itkGradientVectorFlowImageFilterTest(int, char *[]) m_GVFFilter->SetLaplacianFilter(m_LFilter); ITK_TEST_SET_GET_VALUE(m_LFilter, m_GVFFilter->GetLaplacianFilter()); - constexpr double noiseLevel = 500; + constexpr double noiseLevel{ 500 }; m_GVFFilter->SetNoiseLevel(noiseLevel); ITK_TEST_SET_GET_VALUE(noiseLevel, m_GVFFilter->GetNoiseLevel()); - constexpr double timeStep = 0.001; + constexpr double timeStep{ 0.001 }; m_GVFFilter->SetTimeStep(timeStep); ITK_TEST_SET_GET_VALUE(timeStep, m_GVFFilter->GetTimeStep()); - constexpr int iterationNum = 2; + constexpr int iterationNum{ 2 }; m_GVFFilter->SetIterationNum(iterationNum); ITK_TEST_SET_GET_VALUE(iterationNum, m_GVFFilter->GetIterationNum()); diff --git a/Modules/Filtering/ImageFeature/test/itkHessian3DToVesselnessMeasureImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkHessian3DToVesselnessMeasureImageFilterTest.cxx index 10fff2a3996..8418a40b72e 100644 --- a/Modules/Filtering/ImageFeature/test/itkHessian3DToVesselnessMeasureImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkHessian3DToVesselnessMeasureImageFilterTest.cxx @@ -33,7 +33,7 @@ itkHessian3DToVesselnessMeasureImageFilterTest(int argc, char * argv[]) } // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; // Declare the types of the images using myImageType = itk::Image; diff --git a/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterScaleSpaceTest.cxx b/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterScaleSpaceTest.cxx index ae3d13f30b6..295ef7ca8a2 100644 --- a/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterScaleSpaceTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterScaleSpaceTest.cxx @@ -27,7 +27,7 @@ int itkHessianRecursiveGaussianFilterScaleSpaceTest(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = double; using ImageType = itk::Image; using IndexType = itk::Index; @@ -58,7 +58,7 @@ itkHessianRecursiveGaussianFilterScaleSpaceTest(int, char *[]) using IteratorType = itk::ImageRegionIteratorWithIndex; - constexpr unsigned int numberOfScales = 4; + constexpr unsigned int numberOfScales{ 4 }; double scales[numberOfScales]; scales[0] = 1.0; scales[1] = 2.0; @@ -119,7 +119,7 @@ itkHessianRecursiveGaussianFilterScaleSpaceTest(int, char *[]) IteratorType it(inputImage, inputImage->GetRequestedRegion()); PointType point; - constexpr double objectSize = 5.0; + constexpr double objectSize{ 5.0 }; spacing.Fill(scale / 5.0); diff --git a/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterTest.cxx index ac241d196d0..1741b25b70e 100644 --- a/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterTest.cxx @@ -30,7 +30,7 @@ itkHessianRecursiveGaussianFilterTest(int argc, char * argv[]) } // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; // Declare the types of the images using myImageType = itk::Image; diff --git a/Modules/Filtering/ImageFeature/test/itkHessianToObjectnessMeasureImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkHessianToObjectnessMeasureImageFilterTest.cxx index 562586df32b..ed7bf96b3e3 100644 --- a/Modules/Filtering/ImageFeature/test/itkHessianToObjectnessMeasureImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkHessianToObjectnessMeasureImageFilterTest.cxx @@ -36,7 +36,7 @@ itkHessianToObjectnessMeasureImageFilterTest(int argc, char * argv[]) } // Define the dimension of the images - constexpr unsigned char Dimension = 2; + constexpr unsigned char Dimension{ 2 }; using PixelType = float; @@ -74,21 +74,21 @@ itkHessianToObjectnessMeasureImageFilterTest(int argc, char * argv[]) objectnessFilter->SetInput(gaussianFilter->GetOutput()); // Set the filter properties - constexpr bool scaleObjectnessMeasure = false; + constexpr bool scaleObjectnessMeasure{ false }; ITK_TEST_SET_GET_BOOLEAN(objectnessFilter, ScaleObjectnessMeasure, scaleObjectnessMeasure); bool brightObject = true; ITK_TEST_SET_GET_BOOLEAN(objectnessFilter, BrightObject, brightObject); - constexpr double alphaValue = 0.5; + constexpr double alphaValue{ 0.5 }; objectnessFilter->SetAlpha(alphaValue); ITK_TEST_SET_GET_VALUE(alphaValue, objectnessFilter->GetAlpha()); - constexpr double betaValue = 0.5; + constexpr double betaValue{ 0.5 }; objectnessFilter->SetBeta(betaValue); ITK_TEST_SET_GET_VALUE(betaValue, objectnessFilter->GetBeta()); - constexpr double gammaValue = 0.5; + constexpr double gammaValue{ 0.5 }; objectnessFilter->SetGamma(gammaValue); ITK_TEST_SET_GET_VALUE(gammaValue, objectnessFilter->GetGamma()); diff --git a/Modules/Filtering/ImageFeature/test/itkHoughTransform2DCirclesImageTest.cxx b/Modules/Filtering/ImageFeature/test/itkHoughTransform2DCirclesImageTest.cxx index d6d0fa27844..413e2f464e6 100644 --- a/Modules/Filtering/ImageFeature/test/itkHoughTransform2DCirclesImageTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkHoughTransform2DCirclesImageTest.cxx @@ -56,11 +56,11 @@ Test_GetCircles_should_return_empty_list_when_NumberOfCircles_is_set_to_zero() // Create an image that has at least one circle. const auto image = ImageType::New(); - constexpr ImageType::SizeType size = { { 64, 64 } }; + constexpr ImageType::SizeType size{ 64, 64 }; image->SetRegions(size); image->AllocateInitialized(); - constexpr unsigned int center[] = { 16, 16 }; - constexpr double radius = 7.0; + constexpr unsigned int center[]{ 16, 16 }; + constexpr double radius{ 7.0 }; CreateCircle(image, center, radius); using FilterType = itk::HoughTransform2DCirclesImageFilter; @@ -93,7 +93,7 @@ Test_GetCircles_should_return_empty_list_when_input_image_is_uniform() // Create an input image for the filter. const auto image = ImageType::New(); - constexpr ImageType::SizeType size = { { 32, 32 } }; + constexpr ImageType::SizeType size{ 32, 32 }; image->SetRegions(size); image->Allocate(); @@ -130,12 +130,12 @@ Test_RadiusImage_and_OutputImage_may_have_different_types() // Create an image that has at least one circle. const auto inputImage = InputImageType::New(); - constexpr InputImageType::SizeType size = { { 64, 64 } }; + constexpr InputImageType::SizeType size{ 64, 64 }; inputImage->SetRegions(size); inputImage->Allocate(); inputImage->FillBuffer(1); - constexpr unsigned int center[] = { 32, 32 }; - constexpr double radius = 8.5; + constexpr unsigned int center[]{ 32, 32 }; + constexpr double radius{ 8.5 }; CreateCircle(inputImage, center, radius); using OutputPixelType = unsigned long; @@ -231,7 +231,7 @@ Test_RadiusImage_and_OutputImage_may_have_different_types() success = false; } - constexpr double radiusTolerance = 1.0; + constexpr double radiusTolerance{ 1.0 }; if (!itk::Math::FloatAlmostEqual(radius1, radius, 0, radiusTolerance)) { @@ -257,11 +257,11 @@ Test_Center_IsInside_SpatialObject_from_GetCircles() using PixelType = unsigned int; using ImageType = itk::Image; const auto image = ImageType::New(); - constexpr ImageType::SizeType imageSize = { { 16, 32 } }; + constexpr ImageType::SizeType imageSize{ 16, 32 }; image->SetRegions(imageSize); image->AllocateInitialized(); - constexpr double center[] = { 6.0, 9.0 }; - constexpr double radius = 1.0; + constexpr double center[]{ 6.0, 9.0 }; + constexpr double radius{ 1.0 }; CreateCircle(image, center, radius); using FilterType = itk::HoughTransform2DCirclesImageFilter; @@ -322,7 +322,7 @@ itkHoughTransform2DCirclesImageTest(int, char *[]) image->AllocateInitialized(); // Create 3 circles - constexpr unsigned int circles = 3; + constexpr unsigned int circles{ 3 }; unsigned int center[circles][Dimension]; double radius[circles]; @@ -364,40 +364,40 @@ itkHoughTransform2DCirclesImageTest(int, char *[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(houghFilter, HoughTransform2DCirclesImageFilter, ImageToImageFilter); - constexpr double threshold = 2.3; + constexpr double threshold{ 2.3 }; houghFilter->SetThreshold(threshold); ITK_TEST_SET_GET_VALUE(threshold, houghFilter->GetThreshold()); - constexpr double minMaxRadius = 16.2; + constexpr double minMaxRadius{ 16.2 }; houghFilter->SetRadius(minMaxRadius); ITK_TEST_SET_GET_VALUE(minMaxRadius, houghFilter->GetMinimumRadius()); ITK_TEST_SET_GET_VALUE(minMaxRadius, houghFilter->GetMaximumRadius()); - constexpr double minimumRadius = 2.1; + constexpr double minimumRadius{ 2.1 }; houghFilter->SetMinimumRadius(minimumRadius); ITK_TEST_SET_GET_VALUE(minimumRadius, houghFilter->GetMinimumRadius()); - constexpr double maximumRadius = 20.4; + constexpr double maximumRadius{ 20.4 }; houghFilter->SetMaximumRadius(maximumRadius); ITK_TEST_SET_GET_VALUE(maximumRadius, houghFilter->GetMaximumRadius()); - constexpr double gradientNormThreshold = 1.1; + constexpr double gradientNormThreshold{ 1.1 }; houghFilter->SetGradientNormThreshold(gradientNormThreshold); ITK_TEST_SET_GET_VALUE(gradientNormThreshold, houghFilter->GetGradientNormThreshold()); - constexpr double sigmaGradient = 1.2; + constexpr double sigmaGradient{ 1.2 }; houghFilter->SetSigmaGradient(sigmaGradient); ITK_TEST_SET_GET_VALUE(sigmaGradient, houghFilter->GetSigmaGradient()); - constexpr float discRadiusRatio = 1.1; + constexpr float discRadiusRatio{ 1.1 }; houghFilter->SetDiscRadiusRatio(discRadiusRatio); ITK_TEST_SET_GET_VALUE(discRadiusRatio, houghFilter->GetDiscRadiusRatio()); - constexpr float variance = 10; + constexpr float variance{ 10 }; houghFilter->SetVariance(variance); ITK_TEST_SET_GET_VALUE(variance, houghFilter->GetVariance()); - constexpr float sweepAngle = 0.2; + constexpr float sweepAngle{ 0.2 }; houghFilter->SetSweepAngle(sweepAngle); ITK_TEST_SET_GET_VALUE(sweepAngle, houghFilter->GetSweepAngle()); @@ -405,7 +405,7 @@ itkHoughTransform2DCirclesImageTest(int, char *[]) houghFilter->SetNumberOfCircles(numberOfCircles); ITK_TEST_SET_GET_VALUE(numberOfCircles, houghFilter->GetNumberOfCircles()); - constexpr bool useImageSpacing = false; + constexpr bool useImageSpacing{ false }; houghFilter->SetUseImageSpacing(useImageSpacing); ITK_TEST_SET_GET_VALUE(useImageSpacing, houghFilter->GetUseImageSpacing()); @@ -420,7 +420,7 @@ itkHoughTransform2DCirclesImageTest(int, char *[]) circleList = houghFilter->GetCircles(); - constexpr double radiusTolerance = 2.0; + constexpr double radiusTolerance{ 2.0 }; auto it = circleList.begin(); @@ -528,7 +528,7 @@ itkHoughTransform2DCirclesImageTest(int, char *[]) } while (foundCircles < numberOfCircles); // Check the circle detection - constexpr double centerTolerance = 2.0; + constexpr double centerTolerance{ 2.0 }; for (i = 0; i < numberOfCircles; ++i) { if (!itk::Math::FloatAlmostEqual( diff --git a/Modules/Filtering/ImageFeature/test/itkHoughTransform2DLinesImageTest.cxx b/Modules/Filtering/ImageFeature/test/itkHoughTransform2DLinesImageTest.cxx index 50881925822..10e1809928d 100644 --- a/Modules/Filtering/ImageFeature/test/itkHoughTransform2DLinesImageTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkHoughTransform2DLinesImageTest.cxx @@ -48,7 +48,7 @@ Test_GetLines_should_return_empty_list_when_input_image_is_entirely_black() // Create a black input image for the filter. const auto image = ImageType::New(); - constexpr ImageType::SizeType size = { { 32, 32 } }; + constexpr ImageType::SizeType size{ 32, 32 }; image->SetRegions(size); image->AllocateInitialized(); @@ -79,7 +79,7 @@ Test_GetLines_should_return_empty_list_when_NumberOfLines_is_set_to_zero() sizeX = 32, sizeY = 32 }; - constexpr ImageType::SizeType size = { { sizeX, sizeY } }; + constexpr ImageType::SizeType size{ sizeX, sizeY }; image->SetRegions(size); image->AllocateInitialized(); @@ -124,7 +124,7 @@ itkHoughTransform2DLinesImageTest(int, char *[]) bool success = true; // Define the dimension of the images - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; // Declare the pixel types of the images using PixelType = unsigned char; @@ -146,9 +146,9 @@ itkHoughTransform2DLinesImageTest(int, char *[]) image->AllocateInitialized(); // Create a line - constexpr unsigned int lines = 1; - constexpr double theta = 0.20; // radians - constexpr double radius = 50; + constexpr unsigned int lines{ 1 }; + constexpr double theta{ 0.20 }; // radians + constexpr double radius{ 50 }; const double Vx = radius * std::cos(theta); const double Vy = radius * std::sin(theta); @@ -195,8 +195,8 @@ itkHoughTransform2DLinesImageTest(int, char *[]) auto threshFilter = ThresholdFilterType::New(); threshFilter->SetInput(gradFilter->GetOutput()); threshFilter->SetOutsideValue(0); - constexpr unsigned char lowerThreshold = 10; - constexpr unsigned char upperThreshold = 200; + constexpr unsigned char lowerThreshold{ 10 }; + constexpr unsigned char upperThreshold{ 200 }; threshFilter->ThresholdOutside(lowerThreshold, upperThreshold); threshFilter->Update(); @@ -209,11 +209,11 @@ itkHoughTransform2DLinesImageTest(int, char *[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(houghFilter, HoughTransform2DLinesImageFilter, ImageToImageFilter); - constexpr float threshold = 2.3; + constexpr float threshold{ 2.3 }; houghFilter->SetThreshold(threshold); ITK_TEST_SET_GET_VALUE(threshold, houghFilter->GetThreshold()); - constexpr float angleResolution = 200.0; + constexpr float angleResolution{ 200.0 }; houghFilter->SetAngleResolution(angleResolution); ITK_TEST_SET_GET_VALUE(angleResolution, houghFilter->GetAngleResolution()); @@ -221,11 +221,11 @@ itkHoughTransform2DLinesImageTest(int, char *[]) houghFilter->SetNumberOfLines(numberOfLines); ITK_TEST_SET_GET_VALUE(numberOfLines, houghFilter->GetNumberOfLines()); - constexpr float discRadius = 25.0; + constexpr float discRadius{ 25.0 }; houghFilter->SetDiscRadius(discRadius); ITK_TEST_SET_GET_VALUE(discRadius, houghFilter->GetDiscRadius()); - constexpr float variance = 10; + constexpr float variance{ 10 }; houghFilter->SetVariance(variance); ITK_TEST_SET_GET_VALUE(variance, houghFilter->GetVariance()); @@ -319,8 +319,8 @@ itkHoughTransform2DLinesImageTest(int, char *[]) // Check the line detection auto it_list = linesList.begin(); - constexpr double angleTolerance = 0.1; - constexpr double radiusTolerance = 1.0; + constexpr double angleTolerance{ 0.1 }; + constexpr double radiusTolerance{ 1.0 }; while (it_list != linesList.end()) { if (!itk::Math::FloatAlmostEqual(it_list->angle, theta, 10, angleTolerance)) diff --git a/Modules/Filtering/ImageFeature/test/itkLaplacianImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkLaplacianImageFilterTest.cxx index a8a3ab36a6b..e1c1e2a1bff 100644 --- a/Modules/Filtering/ImageFeature/test/itkLaplacianImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkLaplacianImageFilterTest.cxx @@ -45,7 +45,7 @@ itkLaplacianImageFilterTest(int argc, char * argv[]) } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = float; using InputImageType = itk::Image; diff --git a/Modules/Filtering/ImageFeature/test/itkLaplacianRecursiveGaussianImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkLaplacianRecursiveGaussianImageFilterTest.cxx index 0679ab2f6cd..0e6dac2a88e 100644 --- a/Modules/Filtering/ImageFeature/test/itkLaplacianRecursiveGaussianImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkLaplacianRecursiveGaussianImageFilterTest.cxx @@ -40,7 +40,7 @@ itkLaplacianRecursiveGaussianImageFilterTest(int argc, char * argv[]) using CharPixelType = unsigned char; // IO using RealPixelType = double; // Operations - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using CharImageType = itk::Image; using RealImageType = itk::Image; diff --git a/Modules/Filtering/ImageFeature/test/itkLaplacianSharpeningImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkLaplacianSharpeningImageFilterTest.cxx index 8bb6d8dd5fa..5ff812b2c79 100644 --- a/Modules/Filtering/ImageFeature/test/itkLaplacianSharpeningImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkLaplacianSharpeningImageFilterTest.cxx @@ -36,7 +36,7 @@ itkLaplacianSharpeningImageFilterTest(int argc, char * argv[]) } using PixelType = float; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageFeature/test/itkMaskFeaturePointSelectionFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkMaskFeaturePointSelectionFilterTest.cxx index eb65461038c..6d81bdb4115 100644 --- a/Modules/Filtering/ImageFeature/test/itkMaskFeaturePointSelectionFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkMaskFeaturePointSelectionFilterTest.cxx @@ -42,7 +42,7 @@ itkMaskFeaturePointSelectionFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using InputPixelType = unsigned char; using OutputPixelType = itk::RGBPixel; diff --git a/Modules/Filtering/ImageFeature/test/itkMultiScaleHessianBasedMeasureImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkMultiScaleHessianBasedMeasureImageFilterTest.cxx index 25b536bccdf..de505543f58 100644 --- a/Modules/Filtering/ImageFeature/test/itkMultiScaleHessianBasedMeasureImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkMultiScaleHessianBasedMeasureImageFilterTest.cxx @@ -37,7 +37,7 @@ itkMultiScaleHessianBasedMeasureImageFilterTest(int argc, char * argv[]) } // Define the dimension of the images - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = float; using InputImageType = itk::Image; @@ -95,7 +95,7 @@ itkMultiScaleHessianBasedMeasureImageFilterTest(int argc, char * argv[]) const itk::SimpleFilterWatcher watcher(multiScaleEnhancementFilter); - constexpr double tolerance = 0.01; + constexpr double tolerance{ 0.01 }; if (argc > 4) { diff --git a/Modules/Filtering/ImageFeature/test/itkSimpleContourExtractorImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkSimpleContourExtractorImageFilterTest.cxx index fd4483af8af..70d8f69f9a4 100644 --- a/Modules/Filtering/ImageFeature/test/itkSimpleContourExtractorImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkSimpleContourExtractorImageFilterTest.cxx @@ -35,7 +35,7 @@ itkSimpleContourExtractorImageFilterTest(int argc, char * argv[]) } // Define the dimension of the images - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; // Define the pixel type using PixelType = unsigned char; @@ -69,9 +69,9 @@ itkSimpleContourExtractorImageFilterTest(int argc, char * argv[]) filter->SetInput(reader->GetOutput()); writer->SetInput(filter->GetOutput()); - constexpr FilterType::InputPixelType inputForegroundValue = 255; - constexpr FilterType::InputPixelType inputBackgroundValue = 0; - constexpr FilterType::OutputPixelType outputForegroundValue = itk::NumericTraits::max(); + constexpr FilterType::InputPixelType inputForegroundValue{ 255 }; + constexpr FilterType::InputPixelType inputBackgroundValue{ 0 }; + constexpr FilterType::OutputPixelType outputForegroundValue{ itk::NumericTraits::max() }; constexpr FilterType::OutputPixelType outputBackgroundValue{}; filter->SetInputForegroundValue(inputForegroundValue); diff --git a/Modules/Filtering/ImageFeature/test/itkSobelEdgeDetectionImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkSobelEdgeDetectionImageFilterTest.cxx index 6722d01b93e..5b149d5ef46 100644 --- a/Modules/Filtering/ImageFeature/test/itkSobelEdgeDetectionImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkSobelEdgeDetectionImageFilterTest.cxx @@ -33,7 +33,7 @@ itkSobelEdgeDetectionImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned char; using OutputPixelType = float; diff --git a/Modules/Filtering/ImageFeature/test/itkUnsharpMaskImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkUnsharpMaskImageFilterTest.cxx index dea8cd514a7..c338f8510de 100644 --- a/Modules/Filtering/ImageFeature/test/itkUnsharpMaskImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkUnsharpMaskImageFilterTest.cxx @@ -28,7 +28,7 @@ template int RunTest(int argc, char * argv[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputImagePixelType = unsigned char; using InImageType = itk::Image; diff --git a/Modules/Filtering/ImageFeature/test/itkUnsharpMaskImageFilterTestSimple.cxx b/Modules/Filtering/ImageFeature/test/itkUnsharpMaskImageFilterTestSimple.cxx index 2485c435831..acea19adc63 100644 --- a/Modules/Filtering/ImageFeature/test/itkUnsharpMaskImageFilterTestSimple.cxx +++ b/Modules/Filtering/ImageFeature/test/itkUnsharpMaskImageFilterTestSimple.cxx @@ -24,7 +24,7 @@ int itkUnsharpMaskImageFilterTestSimple(int, char *[]) { // Define the dimension of the images - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; // Define the pixel types of the images using PixelType = float; @@ -97,12 +97,12 @@ itkUnsharpMaskImageFilterTestSimple(int, char *[]) // Set the filter properties - constexpr UnsharpMaskImageFilterFilterType::SigmaArrayType::ValueType sigma = 2.5; + constexpr UnsharpMaskImageFilterFilterType::SigmaArrayType::ValueType sigma{ 2.5 }; filter->SetSigma(sigma); UnsharpMaskImageFilterFilterType::SigmaArrayType sigmas = filter->GetSigmas(); - constexpr double tolerance = 10e-6; + constexpr double tolerance{ 10e-6 }; for (unsigned int i = 0; i < sigmas.Size(); ++i) { const UnsharpMaskImageFilterFilterType::SigmaArrayType::ValueType sigma2 = sigmas[i]; @@ -117,7 +117,7 @@ itkUnsharpMaskImageFilterTestSimple(int, char *[]) } } - constexpr UnsharpMaskImageFilterFilterType::InternalPrecisionType amount = 0.8; + constexpr UnsharpMaskImageFilterFilterType::InternalPrecisionType amount{ 0.8 }; filter->SetAmount(amount); ITK_TEST_SET_GET_VALUE(amount, filter->GetAmount()); @@ -125,7 +125,7 @@ itkUnsharpMaskImageFilterTestSimple(int, char *[]) filter->SetThreshold(threshold); ITK_TEST_SET_GET_VALUE(threshold, filter->GetThreshold()); - constexpr bool clamp = std::is_integral_v; + constexpr bool clamp{ std::is_integral_v }; filter->SetClamp(clamp); ITK_TEST_SET_GET_VALUE(clamp, filter->GetClamp()); @@ -151,8 +151,8 @@ itkUnsharpMaskImageFilterTestSimple(int, char *[]) // check that output is correct near the step start[0] = 9; - constexpr float mins[4] = { -0.21f, -0.33f, 1.32f, 1.20f }; - constexpr float maxs[4] = { -0.20f, -0.32f, 1.33f, 1.21f }; + constexpr float mins[4]{ -0.21f, -0.33f, 1.32f, 1.20f }; + constexpr float maxs[4]{ -0.20f, -0.32f, 1.33f, 1.21f }; for (unsigned int i = 0; i < 4; ++i) { if (outputImage->GetPixel(start) < mins[i] || outputImage->GetPixel(start) > maxs[i]) diff --git a/Modules/Filtering/ImageFeature/test/itkZeroCrossingImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkZeroCrossingImageFilterTest.cxx index 603ab89ba1a..ce45307ffa8 100644 --- a/Modules/Filtering/ImageFeature/test/itkZeroCrossingImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkZeroCrossingImageFilterTest.cxx @@ -32,7 +32,7 @@ int itkZeroCrossingImageFilterTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageFilterBase/test/itkImageToImageFilterTest.cxx b/Modules/Filtering/ImageFilterBase/test/itkImageToImageFilterTest.cxx index ddfaa3e5998..39378bba85c 100644 --- a/Modules/Filtering/ImageFilterBase/test/itkImageToImageFilterTest.cxx +++ b/Modules/Filtering/ImageFilterBase/test/itkImageToImageFilterTest.cxx @@ -41,7 +41,7 @@ int itkImageToImageFilterTest(int, char *[]) { - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using InputPixelType = unsigned char; using OutputPixelType = short; diff --git a/Modules/Filtering/ImageFilterBase/test/itkMaskNeighborhoodOperatorImageFilterTest.cxx b/Modules/Filtering/ImageFilterBase/test/itkMaskNeighborhoodOperatorImageFilterTest.cxx index 942d549b046..4528a41d303 100644 --- a/Modules/Filtering/ImageFilterBase/test/itkMaskNeighborhoodOperatorImageFilterTest.cxx +++ b/Modules/Filtering/ImageFilterBase/test/itkMaskNeighborhoodOperatorImageFilterTest.cxx @@ -33,7 +33,7 @@ itkMaskNeighborhoodOperatorImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using OutputPixelType = unsigned char; @@ -106,7 +106,7 @@ itkMaskNeighborhoodOperatorImageFilterTest(int argc, char * argv[]) filter1->SetDefaultValue(defaultValue); ITK_TEST_SET_GET_VALUE(defaultValue, filter1->GetDefaultValue()); - constexpr bool useDefaultValue = false; + constexpr bool useDefaultValue{ false }; ITK_TEST_SET_GET_BOOLEAN(filter1, UseDefaultValue, useDefaultValue); auto filter2 = FilterType::New(); diff --git a/Modules/Filtering/ImageFrequency/test/itkFrequencyBandImageFilterTest.cxx b/Modules/Filtering/ImageFrequency/test/itkFrequencyBandImageFilterTest.cxx index eddd0434aaf..ebddd37e361 100644 --- a/Modules/Filtering/ImageFrequency/test/itkFrequencyBandImageFilterTest.cxx +++ b/Modules/Filtering/ImageFrequency/test/itkFrequencyBandImageFilterTest.cxx @@ -77,7 +77,7 @@ createImage(typename ImageType::SizeType size) int itkFrequencyBandImageFilterTest(int argc, char * argv[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; if (argc != 2) { @@ -144,7 +144,7 @@ itkFrequencyBandImageFilterTest(int argc, char * argv[]) passBandFilter->SetHighFrequencyThreshold(highFreqThreshold); ITK_TEST_SET_GET_VALUE(highFreqThreshold, passBandFilter->GetHighFrequencyThreshold()); - constexpr bool passBand = true; + constexpr bool passBand{ true }; ITK_TEST_SET_GET_BOOLEAN(passBandFilter, PassBand, passBand); bool passLowFreqThreshold = true; @@ -189,14 +189,15 @@ itkFrequencyBandImageFilterTest(int argc, char * argv[]) // Tests with radians - constexpr BandFilterType::FrequencyValueType lowFreqThresholdRadians = itk::Math::pi_over_4; + constexpr BandFilterType::FrequencyValueType lowFreqThresholdRadians{ itk::Math::pi_over_4 }; passBandFilter->SetLowFrequencyThresholdInRadians(lowFreqThresholdRadians); - constexpr BandFilterType::FrequencyValueType highFreqThresholdRadians = itk::Math::pi_over_2; + constexpr BandFilterType::FrequencyValueType highFreqThresholdRadians{ itk::Math::pi_over_2 }; passBandFilter->SetHighFrequencyThresholdInRadians(highFreqThresholdRadians); - constexpr BandFilterType::FrequencyValueType knownLowFrequencyHertz = lowFreqThresholdRadians / (2 * itk::Math::pi); - constexpr BandFilterType::FrequencyValueType knownHighFrequencyHertz = highFreqThresholdRadians / (2 * itk::Math::pi); + constexpr BandFilterType::FrequencyValueType knownLowFrequencyHertz{ lowFreqThresholdRadians / (2 * itk::Math::pi) }; + constexpr BandFilterType::FrequencyValueType knownHighFrequencyHertz{ highFreqThresholdRadians / + (2 * itk::Math::pi) }; if (itk::Math::NotAlmostEquals(knownLowFrequencyHertz, passBandFilter->GetLowFrequencyThreshold()) || itk::Math::NotAlmostEquals(knownHighFrequencyHertz, passBandFilter->GetHighFrequencyThreshold())) @@ -211,11 +212,11 @@ itkFrequencyBandImageFilterTest(int argc, char * argv[]) // Test the non-radial cut-off. // Don't pass negative frequency thresholds. - constexpr bool radialBand = false; + constexpr bool radialBand{ false }; ITK_TEST_SET_GET_BOOLEAN(passBandFilter, RadialBand, radialBand); - constexpr bool passNegativeLowFrequencyThreshold = false; + constexpr bool passNegativeLowFrequencyThreshold{ false }; ITK_TEST_SET_GET_BOOLEAN(passBandFilter, PassNegativeLowFrequencyThreshold, passNegativeLowFrequencyThreshold); - constexpr bool passNegativeHighFrequencyThreshold = false; + constexpr bool passNegativeHighFrequencyThreshold{ false }; ITK_TEST_SET_GET_BOOLEAN(passBandFilter, PassNegativeHighFrequencyThreshold, passNegativeHighFrequencyThreshold); passBandFilter->Update(); diff --git a/Modules/Filtering/ImageFrequency/test/itkFrequencyFFTLayoutImageRegionIteratorWithIndexTest.cxx b/Modules/Filtering/ImageFrequency/test/itkFrequencyFFTLayoutImageRegionIteratorWithIndexTest.cxx index 26ba6aeaefd..c11b3b9e71d 100644 --- a/Modules/Filtering/ImageFrequency/test/itkFrequencyFFTLayoutImageRegionIteratorWithIndexTest.cxx +++ b/Modules/Filtering/ImageFrequency/test/itkFrequencyFFTLayoutImageRegionIteratorWithIndexTest.cxx @@ -252,14 +252,14 @@ itkFrequencyFFTLayoutImageRegionIteratorWithIndexTest(int, char *[]) { bool testPassed = true; // let's be optimistic - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using CharPixelType = char; using FloatPixelType = float; // Even input image size test { - constexpr size_t inputImageSize(8); + constexpr size_t inputImageSize{ 8 }; std::cout << "Testing with EVEN Image< std::complex, 3 > with size: " << inputImageSize << std::endl; itkFrequencyFFTLayoutImageRegionIteratorWithIndexTester, Dimension>> Tester( inputImageSize); @@ -271,7 +271,7 @@ itkFrequencyFFTLayoutImageRegionIteratorWithIndexTest(int, char *[]) // Even input image size test { - constexpr size_t inputImageSize(10); + constexpr size_t inputImageSize{ 10 }; std::cout << "Testing with EVEN Image< char, 3 > with size: " << inputImageSize << std::endl; itkFrequencyFFTLayoutImageRegionIteratorWithIndexTester> Tester( inputImageSize); @@ -283,7 +283,7 @@ itkFrequencyFFTLayoutImageRegionIteratorWithIndexTest(int, char *[]) // Odd input image size test { - constexpr size_t inputImageSize(9); + constexpr size_t inputImageSize{ 9 }; std::cout << "Testing with ODD Image< char, 3 > with size: " << inputImageSize << std::endl; itkFrequencyFFTLayoutImageRegionIteratorWithIndexTester> Tester( inputImageSize); diff --git a/Modules/Filtering/ImageFrequency/test/itkFrequencyIteratorsGTest.cxx b/Modules/Filtering/ImageFrequency/test/itkFrequencyIteratorsGTest.cxx index f0ed1f985a4..71ea813628e 100644 --- a/Modules/Filtering/ImageFrequency/test/itkFrequencyIteratorsGTest.cxx +++ b/Modules/Filtering/ImageFrequency/test/itkFrequencyIteratorsGTest.cxx @@ -238,7 +238,7 @@ compareAllTypesOfIterators(typename TImageType::Pointer image, double difference // Shifted Full Forward FFT using FrequencyShiftedIteratorType = itk::FrequencyShiftedFFTLayoutImageRegionIteratorWithIndex; - constexpr bool shifted = true; + constexpr bool shifted{ true }; auto filteredShiftedImage = applyBandFilter(image, shifted); @@ -277,40 +277,40 @@ TEST_F(FrequencyIterators, AreConstructedAtBegin) TEST_F(FrequencyIterators, Even3D) { - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using PixelType = float; using ImageType = itk::Image; auto image = CreateImage(16); - constexpr double differenceHermitianThreshold = 0.00001; + constexpr double differenceHermitianThreshold{ 0.00001 }; compareAllTypesOfIterators(image, differenceHermitianThreshold); } TEST_F(FrequencyIterators, Even2D) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = float; using ImageType = itk::Image; auto image = CreateImage(16); - constexpr double differenceHermitianThreshold = 0.00001; + constexpr double differenceHermitianThreshold{ 0.00001 }; compareAllTypesOfIterators(image, differenceHermitianThreshold); } TEST_F(FrequencyIterators, Odd3D) { - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using PixelType = float; using ImageType = itk::Image; auto image = CreateImage(15); - constexpr double differenceHermitianThreshold = 0.00001; + constexpr double differenceHermitianThreshold{ 0.00001 }; compareAllTypesOfIterators(image, differenceHermitianThreshold); } TEST_F(FrequencyIterators, Odd2D) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = float; using ImageType = itk::Image; auto image = CreateImage(27); - constexpr double differenceHermitianThreshold = 0.0001; + constexpr double differenceHermitianThreshold{ 0.0001 }; compareAllTypesOfIterators(image, differenceHermitianThreshold); } diff --git a/Modules/Filtering/ImageFusion/include/itkLabelToRGBFunctor.h b/Modules/Filtering/ImageFusion/include/itkLabelToRGBFunctor.h index 0bb5576f774..19d2db3c1a8 100644 --- a/Modules/Filtering/ImageFusion/include/itkLabelToRGBFunctor.h +++ b/Modules/Filtering/ImageFusion/include/itkLabelToRGBFunctor.h @@ -66,7 +66,7 @@ class LabelToRGBFunctor //"violet" "red4" // They are a good selection of distinct colors for plotting and // overlays. - constexpr size_t numColors = 30; + constexpr size_t numColors{ 30 }; constexpr unsigned char colors[numColors][3] = { { 255, 0, 0 }, { 0, 205, 0 }, { 0, 0, 255 }, { 0, 255, 255 }, { 255, 0, 255 }, { 255, 127, 0 }, { 0, 100, 0 }, { 138, 43, 226 }, { 139, 35, 35 }, { 0, 0, 128 }, { 139, 139, 0 }, { 255, 62, 150 }, diff --git a/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest1.cxx b/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest1.cxx index 31f894bc7ab..ab270254251 100644 --- a/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest1.cxx +++ b/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest1.cxx @@ -34,7 +34,7 @@ itkLabelMapContourOverlayImageFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 2; + constexpr int dim{ 2 }; using IType = itk::Image; diff --git a/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest2.cxx b/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest2.cxx index dc7f94a1426..6b3eebab854 100644 --- a/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest2.cxx +++ b/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest2.cxx @@ -34,7 +34,7 @@ itkLabelMapContourOverlayImageFilterTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 2; + constexpr int dim{ 2 }; using IType = itk::Image; using OType = itk::VectorImage; diff --git a/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest3.cxx b/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest3.cxx index aa4ed9216ef..256e56feaa6 100644 --- a/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest3.cxx +++ b/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest3.cxx @@ -34,7 +34,7 @@ itkLabelMapContourOverlayImageFilterTest3(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int Dimension = 2; + constexpr int Dimension{ 2 }; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest1.cxx b/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest1.cxx index 16f134484e7..c5c225fb6c0 100644 --- a/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest1.cxx +++ b/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest1.cxx @@ -35,7 +35,7 @@ itkLabelMapOverlayImageFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 2; + constexpr int dim{ 2 }; using IType = itk::Image; diff --git a/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest2.cxx b/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest2.cxx index 508945dc73d..a1f52a7afdc 100644 --- a/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest2.cxx +++ b/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest2.cxx @@ -35,7 +35,7 @@ itkLabelMapOverlayImageFilterTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 2; + constexpr int dim{ 2 }; using IType = itk::Image; using OType = itk::VectorImage; diff --git a/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest3.cxx b/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest3.cxx index cce1b13cbd7..ad0d6beca19 100644 --- a/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest3.cxx +++ b/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest3.cxx @@ -35,7 +35,7 @@ itkLabelMapOverlayImageFilterTest3(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int Dimension = 2; + constexpr int Dimension{ 2 }; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageFusion/test/itkLabelMapToRGBImageFilterTest1.cxx b/Modules/Filtering/ImageFusion/test/itkLabelMapToRGBImageFilterTest1.cxx index ee624f8520a..cf6483c9d27 100644 --- a/Modules/Filtering/ImageFusion/test/itkLabelMapToRGBImageFilterTest1.cxx +++ b/Modules/Filtering/ImageFusion/test/itkLabelMapToRGBImageFilterTest1.cxx @@ -35,7 +35,7 @@ itkLabelMapToRGBImageFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 2; + constexpr int dim{ 2 }; using IType = itk::Image; diff --git a/Modules/Filtering/ImageFusion/test/itkLabelMapToRGBImageFilterTest2.cxx b/Modules/Filtering/ImageFusion/test/itkLabelMapToRGBImageFilterTest2.cxx index eb579e32c75..9fad84b2f7a 100644 --- a/Modules/Filtering/ImageFusion/test/itkLabelMapToRGBImageFilterTest2.cxx +++ b/Modules/Filtering/ImageFusion/test/itkLabelMapToRGBImageFilterTest2.cxx @@ -35,7 +35,7 @@ itkLabelMapToRGBImageFilterTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 2; + constexpr int dim{ 2 }; using IType = itk::Image; using OType = itk::VectorImage; diff --git a/Modules/Filtering/ImageFusion/test/itkLabelOverlayImageFilterTest.cxx b/Modules/Filtering/ImageFusion/test/itkLabelOverlayImageFilterTest.cxx index 36ead6d28ae..b08ae3c2779 100644 --- a/Modules/Filtering/ImageFusion/test/itkLabelOverlayImageFilterTest.cxx +++ b/Modules/Filtering/ImageFusion/test/itkLabelOverlayImageFilterTest.cxx @@ -28,7 +28,7 @@ int itkLabelOverlayImageFilterTest(int argc, char * argv[]) { - constexpr int Dimension = 2; + constexpr int Dimension{ 2 }; if (argc < 5) { diff --git a/Modules/Filtering/ImageFusion/test/itkLabelToRGBImageFilterTest.cxx b/Modules/Filtering/ImageFusion/test/itkLabelToRGBImageFilterTest.cxx index 16c2db35bdf..cd5cea64ef1 100644 --- a/Modules/Filtering/ImageFusion/test/itkLabelToRGBImageFilterTest.cxx +++ b/Modules/Filtering/ImageFusion/test/itkLabelToRGBImageFilterTest.cxx @@ -36,7 +36,7 @@ itkLabelToRGBImageFilterTest(int argc, char * argv[]) } - constexpr int Dimension = 2; + constexpr int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageGradient/include/itkVectorGradientMagnitudeImageFilter.hxx b/Modules/Filtering/ImageGradient/include/itkVectorGradientMagnitudeImageFilter.hxx index 51a8d599496..1aec542dc57 100644 --- a/Modules/Filtering/ImageGradient/include/itkVectorGradientMagnitudeImageFilter.hxx +++ b/Modules/Filtering/ImageGradient/include/itkVectorGradientMagnitudeImageFilter.hxx @@ -256,7 +256,7 @@ VectorGradientMagnitudeImageFilter::CubicS // found in s. const double dpi = itk::Math::pi; - constexpr double epsilon = 1.0e-11; + constexpr double epsilon{ 1.0e-11 }; // Substitution of x = y - c[2]/3 eliminate the quadric term x^3 +px + q = 0 const double sq_c2 = c[2] * c[2]; diff --git a/Modules/Filtering/ImageGradient/test/itkDifferenceOfGaussiansGradientTest.cxx b/Modules/Filtering/ImageGradient/test/itkDifferenceOfGaussiansGradientTest.cxx index 6aa08efd6b2..cc6a9df3792 100644 --- a/Modules/Filtering/ImageGradient/test/itkDifferenceOfGaussiansGradientTest.cxx +++ b/Modules/Filtering/ImageGradient/test/itkDifferenceOfGaussiansGradientTest.cxx @@ -37,7 +37,7 @@ This file tests: int itkDifferenceOfGaussiansGradientTest(int, char *[]) { - constexpr unsigned int dim = 3; + constexpr unsigned int dim{ 3 }; // Image type alias using TImageType = itk::Image; @@ -101,7 +101,7 @@ itkDifferenceOfGaussiansGradientTest(int, char *[]) //---------Create and initialize a spatial function iterator----------- TImageType::IndexType seedPos; - constexpr TImageType::IndexValueType pos[] = { 10, 10, 10 }; + constexpr TImageType::IndexValueType pos[]{ 10, 10, 10 }; seedPos.SetIndex(pos); using TItType = itk::FloodFilledSpatialFunctionConditionalIterator; diff --git a/Modules/Filtering/ImageGradient/test/itkGradientMagnitudeImageFilterTest.cxx b/Modules/Filtering/ImageGradient/test/itkGradientMagnitudeImageFilterTest.cxx index a6b76cde07d..7eafd8ec8b0 100644 --- a/Modules/Filtering/ImageGradient/test/itkGradientMagnitudeImageFilterTest.cxx +++ b/Modules/Filtering/ImageGradient/test/itkGradientMagnitudeImageFilterTest.cxx @@ -39,7 +39,7 @@ itkGradientMagnitudeImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; diff --git a/Modules/Filtering/ImageGradient/test/itkGradientMagnitudeRecursiveGaussianFilterTest.cxx b/Modules/Filtering/ImageGradient/test/itkGradientMagnitudeRecursiveGaussianFilterTest.cxx index e6e01beaf4a..81f64f32232 100644 --- a/Modules/Filtering/ImageGradient/test/itkGradientMagnitudeRecursiveGaussianFilterTest.cxx +++ b/Modules/Filtering/ImageGradient/test/itkGradientMagnitudeRecursiveGaussianFilterTest.cxx @@ -53,7 +53,7 @@ itkGradientMagnitudeRecursiveGaussianFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; using myImageType = itk::Image; using myIndexType = itk::Index; using mySizeType = itk::Size; diff --git a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterSpeedTest.cxx b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterSpeedTest.cxx index 829dad9d280..8309ed6fe20 100644 --- a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterSpeedTest.cxx +++ b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterSpeedTest.cxx @@ -35,7 +35,7 @@ itkGradientRecursiveGaussianFilterSpeedTest(int argc, char * argv[]) std::cout << "imageSize: " << imageSize << " reps: " << reps << std::endl; // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; // Declare the types of the images using myImageType = itk::Image; diff --git a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest.cxx b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest.cxx index 3f62b03510f..97b86cbaa9c 100644 --- a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest.cxx +++ b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest.cxx @@ -32,7 +32,7 @@ itkGradientRecursiveGaussianFilterTest(int argc, char * argv[]) } // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; // Declare the types of the images using myImageType = itk::Image; diff --git a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest2.cxx b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest2.cxx index 3e917b9d32b..9568265b5fc 100644 --- a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest2.cxx +++ b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest2.cxx @@ -27,7 +27,7 @@ itkGradientRecursiveGaussianFilterTest2(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 1; + constexpr unsigned int myDimension{ 1 }; // Declare the types of the images using myImageType = itk::Image; diff --git a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest3.cxx b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest3.cxx index 0a9dea10c3e..091454a6afe 100644 --- a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest3.cxx +++ b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest3.cxx @@ -189,8 +189,8 @@ itkGradientRecursiveGaussianFilterTest3(int argc, char * argv[]) int result = EXIT_SUCCESS; - constexpr unsigned int myDimension = 3; - constexpr unsigned int myComponents1D = 1; + constexpr unsigned int myDimension{ 3 }; + constexpr unsigned int myComponents1D{ 1 }; using myGrad1DType = itk::Vector; using myGradImage1DType = itk::Image; @@ -227,7 +227,7 @@ itkGradientRecursiveGaussianFilterTest3(int argc, char * argv[]) } // Test with Image of 2D Vector - constexpr unsigned int myComponents2D = 2; + constexpr unsigned int myComponents2D{ 2 }; using myGrad2DType = itk::Vector; using myGradImage2DType = itk::Image; using myVector2DType = itk::Vector; @@ -287,7 +287,7 @@ itkGradientRecursiveGaussianFilterTest3(int argc, char * argv[]) } // Test with Image of 3D Vector - constexpr unsigned int myComponents3D = 3; + constexpr unsigned int myComponents3D{ 3 }; using myGrad3DType = itk::Vector; using myGradImage3DType = itk::Image; using myVector3DType = itk::Vector; diff --git a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest4.cxx b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest4.cxx index 505d926491c..6331c25a172 100644 --- a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest4.cxx +++ b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest4.cxx @@ -38,7 +38,7 @@ itkGradientRecursiveGaussianFilterTest4(int argc, char * argv[]) const std::string outFileName = argv[2]; // Define the dimension of the images - constexpr unsigned int myDimension = 2; + constexpr unsigned int myDimension{ 2 }; // Declare the types of the images using FloatType = float; diff --git a/Modules/Filtering/ImageGradient/test/itkVectorGradientMagnitudeImageFilterTest1.cxx b/Modules/Filtering/ImageGradient/test/itkVectorGradientMagnitudeImageFilterTest1.cxx index ee2f0b6f164..b8676f9461e 100644 --- a/Modules/Filtering/ImageGradient/test/itkVectorGradientMagnitudeImageFilterTest1.cxx +++ b/Modules/Filtering/ImageGradient/test/itkVectorGradientMagnitudeImageFilterTest1.cxx @@ -39,7 +39,7 @@ itkVectorGradientMagnitudeImageFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using RGBPixelType = itk::RGBPixel; using CharImageType = itk::Image; diff --git a/Modules/Filtering/ImageGrid/include/itkOrientImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkOrientImageFilter.hxx index 3585e1bc9f9..df00879dedc 100644 --- a/Modules/Filtering/ImageGrid/include/itkOrientImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkOrientImageFilter.hxx @@ -104,9 +104,9 @@ OrientImageFilter::DeterminePermutationsAndFlips( const CoordinateOrientationCode moving_orient) { // 3-dimensional version of code system only. The 3-axis testing is unrolled. - constexpr unsigned int NumDims = 3; // InputImageDimension is - // regarded as 3. - constexpr unsigned int CodeAxisIncreasingField = 1; + constexpr unsigned int NumDims{ 3 }; // InputImageDimension is + // regarded as 3. + constexpr unsigned int CodeAxisIncreasingField{ 1 }; auto fixed_codes = fixed_orient.GetTerms(); auto moving_codes = moving_orient.GetTerms(); diff --git a/Modules/Filtering/ImageGrid/include/itkShrinkImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkShrinkImageFilter.hxx index 41154bafea4..b64ce9a1f92 100644 --- a/Modules/Filtering/ImageGrid/include/itkShrinkImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkShrinkImageFilter.hxx @@ -129,7 +129,7 @@ ShrinkImageFilter::DynamicThreadedGenerateData( // Given that the size is scaled by a constant factor eq: // inputIndex = outputIndex * factorSize // is equivalent up to a fixed offset which we now compute - constexpr OffsetValueType zeroOffset = 0; + constexpr OffsetValueType zeroOffset{ 0 }; OutputOffsetType offsetIndex; for (unsigned int i = 0; i < TInputImage::ImageDimension; ++i) { @@ -203,7 +203,7 @@ ShrinkImageFilter::GenerateInputRequestedRegion() // Given that the size is scaled by a constant factor eq: // inputIndex = outputIndex * factorSize // is equivalent up to a fixed offset which we now compute - constexpr OffsetValueType zeroOffset = 0; + constexpr OffsetValueType zeroOffset{ 0 }; OutputOffsetType offsetIndex; for (unsigned int i = 0; i < TInputImage::ImageDimension; ++i) { diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFilterTest.cxx index f00d525dbd2..7300aa683c5 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFilterTest.cxx @@ -140,7 +140,7 @@ itkBSplineControlPointImageFilterTest(int argc, char * argv[]) exit(EXIT_FAILURE); } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using RealType = float; using ScalarPixelType = itk::Vector; diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFunctionTest.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFunctionTest.cxx index 15a755e676e..8dc2f18a29a 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFunctionTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFunctionTest.cxx @@ -26,8 +26,8 @@ itkBSplineControlPointImageFunctionTest(int, char *[]) // + 1/6. This is done using a cubic order spline with controls points // (1, 0, 0, 1) - constexpr unsigned int ParametricDimension = 1; - constexpr unsigned int DataDimension = 1; + constexpr unsigned int ParametricDimension{ 1 }; + constexpr unsigned int DataDimension{ 1 }; using RealType = float; using VectorType = itk::Vector; @@ -79,7 +79,7 @@ itkBSplineControlPointImageFunctionTest(int, char *[]) bspliner->SetSize(size); ITK_TEST_SET_GET_VALUE(size, bspliner->GetSize()); - constexpr unsigned int bSplineOrderValue = 3; + constexpr unsigned int bSplineOrderValue{ 3 }; bspliner->SetSplineOrder(bSplineOrderValue); for (auto i : bspliner->GetSplineOrder()) { @@ -96,12 +96,12 @@ itkBSplineControlPointImageFunctionTest(int, char *[]) bspliner->SetSplineOrder(bSplineOrder); ITK_TEST_SET_GET_VALUE(bSplineOrder, bspliner->GetSplineOrder()); - constexpr BSplinerType::ArrayType::ValueType closeDimensionValue = 0; + constexpr BSplinerType::ArrayType::ValueType closeDimensionValue{ 0 }; auto closeDimension = itk::MakeFilled(closeDimensionValue); bspliner->SetCloseDimension(closeDimension); ITK_TEST_SET_GET_VALUE(closeDimension, bspliner->GetCloseDimension()); - constexpr BSplinerType::RealType bSplineEpsilon = 1e-3; + constexpr BSplinerType::RealType bSplineEpsilon{ 1e-3 }; bspliner->SetBSplineEpsilon(bSplineEpsilon); ITK_TEST_SET_GET_VALUE(bSplineEpsilon, bspliner->GetBSplineEpsilon()); diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineDownsampleImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineDownsampleImageFilterTest.cxx index d3c40a865f4..c1d420577c9 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineDownsampleImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineDownsampleImageFilterTest.cxx @@ -47,7 +47,7 @@ itkBSplineDownsampleImageFilterTest(int argc, char * argv[]) } using PixelType = unsigned char; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineResampleImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineResampleImageFilterTest.cxx index 7b1653c6738..3cd36467d06 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineResampleImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineResampleImageFilterTest.cxx @@ -59,7 +59,7 @@ PrintImageData(ImageTypePtr2D imgPtr) using Iterator = itk::ImageLinearIteratorWithIndex; std::cout << "Size: " << imgPtr->GetLargestPossibleRegion().GetSize() << std::endl; - constexpr int dim = ImageType2D::ImageDimension; + constexpr int dim{ ImageType2D::ImageDimension }; std::cout << "Spacing: " << std::endl; for (int n = 0; n < dim; ++n) @@ -92,7 +92,7 @@ PrintImageData(ImageTypePtr2D imgPtr) void set2DData(ImageType2D::Pointer imgPtr) { - constexpr SizeType2D size = { { 4, 4 } }; + constexpr SizeType2D size{ 4, 4 }; const double mydata[49] = { 0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 3, 2 }; ImageType2D::RegionType region; @@ -122,7 +122,7 @@ set2DData(ImageType2D::Pointer imgPtr) void setInt2DData(IntImageType2D::Pointer imgPtr) { - constexpr IntSizeType2D size = { { 4, 4 } }; + constexpr IntSizeType2D size{ 4, 4 }; const int mydata[49] = { 0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 3, 2 }; IntImageType2D::RegionType region; @@ -484,7 +484,7 @@ testIntInputDoubleOutput() auto downSampler = DownsamplerType2D::New(); auto upSampler = UpsamplerType2D::New(); - constexpr int splineOrder = 3; + constexpr int splineOrder{ 3 }; downSampler->SetSplineOrder(splineOrder); upSampler->SetSplineOrder(splineOrder); diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest.cxx index 8dad5c1ec85..cfdd6a77ae0 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest.cxx @@ -38,8 +38,8 @@ itkBSplineScatteredDataPointSetToImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ParametricDimension = 2; - constexpr unsigned int DataDimension = 1; + constexpr unsigned int ParametricDimension{ 2 }; + constexpr unsigned int DataDimension{ 1 }; using PixelType = int; using InputImageType = itk::Image; diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest2.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest2.cxx index 2fbb503f8de..e5c5b6be550 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest2.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest2.cxx @@ -38,8 +38,8 @@ itkBSplineScatteredDataPointSetToImageFilterTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ParametricDimension = 1; - constexpr unsigned int DataDimension = 3; + constexpr unsigned int ParametricDimension{ 1 }; + constexpr unsigned int DataDimension{ 3 }; using RealType = double; using OutputPixelType = unsigned char; @@ -86,7 +86,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest2(int argc, char * argv[]) filter->SetSpacing(spacing); filter->SetInput(pointSet); - constexpr FilterType::RealType bSplineEpsilon = 1e-4; + constexpr FilterType::RealType bSplineEpsilon{ 1e-4 }; filter->SetBSplineEpsilon(bSplineEpsilon); ITK_TEST_SET_GET_VALUE(bSplineEpsilon, filter->GetBSplineEpsilon()); diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest3.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest3.cxx index 7f3854b86cc..e71abd8d6ef 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest3.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest3.cxx @@ -40,8 +40,8 @@ itkBSplineScatteredDataPointSetToImageFilterTest3(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ParametricDimension = 1; - constexpr unsigned int DataDimension = 3; + constexpr unsigned int ParametricDimension{ 1 }; + constexpr unsigned int DataDimension{ 3 }; using RealType = double; using OutputPixelType = unsigned char; @@ -113,7 +113,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest3(int argc, char * argv[]) // fails because of the choice of B-spline epsilon filter->SetNumberOfLevels(15); - constexpr bool generateOutputImage = true; + constexpr bool generateOutputImage{ true }; filter->SetGenerateOutputImage(generateOutputImage); ITK_TEST_SET_GET_VALUE(generateOutputImage, filter->GetGenerateOutputImage()); diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest4.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest4.cxx index bd1d3f71ff6..1819aca16b3 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest4.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest4.cxx @@ -33,9 +33,9 @@ int itkBSplineScatteredDataPointSetToImageFilterTest4(int, char *[]) { - constexpr unsigned int ParametricDimension = 3; - constexpr unsigned int DataDimension = 3; - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int ParametricDimension{ 3 }; + constexpr unsigned int DataDimension{ 3 }; + constexpr unsigned int SplineOrder{ 3 }; using RealType = float; using VectorType = itk::Vector; @@ -72,7 +72,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest4(int, char *[]) landmarkInSecondImage1[1] = 5.0; landmarkInSecondImage1[2] = 5.0; - constexpr RealType weight1 = 1.0; + constexpr RealType weight1{ 1.0 }; weights->InsertElement(0, weight1); VectorType vector1; @@ -95,7 +95,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest4(int, char *[]) landmarkInSecondImage2[1] = 35.0; landmarkInSecondImage2[2] = 45.0; - constexpr RealType weight2 = 3.0; + constexpr RealType weight2{ 3.0 }; weights->InsertElement(1, weight2); VectorType vector2; @@ -118,7 +118,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest4(int, char *[]) landmarkInSecondImage3[1] = 35.0; landmarkInSecondImage3[2] = 45.0; - constexpr RealType weight3 = 0.5; + constexpr RealType weight3{ 0.5 }; weights->InsertElement(2, weight3); VectorType vector3; diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest5.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest5.cxx index e17f71e52c3..270ab567051 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest5.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest5.cxx @@ -93,8 +93,8 @@ itkBSplineScatteredDataPointSetToImageFilterTest5(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ParametricDimension = 2; - constexpr unsigned int DataDimension = 3; + constexpr unsigned int ParametricDimension{ 2 }; + constexpr unsigned int DataDimension{ 3 }; using RealType = double; diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineUpsampleImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineUpsampleImageFilterTest.cxx index c800d16bc6f..5f7fc5593a3 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineUpsampleImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineUpsampleImageFilterTest.cxx @@ -47,7 +47,7 @@ itkBSplineUpsampleImageFilterTest(int argc, char * argv[]) } using PixelType = unsigned char; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageGrid/test/itkBinShrinkImageFilterTest2.cxx b/Modules/Filtering/ImageGrid/test/itkBinShrinkImageFilterTest2.cxx index e179ee5cda1..aaa29902c68 100644 --- a/Modules/Filtering/ImageGrid/test/itkBinShrinkImageFilterTest2.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBinShrinkImageFilterTest2.cxx @@ -67,7 +67,7 @@ int itkBinShrinkImageFilterTest2(int, char *[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = itk::Vector; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageGrid/test/itkChangeInformationImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkChangeInformationImageFilterTest.cxx index a147dffc227..e1d618bf3ae 100644 --- a/Modules/Filtering/ImageGrid/test/itkChangeInformationImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkChangeInformationImageFilterTest.cxx @@ -20,7 +20,7 @@ #include "itkChangeInformationImageFilter.h" #include "itkTestingMacros.h" -constexpr unsigned int ImageDimension = 3; +constexpr unsigned int ImageDimension{ 3 }; using ImageType = itk::Image; using ImagePointer = ImageType::Pointer; @@ -159,7 +159,7 @@ itkChangeInformationImageFilterTest(int, char *[]) inputImage->SetSpacing(spacing); inputImage->SetOrigin(origin); - constexpr itk::SpacePrecisionType newOrigin[ImageDimension] = { 1000.0, 2000.0, 3000.0 }; + constexpr itk::SpacePrecisionType newOrigin[ImageDimension]{ 1000.0, 2000.0, 3000.0 }; itk::SpacePrecisionType newSpacing[ImageDimension] = { 10.0, 20.0, 30.0 }; ImageType::OffsetValueType newOffset[ImageDimension] = { 10, 20, 30 }; diff --git a/Modules/Filtering/ImageGrid/test/itkConstantPadImageTest.cxx b/Modules/Filtering/ImageGrid/test/itkConstantPadImageTest.cxx index 42bdda4f19e..f3bd97803b2 100644 --- a/Modules/Filtering/ImageGrid/test/itkConstantPadImageTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkConstantPadImageTest.cxx @@ -59,7 +59,7 @@ itkConstantPadImageTest(int, char *[]) SizeValueType upperFactors[2] = { 0, 0 }; SizeValueType lowerFactors[2] = { 0, 0 }; - constexpr float constant = 13.3f; + constexpr float constant{ 13.3f }; constantPad->SetConstant(constant); // check the method using the SizeType rather than the simple table type. constexpr ShortImage::SizeType stfactors{}; diff --git a/Modules/Filtering/ImageGrid/test/itkCropImageFilter3DTest.cxx b/Modules/Filtering/ImageGrid/test/itkCropImageFilter3DTest.cxx index e6ae2ff1103..18a99422106 100644 --- a/Modules/Filtering/ImageGrid/test/itkCropImageFilter3DTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkCropImageFilter3DTest.cxx @@ -25,7 +25,7 @@ itkCropImageFilter3DTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the pixel types of the images using PixelType = unsigned short; @@ -35,8 +35,8 @@ itkCropImageFilter3DTest(int, char *[]) ImageType::RegionType region; constexpr unsigned int dimSize(8); - constexpr ImageType::RegionType::SizeType size = { { dimSize, dimSize, dimSize } }; - constexpr ImageType::RegionType::IndexType index = { { 0, 0, 0 } }; + constexpr ImageType::RegionType::SizeType size{ dimSize, dimSize, dimSize }; + constexpr ImageType::RegionType::IndexType index{ 0, 0, 0 }; region = { index, size }; auto image = ImageType::New(); @@ -58,7 +58,7 @@ itkCropImageFilter3DTest(int, char *[]) cropFilter->SetInput(image); // Set the filter properties - constexpr ImageType::SizeType extractSize = { { 1, 1, 1 } }; + constexpr ImageType::SizeType extractSize{ 1, 1, 1 }; cropFilter->SetBoundaryCropSize(extractSize); @@ -84,8 +84,8 @@ itkCropImageFilter3DTest(int, char *[]) } } ImageType::RegionType subRegion; - constexpr ImageType::RegionType::SizeType subSize = { { dimSize - 2, dimSize - 2, dimSize - 2 } }; - constexpr ImageType::RegionType::IndexType subIndex = { { 1, 1, 1 } }; + constexpr ImageType::RegionType::SizeType subSize{ dimSize - 2, dimSize - 2, dimSize - 2 }; + constexpr ImageType::RegionType::IndexType subIndex{ 1, 1, 1 }; subRegion = { subIndex, subSize }; itk::ImageRegionIterator it1(image, subRegion); diff --git a/Modules/Filtering/ImageGrid/test/itkCropImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkCropImageFilterTest.cxx index c4871a30124..4bf80abff63 100644 --- a/Modules/Filtering/ImageGrid/test/itkCropImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkCropImageFilterTest.cxx @@ -26,7 +26,7 @@ itkCropImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; // Declare the pixel types of the images using PixelType = short; @@ -37,8 +37,8 @@ itkCropImageFilterTest(int, char *[]) auto inputImage = ImageType::New(); // Fill in the image - constexpr ImageType::IndexType index = { { 0, 0 } }; - constexpr ImageType::SizeType size = { { 8, 12 } }; + constexpr ImageType::IndexType index{ 0, 0 }; + constexpr ImageType::SizeType size{ 8, 12 }; ImageType::RegionType region{ index, size }; inputImage->SetLargestPossibleRegion(region); inputImage->SetBufferedRegion(region); diff --git a/Modules/Filtering/ImageGrid/test/itkCyclicShiftImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkCyclicShiftImageFilterTest.cxx index b12a5fc3138..0c89c4d500f 100644 --- a/Modules/Filtering/ImageGrid/test/itkCyclicShiftImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkCyclicShiftImageFilterTest.cxx @@ -32,7 +32,7 @@ itkCyclicShiftImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageGrid/test/itkExpandImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkExpandImageFilterTest.cxx index 8b8dd887707..389624ebb39 100644 --- a/Modules/Filtering/ImageGrid/test/itkExpandImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkExpandImageFilterTest.cxx @@ -75,7 +75,7 @@ class ShowProgressObject int itkExpandImageFilterTest(int, char *[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = float; using ImageType = itk::Image; @@ -84,7 +84,7 @@ itkExpandImageFilterTest(int, char *[]) std::cout << "Create the input image pattern." << std::endl; ImageType::RegionType region; - constexpr ImageType::SizeType size = { { 64, 64 } }; + constexpr ImageType::SizeType size{ 64, 64 }; region.SetSize(size); auto input = ImageType::New(); @@ -121,7 +121,7 @@ itkExpandImageFilterTest(int, char *[]) expander->SetExpandFactors(5); unsigned int factors[ImageDimension] = { 2, 3 }; - constexpr ImageType::PixelType padValue = 4.0; + constexpr ImageType::PixelType padValue{ 4.0 }; expander->SetInput(input); expander->SetExpandFactors(factors); // TEST_RMV20100728 expander->SetEdgePaddingValue( padValue ); @@ -160,7 +160,7 @@ itkExpandImageFilterTest(int, char *[]) const ImageType::IndexType inputIndex = input->TransformPhysicalPointToIndex(point); const double trueValue = pattern.Evaluate(inputIndex); - constexpr double epsilon = 1e-4; + constexpr double epsilon{ 1e-4 }; if (itk::Math::abs(trueValue - value) > epsilon) { std::cerr.precision(static_cast(itk::Math::abs(std::log10(epsilon)))); diff --git a/Modules/Filtering/ImageGrid/test/itkExpandImageFilterTest2.cxx b/Modules/Filtering/ImageGrid/test/itkExpandImageFilterTest2.cxx index 93f05707b40..e8b0afdcb30 100644 --- a/Modules/Filtering/ImageGrid/test/itkExpandImageFilterTest2.cxx +++ b/Modules/Filtering/ImageGrid/test/itkExpandImageFilterTest2.cxx @@ -193,7 +193,7 @@ itkExpandImageFilterTest2(int, char *[]) // Test 1D: A 5 pixel long 1D image with 2 channels. Using a NearestNeighborInterpolator for simplicity. Expanding // by 2. - constexpr VectorImage1D::SizeType size1D = { { 5 } }; + constexpr VectorImage1D::SizeType size1D{ 5 }; const VectorImage1D::Pointer input1D = GetVectorTestImage(size1D, 2); std::cout << "Output input1D:" << std::endl; @@ -240,7 +240,7 @@ itkExpandImageFilterTest2(int, char *[]) // Test 3D: a 3 x 3 4-channel image. Like above, incremental pixel values along each channel, dim 0, dim 1, dim 2. // Channel 1 values are 1-27, Channel 2 is 28-54, etc. Expanding by 2 along dim 1. - constexpr VectorImage3D::SizeType size3D = { { 3, 3, 3 } }; + constexpr VectorImage3D::SizeType size3D{ 3, 3, 3 }; const VectorImage3D::Pointer input3D = GetVectorTestImage(size3D, 4); std::cout << "Output input3D:" << std::endl; @@ -253,7 +253,7 @@ itkExpandImageFilterTest2(int, char *[]) auto interpolator3D = Interpolator3DType::New(); expander3D->SetInterpolator(interpolator3D); - constexpr unsigned int factors3[3] = { 1, 2, 1 }; + constexpr unsigned int factors3[3]{ 1, 2, 1 }; expander3D->SetInput(input3D); expander3D->SetExpandFactors(factors3); expander3D->Update(); diff --git a/Modules/Filtering/ImageGrid/test/itkFlipImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkFlipImageFilterTest.cxx index 47cab48f0ae..a3f101733cf 100644 --- a/Modules/Filtering/ImageGrid/test/itkFlipImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkFlipImageFilterTest.cxx @@ -35,14 +35,14 @@ itkFlipImageFilterTest(int argc, char * argv[]) itk::OutputWindow::SetInstance(itk::TextOutput::New()); - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using PixelType = unsigned char; using ImageType = itk::Image; using FlipperType = itk::FlipImageFilter; // Define a small input image - constexpr ImageType::IndexType index = { { 10, 20, 30 } }; - constexpr ImageType::SizeType size = { { 5, 4, 3 } }; + constexpr ImageType::IndexType index{ 10, 20, 30 }; + constexpr ImageType::SizeType size{ 5, 4, 3 }; const ImageType::RegionType region{ index, size }; ImageType::SpacingType spacing; diff --git a/Modules/Filtering/ImageGrid/test/itkInterpolateImagePointsFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkInterpolateImagePointsFilterTest.cxx index 548033491c9..691baa345ce 100644 --- a/Modules/Filtering/ImageGrid/test/itkInterpolateImagePointsFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkInterpolateImagePointsFilterTest.cxx @@ -94,24 +94,24 @@ test2DInterpolateImagePointsFilter() set2DInterpolateImagePointsFilterData(image); // Using Index Coordinates so setting of origin and spacing should // not change results. - constexpr double origin[] = { 5.5, 1.0 }; - constexpr double spacing[] = { 5.1, 0.5 }; + constexpr double origin[]{ 5.5, 1.0 }; + constexpr double spacing[]{ 5.1, 0.5 }; image->SetOrigin(origin); image->SetSpacing(spacing); // Initialize the sample data - constexpr int NPOINTS2 = 4; // number of points - constexpr double DEFAULTPIXELVALUE = 1.23; // Arbitrary value to test setting + constexpr int NPOINTS2{ 4 }; // number of points + constexpr double DEFAULTPIXELVALUE{ 1.23 }; // Arbitrary value to test setting - constexpr double xcoord[NPOINTS2] = { 0.1, 3.4, 4.0, 2.0 }; - constexpr double ycoord[NPOINTS2] = { 0.2, 5.8, 6.0, 7.0 }; - constexpr double truth[NPOINTS2] = { 151.650316034, 22.411473093, 36.2, DEFAULTPIXELVALUE }; + constexpr double xcoord[NPOINTS2]{ 0.1, 3.4, 4.0, 2.0 }; + constexpr double ycoord[NPOINTS2]{ 0.2, 5.8, 6.0, 7.0 }; + constexpr double truth[NPOINTS2]{ 151.650316034, 22.411473093, 36.2, DEFAULTPIXELVALUE }; // Place continuous index coordinates into an image data structure const CoordImageType2DPointer index1 = CoordImageType2D::New(); const CoordImageType2DPointer index2 = CoordImageType2D::New(); - constexpr CoordImage2DSizeType size = { { 2, 2 } }; + constexpr CoordImage2DSizeType size{ 2, 2 }; CoordImageType2D::RegionType region; region.SetSize(size); @@ -146,13 +146,13 @@ test2DInterpolateImagePointsFilter() ITK_EXERCISE_BASIC_OBJECT_METHODS(resamp, InterpolateImagePointsFilter, ImageToImageFilter); - constexpr unsigned int splineOrder = 3; + constexpr unsigned int splineOrder{ 3 }; resamp->GetInterpolator()->SetSplineOrder(splineOrder); resamp->SetInputImage(image); resamp->SetInterpolationCoordinate(index1, 0); resamp->SetInterpolationCoordinate(index2, 1); - constexpr InterpolatorType2D::PixelType defaultPixelValue = DEFAULTPIXELVALUE; + constexpr InterpolatorType2D::PixelType defaultPixelValue{ DEFAULTPIXELVALUE }; resamp->SetDefaultPixelValue(defaultPixelValue); ITK_TEST_SET_GET_VALUE(defaultPixelValue, resamp->GetDefaultPixelValue()); @@ -164,7 +164,7 @@ test2DInterpolateImagePointsFilter() const ImageType2DPointer outputImage = resamp->GetOutput(); InputIterator outIter(outputImage, region); int i = 0; - constexpr double epsilon = 1e-9; + constexpr double epsilon{ 1e-9 }; while (!outIter.IsAtEnd()) { const double value = outIter.Get(); @@ -203,7 +203,7 @@ test3DInterpolateImagePointsFilter() ITK_EXERCISE_BASIC_OBJECT_METHODS(resamp, InterpolateImagePointsFilter, ImageToImageFilter); - constexpr unsigned int splineOrder = 3; + constexpr unsigned int splineOrder{ 3 }; resamp->GetInterpolator()->SetSplineOrder(splineOrder); resamp->SetInputImage(image); @@ -265,7 +265,7 @@ test3DInterpolateImagePointsFilter() // Write home and let mom & dad know how we're doing. std::cout << "rmse of image is " << rmse << "\n "; - constexpr double epsilon = 1e-7; + constexpr double epsilon{ 1e-7 }; std::cout.precision(static_cast(itk::Math::abs(std::log10(epsilon)))); if (!itk::Math::FloatAlmostEqual(rmse, 0.0, 10, epsilon)) { @@ -309,8 +309,8 @@ itkInterpolateImagePointsFilterTest(int, char *[]) void set2DInterpolateImagePointsFilterData(ImageType2D::Pointer imgPtr) { - constexpr ImageType2DSizeType size = { { 7, 7 } }; - constexpr double mydata[49] = { + constexpr ImageType2DSizeType size{ 7, 7 }; + constexpr double mydata[49]{ 154.5000, 82.4000, 30.9000, 0, -10.3000, 0, 30.9000, 117.0000, 62.4000, 23.4000, 0, -7.8000, 0, 23.4000, 18.0000, 9.6000, 3.6000, 0, -1.2000, 0, 3.6000, -120.0000, -64.0000, -24.0000, 0, 8.0000, 0, -24.0000, -274.5000, -146.4000, -54.9000, 0, 18.3000, 0, -54.9000, -423.0000, -225.6000, -84.6000, 0, 28.2000, 0, -84.6000, @@ -346,7 +346,7 @@ set3DData() auto pSource = GaussianSourceType::New(); ImageType3D::SpacingValueType spacing[] = { 1.2f, 1.3f, 1.4f }; - constexpr ImageType3D::PointValueType origin[] = { 1.0f, 4.0f, 2.0f }; + constexpr ImageType3D::PointValueType origin[]{ 1.0f, 4.0f, 2.0f }; ImageType3D::SizeValueType size[] = { 65, 75, 60 }; GaussianSourceType::ArrayType mean; diff --git a/Modules/Filtering/ImageGrid/test/itkMirrorPadImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkMirrorPadImageFilterTest.cxx index ab52f2e18f4..7165cf48bb9 100644 --- a/Modules/Filtering/ImageGrid/test/itkMirrorPadImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkMirrorPadImageFilterTest.cxx @@ -28,7 +28,7 @@ template int RunTest(int argc, char * argv[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputImagePixelType = unsigned char; using InImageType = itk::Image; using ReaderType = itk::ImageFileReader; diff --git a/Modules/Filtering/ImageGrid/test/itkOrientImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkOrientImageFilterTest.cxx index 233ebe0e32e..9add5de8dfb 100644 --- a/Modules/Filtering/ImageGrid/test/itkOrientImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkOrientImageFilterTest.cxx @@ -26,8 +26,8 @@ using ImageType = itk::Image; ImageType::Pointer CreateRandomImage() { - constexpr ImageType::SizeType imageSize = { { 4, 4, 4 } }; - constexpr ImageType::IndexType imageIndex = { { 0, 0, 0 } }; + constexpr ImageType::SizeType imageSize{ 4, 4, 4 }; + constexpr ImageType::IndexType imageIndex{ 0, 0, 0 }; const ImageType::RegionType region{ imageIndex, imageSize }; auto img = ImageType::New(); img->SetRegions(region); diff --git a/Modules/Filtering/ImageGrid/test/itkOrientImageFilterTest2.cxx b/Modules/Filtering/ImageGrid/test/itkOrientImageFilterTest2.cxx index 4516be8bbad..265f3c489ed 100644 --- a/Modules/Filtering/ImageGrid/test/itkOrientImageFilterTest2.cxx +++ b/Modules/Filtering/ImageGrid/test/itkOrientImageFilterTest2.cxx @@ -50,7 +50,7 @@ PrintImg(ImageType::Pointer img, const OrientImageFilterType::PermuteOrderArrayT ImageType::Pointer CreateAxialImage() { - constexpr ImageType::SizeType imageSize = { { 4, 4, 4 } }; + constexpr ImageType::SizeType imageSize{ 4, 4, 4 }; ImageType::IndexType imageIndex = { { 0, 0, 0 } }; const ImageType::RegionType region{ imageIndex, imageSize }; auto img = ImageType::New(); @@ -102,7 +102,7 @@ CreateAxialImage() ImageType::Pointer CreateCoronalImage() { - constexpr ImageType::SizeType imageSize = { { 4, 4, 4 } }; + constexpr ImageType::SizeType imageSize{ 4, 4, 4 }; ImageType::IndexType imageIndex = { { 0, 0, 0 } }; const ImageType::RegionType region{ imageIndex, imageSize }; auto img = ImageType::New(); diff --git a/Modules/Filtering/ImageGrid/test/itkPadImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkPadImageFilterTest.cxx index dd73afef1b7..912dafeb239 100644 --- a/Modules/Filtering/ImageGrid/test/itkPadImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkPadImageFilterTest.cxx @@ -30,7 +30,7 @@ itkPadImageFilterTest(int, char *[]) auto padFilter = FilterType::New(); SizeType lowerBound = { { 1, 2 } }; - constexpr SizeType upperBound = { { 3, 4 } }; + constexpr SizeType upperBound{ 3, 4 }; SizeValueType lowerBoundArray[2] = { 1, 2 }; SizeValueType upperBoundArray[2] = { 3, 4 }; @@ -99,7 +99,7 @@ itkPadImageFilterTest(int, char *[]) // Fill in a test image auto inputImage = ShortImage::New(); - constexpr ShortImage::SizeType inputSize = { { 1, 1 } }; + constexpr ShortImage::SizeType inputSize{ 1, 1 }; const ShortImage::RegionType inputRegion(inputSize); inputImage->SetRegions(inputRegion); inputImage->Allocate(); diff --git a/Modules/Filtering/ImageGrid/test/itkPasteImageFilterGTest.cxx b/Modules/Filtering/ImageGrid/test/itkPasteImageFilterGTest.cxx index c2a517bf0ff..39ed78c90c1 100644 --- a/Modules/Filtering/ImageGrid/test/itkPasteImageFilterGTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkPasteImageFilterGTest.cxx @@ -117,7 +117,7 @@ TEST_F(PasteFixture, ConstantPaste) filter->SetDestinationImage(inputImage); filter->SetDestinationIndex({ { 11, 13 } }); - constexpr int constantValue = -97; + constexpr int constantValue{ -97 }; filter->SetConstant(constantValue); filter->SetSourceRegion(Utils::SizeType{ { 3, 3 } }); @@ -168,7 +168,7 @@ TEST_F(PasteFixture, ConstantPaste3_2) auto inputImage = Utils::CreateImage(100); - constexpr int constantValue = -23; + constexpr int constantValue{ -23 }; filter->SetConstant(constantValue); @@ -251,7 +251,7 @@ TEST_F(PasteFixture, InPlace) auto inputImage = Utils::CreateImage(25); - constexpr int constantValue = 99; + constexpr int constantValue{ 99 }; inputImage->SetPixel(Utils::IndexType{ { 1, 1 } }, constantValue); filter->SetDestinationImage(inputImage); @@ -299,7 +299,7 @@ TEST_F(PasteFixture, Paste3_2) using Utils = FixtureUtilities, itk::Image>; using SkipType = typename Utils::FilterType::InputSkipAxesArrayType; - constexpr int constantValue = -53; + constexpr int constantValue{ -53 }; auto filter = Utils::FilterType::New(); diff --git a/Modules/Filtering/ImageGrid/test/itkPasteImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkPasteImageFilterTest.cxx index ec5917e2b20..50d22081b34 100644 --- a/Modules/Filtering/ImageGrid/test/itkPasteImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkPasteImageFilterTest.cxx @@ -33,7 +33,7 @@ itkPasteImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageGrid/test/itkPermuteAxesImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkPermuteAxesImageFilterTest.cxx index d326d8a4114..44a722cd97b 100644 --- a/Modules/Filtering/ImageGrid/test/itkPermuteAxesImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkPermuteAxesImageFilterTest.cxx @@ -51,8 +51,8 @@ itkPermuteAxesImageFilterTest(int, char *[]) // define a small input test - constexpr ImageType::IndexType index = { { 10, 20, 30, 40 } }; - constexpr ImageType::SizeType size = { { 5, 4, 3, 2 } }; + constexpr ImageType::IndexType index{ 10, 20, 30, 40 }; + constexpr ImageType::SizeType size{ 5, 4, 3, 2 }; const ImageType::RegionType region{ index, size }; double spacing[ImageDimension] = { 1.1, 1.2, 1.3, 1.4 }; diff --git a/Modules/Filtering/ImageGrid/test/itkRegionOfInterestImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkRegionOfInterestImageFilterTest.cxx index 0b8095782a4..91e89679458 100644 --- a/Modules/Filtering/ImageGrid/test/itkRegionOfInterestImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkRegionOfInterestImageFilterTest.cxx @@ -25,7 +25,7 @@ int itkRegionOfInterestImageFilterTest(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = itk::Index; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageFilterGTest.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageFilterGTest.cxx index 68c42f12698..bdf63600bfb 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageFilterGTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageFilterGTest.cxx @@ -144,7 +144,7 @@ TEST(ResampleImageFilter, FilterPreservesAnyDoublePixelValueByDefault) std::default_random_engine randomEngine; // The number of iterations is arbitrarily chosen. - constexpr size_t numberOfIterations = 11; + constexpr size_t numberOfIterations{ 11 }; for (size_t i = 0; i < numberOfIterations; ++i) { diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest.cxx index 4ba2b1ecc39..f2e2182ecb0 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest.cxx @@ -28,7 +28,7 @@ int itkResampleImageTest(int, char *[]) { - constexpr unsigned int VDimension = 2; + constexpr unsigned int VDimension{ 2 }; using PixelType = float; using ImageType = itk::Image; @@ -45,7 +45,7 @@ itkResampleImageTest(int, char *[]) // Create and configure an image const ImagePointerType image = ImageType::New(); ImageIndexType index = { { 0, 0 } }; - constexpr ImageSizeType size = { { 18, 12 } }; + constexpr ImageSizeType size{ 18, 12 }; const ImageRegionType region{ index, size }; image->SetLargestPossibleRegion(region); image->SetBufferedRegion(region); @@ -95,7 +95,7 @@ itkResampleImageTest(int, char *[]) // Check if desired results were obtained bool passed = true; const ImageType::RegionType region2 = resample->GetOutput()->GetRequestedRegion(); - constexpr double tolerance = 1e-30; + constexpr double tolerance{ 1e-30 }; for (itk::ImageRegionIteratorWithIndex iter2(resample->GetOutput(), region2); !iter2.IsAtEnd(); ++iter2) { index = iter2.GetIndex(); diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest2.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest2.cxx index 264d0df9890..5cad64f1a4a 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest2.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest2.cxx @@ -77,7 +77,7 @@ itkResampleImageTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int VDimension = 2; + constexpr unsigned int VDimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest2Streaming.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest2Streaming.cxx index 580c6bad285..1eb55e4e1ad 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest2Streaming.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest2Streaming.cxx @@ -72,7 +72,7 @@ itkResampleImageTest2Streaming(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int VDimension = 2; + constexpr unsigned int VDimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest3.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest3.cxx index 31e1c025f10..9ac29d8df4d 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest3.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest3.cxx @@ -43,7 +43,7 @@ itkResampleImageTest3(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int VDimension = 2; + constexpr unsigned int VDimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest4.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest4.cxx index 90ed88e8480..ff497a96eda 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest4.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest4.cxx @@ -27,7 +27,7 @@ int itkResampleImageTest4(int argc, char * argv[]) { - constexpr unsigned int VDimension = 2; + constexpr unsigned int VDimension{ 2 }; using PixelType = float; diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest5.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest5.cxx index 6acf0abab5f..de702202faa 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest5.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest5.cxx @@ -37,7 +37,7 @@ itkResampleImageTest5(int argc, char * argv[]) } // Resample an RGB image - constexpr unsigned int VDimension = 2; + constexpr unsigned int VDimension{ 2 }; using RGBPixelType = itk::RGBPixel; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest6.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest6.cxx index 314f3a54444..e5cacfb6155 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest6.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest6.cxx @@ -38,7 +38,7 @@ itkResampleImageTest6(int argc, char * argv[]) // Resample a Vector image - constexpr unsigned int VDimension = 2; + constexpr unsigned int VDimension{ 2 }; using ValueType = unsigned char; diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest7.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest7.cxx index f134d64d2dd..16c532a00aa 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest7.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest7.cxx @@ -31,7 +31,7 @@ int itkResampleImageTest7(int, char *[]) { - constexpr unsigned int VDimension = 2; + constexpr unsigned int VDimension{ 2 }; using PixelType = float; @@ -50,7 +50,7 @@ itkResampleImageTest7(int, char *[]) // Create and configure an image const ImagePointerType image = ImageType::New(); ImageIndexType index = { { 0, 0 } }; - constexpr ImageSizeType size = { { 64, 64 } }; + constexpr ImageSizeType size{ 64, 64 }; const ImageRegionType region{ index, size }; image->SetRegions(region); image->Allocate(); diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest8.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest8.cxx index db5dc362cf3..82005b4ca3d 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest8.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest8.cxx @@ -118,8 +118,8 @@ int itkResampleImageTest8(int, char *[]) { - constexpr unsigned int InputImageDimensions = 2; - constexpr unsigned int OutputImageDimensions = 3; + constexpr unsigned int InputImageDimensions{ 2 }; + constexpr unsigned int OutputImageDimensions{ 3 }; using PixelType = float; @@ -143,7 +143,7 @@ itkResampleImageTest8(int, char *[]) // Create and configure an image const InputImagePointerType inputImage = InputImageType::New(); InputImageIndexType inputIndex = { { 0, 0 } }; - constexpr InputImageSizeType inputSize = { { 18, 12 } }; + constexpr InputImageSizeType inputSize{ 18, 12 }; const InputImageRegionType inputRegion{ inputIndex, inputSize }; inputImage->SetLargestPossibleRegion(inputRegion); inputImage->SetBufferedRegion(inputRegion); @@ -163,7 +163,7 @@ itkResampleImageTest8(int, char *[]) // OutputImagePointerType outputImage = OutputImageType::New(); OutputImageIndexType outputIndex = { { 0, 0, 0 } }; - constexpr OutputImageSizeType outputSize = { { 18, 12, 5 } }; + constexpr OutputImageSizeType outputSize{ 18, 12, 5 }; // Create a linear interpolation image function auto interp = InterpolatorType::New(); @@ -198,7 +198,7 @@ itkResampleImageTest8(int, char *[]) // Check if desired results were obtained bool passed = true; const OutputImageType::RegionType region2 = resample->GetOutput()->GetRequestedRegion(); - constexpr double tolerance = 1e-30; + constexpr double tolerance{ 1e-30 }; for (itk::ImageRegionIteratorWithIndex iter2(resample->GetOutput(), region2); !iter2.IsAtEnd(); ++iter2) { diff --git a/Modules/Filtering/ImageGrid/test/itkShrinkImageStreamingTest.cxx b/Modules/Filtering/ImageGrid/test/itkShrinkImageStreamingTest.cxx index 660a8f55965..b765d53e3ae 100644 --- a/Modules/Filtering/ImageGrid/test/itkShrinkImageStreamingTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkShrinkImageStreamingTest.cxx @@ -27,7 +27,7 @@ int itkShrinkImageStreamingTest(int, char *[]) { - constexpr unsigned int numberOfStreamDivisions = 4; + constexpr unsigned int numberOfStreamDivisions{ 4 }; // type alias to simplify the syntax using ShortImage = itk::Image; @@ -36,8 +36,8 @@ itkShrinkImageStreamingTest(int, char *[]) using MonitorFilter = itk::PipelineMonitorImageFilter; // fill in an image - constexpr ShortImage::IndexType index = { { 100, 100 } }; - constexpr ShortImage::SizeType size = { { 8, 12 } }; + constexpr ShortImage::IndexType index{ 100, 100 }; + constexpr ShortImage::SizeType size{ 8, 12 }; const ShortImage::RegionType region{ index, size }; sourceImage->SetRegions(region); sourceImage->Allocate(); diff --git a/Modules/Filtering/ImageGrid/test/itkShrinkImageTest.cxx b/Modules/Filtering/ImageGrid/test/itkShrinkImageTest.cxx index 0aa843bbbfa..d31d08c44de 100644 --- a/Modules/Filtering/ImageGrid/test/itkShrinkImageTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkShrinkImageTest.cxx @@ -44,8 +44,8 @@ itkShrinkImageTest(int, char *[]) auto if2 = ShortImage::New(); // fill in an image - constexpr ShortImage::IndexType index = { { 0, 0 } }; - constexpr ShortImage::SizeType size = { { 8, 12 } }; + constexpr ShortImage::IndexType index{ 0, 0 }; + constexpr ShortImage::SizeType size{ 8, 12 }; const ShortImage::RegionType region{ index, size }; if2->SetLargestPossibleRegion(region); if2->SetBufferedRegion(region); diff --git a/Modules/Filtering/ImageGrid/test/itkSliceBySliceImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkSliceBySliceImageFilterTest.cxx index 0243dfe082b..12f69a3c196 100644 --- a/Modules/Filtering/ImageGrid/test/itkSliceBySliceImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkSliceBySliceImageFilterTest.cxx @@ -29,7 +29,7 @@ void sliceCallBack(itk::Object * object, const itk::EventObject &, void *) { // the same type alias than in the main function - should be done in a nicer way - constexpr int Dimension = 3; + constexpr int Dimension{ 3 }; using PixelType = unsigned char; using ImageType = itk::Image; @@ -58,7 +58,7 @@ itkSliceBySliceImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int Dimension = 3; + constexpr int Dimension{ 3 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageGrid/test/itkSliceImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkSliceImageFilterTest.cxx index b91906971cd..6bd0ce1927f 100644 --- a/Modules/Filtering/ImageGrid/test/itkSliceImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkSliceImageFilterTest.cxx @@ -85,7 +85,7 @@ RunFilter(const TImageType * img, TEST(SliceImageFilterTests, PhysicalPoint1) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = itk::Point; using ImageType = itk::Image; @@ -125,7 +125,7 @@ TEST(SliceImageFilterTests, PhysicalPoint1) TEST(SliceImageFilterTests, PhysicalPoint2) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = itk::Point; using ImageType = itk::Image; @@ -167,7 +167,7 @@ TEST(SliceImageFilterTests, PhysicalPoint2) TEST(SliceImageFilterTests, PhysicalPoint3) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = itk::Point; using ImageType = itk::Image; @@ -205,7 +205,7 @@ TEST(SliceImageFilterTests, PhysicalPoint3) TEST(SliceImageFilterTests, Empty) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = itk::Point; using ImageType = itk::Image; @@ -243,7 +243,7 @@ TEST(SliceImageFilterTests, Empty) TEST(SliceImageFilterTests, Coverage) { - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using ImageType = itk::Image; using FilterType = itk::SliceImageFilter; @@ -279,13 +279,13 @@ TEST(SliceImageFilterTests, Coverage) TEST(SliceImageFilterTests, Sizes) { - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using ImageType = itk::Image; using SourceType = itk::GaussianImageSource; auto source = SourceType::New(); - constexpr SourceType::SizeType size = { { 64, 64, 64 } }; + constexpr SourceType::SizeType size{ 64, 64, 64 }; source->SetSize(size); source->ReleaseDataFlagOn(); @@ -333,7 +333,7 @@ TEST(SliceImageFilterTests, Sizes) TEST(SliceImageFilterTests, ExceptionalCases) { - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using ImageType = itk::Image; using SourceType = itk::GaussianImageSource; diff --git a/Modules/Filtering/ImageGrid/test/itkTileImageFilterGTest.cxx b/Modules/Filtering/ImageGrid/test/itkTileImageFilterGTest.cxx index 93ae3e78639..e988662d127 100644 --- a/Modules/Filtering/ImageGrid/test/itkTileImageFilterGTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkTileImageFilterGTest.cxx @@ -119,7 +119,7 @@ TEST_F(TileImageFixture, VectorImage) const typename ImageType::SizeType imageSize = itk::MakeSize(10, 10); - constexpr unsigned int numberOfComponents = 5; + constexpr unsigned int numberOfComponents{ 5 }; ImageType::PixelType v(numberOfComponents); diff --git a/Modules/Filtering/ImageGrid/test/itkWarpImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkWarpImageFilterTest.cxx index a284e489141..3905342b53b 100644 --- a/Modules/Filtering/ImageGrid/test/itkWarpImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkWarpImageFilterTest.cxx @@ -94,7 +94,7 @@ class ShowProgressObject int itkWarpImageFilterTest(int, char *[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = float; using ImageType = itk::Image; @@ -114,7 +114,7 @@ itkWarpImageFilterTest(int, char *[]) input->SetBufferedRegion(region); input->Allocate(); - constexpr ImageType::PixelType padValue = 4.0; + constexpr ImageType::PixelType padValue{ 4.0 }; ImagePattern pattern; @@ -134,7 +134,7 @@ itkWarpImageFilterTest(int, char *[]) std::cout << "Create the input displacement field." << std::endl; // Tested with { 2, 4 } and { 2, 5 } as well... - constexpr unsigned int factors[ImageDimension] = { 2, 3 }; + constexpr unsigned int factors[ImageDimension]{ 2, 3 }; ImageType::RegionType fieldRegion; ImageType::SizeType fieldSize; @@ -289,7 +289,7 @@ itkWarpImageFilterTest(int, char *[]) const double trueValue = pattern.Evaluate(outIter.GetIndex(), validSize, clampSize, padValue); - constexpr double epsilon = 1e-4; + constexpr double epsilon{ 1e-4 }; if (itk::Math::abs(trueValue - value) > epsilon) { std::cerr.precision(static_cast(itk::Math::abs(std::log10(epsilon)))); diff --git a/Modules/Filtering/ImageGrid/test/itkWarpImageFilterTest2.cxx b/Modules/Filtering/ImageGrid/test/itkWarpImageFilterTest2.cxx index 3ac19f158dd..9bb24aa489a 100644 --- a/Modules/Filtering/ImageGrid/test/itkWarpImageFilterTest2.cxx +++ b/Modules/Filtering/ImageGrid/test/itkWarpImageFilterTest2.cxx @@ -44,10 +44,10 @@ ImageType::Pointer MakeCheckerboard() { using IteratorType = itk::ImageRegionIterator; - constexpr ImageType::SizeType size = { { 16, 16, 16 } }; + constexpr ImageType::SizeType size{ 16, 16, 16 }; ImageType::SpacingType spacing; spacing[0] = spacing[1] = spacing[2] = 1.0; - constexpr ImageType::IndexType index = { { 0, 0, 0 } }; + constexpr ImageType::IndexType index{ 0, 0, 0 }; const ImageType::RegionType region{ index, size }; ImageType::Pointer image; AllocateImageFromRegionAndSpacing(ImageType, image, region, spacing); @@ -77,7 +77,7 @@ MakeDisplacementField() const DisplacementFieldType::SizeType size = { { TImageIndexSpaceSize, TImageIndexSpaceSize, TImageIndexSpaceSize } }; DisplacementFieldType::SpacingType spacing; spacing[0] = spacing[1] = spacing[2] = 16.0 / static_cast(TImageIndexSpaceSize); - constexpr DisplacementFieldType::IndexType index = { { 0, 0, 0 } }; + constexpr DisplacementFieldType::IndexType index{ 0, 0, 0 }; const DisplacementFieldType::RegionType region{ index, size }; DisplacementFieldType::Pointer image; AllocateImageFromRegionAndSpacing(DisplacementFieldType, image, region, spacing); diff --git a/Modules/Filtering/ImageGrid/test/itkWarpVectorImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkWarpVectorImageFilterTest.cxx index acb56ee587e..1a680d9ef2c 100644 --- a/Modules/Filtering/ImageGrid/test/itkWarpVectorImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkWarpVectorImageFilterTest.cxx @@ -93,7 +93,7 @@ class ShowProgressObject int itkWarpVectorImageFilterTest(int, char *[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using VectorType = itk::Vector; using FieldType = itk::Image; @@ -124,7 +124,7 @@ itkWarpVectorImageFilterTest(int, char *[]) using Iterator = itk::ImageRegionIteratorWithIndex; - constexpr float padValue = 4.0; + constexpr float padValue{ 4.0 }; for (Iterator inIter(input, region); !inIter.IsAtEnd(); ++inIter) { @@ -133,7 +133,7 @@ itkWarpVectorImageFilterTest(int, char *[]) std::cout << "Create the input displacement field." << std::endl; - constexpr unsigned int factors[ImageDimension] = { 2, 3 }; + constexpr unsigned int factors[ImageDimension]{ 2, 3 }; ImageType::RegionType fieldRegion; ImageType::SizeType fieldSize; diff --git a/Modules/Filtering/ImageGrid/test/itkZeroFluxNeumannPadImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkZeroFluxNeumannPadImageFilterTest.cxx index 70f19586355..fb056b5b4be 100644 --- a/Modules/Filtering/ImageGrid/test/itkZeroFluxNeumannPadImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkZeroFluxNeumannPadImageFilterTest.cxx @@ -170,8 +170,8 @@ itkZeroFluxNeumannPadImageFilterTest(int, char *[]) auto inputImage = ShortImage::New(); // Fill in a test image - constexpr ShortImage::IndexType inputIndex = { { 0, 0 } }; - constexpr ShortImage::SizeType inputSize = { { 8, 12 } }; + constexpr ShortImage::IndexType inputIndex{ 0, 0 }; + constexpr ShortImage::SizeType inputSize{ 8, 12 }; const ShortImage::RegionType inputRegion{ inputIndex, inputSize }; inputImage->SetLargestPossibleRegion(inputRegion); inputImage->SetBufferedRegion(inputRegion); diff --git a/Modules/Filtering/ImageIntensity/include/itkDiscreteGaussianDerivativeImageFunction.hxx b/Modules/Filtering/ImageIntensity/include/itkDiscreteGaussianDerivativeImageFunction.hxx index 51f7c918ef7..95e151af0a8 100644 --- a/Modules/Filtering/ImageIntensity/include/itkDiscreteGaussianDerivativeImageFunction.hxx +++ b/Modules/Filtering/ImageIntensity/include/itkDiscreteGaussianDerivativeImageFunction.hxx @@ -195,7 +195,7 @@ DiscreteGaussianDerivativeImageFunction::EvaluateAtContinu using NumberOfNeighborsType = unsigned int; - constexpr NumberOfNeighborsType numberOfNeighbors = 1 << ImageDimension2; + constexpr NumberOfNeighborsType numberOfNeighbors{ 1 << ImageDimension2 }; // Compute base index = closet index below point // Compute distance from point to base index diff --git a/Modules/Filtering/ImageIntensity/include/itkDiscreteGradientMagnitudeGaussianImageFunction.hxx b/Modules/Filtering/ImageIntensity/include/itkDiscreteGradientMagnitudeGaussianImageFunction.hxx index da379fdee6b..fc2ebc93c33 100644 --- a/Modules/Filtering/ImageIntensity/include/itkDiscreteGradientMagnitudeGaussianImageFunction.hxx +++ b/Modules/Filtering/ImageIntensity/include/itkDiscreteGradientMagnitudeGaussianImageFunction.hxx @@ -230,7 +230,7 @@ DiscreteGradientMagnitudeGaussianImageFunction::EvaluateAt using NumberOfNeighborsType = unsigned int; - constexpr NumberOfNeighborsType neighbors = 1 << ImageDimension2; + constexpr NumberOfNeighborsType neighbors{ 1 << ImageDimension2 }; // Compute base index = closet index below point // Compute distance from point to base index diff --git a/Modules/Filtering/ImageIntensity/include/itkDiscreteHessianGaussianImageFunction.hxx b/Modules/Filtering/ImageIntensity/include/itkDiscreteHessianGaussianImageFunction.hxx index 8e722988859..cf1a6be8a71 100644 --- a/Modules/Filtering/ImageIntensity/include/itkDiscreteHessianGaussianImageFunction.hxx +++ b/Modules/Filtering/ImageIntensity/include/itkDiscreteHessianGaussianImageFunction.hxx @@ -224,7 +224,7 @@ DiscreteHessianGaussianImageFunction::EvaluateAtContinuous using NumberOfNeighborsType = unsigned int; - constexpr NumberOfNeighborsType neighbors = 1 << ImageDimension2; + constexpr NumberOfNeighborsType neighbors{ 1 << ImageDimension2 }; // Compute base index = closet index below point // Compute distance from point to base index diff --git a/Modules/Filtering/ImageIntensity/test/itkAbsImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkAbsImageFilterAndAdaptorTest.cxx index 49a9644c658..ea240ede5ac 100644 --- a/Modules/Filtering/ImageIntensity/test/itkAbsImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkAbsImageFilterAndAdaptorTest.cxx @@ -30,7 +30,7 @@ itkAbsImageFilterAndAdaptorTest(int, char *[]) int testStatus = EXIT_SUCCESS; // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the types of the images using InputImageType = itk::Image; @@ -97,7 +97,7 @@ itkAbsImageFilterAndAdaptorTest(int, char *[]) // Check the content of the result image std::cout << "Verification of the output " << std::endl; - constexpr OutputImageType::PixelType epsilon = 1e-6; + constexpr OutputImageType::PixelType epsilon{ 1e-6 }; ot.GoToBegin(); it.GoToBegin(); while (!ot.IsAtEnd()) diff --git a/Modules/Filtering/ImageIntensity/test/itkAcosImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkAcosImageFilterAndAdaptorTest.cxx index 07bf6da9537..08680888efc 100644 --- a/Modules/Filtering/ImageIntensity/test/itkAcosImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkAcosImageFilterAndAdaptorTest.cxx @@ -29,7 +29,7 @@ itkAcosImageFilterAndAdaptorTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the pixel types of the images using PixelType = float; @@ -101,7 +101,7 @@ itkAcosImageFilterAndAdaptorTest(int, char *[]) OutputIteratorType ot(outputImage, outputImage->GetRequestedRegion()); // Check the content of the result image - constexpr OutputImageType::PixelType epsilon = 1e-6; + constexpr OutputImageType::PixelType epsilon{ 1e-6 }; ot.GoToBegin(); it.GoToBegin(); while (!ot.IsAtEnd()) diff --git a/Modules/Filtering/ImageIntensity/test/itkAddImageAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkAddImageAdaptorTest.cxx index 50561f2bbc7..19f778e361b 100644 --- a/Modules/Filtering/ImageIntensity/test/itkAddImageAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkAddImageAdaptorTest.cxx @@ -25,7 +25,7 @@ itkAddImageAdaptorTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Declare the pixel type using PixelType = int; @@ -79,7 +79,7 @@ itkAddImageAdaptorTest(int, char *[]) auto addAdaptor = AdaptorType::New(); - constexpr PixelType additiveConstant = 19; + constexpr PixelType additiveConstant{ 19 }; addAdaptor->SetImage(inputImage); addAdaptor->SetValue(additiveConstant); @@ -138,7 +138,7 @@ itkAddImageAdaptorTest(int, char *[]) std::cout << " Pixel " << index << " had value = " << p1 << std::endl; - constexpr PixelType newValue = 27; + constexpr PixelType newValue{ 27 }; std::cout << " We set Pixel " << index << " to value = " << newValue << std::endl; addAdaptor->SetPixel(index, newValue); diff --git a/Modules/Filtering/ImageIntensity/test/itkAddImageFilterFrameTest.cxx b/Modules/Filtering/ImageIntensity/test/itkAddImageFilterFrameTest.cxx index 4bc9adae4a8..ce3a113aa1f 100644 --- a/Modules/Filtering/ImageIntensity/test/itkAddImageFilterFrameTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkAddImageFilterFrameTest.cxx @@ -25,7 +25,7 @@ itkAddImageFilterFrameTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; // Declare the types of the images using myImageType1 = itk::Image; diff --git a/Modules/Filtering/ImageIntensity/test/itkAddImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkAddImageFilterTest.cxx index 08b181e215d..9cf6d8bef04 100644 --- a/Modules/Filtering/ImageIntensity/test/itkAddImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkAddImageFilterTest.cxx @@ -28,7 +28,7 @@ itkAddImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Declare the pixel types of the images using PixelType = float; @@ -68,11 +68,11 @@ itkAddImageFilterTest(int, char *[]) inputImageB->Allocate(); // Initialize the content of Image A - constexpr InputImageType1::PixelType valueA = 2.0; + constexpr InputImageType1::PixelType valueA{ 2.0 }; inputImageA->FillBuffer(valueA); // Initialize the content of Image B - constexpr InputImageType2::PixelType valueB = 3.0; + constexpr InputImageType2::PixelType valueB{ 3.0 }; inputImageB->FillBuffer(valueB); diff --git a/Modules/Filtering/ImageIntensity/test/itkAddImageFilterTest2.cxx b/Modules/Filtering/ImageIntensity/test/itkAddImageFilterTest2.cxx index 4dbc462469d..1264cf2a816 100644 --- a/Modules/Filtering/ImageIntensity/test/itkAddImageFilterTest2.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkAddImageFilterTest2.cxx @@ -37,7 +37,7 @@ itkAddImageFilterTest2(int argc, char * argv[]) const char * outputImage = argv[2]; // Define the dimension of the images - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using FloatPixelType = float; using IntegerPixelType = unsigned short; @@ -55,7 +55,7 @@ itkAddImageFilterTest2(int argc, char * argv[]) integerReader->SetFileName(inputImage); integerReader->SetUseStreaming(true); - constexpr unsigned int streams = 4; + constexpr unsigned int streams{ 4 }; using IntegerMonitorFilterType = itk::PipelineMonitorImageFilter; auto integerMonitorFilter = IntegerMonitorFilterType::New(); diff --git a/Modules/Filtering/ImageIntensity/test/itkAndImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkAndImageFilterTest.cxx index c6a02d96c27..e6aa342a6de 100644 --- a/Modules/Filtering/ImageIntensity/test/itkAndImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkAndImageFilterTest.cxx @@ -31,7 +31,7 @@ itkAndImageFilterTest(int argc, char * argv[]) } // Define the dimension of the images - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Declare the pixel type using PixelType = unsigned short; @@ -76,7 +76,7 @@ itkAndImageFilterTest(int argc, char * argv[]) it1.GoToBegin(); // Initialize the content of Image A - constexpr InputImage1Type::PixelType valueA = 2; + constexpr InputImage1Type::PixelType valueA{ 2 }; while (!it1.IsAtEnd()) { it1.Set(valueA); @@ -88,7 +88,7 @@ itkAndImageFilterTest(int argc, char * argv[]) it2.GoToBegin(); // Initialize the content of Image B - constexpr InputImage2Type::PixelType valueB = 3; + constexpr InputImage2Type::PixelType valueB{ 3 }; while (!it2.IsAtEnd()) { it2.Set(valueB); diff --git a/Modules/Filtering/ImageIntensity/test/itkAsinImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkAsinImageFilterAndAdaptorTest.cxx index 9a7aed9f3d5..5638b5829cc 100644 --- a/Modules/Filtering/ImageIntensity/test/itkAsinImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkAsinImageFilterAndAdaptorTest.cxx @@ -28,7 +28,7 @@ itkAsinImageFilterAndAdaptorTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the pixel types of the images using PixelType = float; @@ -97,7 +97,7 @@ itkAsinImageFilterAndAdaptorTest(int, char *[]) OutputIteratorType ot(outputImage, outputImage->GetRequestedRegion()); // Check the content of the result image - constexpr OutputImageType::PixelType epsilon = 1e-6; + constexpr OutputImageType::PixelType epsilon{ 1e-6 }; ot.GoToBegin(); it.GoToBegin(); while (!ot.IsAtEnd()) diff --git a/Modules/Filtering/ImageIntensity/test/itkAtan2ImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkAtan2ImageFilterTest.cxx index 64e0968e4ae..b8518abd3e1 100644 --- a/Modules/Filtering/ImageIntensity/test/itkAtan2ImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkAtan2ImageFilterTest.cxx @@ -27,7 +27,7 @@ itkAtan2ImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the pixel types of the images using PixelType = float; @@ -113,7 +113,7 @@ itkAtan2ImageFilterTest(int, char *[]) OutputIteratorType ot(outputImage, outputImage->GetRequestedRegion()); // Check the content of the result image - constexpr OutputImageType::PixelType epsilon = 1e-6; + constexpr OutputImageType::PixelType epsilon{ 1e-6 }; ot.GoToBegin(); it1.GoToBegin(); diff --git a/Modules/Filtering/ImageIntensity/test/itkAtanImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkAtanImageFilterAndAdaptorTest.cxx index 7bb8226f0e0..d1b790c6a8b 100644 --- a/Modules/Filtering/ImageIntensity/test/itkAtanImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkAtanImageFilterAndAdaptorTest.cxx @@ -28,7 +28,7 @@ itkAtanImageFilterAndAdaptorTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the pixel types of the images using PixelType = float; @@ -66,7 +66,7 @@ itkAtanImageFilterAndAdaptorTest(int, char *[]) InputIteratorType it(inputImage, inputImage->GetBufferedRegion()); // Initialize the content of Image A - constexpr double value = itk::Math::pi / 6.0; + constexpr double value{ itk::Math::pi / 6.0 }; it.GoToBegin(); while (!it.IsAtEnd()) { @@ -96,7 +96,7 @@ itkAtanImageFilterAndAdaptorTest(int, char *[]) OutputIteratorType ot(outputImage, outputImage->GetRequestedRegion()); // Check the content of the result image - constexpr OutputImageType::PixelType epsilon = 1e-6; + constexpr OutputImageType::PixelType epsilon{ 1e-6 }; ot.GoToBegin(); it.GoToBegin(); while (!ot.IsAtEnd()) diff --git a/Modules/Filtering/ImageIntensity/test/itkBinaryMagnitudeImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkBinaryMagnitudeImageFilterTest.cxx index 1de3361cea2..d9b1b7ae573 100644 --- a/Modules/Filtering/ImageIntensity/test/itkBinaryMagnitudeImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkBinaryMagnitudeImageFilterTest.cxx @@ -27,7 +27,7 @@ itkBinaryMagnitudeImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Declare the pixel types of the images using PixelType = float; @@ -72,7 +72,7 @@ itkBinaryMagnitudeImageFilterTest(int, char *[]) InputImage1IteratorType it1(inputImageA, inputImageA->GetBufferedRegion()); // Initialize the content of Image A - constexpr InputImageType1::PixelType input1Value = 3.0; + constexpr InputImageType1::PixelType input1Value{ 3.0 }; while (!it1.IsAtEnd()) { it1.Set(input1Value); @@ -83,7 +83,7 @@ itkBinaryMagnitudeImageFilterTest(int, char *[]) InputImage2IteratorType it2(inputImageB, inputImageB->GetBufferedRegion()); // Initialize the content of Image B - constexpr InputImageType2::PixelType input2Value = 4.0; + constexpr InputImageType2::PixelType input2Value{ 4.0 }; while (!it2.IsAtEnd()) { it2.Set(input2Value); @@ -91,7 +91,7 @@ itkBinaryMagnitudeImageFilterTest(int, char *[]) } // Define the values of the output image - constexpr OutputImageType::PixelType outputValue = 5.0; + constexpr OutputImageType::PixelType outputValue{ 5.0 }; // Declare the type for the BinaryMagnitudeImageFilter @@ -117,7 +117,7 @@ itkBinaryMagnitudeImageFilterTest(int, char *[]) OutputImageIteratorType oIt(outputImage, outputImage->GetBufferedRegion()); // Check the content of the result image - constexpr float epsilon = 1e-6; + constexpr float epsilon{ 1e-6 }; while (!oIt.IsAtEnd()) { if (!itk::Math::FloatAlmostEqual(oIt.Get(), outputValue, 10, epsilon)) diff --git a/Modules/Filtering/ImageIntensity/test/itkBoundedReciprocalImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkBoundedReciprocalImageFilterTest.cxx index 8592833c458..5358c70b79a 100644 --- a/Modules/Filtering/ImageIntensity/test/itkBoundedReciprocalImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkBoundedReciprocalImageFilterTest.cxx @@ -35,7 +35,7 @@ itkBoundedReciprocalImageFilterTest(int argc, char * argv[]) auto testStatus = EXIT_SUCCESS; - constexpr int Dimension = 2; + constexpr int Dimension{ 2 }; using PixelType = float; using ImageType = itk::Image; @@ -62,7 +62,7 @@ itkBoundedReciprocalImageFilterTest(int argc, char * argv[]) ImageIterator inIter(inputImage, inputImage->GetBufferedRegion()); ImageIterator outIter(outputImage, outputImage->GetBufferedRegion()); - constexpr double tolerance = 10e-6; + constexpr double tolerance{ 10e-6 }; std::cerr.precision(static_cast(itk::Math::abs(std::log10(tolerance)))); for (; !inIter.IsAtEnd() || !outIter.IsAtEnd(); ++inIter, ++outIter) diff --git a/Modules/Filtering/ImageIntensity/test/itkComplexToImaginaryFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkComplexToImaginaryFilterAndAdaptorTest.cxx index 2147e8b51b1..22b1ceed471 100644 --- a/Modules/Filtering/ImageIntensity/test/itkComplexToImaginaryFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkComplexToImaginaryFilterAndAdaptorTest.cxx @@ -27,7 +27,7 @@ itkComplexToImaginaryFilterAndAdaptorTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the types of the images using InputPixelType = std::complex; @@ -93,7 +93,7 @@ itkComplexToImaginaryFilterAndAdaptorTest(int, char *[]) OutputIteratorType ot(outputImage, outputImage->GetRequestedRegion()); // Check the content of the result image - constexpr OutputImageType::PixelType epsilon = 1e-6; + constexpr OutputImageType::PixelType epsilon{ 1e-6 }; ot.GoToBegin(); it.GoToBegin(); while (!ot.IsAtEnd()) diff --git a/Modules/Filtering/ImageIntensity/test/itkComplexToModulusFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkComplexToModulusFilterAndAdaptorTest.cxx index e9f3a2ca406..a1fed4adb34 100644 --- a/Modules/Filtering/ImageIntensity/test/itkComplexToModulusFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkComplexToModulusFilterAndAdaptorTest.cxx @@ -27,7 +27,7 @@ itkComplexToModulusFilterAndAdaptorTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the types of the images using InputPixelType = std::complex; @@ -97,7 +97,7 @@ itkComplexToModulusFilterAndAdaptorTest(int, char *[]) OutputIteratorType ot(outputImage, outputImage->GetRequestedRegion()); // Check the content of the result image - constexpr OutputImageType::PixelType epsilon = 1e-6; + constexpr OutputImageType::PixelType epsilon{ 1e-6 }; ot.GoToBegin(); it.GoToBegin(); while (!ot.IsAtEnd()) diff --git a/Modules/Filtering/ImageIntensity/test/itkComplexToPhaseFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkComplexToPhaseFilterAndAdaptorTest.cxx index d67d250d1b7..ad2de14d6c3 100644 --- a/Modules/Filtering/ImageIntensity/test/itkComplexToPhaseFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkComplexToPhaseFilterAndAdaptorTest.cxx @@ -27,7 +27,7 @@ itkComplexToPhaseFilterAndAdaptorTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the types of the images using InputPixelType = std::complex; @@ -93,7 +93,7 @@ itkComplexToPhaseFilterAndAdaptorTest(int, char *[]) OutputIteratorType ot(outputImage, outputImage->GetRequestedRegion()); // Check the content of the result image - constexpr OutputImageType::PixelType epsilon = 1e-6; + constexpr OutputImageType::PixelType epsilon{ 1e-6 }; ot.GoToBegin(); it.GoToBegin(); while (!ot.IsAtEnd()) diff --git a/Modules/Filtering/ImageIntensity/test/itkComplexToRealFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkComplexToRealFilterAndAdaptorTest.cxx index e0ba42b0a0d..f4b4750ee1b 100644 --- a/Modules/Filtering/ImageIntensity/test/itkComplexToRealFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkComplexToRealFilterAndAdaptorTest.cxx @@ -27,7 +27,7 @@ itkComplexToRealFilterAndAdaptorTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the types of the images using InputPixelType = std::complex; @@ -93,7 +93,7 @@ itkComplexToRealFilterAndAdaptorTest(int, char *[]) OutputIteratorType ot(outputImage, outputImage->GetRequestedRegion()); // Check the content of the result image - constexpr OutputImageType::PixelType epsilon = 1e-6; + constexpr OutputImageType::PixelType epsilon{ 1e-6 }; ot.GoToBegin(); it.GoToBegin(); while (!ot.IsAtEnd()) diff --git a/Modules/Filtering/ImageIntensity/test/itkConstrainedValueAdditionImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkConstrainedValueAdditionImageFilterTest.cxx index ffe64000961..e80d475cd89 100644 --- a/Modules/Filtering/ImageIntensity/test/itkConstrainedValueAdditionImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkConstrainedValueAdditionImageFilterTest.cxx @@ -32,7 +32,7 @@ itkConstrainedValueAdditionImageFilterTest(int argc, char * argv[]) } // Define the dimension of the images - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Define the pixel types using InputPixelType = float; diff --git a/Modules/Filtering/ImageIntensity/test/itkCosImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkCosImageFilterAndAdaptorTest.cxx index 8a243cf8caa..25e6f23a257 100644 --- a/Modules/Filtering/ImageIntensity/test/itkCosImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkCosImageFilterAndAdaptorTest.cxx @@ -28,7 +28,7 @@ itkCosImageFilterAndAdaptorTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the pixel types of the images using PixelType = float; @@ -66,7 +66,7 @@ itkCosImageFilterAndAdaptorTest(int, char *[]) InputIteratorType it(inputImage, inputImage->GetBufferedRegion()); // Initialize the content of Image A - constexpr double value = itk::Math::pi / 6.0; + constexpr double value{ itk::Math::pi / 6.0 }; it.GoToBegin(); while (!it.IsAtEnd()) { @@ -96,7 +96,7 @@ itkCosImageFilterAndAdaptorTest(int, char *[]) OutputIteratorType ot(outputImage, outputImage->GetRequestedRegion()); // Check the content of the result image - constexpr OutputImageType::PixelType epsilon = 1e-6; + constexpr OutputImageType::PixelType epsilon{ 1e-6 }; ot.GoToBegin(); it.GoToBegin(); while (!ot.IsAtEnd()) diff --git a/Modules/Filtering/ImageIntensity/test/itkDiscreteGaussianDerivativeImageFunctionTest.cxx b/Modules/Filtering/ImageIntensity/test/itkDiscreteGaussianDerivativeImageFunctionTest.cxx index dbcc07f66ec..cf8814bba8f 100644 --- a/Modules/Filtering/ImageIntensity/test/itkDiscreteGaussianDerivativeImageFunctionTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkDiscreteGaussianDerivativeImageFunctionTest.cxx @@ -27,7 +27,7 @@ template int itkDiscreteGaussianDerivativeImageFunctionTestND(int argc, char * argv[]) { - constexpr unsigned int Dimension = VDimension; + constexpr unsigned int Dimension{ VDimension }; using PixelType = float; using ImageType = itk::Image; @@ -205,7 +205,7 @@ itkDiscreteGaussianDerivativeImageFunctionTest(int argc, char * argv[]) // Exercise basic object methods // Done outside the helper function in the test because GCC is limited // when calling overloaded base class functions. - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageIntensity/test/itkDiscreteGradientMagnitudeGaussianImageFunctionTest.cxx b/Modules/Filtering/ImageIntensity/test/itkDiscreteGradientMagnitudeGaussianImageFunctionTest.cxx index 70b76ce8fda..b2d0a5331fb 100644 --- a/Modules/Filtering/ImageIntensity/test/itkDiscreteGradientMagnitudeGaussianImageFunctionTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkDiscreteGradientMagnitudeGaussianImageFunctionTest.cxx @@ -27,7 +27,7 @@ template int itkDiscreteGradientMagnitudeGaussianImageFunctionTestND(int argc, char * argv[]) { - constexpr unsigned int Dimension = VDimension; + constexpr unsigned int Dimension{ VDimension }; using PixelType = float; using ImageType = itk::Image; @@ -209,7 +209,7 @@ itkDiscreteGradientMagnitudeGaussianImageFunctionTest(int argc, char * argv[]) // Exercise basic object methods // Done outside the helper function in the test because GCC is limited // when calling overloaded base class functions. - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageIntensity/test/itkDiscreteHessianGaussianImageFunctionTest.cxx b/Modules/Filtering/ImageIntensity/test/itkDiscreteHessianGaussianImageFunctionTest.cxx index 3e5742900db..d5aa2d12227 100644 --- a/Modules/Filtering/ImageIntensity/test/itkDiscreteHessianGaussianImageFunctionTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkDiscreteHessianGaussianImageFunctionTest.cxx @@ -28,7 +28,7 @@ template int itkDiscreteHessianGaussianImageFunctionTestND(int argc, char * argv[]) { - constexpr unsigned int Dimension = VDimension; + constexpr unsigned int Dimension{ VDimension }; using PixelType = float; using ImageType = itk::Image; @@ -272,7 +272,7 @@ itkDiscreteHessianGaussianImageFunctionTest(int argc, char * argv[]) // Exercise basic object methods // Done outside the helper function in the test because GCC is limited // when calling overloaded base class functions. - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = float; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageIntensity/test/itkDivideImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkDivideImageFilterTest.cxx index fb121fb8339..cdd5c1c5617 100644 --- a/Modules/Filtering/ImageIntensity/test/itkDivideImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkDivideImageFilterTest.cxx @@ -27,7 +27,7 @@ itkDivideImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Declare the pixel types of the images using PixelType = float; @@ -67,11 +67,11 @@ itkDivideImageFilterTest(int, char *[]) inputImageB->Allocate(); // Initialize the content of Image A - constexpr InputImageType1::PixelType valueA = 2.0; + constexpr InputImageType1::PixelType valueA{ 2.0 }; inputImageA->FillBuffer(valueA); // Initialize the content of Image B - constexpr InputImageType2::PixelType valueB = 3.0; + constexpr InputImageType2::PixelType valueB{ 3.0 }; inputImageB->FillBuffer(valueB); @@ -102,7 +102,7 @@ itkDivideImageFilterTest(int, char *[]) // Check the content of the result image // constexpr auto expectedValue = static_cast(valueA / valueB); - constexpr OutputImageType::PixelType epsilon = 1e-6; + constexpr OutputImageType::PixelType epsilon{ 1e-6 }; while (!oIt.IsAtEnd()) { if (!itk::Math::FloatAlmostEqual(oIt.Get(), expectedValue, 2, epsilon)) diff --git a/Modules/Filtering/ImageIntensity/test/itkDivideImageFilterTest2.cxx b/Modules/Filtering/ImageIntensity/test/itkDivideImageFilterTest2.cxx index e22b74421a6..cab6d677e81 100644 --- a/Modules/Filtering/ImageIntensity/test/itkDivideImageFilterTest2.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkDivideImageFilterTest2.cxx @@ -27,7 +27,7 @@ itkDivideImageFilterTest2(int, char *[]) { // Define the dimension of the images - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Declare the pixel types of the images using ElementPixelType = float; @@ -70,12 +70,12 @@ itkDivideImageFilterTest2(int, char *[]) // Initialize the content of Image A InputImageType1::PixelType valueA(inputImageA->GetNumberOfComponentsPerPixel()); - constexpr InputImageType1::PixelType::ValueType elementValueA = 2.0; + constexpr InputImageType1::PixelType::ValueType elementValueA{ 2.0 }; valueA.Fill(elementValueA); inputImageA->FillBuffer(valueA); // Initialize the content of Image B - constexpr InputImageType2::PixelType valueB = 3.0; + constexpr InputImageType2::PixelType valueB{ 3.0 }; inputImageB->FillBuffer(valueB); @@ -106,7 +106,7 @@ itkDivideImageFilterTest2(int, char *[]) // Check the content of the result image // constexpr auto expectedValue = static_cast(elementValueA / valueB); - constexpr OutputImageType::PixelType::ValueType epsilon = 1e-6; + constexpr OutputImageType::PixelType::ValueType epsilon{ 1e-6 }; while (!oIt.IsAtEnd()) { for (unsigned int i = 0; i < oIt.GetImageDimension(); ++i) diff --git a/Modules/Filtering/ImageIntensity/test/itkDivideOrZeroOutImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkDivideOrZeroOutImageFilterTest.cxx index 2dc90e37d0a..ded438788d7 100644 --- a/Modules/Filtering/ImageIntensity/test/itkDivideOrZeroOutImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkDivideOrZeroOutImageFilterTest.cxx @@ -24,12 +24,12 @@ int itkDivideOrZeroOutImageFilterTest(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = float; using ImageType = itk::Image; using DivideFilterType = itk::DivideOrZeroOutImageFilter; - constexpr ImageType::SizeType size = { { 10, 12, 14 } }; + constexpr ImageType::SizeType size{ 10, 12, 14 }; auto numeratorImage = ImageType::New(); numeratorImage->SetRegions(size); @@ -42,7 +42,7 @@ itkDivideOrZeroOutImageFilterTest(int, char *[]) // Set input test values denominatorImage->FillBuffer(1.0f); - constexpr ImageType::IndexType zeroIndex = { { 4, 5, 6 } }; + constexpr ImageType::IndexType zeroIndex{ 4, 5, 6 }; denominatorImage->SetPixel(zeroIndex, 0.0f); // Instantiate and run the filter diff --git a/Modules/Filtering/ImageIntensity/test/itkEdgePotentialImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkEdgePotentialImageFilterTest.cxx index 4998bc3e558..e2dc4920bb2 100644 --- a/Modules/Filtering/ImageIntensity/test/itkEdgePotentialImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkEdgePotentialImageFilterTest.cxx @@ -25,7 +25,7 @@ itkEdgePotentialImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the types of the images using VectorType = itk::CovariantVector; @@ -96,7 +96,7 @@ itkEdgePotentialImageFilterTest(int, char *[]) // Check the content of the result image std::cout << "Verification of the output " << std::endl; - constexpr OutputImageType::PixelType epsilon = 1e-6; + constexpr OutputImageType::PixelType epsilon{ 1e-6 }; ot.GoToBegin(); it.GoToBegin(); while (!ot.IsAtEnd()) diff --git a/Modules/Filtering/ImageIntensity/test/itkEqualTest.cxx b/Modules/Filtering/ImageIntensity/test/itkEqualTest.cxx index 6f9c9456999..2ffb2bc9734 100644 --- a/Modules/Filtering/ImageIntensity/test/itkEqualTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkEqualTest.cxx @@ -65,7 +65,7 @@ itkEqualTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; // Declare the types of the images using myImageType1 = itk::Image; diff --git a/Modules/Filtering/ImageIntensity/test/itkExpImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkExpImageFilterAndAdaptorTest.cxx index 7e4a233c8c3..c2bcf6eed2a 100644 --- a/Modules/Filtering/ImageIntensity/test/itkExpImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkExpImageFilterAndAdaptorTest.cxx @@ -26,7 +26,7 @@ itkExpImageFilterAndAdaptorTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the types of the images using InputImageType = itk::Image; @@ -60,7 +60,7 @@ itkExpImageFilterAndAdaptorTest(int, char *[]) InputIteratorType it(inputImage, inputImage->GetBufferedRegion()); // Initialize the content of Image A - constexpr double value = itk::Math::pi / 6.0; + constexpr double value{ itk::Math::pi / 6.0 }; std::cout << "Content of the Input " << std::endl; it.GoToBegin(); while (!it.IsAtEnd()) @@ -94,7 +94,7 @@ itkExpImageFilterAndAdaptorTest(int, char *[]) // Check the content of the result image std::cout << "Verification of the output " << std::endl; - constexpr OutputImageType::PixelType epsilon = 1e-6; + constexpr OutputImageType::PixelType epsilon{ 1e-6 }; ot.GoToBegin(); it.GoToBegin(); while (!ot.IsAtEnd()) diff --git a/Modules/Filtering/ImageIntensity/test/itkExpNegativeImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkExpNegativeImageFilterAndAdaptorTest.cxx index 074131cd0f9..d40e169285c 100644 --- a/Modules/Filtering/ImageIntensity/test/itkExpNegativeImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkExpNegativeImageFilterAndAdaptorTest.cxx @@ -26,7 +26,7 @@ itkExpNegativeImageFilterAndAdaptorTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the types of the images using InputImageType = itk::Image; @@ -60,7 +60,7 @@ itkExpNegativeImageFilterAndAdaptorTest(int, char *[]) InputIteratorType it(inputImage, inputImage->GetBufferedRegion()); // Initialize the content of Image A - constexpr double value = itk::Math::pi / 6.0; + constexpr double value{ itk::Math::pi / 6.0 }; std::cout << "Content of the Input " << std::endl; it.GoToBegin(); while (!it.IsAtEnd()) @@ -94,7 +94,7 @@ itkExpNegativeImageFilterAndAdaptorTest(int, char *[]) // Check the content of the result image std::cout << "Verification of the output " << std::endl; - constexpr OutputImageType::PixelType epsilon = 1e-6; + constexpr OutputImageType::PixelType epsilon{ 1e-6 }; ot.GoToBegin(); it.GoToBegin(); while (!ot.IsAtEnd()) diff --git a/Modules/Filtering/ImageIntensity/test/itkGreaterEqualTest.cxx b/Modules/Filtering/ImageIntensity/test/itkGreaterEqualTest.cxx index 361276ffab6..6036144a2dd 100644 --- a/Modules/Filtering/ImageIntensity/test/itkGreaterEqualTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkGreaterEqualTest.cxx @@ -25,7 +25,7 @@ itkGreaterEqualTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; // Declare the types of the images using myImageType1 = itk::Image; diff --git a/Modules/Filtering/ImageIntensity/test/itkGreaterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkGreaterTest.cxx index 448626530ed..158ad32d1ff 100644 --- a/Modules/Filtering/ImageIntensity/test/itkGreaterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkGreaterTest.cxx @@ -25,7 +25,7 @@ itkGreaterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; // Declare the types of the images using myImageType1 = itk::Image; diff --git a/Modules/Filtering/ImageIntensity/test/itkHistogramMatchingImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkHistogramMatchingImageFilterTest.cxx index 7dc21ab66b2..e57254c1f30 100644 --- a/Modules/Filtering/ImageIntensity/test/itkHistogramMatchingImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkHistogramMatchingImageFilterTest.cxx @@ -132,7 +132,7 @@ PrintHistogramInfo(HistogramConstPointerType refHistogram) const auto & allReferenceMinsFirstDimension = allReferenceMinsByDimension.at(0); // Mins for dimension 0 const auto & allReferenceMaxsByDimension = refHistogram->GetMaxs(); // Array of dimensions const auto & allReferenceMaxsFirstDimension = allReferenceMaxsByDimension.at(0); // Maxes for dimension 0 - constexpr int colWidth = 8; + constexpr int colWidth{ 8 }; const std::ios_base::fmtflags initial_cout_state{ std::cout.flags() }; std::cout << std::left << std::setw(colWidth) << "INDEX" << std::left << std::setw(colWidth) << "FREQ" << std::left << std::setw(colWidth) << "MIN" << std::left << std::setw(colWidth) << "MAX" << std::left @@ -156,7 +156,7 @@ int itkHistogramMatchingImageFilterTest() { using PixelType = TScalar; - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using ImageType = itk::Image; using Iterator = itk::ImageRegionIterator; @@ -215,7 +215,7 @@ itkHistogramMatchingImageFilterTest() ITK_EXERCISE_BASIC_OBJECT_METHODS(filterWithReferenceImage, HistogramMatchingImageFilter, ImageToImageFilter); - constexpr bool generateReferenceHistogramFromImage = true; + constexpr bool generateReferenceHistogramFromImage{ true }; ITK_TEST_SET_GET_BOOLEAN( filterWithReferenceImage, GenerateReferenceHistogramFromImage, generateReferenceHistogramFromImage); @@ -225,11 +225,11 @@ itkHistogramMatchingImageFilterTest() filterWithReferenceImage->SetSourceImage(source); ITK_TEST_SET_GET_VALUE(source, filterWithReferenceImage->GetSourceImage()); - constexpr itk::SizeValueType numberOfHistogramLevels = 50; + constexpr itk::SizeValueType numberOfHistogramLevels{ 50 }; filterWithReferenceImage->SetNumberOfHistogramLevels(numberOfHistogramLevels); ITK_TEST_SET_GET_VALUE(numberOfHistogramLevels, filterWithReferenceImage->GetNumberOfHistogramLevels()); - constexpr itk::SizeValueType numberOfMatchPoints = 8; + constexpr itk::SizeValueType numberOfMatchPoints{ 8 }; filterWithReferenceImage->SetNumberOfMatchPoints(numberOfMatchPoints); ITK_TEST_SET_GET_VALUE(numberOfMatchPoints, filterWithReferenceImage->GetNumberOfMatchPoints()); @@ -241,7 +241,7 @@ itkHistogramMatchingImageFilterTest() { // Exercise and test with ThresholdAtMeanIntensityOff - constexpr bool thresholdAtMeanIntensity = false; + constexpr bool thresholdAtMeanIntensity{ false }; ITK_TEST_SET_GET_BOOLEAN(filterWithReferenceImage, ThresholdAtMeanIntensity, thresholdAtMeanIntensity); filterWithReferenceImage->Update(); @@ -255,7 +255,7 @@ itkHistogramMatchingImageFilterTest() } { // Exercise and test with ThresholdAtMeanIntensityOn - constexpr bool thresholdAtMeanIntensity = true; + constexpr bool thresholdAtMeanIntensity{ true }; ITK_TEST_SET_GET_BOOLEAN(filterWithReferenceImage, ThresholdAtMeanIntensity, thresholdAtMeanIntensity); filterWithReferenceImage->Update(); diff --git a/Modules/Filtering/ImageIntensity/test/itkImageAdaptorNthElementTest.cxx b/Modules/Filtering/ImageIntensity/test/itkImageAdaptorNthElementTest.cxx index 20966384f86..43323d019eb 100644 --- a/Modules/Filtering/ImageIntensity/test/itkImageAdaptorNthElementTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkImageAdaptorNthElementTest.cxx @@ -146,7 +146,7 @@ itkImageAdaptorNthElementTest(int, char *[]) myFloatIteratorType itf(myFloatImage, myFloatImage->GetRequestedRegion()); - constexpr myFloatPixelType initialFloatValue = 5.0; + constexpr myFloatPixelType initialFloatValue{ 5.0 }; while (!itf.IsAtEnd()) { diff --git a/Modules/Filtering/ImageIntensity/test/itkIntensityWindowingImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkIntensityWindowingImageFilterTest.cxx index 2db4c66f0f4..e31314cb4ba 100644 --- a/Modules/Filtering/ImageIntensity/test/itkIntensityWindowingImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkIntensityWindowingImageFilterTest.cxx @@ -27,7 +27,7 @@ int itkIntensityWindowingImageFilterTest(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = float; using TestInputImage = itk::Image; @@ -51,19 +51,19 @@ itkIntensityWindowingImageFilterTest(int, char *[]) // Set up source source->SetSize(randomSize); - constexpr double minValue = -128.0; - constexpr double maxValue = 127.0; + constexpr double minValue{ -128.0 }; + constexpr double maxValue{ 127.0 }; source->SetMin(static_cast(minValue)); source->SetMax(static_cast(maxValue)); filter->SetInput(source->GetOutput()); - constexpr double desiredMinimum = -1.0; - constexpr double desiredMaximum = 1.0; + constexpr double desiredMinimum{ -1.0 }; + constexpr double desiredMaximum{ 1.0 }; - constexpr float windowMinimum = -50.0f; - constexpr float windowMaximum = 50.0f; + constexpr float windowMinimum{ -50.0f }; + constexpr float windowMaximum{ 50.0f }; filter->SetOutputMinimum(desiredMinimum); ITK_TEST_SET_GET_VALUE(desiredMinimum, filter->GetOutputMinimum()); @@ -97,7 +97,7 @@ itkIntensityWindowingImageFilterTest(int, char *[]) calculator->Compute(); - constexpr double tolerance = 1e-7; + constexpr double tolerance{ 1e-7 }; const double obtainedMinimum = calculator->GetMinimum(); const double obtainedMaximum = calculator->GetMaximum(); @@ -120,8 +120,8 @@ itkIntensityWindowingImageFilterTest(int, char *[]) return EXIT_FAILURE; } - constexpr float window = 50.0f; - constexpr float level = 50.0f; + constexpr float window{ 50.0f }; + constexpr float level{ 50.0f }; filter->SetWindowLevel(window, level); diff --git a/Modules/Filtering/ImageIntensity/test/itkInvertIntensityImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkInvertIntensityImageFilterTest.cxx index b7ca94606cc..b9be8e7abe8 100644 --- a/Modules/Filtering/ImageIntensity/test/itkInvertIntensityImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkInvertIntensityImageFilterTest.cxx @@ -35,7 +35,7 @@ itkInvertIntensityImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; @@ -51,7 +51,7 @@ itkInvertIntensityImageFilterTest(int argc, char * argv[]) const itk::SimpleFilterWatcher watcher(filter); - constexpr FilterType::InputPixelType maximum = itk::NumericTraits::max(); + constexpr FilterType::InputPixelType maximum{ itk::NumericTraits::max() }; filter->SetMaximum(maximum); ITK_TEST_SET_GET_VALUE(maximum, filter->GetMaximum()); diff --git a/Modules/Filtering/ImageIntensity/test/itkLessEqualTest.cxx b/Modules/Filtering/ImageIntensity/test/itkLessEqualTest.cxx index 8c29a6a8162..362c4d1bc5e 100644 --- a/Modules/Filtering/ImageIntensity/test/itkLessEqualTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkLessEqualTest.cxx @@ -25,7 +25,7 @@ itkLessEqualTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; // Declare the types of the images using myImageType1 = itk::Image; diff --git a/Modules/Filtering/ImageIntensity/test/itkLessTest.cxx b/Modules/Filtering/ImageIntensity/test/itkLessTest.cxx index 3eea9a5e8d7..bfe3f1d6ce9 100644 --- a/Modules/Filtering/ImageIntensity/test/itkLessTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkLessTest.cxx @@ -25,7 +25,7 @@ itkLessTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; // Declare the types of the images using myImageType1 = itk::Image; diff --git a/Modules/Filtering/ImageIntensity/test/itkLog10ImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkLog10ImageFilterAndAdaptorTest.cxx index 6beef2bdb22..42baf22f8d9 100644 --- a/Modules/Filtering/ImageIntensity/test/itkLog10ImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkLog10ImageFilterAndAdaptorTest.cxx @@ -26,7 +26,7 @@ int itkLog10ImageFilterAndAdaptorTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the pixel types of the images using PixelType = float; @@ -64,7 +64,7 @@ itkLog10ImageFilterAndAdaptorTest(int, char *[]) InputIteratorType it(inputImage, inputImage->GetBufferedRegion()); // Initialize the content of Image A - constexpr double value = itk::Math::pi / 6.0; + constexpr double value{ itk::Math::pi / 6.0 }; it.GoToBegin(); while (!it.IsAtEnd()) { @@ -94,7 +94,7 @@ itkLog10ImageFilterAndAdaptorTest(int, char *[]) OutputIteratorType ot(outputImage, outputImage->GetRequestedRegion()); // Check the content of the result image - constexpr OutputImageType::PixelType epsilon = 1e-6; + constexpr OutputImageType::PixelType epsilon{ 1e-6 }; ot.GoToBegin(); it.GoToBegin(); while (!ot.IsAtEnd()) diff --git a/Modules/Filtering/ImageIntensity/test/itkLogImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkLogImageFilterAndAdaptorTest.cxx index 1cc503782a2..95732d906b4 100644 --- a/Modules/Filtering/ImageIntensity/test/itkLogImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkLogImageFilterAndAdaptorTest.cxx @@ -27,7 +27,7 @@ int itkLogImageFilterAndAdaptorTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the pixel types of the images using PixelType = float; @@ -65,7 +65,7 @@ itkLogImageFilterAndAdaptorTest(int, char *[]) InputIteratorType it(inputImage, inputImage->GetBufferedRegion()); // Initialize the content of Image A - constexpr double value = itk::Math::pi / 6.0; + constexpr double value{ itk::Math::pi / 6.0 }; it.GoToBegin(); while (!it.IsAtEnd()) { @@ -95,7 +95,7 @@ itkLogImageFilterAndAdaptorTest(int, char *[]) OutputIteratorType ot(outputImage, outputImage->GetRequestedRegion()); // Check the content of the result image - constexpr OutputImageType::PixelType epsilon = 1e-6; + constexpr OutputImageType::PixelType epsilon{ 1e-6 }; ot.GoToBegin(); it.GoToBegin(); while (!ot.IsAtEnd()) diff --git a/Modules/Filtering/ImageIntensity/test/itkMagnitudeAndPhaseToComplexImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkMagnitudeAndPhaseToComplexImageFilterTest.cxx index f69d9e1bef0..b6285708ac4 100644 --- a/Modules/Filtering/ImageIntensity/test/itkMagnitudeAndPhaseToComplexImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkMagnitudeAndPhaseToComplexImageFilterTest.cxx @@ -48,7 +48,7 @@ itkMagnitudeAndPhaseToComplexImageFilterTest(int argc, char * argv[]) const char * phaseImageFileName = argv[2]; const char * complexImageFileName = argv[3]; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = float; using OutputPixelType = std::complex; diff --git a/Modules/Filtering/ImageIntensity/test/itkMaskImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkMaskImageFilterTest.cxx index cb62bcd0eaf..3dd0e36a4c7 100644 --- a/Modules/Filtering/ImageIntensity/test/itkMaskImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkMaskImageFilterTest.cxx @@ -26,7 +26,7 @@ itkMaskImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; // Declare the types of the images using myImageType1 = itk::Image; diff --git a/Modules/Filtering/ImageIntensity/test/itkMaskNegatedImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkMaskNegatedImageFilterTest.cxx index 4b0e317ac9d..1654d29c552 100644 --- a/Modules/Filtering/ImageIntensity/test/itkMaskNegatedImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkMaskNegatedImageFilterTest.cxx @@ -28,7 +28,7 @@ itkMaskNegatedImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; // Declare the types of the images using InputImageType = itk::Image; diff --git a/Modules/Filtering/ImageIntensity/test/itkMatrixIndexSelectionImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkMatrixIndexSelectionImageFilterTest.cxx index f6cfa30abeb..b058a122393 100644 --- a/Modules/Filtering/ImageIntensity/test/itkMatrixIndexSelectionImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkMatrixIndexSelectionImageFilterTest.cxx @@ -33,7 +33,7 @@ itkMatrixIndexSelectionImageFilterTest(int argc, char * argv[]) } // Define the dimension of the images - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; // Declare the pixel types of the images using PixelType = itk::Matrix; @@ -109,8 +109,8 @@ itkMatrixIndexSelectionImageFilterTest(int argc, char * argv[]) filter->SetInput(image); - constexpr unsigned int indexA = 0; - constexpr unsigned int indexB = 1; + constexpr unsigned int indexA{ 0 }; + constexpr unsigned int indexB{ 1 }; filter->SetIndices(indexA, indexB); unsigned int testIndexA = 0; diff --git a/Modules/Filtering/ImageIntensity/test/itkMaximumImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkMaximumImageFilterTest.cxx index e2f6cb97dc2..78d57360a6b 100644 --- a/Modules/Filtering/ImageIntensity/test/itkMaximumImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkMaximumImageFilterTest.cxx @@ -26,7 +26,7 @@ itkMaximumImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = unsigned char; @@ -63,8 +63,8 @@ itkMaximumImageFilterTest(int, char *[]) inputImageB->Allocate(); // Define the pixel values for each image - constexpr PixelType largePixelValue = 3; - constexpr PixelType smallPixelValue = 2; + constexpr PixelType largePixelValue{ 3 }; + constexpr PixelType smallPixelValue{ 2 }; // Declare Iterator types appropriate for each image using IteratorType = itk::ImageRegionIteratorWithIndex; @@ -109,7 +109,7 @@ itkMaximumImageFilterTest(int, char *[]) // Note that we are not comparing the entirety of the filter output in order // to keep compile time as small as possible - constexpr ImageType::IndexType pixelIndex = { { 0, 1, 1 } }; + constexpr ImageType::IndexType pixelIndex{ 0, 1, 1 }; ITK_TEST_EXPECT_EQUAL(outputImage->GetPixel(start), largePixelValue); ITK_TEST_EXPECT_EQUAL(outputImage->GetPixel(pixelIndex), largePixelValue); diff --git a/Modules/Filtering/ImageIntensity/test/itkMinimumImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkMinimumImageFilterTest.cxx index 3d5e1c8bf8f..8a22fc068de 100644 --- a/Modules/Filtering/ImageIntensity/test/itkMinimumImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkMinimumImageFilterTest.cxx @@ -26,7 +26,7 @@ itkMinimumImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = unsigned char; @@ -63,8 +63,8 @@ itkMinimumImageFilterTest(int, char *[]) inputImageB->Allocate(); // Define the pixel values for each image - constexpr PixelType largePixelValue = 3; - constexpr PixelType smallPixelValue = 2; + constexpr PixelType largePixelValue{ 3 }; + constexpr PixelType smallPixelValue{ 2 }; // Declare Iterator types appropriate for each image using IteratorType = itk::ImageRegionIteratorWithIndex; @@ -109,7 +109,7 @@ itkMinimumImageFilterTest(int, char *[]) // Note that we are not comparing the entirety of the filter output in order // to keep compile time as small as possible - constexpr ImageType::IndexType pixelIndex = { { 0, 1, 1 } }; + constexpr ImageType::IndexType pixelIndex{ 0, 1, 1 }; ITK_TEST_EXPECT_EQUAL(outputImage->GetPixel(start), smallPixelValue); ITK_TEST_EXPECT_EQUAL(outputImage->GetPixel(pixelIndex), smallPixelValue); diff --git a/Modules/Filtering/ImageIntensity/test/itkModulusImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkModulusImageFilterTest.cxx index efc792f9a33..d136b56df26 100644 --- a/Modules/Filtering/ImageIntensity/test/itkModulusImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkModulusImageFilterTest.cxx @@ -35,7 +35,7 @@ itkModulusImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; @@ -57,7 +57,7 @@ itkModulusImageFilterTest(int argc, char * argv[]) filter->SetInput(distance->GetOutput()); - constexpr FilterType::InputPixelType dividend = 8; + constexpr FilterType::InputPixelType dividend{ 8 }; filter->SetDividend(dividend); ITK_TEST_SET_GET_VALUE(dividend, filter->GetDividend()); diff --git a/Modules/Filtering/ImageIntensity/test/itkMultiplyImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkMultiplyImageFilterTest.cxx index 054d2d84ba1..d1bd1922b4f 100644 --- a/Modules/Filtering/ImageIntensity/test/itkMultiplyImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkMultiplyImageFilterTest.cxx @@ -27,7 +27,7 @@ itkMultiplyImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Declare the pixel types of the images using PixelType = float; @@ -67,11 +67,11 @@ itkMultiplyImageFilterTest(int, char *[]) inputImageB->Allocate(); // Initialize the content of Image A - constexpr InputImageType1::PixelType valueA = 2.0; + constexpr InputImageType1::PixelType valueA{ 2.0 }; inputImageA->FillBuffer(valueA); // Initialize the content of Image B - constexpr InputImageType2::PixelType valueB = 3.0; + constexpr InputImageType2::PixelType valueB{ 3.0 }; inputImageB->FillBuffer(valueB); @@ -102,7 +102,7 @@ itkMultiplyImageFilterTest(int, char *[]) // Check the content of the result image // constexpr auto expectedValue = static_cast(valueA * valueB); - constexpr OutputImageType::PixelType epsilon = 1e-6; + constexpr OutputImageType::PixelType epsilon{ 1e-6 }; while (!oIt.IsAtEnd()) { if (!itk::Math::FloatAlmostEqual(oIt.Get(), expectedValue, 10, epsilon)) diff --git a/Modules/Filtering/ImageIntensity/test/itkNaryAddImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkNaryAddImageFilterTest.cxx index 137754d4ab6..9c9abc68234 100644 --- a/Modules/Filtering/ImageIntensity/test/itkNaryAddImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkNaryAddImageFilterTest.cxx @@ -51,7 +51,7 @@ itkNaryAddImageFilterTest(int, char *[]) bool testStatus = true; // Define the dimension of the images - constexpr unsigned int Dimension3D = 3; + constexpr unsigned int Dimension3D{ 3 }; // Declare the pixel types of the images using PixelType = float; @@ -66,11 +66,11 @@ itkNaryAddImageFilterTest(int, char *[]) auto inputImageC = InputImageType::New(); - constexpr InputImageType::PixelType valueA = 12; + constexpr InputImageType::PixelType valueA{ 12 }; InitializeImage(inputImageA, valueA); - constexpr InputImageType::PixelType valueB = 17; + constexpr InputImageType::PixelType valueB{ 17 }; InitializeImage(inputImageB, valueB); - constexpr InputImageType::PixelType valueC = -4; + constexpr InputImageType::PixelType valueC{ -4 }; InitializeImage(inputImageC, valueC); @@ -105,7 +105,7 @@ itkNaryAddImageFilterTest(int, char *[]) InputImageIteratorType iterC(inputImageC, inputImageA->GetRequestedRegion()); OutputImageIteratorType oIt(outputImage, inputImageA->GetRequestedRegion()); - constexpr OutputImageType::PixelType epsilon = 1e-9; + constexpr OutputImageType::PixelType epsilon{ 1e-9 }; unsigned int failures = 0; while (!oIt.IsAtEnd()) { @@ -161,7 +161,7 @@ itkNaryAddImageFilterTest(int, char *[]) // // Define the dimension of the images - constexpr unsigned int Dimension2D = 2; + constexpr unsigned int Dimension2D{ 2 }; // Declare the pixel types of the images using ElementPixelType = int; @@ -173,15 +173,15 @@ itkNaryAddImageFilterTest(int, char *[]) auto vectorImageB = VectorImageType::New(); auto vectorImageC = VectorImageType::New(); - constexpr VectorImageType::PixelType::ValueType vectorValueA = 12; + constexpr VectorImageType::PixelType::ValueType vectorValueA{ 12 }; auto vectorImageValueA = itk::MakeFilled(vectorValueA); vectorImageValueA[0] = 5; - constexpr VectorImageType::PixelType::ValueType vectorValueB = 17; + constexpr VectorImageType::PixelType::ValueType vectorValueB{ 17 }; auto vectorImageValueB = itk::MakeFilled(vectorValueB); vectorImageValueB[0] = 9; - constexpr VectorImageType::PixelType::ValueType vectorValueC = -4; + constexpr VectorImageType::PixelType::ValueType vectorValueC{ -4 }; auto vectorImageValueC = itk::MakeFilled(vectorValueC); vectorImageValueC[0] = -80; diff --git a/Modules/Filtering/ImageIntensity/test/itkNaryMaximumImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkNaryMaximumImageFilterTest.cxx index 4a1ce3133c9..92bcacf9b5c 100644 --- a/Modules/Filtering/ImageIntensity/test/itkNaryMaximumImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkNaryMaximumImageFilterTest.cxx @@ -27,7 +27,7 @@ namespace NaryMaximumImageFilterTest { // Define the dimension of the images -constexpr unsigned int Dimension = 3; +constexpr unsigned int Dimension{ 3 }; // Declare the pixel types of the images using PixelType = float; diff --git a/Modules/Filtering/ImageIntensity/test/itkNormalizeImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkNormalizeImageFilterTest.cxx index d08e144cbd6..f6bbaeebd40 100644 --- a/Modules/Filtering/ImageIntensity/test/itkNormalizeImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkNormalizeImageFilterTest.cxx @@ -37,8 +37,8 @@ itkNormalizeImageFilterTest(int, char *[]) ShortImage::SizeValueType randomSize[3] = { 18, 17, 67 }; source->SetSize(randomSize); - constexpr float minValue = -1000.0; - constexpr float maxValue = 1000.0; + constexpr float minValue{ -1000.0 }; + constexpr float maxValue{ 1000.0 }; source->SetMin(static_cast(minValue)); source->SetMax(static_cast(maxValue)); diff --git a/Modules/Filtering/ImageIntensity/test/itkNormalizeToConstantImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkNormalizeToConstantImageFilterTest.cxx index 639d6f02fcc..8df0bb1e005 100644 --- a/Modules/Filtering/ImageIntensity/test/itkNormalizeToConstantImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkNormalizeToConstantImageFilterTest.cxx @@ -27,7 +27,7 @@ int itkNormalizeToConstantImageFilterTest(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using IntPixelType = int; using DoublePixelType = double; @@ -42,8 +42,8 @@ itkNormalizeToConstantImageFilterTest(int, char *[]) source->SetSize(randomSize); - constexpr IntImage::PixelType minValue = 0; - constexpr IntImage::PixelType maxValue = 1000; + constexpr IntImage::PixelType minValue{ 0 }; + constexpr IntImage::PixelType maxValue{ 1000 }; source->SetMin(minValue); source->SetMax(maxValue); diff --git a/Modules/Filtering/ImageIntensity/test/itkNotEqualTest.cxx b/Modules/Filtering/ImageIntensity/test/itkNotEqualTest.cxx index 30bdd594b38..fe42109a4f9 100644 --- a/Modules/Filtering/ImageIntensity/test/itkNotEqualTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkNotEqualTest.cxx @@ -25,7 +25,7 @@ itkNotEqualTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; // Declare the types of the images using myImageType1 = itk::Image; diff --git a/Modules/Filtering/ImageIntensity/test/itkNotImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkNotImageFilterTest.cxx index 97509872add..47405f1dec0 100644 --- a/Modules/Filtering/ImageIntensity/test/itkNotImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkNotImageFilterTest.cxx @@ -25,7 +25,7 @@ itkNotImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Declare the types of the images using PixelType = unsigned char; diff --git a/Modules/Filtering/ImageIntensity/test/itkNthElementPixelAccessorTest2.cxx b/Modules/Filtering/ImageIntensity/test/itkNthElementPixelAccessorTest2.cxx index c9bc57cc5e8..b1670663bfb 100644 --- a/Modules/Filtering/ImageIntensity/test/itkNthElementPixelAccessorTest2.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkNthElementPixelAccessorTest2.cxx @@ -48,8 +48,8 @@ itkNthElementPixelAccessorTest2(int, char *[]) { // Typedefs for convenience - constexpr unsigned int Dimension = 2; - constexpr unsigned int VectorLength = 3; + constexpr unsigned int Dimension{ 2 }; + constexpr unsigned int VectorLength{ 3 }; using PrecisionType = float; diff --git a/Modules/Filtering/ImageIntensity/test/itkOrImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkOrImageFilterTest.cxx index 3f21909bdbc..128f9829df7 100644 --- a/Modules/Filtering/ImageIntensity/test/itkOrImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkOrImageFilterTest.cxx @@ -32,7 +32,7 @@ itkOrImageFilterTest(int argc, char * argv[]) } // Define the dimension of the images - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Declare the pixel types of the images using PixelType = unsigned char; @@ -80,7 +80,7 @@ itkOrImageFilterTest(int argc, char * argv[]) it1.GoToBegin(); // Initialize the content of Image A - constexpr InputImage1Type::PixelType valueA = 2; + constexpr InputImage1Type::PixelType valueA{ 2 }; while (!it1.IsAtEnd()) { it1.Set(valueA); @@ -92,7 +92,7 @@ itkOrImageFilterTest(int argc, char * argv[]) it2.GoToBegin(); // Initialize the content of Image B - constexpr InputImage2Type::PixelType valueB = 3; + constexpr InputImage2Type::PixelType valueB{ 3 }; while (!it2.IsAtEnd()) { it2.Set(valueB); diff --git a/Modules/Filtering/ImageIntensity/test/itkPolylineMask2DImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkPolylineMask2DImageFilterTest.cxx index 5d1573c91cb..65cc5e9cf11 100644 --- a/Modules/Filtering/ImageIntensity/test/itkPolylineMask2DImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkPolylineMask2DImageFilterTest.cxx @@ -35,7 +35,7 @@ itkPolylineMask2DImageFilterTest(int argc, char * argv[]) } // Declare the types of the images - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using InputImageType = itk::Image; diff --git a/Modules/Filtering/ImageIntensity/test/itkPolylineMaskImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkPolylineMaskImageFilterTest.cxx index 298bc3dae1b..f20c91acbd1 100644 --- a/Modules/Filtering/ImageIntensity/test/itkPolylineMaskImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkPolylineMaskImageFilterTest.cxx @@ -38,10 +38,10 @@ itkPolylineMaskImageFilterTest(int argc, char * argv[]) } // Define the dimension of the images - constexpr unsigned int iDimension = 3; + constexpr unsigned int iDimension{ 3 }; // Define the dimension of the polyline - constexpr unsigned int pDimension = 2; + constexpr unsigned int pDimension{ 2 }; // Declare the types of the images using inputImageType = itk::Image; @@ -169,7 +169,7 @@ itkPolylineMaskImageFilterTest(int argc, char * argv[]) ITK_TEST_SET_GET_VALUE(cameraCenterPoint, polylineMaskFilter->GetCameraCenterPoint()); // Set the camera focal distance - constexpr double focalDistance = 30.0; + constexpr double focalDistance{ 30.0 }; polylineMaskFilter->SetFocalDistance(focalDistance); ITK_TEST_SET_GET_VALUE(focalDistance, polylineMaskFilter->GetFocalDistance()); diff --git a/Modules/Filtering/ImageIntensity/test/itkPromoteDimensionImageTest.cxx b/Modules/Filtering/ImageIntensity/test/itkPromoteDimensionImageTest.cxx index 8c10969aad0..05981f0c0b8 100644 --- a/Modules/Filtering/ImageIntensity/test/itkPromoteDimensionImageTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkPromoteDimensionImageTest.cxx @@ -38,8 +38,8 @@ itkPromoteDimensionImageTest(int argc, char * argv[]) using CharPixelType = unsigned char; // IO using RealPixelType = double; // Operations - constexpr unsigned int InDimension = 2; - constexpr unsigned int OutDimension = 3; + constexpr unsigned int InDimension{ 2 }; + constexpr unsigned int OutDimension{ 3 }; using InCharImageType = itk::Image; using OutCharImageType = itk::Image; diff --git a/Modules/Filtering/ImageIntensity/test/itkRGBToLuminanceImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkRGBToLuminanceImageFilterAndAdaptorTest.cxx index 91d3e9fbf10..19ad8fb5eb2 100644 --- a/Modules/Filtering/ImageIntensity/test/itkRGBToLuminanceImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkRGBToLuminanceImageFilterAndAdaptorTest.cxx @@ -29,7 +29,7 @@ itkRGBToLuminanceImageFilterAndAdaptorTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the pixel types of the images using InputPixelType = itk::RGBPixel; @@ -103,7 +103,7 @@ itkRGBToLuminanceImageFilterAndAdaptorTest(int, char *[]) OutputIteratorType ot(outputImage, outputImage->GetRequestedRegion()); // Check the content of the result image - constexpr OutputImageType::PixelType epsilon = 1e-6; + constexpr OutputImageType::PixelType epsilon{ 1e-6 }; ot.GoToBegin(); it.GoToBegin(); diff --git a/Modules/Filtering/ImageIntensity/test/itkRescaleIntensityImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkRescaleIntensityImageFilterTest.cxx index 1b81ddc47b7..2924bf8dd03 100644 --- a/Modules/Filtering/ImageIntensity/test/itkRescaleIntensityImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkRescaleIntensityImageFilterTest.cxx @@ -29,7 +29,7 @@ itkRescaleIntensityImageFilterTest(int, char *[]) std::cout << "itkRescaleIntensityImageFilterTest Start" << std::endl; // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the pixel types of the images using PixelType = float; @@ -58,8 +58,8 @@ itkRescaleIntensityImageFilterTest(int, char *[]) // Set up source source->SetSize(randomSize); - constexpr double minValue = -128.0; - constexpr double maxValue = 127.0; + constexpr double minValue{ -128.0 }; + constexpr double maxValue{ 127.0 }; source->SetMin(static_cast(minValue)); source->SetMax(static_cast(maxValue)); @@ -67,8 +67,8 @@ itkRescaleIntensityImageFilterTest(int, char *[]) filter->SetFunctor(filter->GetFunctor()); filter->SetInput(source->GetOutput()); - constexpr double desiredMinimum = -1.0; - constexpr double desiredMaximum = 1.0; + constexpr double desiredMinimum{ -1.0 }; + constexpr double desiredMaximum{ 1.0 }; filter->SetOutputMinimum(desiredMinimum); ITK_TEST_SET_GET_VALUE(desiredMinimum, filter->GetOutputMinimum()); @@ -85,7 +85,7 @@ itkRescaleIntensityImageFilterTest(int, char *[]) calculator->Compute(); - constexpr double tolerance = 1e-7; + constexpr double tolerance{ 1e-7 }; const double obtainedMinimum = calculator->GetMinimum(); const double obtainedMaximum = calculator->GetMaximum(); diff --git a/Modules/Filtering/ImageIntensity/test/itkRoundImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkRoundImageFilterTest.cxx index 810908cc3be..633cd2da20c 100644 --- a/Modules/Filtering/ImageIntensity/test/itkRoundImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkRoundImageFilterTest.cxx @@ -27,7 +27,7 @@ int itkRoundImageFilterTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = float; using OutputPixelType = int; @@ -46,7 +46,7 @@ itkRoundImageFilterTest(int, char *[]) // Create a random image auto randomImageSource = ImageSourceType::New(); - constexpr InputImageType::SizeType size{ { 10, 10 } }; + constexpr InputImageType::SizeType size{ 10, 10 }; randomImageSource->SetSize(size); randomImageSource->SetMin(0.0); diff --git a/Modules/Filtering/ImageIntensity/test/itkShiftScaleImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkShiftScaleImageFilterTest.cxx index 170c4e4c36a..bfe573d84bb 100644 --- a/Modules/Filtering/ImageIntensity/test/itkShiftScaleImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkShiftScaleImageFilterTest.cxx @@ -39,7 +39,7 @@ itkShiftScaleImageFilterTest(int, char *[]) TestInputImage::RegionType region = { index, size }; // first try a constant image - constexpr double fillValue = -100.0; + constexpr double fillValue{ -100.0 }; inputImage->SetRegions(region); inputImage->Allocate(); inputImage->FillBuffer(static_cast(fillValue)); @@ -65,8 +65,8 @@ itkShiftScaleImageFilterTest(int, char *[]) // Set up source source->SetSize(randomSize); - constexpr double minValue = -128.0; - constexpr double maxValue = 127.0; + constexpr double minValue{ -128.0 }; + constexpr double maxValue{ 127.0 }; source->SetMin(static_cast(minValue)); source->SetMax(static_cast(maxValue)); diff --git a/Modules/Filtering/ImageIntensity/test/itkSigmoidImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkSigmoidImageFilterTest.cxx index 190274f0802..9420cc1a4cd 100644 --- a/Modules/Filtering/ImageIntensity/test/itkSigmoidImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkSigmoidImageFilterTest.cxx @@ -26,7 +26,7 @@ itkSigmoidImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the types of the images using InputPixelType = float; @@ -64,7 +64,7 @@ itkSigmoidImageFilterTest(int, char *[]) InputIteratorType it(inputImage, inputImage->GetBufferedRegion()); // Initialize the content of the input image - constexpr double value = 30; + constexpr double value{ 30 }; it.GoToBegin(); while (!it.IsAtEnd()) { @@ -84,8 +84,8 @@ itkSigmoidImageFilterTest(int, char *[]) filter->SetInput(inputImage); // Set the filter parameters - constexpr double alpha = 2.0; - constexpr double beta = 3.0; + constexpr double alpha{ 2.0 }; + constexpr double beta{ 3.0 }; filter->SetAlpha(alpha); ITK_TEST_SET_GET_VALUE(alpha, filter->GetAlpha()); @@ -93,8 +93,8 @@ itkSigmoidImageFilterTest(int, char *[]) filter->SetBeta(beta); ITK_TEST_SET_GET_VALUE(beta, filter->GetBeta()); - constexpr OutputPixelType maximum = 1.0; - constexpr OutputPixelType minimum = -1.0; + constexpr OutputPixelType maximum{ 1.0 }; + constexpr OutputPixelType minimum{ -1.0 }; filter->SetOutputMinimum(minimum); ITK_TEST_SET_GET_VALUE(minimum, filter->GetOutputMinimum()); @@ -114,7 +114,7 @@ itkSigmoidImageFilterTest(int, char *[]) OutputIteratorType ot(outputImage, outputImage->GetRequestedRegion()); // Check the content of the result image - constexpr OutputImageType::PixelType epsilon = 1e-6; + constexpr OutputImageType::PixelType epsilon{ 1e-6 }; ot.GoToBegin(); it.GoToBegin(); while (!ot.IsAtEnd()) diff --git a/Modules/Filtering/ImageIntensity/test/itkSinImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkSinImageFilterAndAdaptorTest.cxx index b49b6bb93bf..f39a70bca18 100644 --- a/Modules/Filtering/ImageIntensity/test/itkSinImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkSinImageFilterAndAdaptorTest.cxx @@ -28,7 +28,7 @@ itkSinImageFilterAndAdaptorTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the pixel types of the images using PixelType = float; @@ -66,7 +66,7 @@ itkSinImageFilterAndAdaptorTest(int, char *[]) InputIteratorType it(inputImage, inputImage->GetBufferedRegion()); // Initialize the content of Image A - constexpr double value = itk::Math::pi / 6.0; + constexpr double value{ itk::Math::pi / 6.0 }; it.GoToBegin(); while (!it.IsAtEnd()) { @@ -96,7 +96,7 @@ itkSinImageFilterAndAdaptorTest(int, char *[]) OutputIteratorType ot(outputImage, outputImage->GetRequestedRegion()); // Check the content of the result image - constexpr OutputImageType::PixelType epsilon = 1e-6; + constexpr OutputImageType::PixelType epsilon{ 1e-6 }; ot.GoToBegin(); it.GoToBegin(); while (!ot.IsAtEnd()) diff --git a/Modules/Filtering/ImageIntensity/test/itkSqrtImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkSqrtImageFilterAndAdaptorTest.cxx index bc755bd617a..9ce8fb532b8 100644 --- a/Modules/Filtering/ImageIntensity/test/itkSqrtImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkSqrtImageFilterAndAdaptorTest.cxx @@ -28,7 +28,7 @@ itkSqrtImageFilterAndAdaptorTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the pixel types of the images using PixelType = float; @@ -66,7 +66,7 @@ itkSqrtImageFilterAndAdaptorTest(int, char *[]) InputIteratorType it(inputImage, inputImage->GetBufferedRegion()); // Initialize the content of the input image - constexpr double value = itk::Math::pi / 6.0; + constexpr double value{ itk::Math::pi / 6.0 }; it.GoToBegin(); while (!it.IsAtEnd()) { @@ -96,7 +96,7 @@ itkSqrtImageFilterAndAdaptorTest(int, char *[]) OutputIteratorType ot(outputImage, outputImage->GetRequestedRegion()); // Check the content of the result image - constexpr OutputImageType::PixelType epsilon = 1e-6; + constexpr OutputImageType::PixelType epsilon{ 1e-6 }; ot.GoToBegin(); it.GoToBegin(); while (!ot.IsAtEnd()) diff --git a/Modules/Filtering/ImageIntensity/test/itkSquareImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkSquareImageFilterTest.cxx index 2e6fe6b8a35..9a32d70a6c8 100644 --- a/Modules/Filtering/ImageIntensity/test/itkSquareImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkSquareImageFilterTest.cxx @@ -25,7 +25,7 @@ itkSquareImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the types of the images using InputPixelType = float; @@ -62,7 +62,7 @@ itkSquareImageFilterTest(int, char *[]) InputIteratorType it(inputImage, inputImage->GetBufferedRegion()); // Initialize the content of Image A - constexpr double value = 30; + constexpr double value{ 30 }; std::cout << "Content of the Input " << std::endl; it.GoToBegin(); while (!it.IsAtEnd()) @@ -95,7 +95,7 @@ itkSquareImageFilterTest(int, char *[]) // Check the content of the result image - constexpr OutputImageType::PixelType epsilon = 1e-6; + constexpr OutputImageType::PixelType epsilon{ 1e-6 }; ot.GoToBegin(); it.GoToBegin(); while (!ot.IsAtEnd()) diff --git a/Modules/Filtering/ImageIntensity/test/itkSubtractImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkSubtractImageFilterTest.cxx index f0ec80be145..b8bed9bd9a2 100644 --- a/Modules/Filtering/ImageIntensity/test/itkSubtractImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkSubtractImageFilterTest.cxx @@ -27,7 +27,7 @@ itkSubtractImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Declare the pixel types of the images using PixelType = float; @@ -68,11 +68,11 @@ itkSubtractImageFilterTest(int, char *[]) inputImageB->Allocate(); // Initialize the content of Image A - constexpr InputImageType1::PixelType valueA = 2.0; + constexpr InputImageType1::PixelType valueA{ 2.0 }; inputImageA->FillBuffer(valueA); // Initialize the content of Image B - constexpr InputImageType2::PixelType valueB = 3.0; + constexpr InputImageType2::PixelType valueB{ 3.0 }; inputImageB->FillBuffer(valueB); diff --git a/Modules/Filtering/ImageIntensity/test/itkSymmetricEigenAnalysisImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkSymmetricEigenAnalysisImageFilterTest.cxx index 11c28ea7421..8dd9a1cfa08 100644 --- a/Modules/Filtering/ImageIntensity/test/itkSymmetricEigenAnalysisImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkSymmetricEigenAnalysisImageFilterTest.cxx @@ -287,7 +287,7 @@ itkSymmetricEigenAnalysisImageFilterTest(int argc, char * argv[]) bool testPassed = true; // Define the dimension of the images - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Declare the pixel type using InputPixelType = float; diff --git a/Modules/Filtering/ImageIntensity/test/itkTanImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkTanImageFilterAndAdaptorTest.cxx index edac6ada5cf..7c6eb18bd31 100644 --- a/Modules/Filtering/ImageIntensity/test/itkTanImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkTanImageFilterAndAdaptorTest.cxx @@ -27,7 +27,7 @@ itkTanImageFilterAndAdaptorTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the pixel types of the images using PixelType = float; @@ -65,7 +65,7 @@ itkTanImageFilterAndAdaptorTest(int, char *[]) InputIteratorType it(inputImage, inputImage->GetBufferedRegion()); // Initialize the content of the input image - constexpr double value = itk::Math::pi / 6.0; + constexpr double value{ itk::Math::pi / 6.0 }; it.GoToBegin(); while (!it.IsAtEnd()) { @@ -95,7 +95,7 @@ itkTanImageFilterAndAdaptorTest(int, char *[]) OutputIteratorType ot(outputImage, outputImage->GetRequestedRegion()); // Check the content of the result image - constexpr OutputImageType::PixelType epsilon = 1e-6; + constexpr OutputImageType::PixelType epsilon{ 1e-6 }; ot.GoToBegin(); it.GoToBegin(); while (!ot.IsAtEnd()) diff --git a/Modules/Filtering/ImageIntensity/test/itkTernaryMagnitudeImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkTernaryMagnitudeImageFilterTest.cxx index 42d3e4b3319..3e57123dd05 100644 --- a/Modules/Filtering/ImageIntensity/test/itkTernaryMagnitudeImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkTernaryMagnitudeImageFilterTest.cxx @@ -30,7 +30,7 @@ itkTernaryMagnitudeImageFilterTest(int argc, char * argv[]) } // Define the dimension of the images - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Define the pixel types using InputPixelType = float; @@ -82,7 +82,7 @@ itkTernaryMagnitudeImageFilterTest(int argc, char * argv[]) InputImage1IteratorType it1(inputImageA, inputImageA->GetBufferedRegion()); // Initialize the content of Image A - constexpr InputImage1Type::PixelType valueA = 2.0; + constexpr InputImage1Type::PixelType valueA{ 2.0 }; while (!it1.IsAtEnd()) { it1.Set(valueA); @@ -93,7 +93,7 @@ itkTernaryMagnitudeImageFilterTest(int argc, char * argv[]) InputImage2IteratorType it2(inputImageB, inputImageB->GetBufferedRegion()); // Initialize the content of Image B - constexpr InputImage2Type::PixelType valueB = 3.0; + constexpr InputImage2Type::PixelType valueB{ 3.0 }; while (!it2.IsAtEnd()) { it2.Set(valueB); @@ -104,7 +104,7 @@ itkTernaryMagnitudeImageFilterTest(int argc, char * argv[]) InputImage3IteratorType it3(inputImageC, inputImageC->GetBufferedRegion()); // Initialize the content of Image C - constexpr InputImage3Type::PixelType valueC = 4.0; + constexpr InputImage3Type::PixelType valueC{ 4.0 }; while (!it3.IsAtEnd()) { it3.Set(valueC); diff --git a/Modules/Filtering/ImageIntensity/test/itkTernaryMagnitudeSquaredImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkTernaryMagnitudeSquaredImageFilterTest.cxx index 0b08b56be0d..3c8681ba88f 100644 --- a/Modules/Filtering/ImageIntensity/test/itkTernaryMagnitudeSquaredImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkTernaryMagnitudeSquaredImageFilterTest.cxx @@ -25,7 +25,7 @@ itkTernaryMagnitudeSquaredImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Declare the pixel types of the images using PixelType = float; @@ -77,7 +77,7 @@ itkTernaryMagnitudeSquaredImageFilterTest(int, char *[]) InputImage1IteratorType it1(inputImageA, inputImageA->GetBufferedRegion()); // Initialize the content of Image A - constexpr InputImageType1::PixelType valueA = 2.0; + constexpr InputImageType1::PixelType valueA{ 2.0 }; while (!it1.IsAtEnd()) { it1.Set(valueA); @@ -88,7 +88,7 @@ itkTernaryMagnitudeSquaredImageFilterTest(int, char *[]) InputImage2IteratorType it2(inputImageB, inputImageB->GetBufferedRegion()); // Initialize the content of Image B - constexpr InputImageType2::PixelType valueB = 3.0; + constexpr InputImageType2::PixelType valueB{ 3.0 }; while (!it2.IsAtEnd()) { it2.Set(valueB); @@ -99,7 +99,7 @@ itkTernaryMagnitudeSquaredImageFilterTest(int, char *[]) InputImage3IteratorType it3(inputImageC, inputImageC->GetBufferedRegion()); // Initialize the content of Image C - constexpr InputImageType3::PixelType valueC = 4.0; + constexpr InputImageType3::PixelType valueC{ 4.0 }; while (!it3.IsAtEnd()) { it3.Set(valueC); @@ -132,7 +132,7 @@ itkTernaryMagnitudeSquaredImageFilterTest(int, char *[]) OutputImageIteratorType oIt(outputImage, outputImage->GetBufferedRegion()); // Check the content of the result image - constexpr float epsilon = 1e-6; + constexpr float epsilon{ 1e-6 }; oIt.GoToBegin(); it1.GoToBegin(); it2.GoToBegin(); diff --git a/Modules/Filtering/ImageIntensity/test/itkTernaryOperatorImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkTernaryOperatorImageFilterTest.cxx index b70ecae631b..6b4a7ce109d 100644 --- a/Modules/Filtering/ImageIntensity/test/itkTernaryOperatorImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkTernaryOperatorImageFilterTest.cxx @@ -58,7 +58,7 @@ itkTernaryOperatorImageFilterTest(int, char *[]) // // Define the dimension of the images - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; // Declare the pixel types of the images using MaskPixelType = bool; @@ -87,13 +87,13 @@ itkTernaryOperatorImageFilterTest(int, char *[]) } } - constexpr short val1 = 25; + constexpr short val1{ 25 }; auto image1 = GrayImageType::New(); image1->SetRegions(region); image1->Allocate(); image1->FillBuffer(val1); - constexpr short val2 = 123; + constexpr short val2{ 123 }; auto image2 = GrayImageType::New(); image2->SetRegions(region); image2->Allocate(); diff --git a/Modules/Filtering/ImageIntensity/test/itkVectorExpandImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkVectorExpandImageFilterTest.cxx index 4cf51eb4a78..b08980bc3eb 100644 --- a/Modules/Filtering/ImageIntensity/test/itkVectorExpandImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkVectorExpandImageFilterTest.cxx @@ -92,7 +92,7 @@ itkVectorExpandImageFilterTest(int, char *[]) std::cout << "Create the input image pattern." << std::endl; ImageType::RegionType region; - constexpr ImageType::SizeType size = { { 64, 64 } }; + constexpr ImageType::SizeType size{ 64, 64 }; region.SetSize(size); auto input = ImageType::New(); @@ -108,7 +108,7 @@ itkVectorExpandImageFilterTest(int, char *[]) pattern.m_Coeff[j] = 1.0; } - constexpr double vectorCoeff[VectorDimension] = { 1.0, 4.0, 6.0 }; + constexpr double vectorCoeff[VectorDimension]{ 1.0, 4.0, 6.0 }; using Iterator = itk::ImageRegionIteratorWithIndex; Iterator inIter(input, region); diff --git a/Modules/Filtering/ImageIntensity/test/itkVectorIndexSelectionCastImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkVectorIndexSelectionCastImageFilterTest.cxx index 0cc3f7ebfc8..f49b813d24b 100644 --- a/Modules/Filtering/ImageIntensity/test/itkVectorIndexSelectionCastImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkVectorIndexSelectionCastImageFilterTest.cxx @@ -37,7 +37,7 @@ itkVectorIndexSelectionCastImageFilterTest(int argc, char * argv[]) using InputPixelType = unsigned short; using OutputPixelType = unsigned short; - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using InputImageType = itk::VectorImage; using OutputImageType = itk::Image; diff --git a/Modules/Filtering/ImageIntensity/test/itkVectorRescaleIntensityImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkVectorRescaleIntensityImageFilterTest.cxx index e79f94873ba..36ed9d784ad 100644 --- a/Modules/Filtering/ImageIntensity/test/itkVectorRescaleIntensityImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkVectorRescaleIntensityImageFilterTest.cxx @@ -26,12 +26,12 @@ int itkVectorRescaleIntensityImageFilterTest(int, char *[]) { - constexpr unsigned int VectorDimension = 3; + constexpr unsigned int VectorDimension{ 3 }; using InputPixelType = itk::Vector; using OutputPixelType = itk::Vector; - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using InputImageType = itk::Image; using OutputImageType = itk::Image; @@ -89,7 +89,7 @@ itkVectorRescaleIntensityImageFilterTest(int, char *[]) ot.GoToBegin(); - constexpr double tolerance = 1e-3; + constexpr double tolerance{ 1e-3 }; const double factor = desiredMaximum / static_cast(pixelValue.GetNorm()); diff --git a/Modules/Filtering/ImageIntensity/test/itkVectorToRGBImageAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkVectorToRGBImageAdaptorTest.cxx index cd41ca2fa0e..662c275e92a 100644 --- a/Modules/Filtering/ImageIntensity/test/itkVectorToRGBImageAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkVectorToRGBImageAdaptorTest.cxx @@ -45,11 +45,11 @@ itkVectorToRGBImageAdaptorTest(int, char *[]) using ValueType = float; - constexpr unsigned int numberOfComponents = 3; + constexpr unsigned int numberOfComponents{ 3 }; using VectorPixelType = itk::Vector; - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using ImageType = itk::Image; using ImageAdaptorType = itk::VectorToRGBImageAdaptor; diff --git a/Modules/Filtering/ImageIntensity/test/itkWeightedAddImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkWeightedAddImageFilterTest.cxx index 409a7237f43..81b415e0f18 100644 --- a/Modules/Filtering/ImageIntensity/test/itkWeightedAddImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkWeightedAddImageFilterTest.cxx @@ -34,7 +34,7 @@ itkWeightedAddImageFilterTest(int argc, char * argv[]) // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; // Declare the types of the images using myImageType1 = itk::Image; diff --git a/Modules/Filtering/ImageIntensity/test/itkXorImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkXorImageFilterTest.cxx index df94f69a827..b44ec703155 100644 --- a/Modules/Filtering/ImageIntensity/test/itkXorImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkXorImageFilterTest.cxx @@ -32,7 +32,7 @@ itkXorImageFilterTest(int argc, char * argv[]) } // Define the dimension of the images - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Declare the types of the images using PixelType = unsigned char; @@ -78,7 +78,7 @@ itkXorImageFilterTest(int argc, char * argv[]) it1.GoToBegin(); // Initialize the content of Image A - constexpr InputImage1Type::PixelType valueA = 2; + constexpr InputImage1Type::PixelType valueA{ 2 }; while (!it1.IsAtEnd()) { it1.Set(valueA); @@ -90,7 +90,7 @@ itkXorImageFilterTest(int argc, char * argv[]) it2.GoToBegin(); // Initialize the content of Image B - constexpr InputImage2Type::PixelType valueB = 3; + constexpr InputImage2Type::PixelType valueB{ 3 }; while (!it2.IsAtEnd()) { it2.Set(valueB); diff --git a/Modules/Filtering/ImageLabel/include/itkBinaryContourImageFilter.hxx b/Modules/Filtering/ImageLabel/include/itkBinaryContourImageFilter.hxx index 511919a938e..3104680d89f 100644 --- a/Modules/Filtering/ImageLabel/include/itkBinaryContourImageFilter.hxx +++ b/Modules/Filtering/ImageLabel/include/itkBinaryContourImageFilter.hxx @@ -77,7 +77,7 @@ BinaryContourImageFilter::GenerateData() this->GetMultiThreader()->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); // parallelize in a way which does not split the region along X axis - constexpr unsigned int restrictedDirection = 0; + constexpr unsigned int restrictedDirection{ 0 }; this->GetMultiThreader()->template ParallelizeImageRegionRestrictDirection( restrictedDirection, reqRegion, diff --git a/Modules/Filtering/ImageLabel/test/itkBinaryContourImageFilterTest.cxx b/Modules/Filtering/ImageLabel/test/itkBinaryContourImageFilterTest.cxx index 61857b396fb..bb66680e43b 100644 --- a/Modules/Filtering/ImageLabel/test/itkBinaryContourImageFilterTest.cxx +++ b/Modules/Filtering/ImageLabel/test/itkBinaryContourImageFilterTest.cxx @@ -34,7 +34,7 @@ itkBinaryContourImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageLabel/test/itkChangeLabelImageFilterTest.cxx b/Modules/Filtering/ImageLabel/test/itkChangeLabelImageFilterTest.cxx index da582a4af9e..65e51d478c0 100644 --- a/Modules/Filtering/ImageLabel/test/itkChangeLabelImageFilterTest.cxx +++ b/Modules/Filtering/ImageLabel/test/itkChangeLabelImageFilterTest.cxx @@ -25,7 +25,7 @@ itkChangeLabelImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; // Declare the types of the images using InputImageType = itk::Image; @@ -45,7 +45,7 @@ itkChangeLabelImageFilterTest(int, char *[]) InputImageType::SizeValueType sizeArray[ImageDimension] = { 3, 3, 3 }; // limit to a few labels - constexpr InputPixelType upper = 10; + constexpr InputPixelType upper{ 10 }; source->SetMin(InputPixelType{}); source->SetMax(upper); source->SetSize(sizeArray); @@ -58,8 +58,8 @@ itkChangeLabelImageFilterTest(int, char *[]) auto filter = FilterType::New(); // Eliminate most labels - constexpr InputPixelType background = 0; - constexpr InputPixelType maxRemainingLabel = 2; + constexpr InputPixelType background{ 0 }; + constexpr InputPixelType maxRemainingLabel{ 2 }; for (InputPixelType i = maxRemainingLabel; i <= upper; ++i) { filter->SetChange(i, background); diff --git a/Modules/Filtering/ImageLabel/test/itkLabelContourImageFilterTest.cxx b/Modules/Filtering/ImageLabel/test/itkLabelContourImageFilterTest.cxx index f5f661a6a1f..228ffa78531 100644 --- a/Modules/Filtering/ImageLabel/test/itkLabelContourImageFilterTest.cxx +++ b/Modules/Filtering/ImageLabel/test/itkLabelContourImageFilterTest.cxx @@ -34,7 +34,7 @@ itkLabelContourImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageNoise/test/itkAdditiveGaussianNoiseImageFilterTest.cxx b/Modules/Filtering/ImageNoise/test/itkAdditiveGaussianNoiseImageFilterTest.cxx index 95fe7695caf..e84b96a91fa 100644 --- a/Modules/Filtering/ImageNoise/test/itkAdditiveGaussianNoiseImageFilterTest.cxx +++ b/Modules/Filtering/ImageNoise/test/itkAdditiveGaussianNoiseImageFilterTest.cxx @@ -33,7 +33,7 @@ itkAdditiveGaussianNoiseImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageNoise/test/itkPeakSignalToNoiseRatioCalculatorTest.cxx b/Modules/Filtering/ImageNoise/test/itkPeakSignalToNoiseRatioCalculatorTest.cxx index f0c03751ea4..23f236a2e82 100644 --- a/Modules/Filtering/ImageNoise/test/itkPeakSignalToNoiseRatioCalculatorTest.cxx +++ b/Modules/Filtering/ImageNoise/test/itkPeakSignalToNoiseRatioCalculatorTest.cxx @@ -34,7 +34,7 @@ itkPeakSignalToNoiseRatioCalculatorTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageNoise/test/itkSaltAndPepperNoiseImageFilterTest.cxx b/Modules/Filtering/ImageNoise/test/itkSaltAndPepperNoiseImageFilterTest.cxx index de4442fc0bb..459abad95dd 100644 --- a/Modules/Filtering/ImageNoise/test/itkSaltAndPepperNoiseImageFilterTest.cxx +++ b/Modules/Filtering/ImageNoise/test/itkSaltAndPepperNoiseImageFilterTest.cxx @@ -34,7 +34,7 @@ itkSaltAndPepperNoiseImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; @@ -58,10 +58,10 @@ itkSaltAndPepperNoiseImageFilterTest(int argc, char * argv[]) // change the default values and then set back to defaults so that // the original test image is still valid. - constexpr PixelType saltValue = 245; + constexpr PixelType saltValue{ 245 }; saltAndPepperNoiseImageFilter->SetSaltValue(saltValue); ITK_TEST_SET_GET_VALUE(saltValue, saltAndPepperNoiseImageFilter->GetSaltValue()); - constexpr PixelType pepperValue = 10; + constexpr PixelType pepperValue{ 10 }; saltAndPepperNoiseImageFilter->SetPepperValue(pepperValue); ITK_TEST_SET_GET_VALUE(pepperValue, saltAndPepperNoiseImageFilter->GetPepperValue()); saltAndPepperNoiseImageFilter->SetSaltValue(itk::NumericTraits::max()); diff --git a/Modules/Filtering/ImageNoise/test/itkShotNoiseImageFilterTest.cxx b/Modules/Filtering/ImageNoise/test/itkShotNoiseImageFilterTest.cxx index ebdf9f522af..9d9ee10bdf7 100644 --- a/Modules/Filtering/ImageNoise/test/itkShotNoiseImageFilterTest.cxx +++ b/Modules/Filtering/ImageNoise/test/itkShotNoiseImageFilterTest.cxx @@ -34,7 +34,7 @@ itkShotNoiseImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageNoise/test/itkSpeckleNoiseImageFilterTest.cxx b/Modules/Filtering/ImageNoise/test/itkSpeckleNoiseImageFilterTest.cxx index 792eb49149b..75a25f325ce 100644 --- a/Modules/Filtering/ImageNoise/test/itkSpeckleNoiseImageFilterTest.cxx +++ b/Modules/Filtering/ImageNoise/test/itkSpeckleNoiseImageFilterTest.cxx @@ -35,7 +35,7 @@ itkSpeckleNoiseImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageSources/test/itkGaborImageSourceTest.cxx b/Modules/Filtering/ImageSources/test/itkGaborImageSourceTest.cxx index d5b3f07a15e..d15c7991169 100644 --- a/Modules/Filtering/ImageSources/test/itkGaborImageSourceTest.cxx +++ b/Modules/Filtering/ImageSources/test/itkGaborImageSourceTest.cxx @@ -57,7 +57,7 @@ itkGaborImageSourceTestHelper(char * outputFilename, bool calculcateImaginaryPar gaborImage->SetMean(mean); ITK_TEST_SET_GET_VALUE(mean, gaborImage->GetMean()); - constexpr double frequency = 0.1; + constexpr double frequency{ 0.1 }; gaborImage->SetFrequency(frequency); ITK_TEST_SET_GET_VALUE(frequency, gaborImage->GetFrequency()); @@ -96,7 +96,7 @@ itkGaborImageSourceTest(int argc, char * argv[]) } - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = float; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageSources/test/itkGaborKernelFunctionTest.cxx b/Modules/Filtering/ImageSources/test/itkGaborKernelFunctionTest.cxx index 8f4041af5e1..497e78e092a 100644 --- a/Modules/Filtering/ImageSources/test/itkGaborKernelFunctionTest.cxx +++ b/Modules/Filtering/ImageSources/test/itkGaborKernelFunctionTest.cxx @@ -28,27 +28,27 @@ itkGaborKernelFunctionTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(gabor, GaborKernelFunction, KernelFunctionBase); - constexpr double sigma = 1.5; + constexpr double sigma{ 1.5 }; gabor->SetSigma(sigma); ITK_TEST_SET_GET_VALUE(sigma, gabor->GetSigma()); - constexpr double frequency = 2.; + constexpr double frequency{ 2. }; gabor->SetFrequency(frequency); ITK_TEST_SET_GET_VALUE(frequency, gabor->GetFrequency()); - constexpr double phaseOffset = 0.8; + constexpr double phaseOffset{ 0.8 }; gabor->SetPhaseOffset(phaseOffset); ITK_TEST_SET_GET_VALUE(phaseOffset, gabor->GetPhaseOffset()); - constexpr bool calculateImaginaryPart = true; + constexpr bool calculateImaginaryPart{ true }; gabor->SetCalculateImaginaryPart(calculateImaginaryPart); ITK_TEST_SET_GET_VALUE(calculateImaginaryPart, gabor->GetCalculateImaginaryPart()); gabor->CalculateImaginaryPartOn(); ITK_TEST_SET_GET_VALUE(true, gabor->GetCalculateImaginaryPart()); - constexpr double tolerance = 1e-12; - constexpr double point = 2.86; + constexpr double tolerance{ 1e-12 }; + constexpr double point{ 2.86 }; double expectedValue = -0.13297125073713259; double result = gabor->Evaluate(point); if (!itk::Math::FloatAlmostEqual(expectedValue, result, 10, tolerance)) diff --git a/Modules/Filtering/ImageSources/test/itkGaussianImageSourceTest.cxx b/Modules/Filtering/ImageSources/test/itkGaussianImageSourceTest.cxx index 649afe49a5b..934125f0298 100644 --- a/Modules/Filtering/ImageSources/test/itkGaussianImageSourceTest.cxx +++ b/Modules/Filtering/ImageSources/test/itkGaussianImageSourceTest.cxx @@ -31,7 +31,7 @@ itkGaussianImageSourceTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = unsigned char; using ImageType = itk::Image; @@ -91,7 +91,7 @@ itkGaussianImageSourceTest(int argc, char * argv[]) referenceImage->SetSpacing(spacing); referenceImage->SetDirection(direction); gaussianImage->SetReferenceImage(referenceImage); - constexpr bool useReferenceImage = true; + constexpr bool useReferenceImage{ true }; ITK_TEST_SET_GET_BOOLEAN(gaussianImage, UseReferenceImage, useReferenceImage); gaussianImage->SetReferenceImage(referenceImage); ITK_TEST_SET_GET_VALUE(referenceImage, gaussianImage->GetReferenceImage()); diff --git a/Modules/Filtering/ImageSources/test/itkGridImageSourceTest.cxx b/Modules/Filtering/ImageSources/test/itkGridImageSourceTest.cxx index 24cc7ed3703..5f10c833b99 100644 --- a/Modules/Filtering/ImageSources/test/itkGridImageSourceTest.cxx +++ b/Modules/Filtering/ImageSources/test/itkGridImageSourceTest.cxx @@ -42,7 +42,7 @@ itkGridImageSourceTest(int argc, char * argv[]) } - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using PixelType = float; using ImageType = itk::Image; @@ -65,7 +65,7 @@ itkGridImageSourceTest(int argc, char * argv[]) gridImage->SetDirection(direction); // Specify grid parameters - constexpr double scale = 255.0; + constexpr double scale{ 255.0 }; gridImage->SetScale(scale); ITK_TEST_SET_GET_VALUE(scale, gridImage->GetScale()); diff --git a/Modules/Filtering/ImageSources/test/itkGridImageSourceTest2.cxx b/Modules/Filtering/ImageSources/test/itkGridImageSourceTest2.cxx index 743212e9d11..1436ba729db 100644 --- a/Modules/Filtering/ImageSources/test/itkGridImageSourceTest2.cxx +++ b/Modules/Filtering/ImageSources/test/itkGridImageSourceTest2.cxx @@ -35,7 +35,7 @@ itkGridImageSourceTest2(int argc, char * argv[]) const char * outputImageFile = argv[2]; - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using PixelType = uint8_t; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageSources/test/itkPhysicalPointImageSourceTest.cxx b/Modules/Filtering/ImageSources/test/itkPhysicalPointImageSourceTest.cxx index 00bb6ddbf56..446c9e54697 100644 --- a/Modules/Filtering/ImageSources/test/itkPhysicalPointImageSourceTest.cxx +++ b/Modules/Filtering/ImageSources/test/itkPhysicalPointImageSourceTest.cxx @@ -79,7 +79,7 @@ itkPhysicalPointImageSourceTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageStatistics/test/itkBinaryProjectionImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkBinaryProjectionImageFilterTest.cxx index cc436f971ae..cdf1083842e 100644 --- a/Modules/Filtering/ImageStatistics/test/itkBinaryProjectionImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkBinaryProjectionImageFilterTest.cxx @@ -35,7 +35,7 @@ itkBinaryProjectionImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 3; + constexpr int dim{ 3 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageStatistics/test/itkHistogramToEntropyImageFilterTest1.cxx b/Modules/Filtering/ImageStatistics/test/itkHistogramToEntropyImageFilterTest1.cxx index 260e05c16f7..4dc49a61de3 100644 --- a/Modules/Filtering/ImageStatistics/test/itkHistogramToEntropyImageFilterTest1.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkHistogramToEntropyImageFilterTest1.cxx @@ -36,7 +36,7 @@ itkHistogramToEntropyImageFilterTest1(int argc, char * argv[]) } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelComponentType = unsigned char; using ScalarImageType = itk::Image; using ReaderType = itk::ImageFileReader; diff --git a/Modules/Filtering/ImageStatistics/test/itkHistogramToEntropyImageFilterTest2.cxx b/Modules/Filtering/ImageStatistics/test/itkHistogramToEntropyImageFilterTest2.cxx index a2c6a457277..fd15be4aa59 100644 --- a/Modules/Filtering/ImageStatistics/test/itkHistogramToEntropyImageFilterTest2.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkHistogramToEntropyImageFilterTest2.cxx @@ -37,7 +37,7 @@ itkHistogramToEntropyImageFilterTest2(int argc, char * argv[]) } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelComponentType = unsigned char; using ScalarImageType = itk::Image; @@ -66,7 +66,7 @@ itkHistogramToEntropyImageFilterTest2(int argc, char * argv[]) using HistogramMeasurementVectorType = HistogramFilterType::HistogramMeasurementVectorType; - constexpr unsigned int NumberOfComponents = 2; + constexpr unsigned int NumberOfComponents{ 2 }; const itk::MinimumMaximumImageFilter::Pointer minmaxFilter = itk::MinimumMaximumImageFilter::New(); diff --git a/Modules/Filtering/ImageStatistics/test/itkHistogramToIntensityImageFilterTest1.cxx b/Modules/Filtering/ImageStatistics/test/itkHistogramToIntensityImageFilterTest1.cxx index 5297402788f..f8cdcd6ca0d 100644 --- a/Modules/Filtering/ImageStatistics/test/itkHistogramToIntensityImageFilterTest1.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkHistogramToIntensityImageFilterTest1.cxx @@ -36,7 +36,7 @@ itkHistogramToIntensityImageFilterTest1(int argc, char * argv[]) } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelComponentType = unsigned char; using ScalarImageType = itk::Image; using ReaderType = itk::ImageFileReader; diff --git a/Modules/Filtering/ImageStatistics/test/itkHistogramToIntensityImageFilterTest2.cxx b/Modules/Filtering/ImageStatistics/test/itkHistogramToIntensityImageFilterTest2.cxx index a79013a37bc..df9f1fc3d49 100644 --- a/Modules/Filtering/ImageStatistics/test/itkHistogramToIntensityImageFilterTest2.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkHistogramToIntensityImageFilterTest2.cxx @@ -37,7 +37,7 @@ itkHistogramToIntensityImageFilterTest2(int argc, char * argv[]) } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelComponentType = unsigned char; using ScalarImageType = itk::Image; @@ -66,7 +66,7 @@ itkHistogramToIntensityImageFilterTest2(int argc, char * argv[]) using HistogramMeasurementVectorType = HistogramFilterType::HistogramMeasurementVectorType; - constexpr unsigned int NumberOfComponents = 2; + constexpr unsigned int NumberOfComponents{ 2 }; const itk::MinimumMaximumImageFilter::Pointer minmaxFilter = itk::MinimumMaximumImageFilter::New(); diff --git a/Modules/Filtering/ImageStatistics/test/itkHistogramToLogProbabilityImageFilterTest1.cxx b/Modules/Filtering/ImageStatistics/test/itkHistogramToLogProbabilityImageFilterTest1.cxx index 56b068d38fe..1e157c38c27 100644 --- a/Modules/Filtering/ImageStatistics/test/itkHistogramToLogProbabilityImageFilterTest1.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkHistogramToLogProbabilityImageFilterTest1.cxx @@ -36,7 +36,7 @@ itkHistogramToLogProbabilityImageFilterTest1(int argc, char * argv[]) } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelComponentType = unsigned char; using ScalarImageType = itk::Image; using ReaderType = itk::ImageFileReader; diff --git a/Modules/Filtering/ImageStatistics/test/itkHistogramToLogProbabilityImageFilterTest2.cxx b/Modules/Filtering/ImageStatistics/test/itkHistogramToLogProbabilityImageFilterTest2.cxx index 3506e7fd2c3..2e0a9f897b5 100644 --- a/Modules/Filtering/ImageStatistics/test/itkHistogramToLogProbabilityImageFilterTest2.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkHistogramToLogProbabilityImageFilterTest2.cxx @@ -37,7 +37,7 @@ itkHistogramToLogProbabilityImageFilterTest2(int argc, char * argv[]) } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelComponentType = unsigned char; using ScalarImageType = itk::Image; @@ -66,7 +66,7 @@ itkHistogramToLogProbabilityImageFilterTest2(int argc, char * argv[]) using HistogramMeasurementVectorType = HistogramFilterType::HistogramMeasurementVectorType; - constexpr unsigned int NumberOfComponents = 2; + constexpr unsigned int NumberOfComponents{ 2 }; const itk::MinimumMaximumImageFilter::Pointer minmaxFilter = itk::MinimumMaximumImageFilter::New(); diff --git a/Modules/Filtering/ImageStatistics/test/itkHistogramToProbabilityImageFilterTest1.cxx b/Modules/Filtering/ImageStatistics/test/itkHistogramToProbabilityImageFilterTest1.cxx index ddc2341c27b..8e56a988d56 100644 --- a/Modules/Filtering/ImageStatistics/test/itkHistogramToProbabilityImageFilterTest1.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkHistogramToProbabilityImageFilterTest1.cxx @@ -36,7 +36,7 @@ itkHistogramToProbabilityImageFilterTest1(int argc, char * argv[]) } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelComponentType = unsigned char; using ScalarImageType = itk::Image; using ReaderType = itk::ImageFileReader; diff --git a/Modules/Filtering/ImageStatistics/test/itkHistogramToProbabilityImageFilterTest2.cxx b/Modules/Filtering/ImageStatistics/test/itkHistogramToProbabilityImageFilterTest2.cxx index a95402391b1..935b7b9619e 100644 --- a/Modules/Filtering/ImageStatistics/test/itkHistogramToProbabilityImageFilterTest2.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkHistogramToProbabilityImageFilterTest2.cxx @@ -37,7 +37,7 @@ itkHistogramToProbabilityImageFilterTest2(int argc, char * argv[]) } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelComponentType = unsigned char; using ScalarImageType = itk::Image; @@ -74,7 +74,7 @@ itkHistogramToProbabilityImageFilterTest2(int argc, char * argv[]) using HistogramMeasurementVectorType = HistogramFilterType::HistogramMeasurementVectorType; - constexpr unsigned int NumberOfComponents = 2; + constexpr unsigned int NumberOfComponents{ 2 }; const itk::MinimumMaximumImageFilter::Pointer minmaxFilter = itk::MinimumMaximumImageFilter::New(); diff --git a/Modules/Filtering/ImageStatistics/test/itkImageMomentsTest.cxx b/Modules/Filtering/ImageStatistics/test/itkImageMomentsTest.cxx index 99b1b5ea567..0d1257d7c7e 100644 --- a/Modules/Filtering/ImageStatistics/test/itkImageMomentsTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkImageMomentsTest.cxx @@ -50,22 +50,22 @@ itkImageMomentsTest(int argc, char * argv[]) reasonably close but might deserve investigation some day when all the worse problems have been fixed. */ // double maxerr = 1.9e-15; - constexpr double maxerr = 5.0e-15; + constexpr double maxerr{ 5.0e-15 }; /* Define the image size and physical coordinates */ constexpr itk::Size<3> size = { { 20, 40, 80 } }; - constexpr double origin[3] = { 0.5, 0.5, 0.5 }; - constexpr double spacing[3] = { 0.1, 0.05, 0.025 }; + constexpr double origin[3]{ 0.5, 0.5, 0.5 }; + constexpr double spacing[3]{ 0.1, 0.05, 0.025 }; /* Define positions of the test masses in index coordinates */ - constexpr unsigned short mass = 1; // Test mass + constexpr unsigned short mass{ 1 }; // Test mass itk::Index<3>::IndexValueType point[8][3] = { { 10 + 8, 20 + 12, 40 + 0 }, { 10 - 8, 20 - 12, 40 - 0 }, { 10 + 3, 20 - 8, 40 + 0 }, { 10 - 3, 20 + 8, 40 - 0 }, { 10 + 0, 20 + 0, 40 + 10 }, { 10 - 0, 20 - 0, 40 - 10 }, }; /* Define the expected (true) results for comparison */ - constexpr double ttm = 6.0; // Total mass + constexpr double ttm{ 6.0 }; // Total mass double pad[3][3] = { // Principal axes { 0.0, 0.0, 1.0 }, diff --git a/Modules/Filtering/ImageStatistics/test/itkImagePCADecompositionCalculatorTest.cxx b/Modules/Filtering/ImageStatistics/test/itkImagePCADecompositionCalculatorTest.cxx index aa45c20776a..f382f373462 100644 --- a/Modules/Filtering/ImageStatistics/test/itkImagePCADecompositionCalculatorTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkImagePCADecompositionCalculatorTest.cxx @@ -46,9 +46,9 @@ itkImagePCADecompositionCalculatorTest(int, char *[]) itk::OutputWindow::SetInstance(itk::TextOutput::New().GetPointer()); // Data definitions - constexpr unsigned int IMGWIDTH = 2; - constexpr unsigned int IMGHEIGHT = 2; - constexpr unsigned int NDIMENSION = 2; + constexpr unsigned int IMGWIDTH{ 2 }; + constexpr unsigned int IMGHEIGHT{ 2 }; + constexpr unsigned int NDIMENSION{ 2 }; //------------------------------------------------------ @@ -75,7 +75,7 @@ itkImagePCADecompositionCalculatorTest(int, char *[]) auto image8 = InputImageType::New(); - constexpr InputImageType::SizeType inputImageSize = { { IMGWIDTH, IMGHEIGHT } }; + constexpr InputImageType::SizeType inputImageSize{ IMGWIDTH, IMGHEIGHT }; constexpr InputImageType::IndexType index{}; InputImageType::RegionType region{ index, inputImageSize }; diff --git a/Modules/Filtering/ImageStatistics/test/itkImagePCAShapeModelEstimatorTest.cxx b/Modules/Filtering/ImageStatistics/test/itkImagePCAShapeModelEstimatorTest.cxx index 0f4f35b952e..b8dbcdd5df5 100644 --- a/Modules/Filtering/ImageStatistics/test/itkImagePCAShapeModelEstimatorTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkImagePCAShapeModelEstimatorTest.cxx @@ -48,9 +48,9 @@ itkImagePCAShapeModelEstimatorTest(int, char *[]) // Data definitions constexpr itk::Size<2u>::SizeValueType IMGWIDTH = 2; constexpr itk::Size<2u>::SizeValueType IMGHEIGHT = 2; - constexpr unsigned int NDIMENSION = 2; - constexpr unsigned int NUMTRAINIMAGES = 3; - constexpr unsigned int NUMLARGESTPC = 2; + constexpr unsigned int NDIMENSION{ 2 }; + constexpr unsigned int NUMTRAINIMAGES{ 3 }; + constexpr unsigned int NUMLARGESTPC{ 2 }; itk::OutputWindow::SetInstance(itk::TextOutput::New().GetPointer()); @@ -67,7 +67,7 @@ itkImagePCAShapeModelEstimatorTest(int, char *[]) auto image3 = InputImageType::New(); - constexpr InputImageType::SizeType inputImageSize = { { IMGWIDTH, IMGHEIGHT } }; + constexpr InputImageType::SizeType inputImageSize{ IMGWIDTH, IMGHEIGHT }; constexpr InputImageType::IndexType index{}; InputImageType::RegionType region{ index, inputImageSize }; diff --git a/Modules/Filtering/ImageStatistics/test/itkLabelOverlapMeasuresImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkLabelOverlapMeasuresImageFilterTest.cxx index 4a7c317d543..239a22202ae 100644 --- a/Modules/Filtering/ImageStatistics/test/itkLabelOverlapMeasuresImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkLabelOverlapMeasuresImageFilterTest.cxx @@ -163,7 +163,7 @@ itkLabelOverlapMeasuresImageFilterTest(int argc, char * argv[]) } // Instantiate the filter - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using PixelType = unsigned int; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageStatistics/test/itkMaximumProjectionImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkMaximumProjectionImageFilterTest.cxx index a4304c2d9ec..51fba55d79f 100644 --- a/Modules/Filtering/ImageStatistics/test/itkMaximumProjectionImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkMaximumProjectionImageFilterTest.cxx @@ -34,7 +34,7 @@ itkMaximumProjectionImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 3; + constexpr int dim{ 3 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageStatistics/test/itkMeanProjectionImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkMeanProjectionImageFilterTest.cxx index 7d46de91d52..4fd0d5b223e 100644 --- a/Modules/Filtering/ImageStatistics/test/itkMeanProjectionImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkMeanProjectionImageFilterTest.cxx @@ -33,7 +33,7 @@ itkMeanProjectionImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 3; + constexpr int dim{ 3 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageStatistics/test/itkMedianProjectionImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkMedianProjectionImageFilterTest.cxx index 3c416d4e619..12b1ffe0a72 100644 --- a/Modules/Filtering/ImageStatistics/test/itkMedianProjectionImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkMedianProjectionImageFilterTest.cxx @@ -34,7 +34,7 @@ itkMedianProjectionImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 3; + constexpr int dim{ 3 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageStatistics/test/itkMinimumMaximumImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkMinimumMaximumImageFilterTest.cxx index 3972042c471..4273b51108f 100644 --- a/Modules/Filtering/ImageStatistics/test/itkMinimumMaximumImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkMinimumMaximumImageFilterTest.cxx @@ -37,9 +37,9 @@ itkMinimumMaximumImageFilterTest(int argc, char * argv[]) using MinMaxFilterType = itk::MinimumMaximumImageFilter; /* Define the image size and physical coordinates */ - constexpr SizeType size = { { 20, 20, 20 } }; - constexpr double origin[3] = { 0.0, 0.0, 0.0 }; - constexpr double spacing[3] = { 1, 1, 1 }; + constexpr SizeType size{ 20, 20, 20 }; + constexpr double origin[3]{ 0.0, 0.0, 0.0 }; + constexpr double spacing[3]{ 1, 1, 1 }; int flag = 0; /* Did this test program work? */ @@ -56,8 +56,8 @@ itkMinimumMaximumImageFilterTest(int argc, char * argv[]) image->SetOrigin(origin); image->SetSpacing(spacing); - constexpr float minimum = -52; - constexpr float maximum = -10; + constexpr float minimum{ -52 }; + constexpr float maximum{ -10 }; // Initialize the image contents with the minimum value diff --git a/Modules/Filtering/ImageStatistics/test/itkMinimumProjectionImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkMinimumProjectionImageFilterTest.cxx index 2d54af71df0..8c587597d88 100644 --- a/Modules/Filtering/ImageStatistics/test/itkMinimumProjectionImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkMinimumProjectionImageFilterTest.cxx @@ -33,7 +33,7 @@ itkMinimumProjectionImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 3; + constexpr int dim{ 3 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageStatistics/test/itkProjectionImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkProjectionImageFilterTest.cxx index 81b0c6c8341..466f148918c 100644 --- a/Modules/Filtering/ImageStatistics/test/itkProjectionImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkProjectionImageFilterTest.cxx @@ -77,7 +77,7 @@ itkProjectionImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageStatistics/test/itkStandardDeviationProjectionImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkStandardDeviationProjectionImageFilterTest.cxx index 11767a8aab7..40a298b6fc5 100644 --- a/Modules/Filtering/ImageStatistics/test/itkStandardDeviationProjectionImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkStandardDeviationProjectionImageFilterTest.cxx @@ -34,7 +34,7 @@ itkStandardDeviationProjectionImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 3; + constexpr int dim{ 3 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/ImageStatistics/test/itkStatisticsImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkStatisticsImageFilterTest.cxx index 23bcbe17cb1..b9dd8328643 100644 --- a/Modules/Filtering/ImageStatistics/test/itkStatisticsImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkStatisticsImageFilterTest.cxx @@ -52,7 +52,7 @@ itkStatisticsImageFilterTest(int argc, char * argv[]) FloatImage::RegionType region = { index, size }; // first try a constant image - constexpr float fillValue = -100.0; + constexpr float fillValue{ -100.0 }; image->SetRegions(region); image->Allocate(); image->FillBuffer(static_cast(fillValue)); @@ -117,8 +117,8 @@ itkStatisticsImageFilterTest(int argc, char * argv[]) FloatImage::SizeValueType randomSize[3] = { 17, 8, 241 }; source->SetSize(randomSize); - constexpr float minValue = -100.0; - constexpr float maxValue = 1000.0; + constexpr float minValue{ -100.0 }; + constexpr float maxValue{ 1000.0 }; source->SetMin(static_cast(minValue)); source->SetMax(static_cast(maxValue)); @@ -128,7 +128,7 @@ itkStatisticsImageFilterTest(int argc, char * argv[]) ITK_TRY_EXPECT_NO_EXCEPTION(filter->UpdateLargestPossibleRegion()); const double expectedSigma = std::sqrt((maxValue - minValue) * (maxValue - minValue) / 12.0); - constexpr double epsilon = (maxValue - minValue) * .001; + constexpr double epsilon{ (maxValue - minValue) * .001 }; if (itk::Math::abs(filter->GetSigma() - expectedSigma) > epsilon) { @@ -138,8 +138,8 @@ itkStatisticsImageFilterTest(int argc, char * argv[]) // Now generate an image with a known mean and variance const itk::Statistics::MersenneTwisterRandomVariateGenerator::Pointer rvgen = itk::Statistics::MersenneTwisterRandomVariateGenerator::GetInstance(); - constexpr double knownMean = 12.0; - constexpr double knownVariance = 10.0; + constexpr double knownMean{ 12.0 }; + constexpr double knownVariance{ 10.0 }; using DoubleImage = itk::Image; auto dImage = DoubleImage::New(); diff --git a/Modules/Filtering/ImageStatistics/test/itkSumProjectionImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkSumProjectionImageFilterTest.cxx index 3ceb6b75017..6da6ba6d1ce 100644 --- a/Modules/Filtering/ImageStatistics/test/itkSumProjectionImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkSumProjectionImageFilterTest.cxx @@ -33,7 +33,7 @@ itkSumProjectionImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 3; + constexpr int dim{ 3 }; using InputPixelType = unsigned char; using InputImageType = itk::Image; diff --git a/Modules/Filtering/LabelMap/include/itkLabelMap.hxx b/Modules/Filtering/LabelMap/include/itkLabelMap.hxx index cdebe85e6dd..d05b3a33c3b 100644 --- a/Modules/Filtering/LabelMap/include/itkLabelMap.hxx +++ b/Modules/Filtering/LabelMap/include/itkLabelMap.hxx @@ -313,7 +313,7 @@ LabelMap::RemovePixel(const IndexType & idx, const LabelType & lab const LabelObjectContainerIterator it = m_LabelObjectContainer.find(label); - constexpr bool emitModifiedEvent = true; + constexpr bool emitModifiedEvent{ true }; RemovePixel(it, idx, emitModifiedEvent); } diff --git a/Modules/Filtering/LabelMap/include/itkShapeLabelMapFilter.hxx b/Modules/Filtering/LabelMap/include/itkShapeLabelMapFilter.hxx index 01f19f51b84..3e05444d3f4 100644 --- a/Modules/Filtering/LabelMap/include/itkShapeLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkShapeLabelMapFilter.hxx @@ -592,7 +592,7 @@ ShapeLabelMapFilter::ComputePerimeter(LabelObjectType * lab auto li = ls.begin(); auto ni = ns.begin(); - constexpr IndexValueType lZero = 0; + constexpr IndexValueType lZero{ 0 }; IndexValueType lMin = 0; IndexValueType lMax = 0; diff --git a/Modules/Filtering/LabelMap/include/itkStatisticsLabelMapFilter.h b/Modules/Filtering/LabelMap/include/itkStatisticsLabelMapFilter.h index 9ad9168cade..47c190ea9b7 100644 --- a/Modules/Filtering/LabelMap/include/itkStatisticsLabelMapFilter.h +++ b/Modules/Filtering/LabelMap/include/itkStatisticsLabelMapFilter.h @@ -135,8 +135,7 @@ class ITK_TEMPLATE_EXPORT StatisticsLabelMapFilter static constexpr unsigned int GetDefaultNumberOfBins() { - constexpr size_t bitsShift = std::min(8 * sizeof(FeatureImagePixelType), 8 * sizeof(m_NumberOfBins) - 1); - + constexpr size_t bitsShift{ std::min(8 * sizeof(FeatureImagePixelType), 8 * sizeof(m_NumberOfBins) - 1) }; return std::is_integral_v && sizeof(FeatureImagePixelType) <= 2 ? 1u << bitsShift : 128u; } diff --git a/Modules/Filtering/LabelMap/include/itkStatisticsLabelMapFilter.hxx b/Modules/Filtering/LabelMap/include/itkStatisticsLabelMapFilter.hxx index 712107ac1b5..ba86e2e4893 100644 --- a/Modules/Filtering/LabelMap/include/itkStatisticsLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkStatisticsLabelMapFilter.hxx @@ -71,7 +71,7 @@ StatisticsLabelMapFilter::ThreadedProcessLabelObject(Labe typename HistogramType::MeasurementVectorType featureImageMax(1); - constexpr size_t bitsShift = std::min(8 * sizeof(FeatureImagePixelType), 8 * sizeof(m_NumberOfBins) - 1); + constexpr size_t bitsShift{ std::min(8 * sizeof(FeatureImagePixelType), 8 * sizeof(m_NumberOfBins) - 1) }; if (std::is_integral_v && sizeof(FeatureImagePixelType) <= 2 && m_NumberOfBins == 1u << bitsShift) { diff --git a/Modules/Filtering/LabelMap/test/itkAggregateLabelMapFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkAggregateLabelMapFilterTest.cxx index 8887b750749..6e1a67571a6 100644 --- a/Modules/Filtering/LabelMap/test/itkAggregateLabelMapFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkAggregateLabelMapFilterTest.cxx @@ -36,7 +36,7 @@ itkAggregateLabelMapFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 2; + constexpr int dim{ 2 }; using ImageType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkAttributeKeepNObjectsLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkAttributeKeepNObjectsLabelMapFilterTest1.cxx index 62efb3414dd..1169ce7be58 100644 --- a/Modules/Filtering/LabelMap/test/itkAttributeKeepNObjectsLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkAttributeKeepNObjectsLabelMapFilterTest1.cxx @@ -39,7 +39,7 @@ itkAttributeKeepNObjectsLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 3; + constexpr unsigned int dim{ 3 }; using PixelType = unsigned char; diff --git a/Modules/Filtering/LabelMap/test/itkAttributeLabelObjectAccessorsTest1.cxx b/Modules/Filtering/LabelMap/test/itkAttributeLabelObjectAccessorsTest1.cxx index d8912adc879..05c59c50787 100644 --- a/Modules/Filtering/LabelMap/test/itkAttributeLabelObjectAccessorsTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkAttributeLabelObjectAccessorsTest1.cxx @@ -35,7 +35,7 @@ itkAttributeLabelObjectAccessorsTest1(int argc, char * argv[]) } // declare the dimension used, and the type of the input image - constexpr int dim = 2; + constexpr int dim{ 2 }; using PType = unsigned char; using IType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkAttributeOpeningLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkAttributeOpeningLabelMapFilterTest1.cxx index 67f9258c361..9a3cdb27d05 100644 --- a/Modules/Filtering/LabelMap/test/itkAttributeOpeningLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkAttributeOpeningLabelMapFilterTest1.cxx @@ -39,7 +39,7 @@ itkAttributeOpeningLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = unsigned char; diff --git a/Modules/Filtering/LabelMap/test/itkAttributePositionLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkAttributePositionLabelMapFilterTest1.cxx index 5b6351a1c1a..c8ec684e10e 100644 --- a/Modules/Filtering/LabelMap/test/itkAttributePositionLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkAttributePositionLabelMapFilterTest1.cxx @@ -55,7 +55,7 @@ itkAttributePositionLabelMapFilterTest1(int argc, char * argv[]) } // declare the dimension used, and the type of the input image - constexpr int dim = 3; + constexpr int dim{ 3 }; using PType = unsigned char; using IType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkAttributeRelabelLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkAttributeRelabelLabelMapFilterTest1.cxx index 05bd63157e9..4ef7d8b40fa 100644 --- a/Modules/Filtering/LabelMap/test/itkAttributeRelabelLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkAttributeRelabelLabelMapFilterTest1.cxx @@ -39,7 +39,7 @@ itkAttributeRelabelLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 3; + constexpr unsigned int dim{ 3 }; using PixelType = unsigned char; diff --git a/Modules/Filtering/LabelMap/test/itkAttributeUniqueLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkAttributeUniqueLabelMapFilterTest1.cxx index 0a7a2bccbac..0590535a5b4 100644 --- a/Modules/Filtering/LabelMap/test/itkAttributeUniqueLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkAttributeUniqueLabelMapFilterTest1.cxx @@ -41,7 +41,7 @@ itkAttributeUniqueLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 2; + constexpr int dim{ 2 }; using ImageType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkAutoCropLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkAutoCropLabelMapFilterTest1.cxx index f189276098f..30eb8536cbb 100644 --- a/Modules/Filtering/LabelMap/test/itkAutoCropLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkAutoCropLabelMapFilterTest1.cxx @@ -47,7 +47,7 @@ itkAutoCropLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkAutoCropLabelMapFilterTest2.cxx b/Modules/Filtering/LabelMap/test/itkAutoCropLabelMapFilterTest2.cxx index cd049ae321b..32b9909f22d 100644 --- a/Modules/Filtering/LabelMap/test/itkAutoCropLabelMapFilterTest2.cxx +++ b/Modules/Filtering/LabelMap/test/itkAutoCropLabelMapFilterTest2.cxx @@ -48,7 +48,7 @@ itkAutoCropLabelMapFilterTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkBinaryGrindPeakImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkBinaryGrindPeakImageFilterTest1.cxx index 6badc2ab4fe..e2fa60bd962 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryGrindPeakImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryGrindPeakImageFilterTest1.cxx @@ -35,7 +35,7 @@ itkBinaryGrindPeakImageFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkBinaryImageToLabelMapFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkBinaryImageToLabelMapFilterTest.cxx index 453d077cee2..d198eae5211 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryImageToLabelMapFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryImageToLabelMapFilterTest.cxx @@ -37,7 +37,7 @@ itkBinaryImageToLabelMapFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using BinaryPixelType = unsigned char; using LabelPixelType = unsigned char; diff --git a/Modules/Filtering/LabelMap/test/itkBinaryImageToLabelMapFilterTest2.cxx b/Modules/Filtering/LabelMap/test/itkBinaryImageToLabelMapFilterTest2.cxx index 3b1da25bac6..dc203fb1bdd 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryImageToLabelMapFilterTest2.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryImageToLabelMapFilterTest2.cxx @@ -37,7 +37,7 @@ itkBinaryImageToLabelMapFilterTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using BinaryPixelType = unsigned char; using LabelPixelType = unsigned short; diff --git a/Modules/Filtering/LabelMap/test/itkBinaryImageToShapeLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkBinaryImageToShapeLabelMapFilterTest1.cxx index 86dcff8be69..ea16f04ee3f 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryImageToShapeLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryImageToShapeLabelMapFilterTest1.cxx @@ -38,7 +38,7 @@ itkBinaryImageToShapeLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using ImageType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkBinaryImageToStatisticsLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkBinaryImageToStatisticsLabelMapFilterTest1.cxx index 2e8e6bfe01a..0d6f31f3384 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryImageToStatisticsLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryImageToStatisticsLabelMapFilterTest1.cxx @@ -38,7 +38,7 @@ itkBinaryImageToStatisticsLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using ImageType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkBinaryNotImageFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkBinaryNotImageFilterTest.cxx index 1993bb12a8c..791adf8ba0a 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryNotImageFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryNotImageFilterTest.cxx @@ -31,7 +31,7 @@ itkBinaryNotImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkBinaryReconstructionByDilationImageFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkBinaryReconstructionByDilationImageFilterTest.cxx index 9305ced0dae..a5b321e60f7 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryReconstructionByDilationImageFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryReconstructionByDilationImageFilterTest.cxx @@ -34,7 +34,7 @@ itkBinaryReconstructionByDilationImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 3; + constexpr unsigned int dim{ 3 }; using PixelType = unsigned char; diff --git a/Modules/Filtering/LabelMap/test/itkBinaryReconstructionByErosionImageFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkBinaryReconstructionByErosionImageFilterTest.cxx index 8c2b53f8bee..3f54121f3f9 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryReconstructionByErosionImageFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryReconstructionByErosionImageFilterTest.cxx @@ -33,7 +33,7 @@ itkBinaryReconstructionByErosionImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 3; + constexpr unsigned int dim{ 3 }; using PixelType = unsigned char; diff --git a/Modules/Filtering/LabelMap/test/itkBinaryReconstructionLabelMapFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkBinaryReconstructionLabelMapFilterTest.cxx index 9b4e795f403..7c2036f7879 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryReconstructionLabelMapFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryReconstructionLabelMapFilterTest.cxx @@ -39,7 +39,7 @@ itkBinaryReconstructionLabelMapFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = unsigned char; using AttributeValueType = bool; diff --git a/Modules/Filtering/LabelMap/test/itkBinaryShapeKeepNObjectsImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkBinaryShapeKeepNObjectsImageFilterTest1.cxx index c14344f9b70..747795dcb1a 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryShapeKeepNObjectsImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryShapeKeepNObjectsImageFilterTest1.cxx @@ -37,7 +37,7 @@ itkBinaryShapeKeepNObjectsImageFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using IType = itk::Image; @@ -96,7 +96,7 @@ itkBinaryShapeKeepNObjectsImageFilterTest1(int argc, char * argv[]) const std::string attributeByName{ argv[8] }; KeepNObjects->SetAttribute(attributeByName); // SetAttribute accepts a string for conversion to internal label code - constexpr BinaryKeepNObjectsType::AttributeType attributeByCode = BinaryKeepNObjectsType::LabelObjectType::LABEL; + constexpr BinaryKeepNObjectsType::AttributeType attributeByCode{ BinaryKeepNObjectsType::LabelObjectType::LABEL }; ITK_TEST_SET_GET_VALUE(attributeByCode, KeepNObjects->GetAttribute()); const itk::SimpleFilterWatcher watcher(KeepNObjects, "filter"); diff --git a/Modules/Filtering/LabelMap/test/itkBinaryShapeOpeningImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkBinaryShapeOpeningImageFilterTest1.cxx index 6997b0d47a0..9c2aed388de 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryShapeOpeningImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryShapeOpeningImageFilterTest1.cxx @@ -37,7 +37,7 @@ itkBinaryShapeOpeningImageFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using IType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkBinaryStatisticsKeepNObjectsImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkBinaryStatisticsKeepNObjectsImageFilterTest1.cxx index ec0d219e7fe..bb1dc7f7aad 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryStatisticsKeepNObjectsImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryStatisticsKeepNObjectsImageFilterTest1.cxx @@ -37,7 +37,7 @@ itkBinaryStatisticsKeepNObjectsImageFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using IType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkBinaryStatisticsOpeningImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkBinaryStatisticsOpeningImageFilterTest1.cxx index b97e7deb1a6..3474444ae38 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryStatisticsOpeningImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryStatisticsOpeningImageFilterTest1.cxx @@ -37,7 +37,7 @@ itkBinaryStatisticsOpeningImageFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using IType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkChangeLabelLabelMapFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkChangeLabelLabelMapFilterTest.cxx index 2cc0cbf76ba..931f03b554d 100644 --- a/Modules/Filtering/LabelMap/test/itkChangeLabelLabelMapFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkChangeLabelLabelMapFilterTest.cxx @@ -39,7 +39,7 @@ itkChangeLabelLabelMapFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ImagePixelType = unsigned char; using LabelPixelType = unsigned char; @@ -62,7 +62,7 @@ itkChangeLabelLabelMapFilterTest(int argc, char * argv[]) changeFilter->SetInput(i2l->GetOutput()); - constexpr unsigned int numberOfArgumentsBeforeLabels = 3; + constexpr unsigned int numberOfArgumentsBeforeLabels{ 3 }; const unsigned int numberOfArguments = argc; using LabelPrintType = itk::NumericTraits::PrintType; diff --git a/Modules/Filtering/LabelMap/test/itkChangeRegionLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkChangeRegionLabelMapFilterTest1.cxx index eaefad7728b..055ebc5fe21 100644 --- a/Modules/Filtering/LabelMap/test/itkChangeRegionLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkChangeRegionLabelMapFilterTest1.cxx @@ -37,7 +37,7 @@ itkChangeRegionLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using ImageType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkConvertLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkConvertLabelMapFilterTest1.cxx index 3670d4a822c..72887726bda 100644 --- a/Modules/Filtering/LabelMap/test/itkConvertLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkConvertLabelMapFilterTest1.cxx @@ -35,7 +35,7 @@ itkConvertLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using PixelType = unsigned char; diff --git a/Modules/Filtering/LabelMap/test/itkConvertLabelMapFilterTest2.cxx b/Modules/Filtering/LabelMap/test/itkConvertLabelMapFilterTest2.cxx index e4d4a231b9a..e2029963978 100644 --- a/Modules/Filtering/LabelMap/test/itkConvertLabelMapFilterTest2.cxx +++ b/Modules/Filtering/LabelMap/test/itkConvertLabelMapFilterTest2.cxx @@ -37,7 +37,7 @@ itkConvertLabelMapFilterTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using InputPixelType = unsigned char; using InputImageType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkCropLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkCropLabelMapFilterTest1.cxx index 9e17772f762..da6782d0f94 100644 --- a/Modules/Filtering/LabelMap/test/itkCropLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkCropLabelMapFilterTest1.cxx @@ -47,7 +47,7 @@ itkCropLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using ImageType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkLabelImageToLabelMapFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkLabelImageToLabelMapFilterTest.cxx index cac8b2e04ff..ed981c5806d 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelImageToLabelMapFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelImageToLabelMapFilterTest.cxx @@ -24,7 +24,7 @@ void zeroSizeCase() { // test filter with zero sized image - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using PixelType = unsigned char; using ImageType = itk::Image; auto p_filter = itk::LabelImageToLabelMapFilter::New(); @@ -40,7 +40,7 @@ zeroSizeCase() int itkLabelImageToLabelMapFilterTest(int, char *[]) { - constexpr int Dimension = 2; + constexpr int Dimension{ 2 }; using LabelObjectType = itk::LabelObject; using IndexType = LabelObjectType::IndexType; diff --git a/Modules/Filtering/LabelMap/test/itkLabelImageToShapeLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkLabelImageToShapeLabelMapFilterTest1.cxx index 733a4b5c4fc..7767b005004 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelImageToShapeLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelImageToShapeLabelMapFilterTest1.cxx @@ -34,7 +34,7 @@ itkLabelImageToShapeLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using PixelType = unsigned char; diff --git a/Modules/Filtering/LabelMap/test/itkLabelImageToStatisticsLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkLabelImageToStatisticsLabelMapFilterTest1.cxx index b128e077900..19e82f44b97 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelImageToStatisticsLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelImageToStatisticsLabelMapFilterTest1.cxx @@ -38,7 +38,7 @@ itkLabelImageToStatisticsLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using ImageType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkLabelMapFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkLabelMapFilterTest.cxx index 7a7389140ca..05d6e4943ef 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelMapFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelMapFilterTest.cxx @@ -32,7 +32,7 @@ itkLabelMapFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 2; + constexpr int dim{ 2 }; using LabelObjectType = itk::LabelObject; using IndexType = LabelObjectType::IndexType; diff --git a/Modules/Filtering/LabelMap/test/itkLabelMapMaskImageFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkLabelMapMaskImageFilterTest.cxx index 1dbfac468e1..a614d47a6ef 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelMapMaskImageFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelMapMaskImageFilterTest.cxx @@ -35,7 +35,7 @@ itkLabelMapMaskImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Declare the pixel type using PixelType = unsigned char; diff --git a/Modules/Filtering/LabelMap/test/itkLabelMapTest.cxx b/Modules/Filtering/LabelMap/test/itkLabelMapTest.cxx index 8755808142b..dbd7d72047f 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelMapTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelMapTest.cxx @@ -31,7 +31,7 @@ itkLabelMapTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 3; + constexpr unsigned int dim{ 3 }; using LabelObjectType = itk::LabelObject; using IndexType = LabelObjectType::IndexType; diff --git a/Modules/Filtering/LabelMap/test/itkLabelMapTest2.cxx b/Modules/Filtering/LabelMap/test/itkLabelMapTest2.cxx index c9e20dfdd1e..42b454bfced 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelMapTest2.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelMapTest2.cxx @@ -24,7 +24,7 @@ int itkLabelMapTest2(int, char *[]) { - constexpr unsigned int dim = 3; + constexpr unsigned int dim{ 3 }; using LabelObjectType = itk::LabelObject; using IndexType = LabelObjectType::IndexType; diff --git a/Modules/Filtering/LabelMap/test/itkLabelMapToAttributeImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkLabelMapToAttributeImageFilterTest1.cxx index d9d7823d709..6bfabcd0e06 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelMapToAttributeImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelMapToAttributeImageFilterTest1.cxx @@ -38,7 +38,7 @@ itkLabelMapToAttributeImageFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using PixelType = unsigned short; diff --git a/Modules/Filtering/LabelMap/test/itkLabelMapToBinaryImageFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkLabelMapToBinaryImageFilterTest.cxx index ba3e20cd89d..7d3348764ca 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelMapToBinaryImageFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelMapToBinaryImageFilterTest.cxx @@ -38,7 +38,7 @@ itkLabelMapToBinaryImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using BinaryPixelType = unsigned char; using LabelPixelType = unsigned char; diff --git a/Modules/Filtering/LabelMap/test/itkLabelMapToLabelImageFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkLabelMapToLabelImageFilterTest.cxx index 743803edd5a..61eb15426b4 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelMapToLabelImageFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelMapToLabelImageFilterTest.cxx @@ -32,7 +32,7 @@ itkLabelMapToLabelImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 2; + constexpr int dim{ 2 }; using LabelObjectType = itk::LabelObject; using IndexType = LabelObjectType::IndexType; diff --git a/Modules/Filtering/LabelMap/test/itkLabelObjectTest.cxx b/Modules/Filtering/LabelMap/test/itkLabelObjectTest.cxx index 3c534705f54..3c53d90fcbe 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelObjectTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelObjectTest.cxx @@ -30,7 +30,7 @@ itkLabelObjectTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 3; + constexpr int dim{ 3 }; using LabelObjectType = itk::LabelObject; using IndexType = LabelObjectType::IndexType; diff --git a/Modules/Filtering/LabelMap/test/itkLabelSelectionLabelMapFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkLabelSelectionLabelMapFilterTest.cxx index 78b7ff26de5..4eb26054eb7 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelSelectionLabelMapFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelSelectionLabelMapFilterTest.cxx @@ -37,7 +37,7 @@ itkLabelSelectionLabelMapFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 2; + constexpr int dim{ 2 }; using ImageType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkLabelShapeKeepNObjectsImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkLabelShapeKeepNObjectsImageFilterTest1.cxx index b05658fa05a..fb6f77bc10b 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelShapeKeepNObjectsImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelShapeKeepNObjectsImageFilterTest1.cxx @@ -37,7 +37,7 @@ itkLabelShapeKeepNObjectsImageFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using IType = itk::Image; @@ -78,7 +78,7 @@ itkLabelShapeKeepNObjectsImageFilterTest1(int argc, char * argv[]) const std::string attributeByName{ argv[6] }; KeepNObjects->SetAttribute(attributeByName); // SetAttribute accepts a string for conversion to internal label code - constexpr LabelKeepNObjectsType::AttributeType attributeByCode = LabelKeepNObjectsType::LabelObjectType::LABEL; + constexpr LabelKeepNObjectsType::AttributeType attributeByCode{ LabelKeepNObjectsType::LabelObjectType::LABEL }; ITK_TEST_SET_GET_VALUE(attributeByCode, KeepNObjects->GetAttribute()); const itk::SimpleFilterWatcher watcher(KeepNObjects, "filter"); diff --git a/Modules/Filtering/LabelMap/test/itkLabelShapeOpeningImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkLabelShapeOpeningImageFilterTest1.cxx index 4171e58716d..4955ae3918e 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelShapeOpeningImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelShapeOpeningImageFilterTest1.cxx @@ -37,7 +37,7 @@ itkLabelShapeOpeningImageFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using IType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkLabelStatisticsKeepNObjectsImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkLabelStatisticsKeepNObjectsImageFilterTest1.cxx index 0393627405e..a4df4d69807 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelStatisticsKeepNObjectsImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelStatisticsKeepNObjectsImageFilterTest1.cxx @@ -37,7 +37,7 @@ itkLabelStatisticsKeepNObjectsImageFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using IType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkLabelStatisticsOpeningImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkLabelStatisticsOpeningImageFilterTest1.cxx index eec01105692..c1d0511cb07 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelStatisticsOpeningImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelStatisticsOpeningImageFilterTest1.cxx @@ -37,7 +37,7 @@ itkLabelStatisticsOpeningImageFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using IType = itk::Image; @@ -85,7 +85,7 @@ itkLabelStatisticsOpeningImageFilterTest1(int argc, char * argv[]) const std::string attributeByName{ argv[7] }; opening->SetAttribute(attributeByName); // SetAttribute accepts a string for conversion to internal label code - constexpr LabelOpeningType::AttributeType attributeByCode = LabelOpeningType::LabelObjectType::LABEL; + constexpr LabelOpeningType::AttributeType attributeByCode{ LabelOpeningType::LabelObjectType::LABEL }; ITK_TEST_SET_GET_VALUE(attributeByCode, opening->GetAttribute()); const itk::SimpleFilterWatcher watcher(opening, "filter"); diff --git a/Modules/Filtering/LabelMap/test/itkLabelUniqueLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkLabelUniqueLabelMapFilterTest1.cxx index 6c545038dbe..67279866b31 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelUniqueLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelUniqueLabelMapFilterTest1.cxx @@ -40,7 +40,7 @@ itkLabelUniqueLabelMapFilterTest1(int argc, char * argv[]) return EXIT_SUCCESS; } - constexpr int dim = 2; + constexpr int dim{ 2 }; using ImageType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkMergeLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkMergeLabelMapFilterTest1.cxx index b4cc1a8a1cc..2a76bec426b 100644 --- a/Modules/Filtering/LabelMap/test/itkMergeLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkMergeLabelMapFilterTest1.cxx @@ -36,7 +36,7 @@ itkMergeLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkObjectByObjectLabelMapFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkObjectByObjectLabelMapFilterTest.cxx index 15883f41474..499ed63032a 100644 --- a/Modules/Filtering/LabelMap/test/itkObjectByObjectLabelMapFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkObjectByObjectLabelMapFilterTest.cxx @@ -37,7 +37,7 @@ itkObjectByObjectLabelMapFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 2; + constexpr int dim{ 2 }; using ImageType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkPadLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkPadLabelMapFilterTest1.cxx index cfd401326c9..28d2d5dc374 100644 --- a/Modules/Filtering/LabelMap/test/itkPadLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkPadLabelMapFilterTest1.cxx @@ -48,7 +48,7 @@ itkPadLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using ImageType = itk::Image; @@ -70,11 +70,11 @@ itkPadLabelMapFilterTest1(int argc, char * argv[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(padLabelMapFilter, PadLabelMapFilter, ChangeRegionLabelMapFilter); - constexpr PadLabelMapFilterType::SizeType upperBoundaryPadSize = { { 0 } }; + constexpr PadLabelMapFilterType::SizeType upperBoundaryPadSize{ 0 }; padLabelMapFilter->SetPadSize(upperBoundaryPadSize); ITK_TEST_SET_GET_VALUE(upperBoundaryPadSize, padLabelMapFilter->GetUpperBoundaryPadSize()); - constexpr PadLabelMapFilterType::SizeType lowerBoundaryPadSize = { { 0 } }; + constexpr PadLabelMapFilterType::SizeType lowerBoundaryPadSize{ 0 }; padLabelMapFilter->SetPadSize(lowerBoundaryPadSize); ITK_TEST_SET_GET_VALUE(upperBoundaryPadSize, padLabelMapFilter->GetLowerBoundaryPadSize()); diff --git a/Modules/Filtering/LabelMap/test/itkRegionFromReferenceLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkRegionFromReferenceLabelMapFilterTest1.cxx index dd6823c0ec3..503ed9d62a4 100644 --- a/Modules/Filtering/LabelMap/test/itkRegionFromReferenceLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkRegionFromReferenceLabelMapFilterTest1.cxx @@ -47,7 +47,7 @@ itkRegionFromReferenceLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 3; + constexpr unsigned int dim{ 3 }; using ImageType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkRelabelLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkRelabelLabelMapFilterTest1.cxx index 6aa11797ce7..1bf089ba31a 100644 --- a/Modules/Filtering/LabelMap/test/itkRelabelLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkRelabelLabelMapFilterTest1.cxx @@ -38,7 +38,7 @@ itkRelabelLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 2; + constexpr int dim{ 2 }; using ImageType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkShapeKeepNObjectsLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkShapeKeepNObjectsLabelMapFilterTest1.cxx index ee805a01271..5a53148a6d9 100644 --- a/Modules/Filtering/LabelMap/test/itkShapeKeepNObjectsLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkShapeKeepNObjectsLabelMapFilterTest1.cxx @@ -38,7 +38,7 @@ itkShapeKeepNObjectsLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 3; + constexpr unsigned int dim{ 3 }; using PixelType = unsigned char; diff --git a/Modules/Filtering/LabelMap/test/itkShapeLabelMapFilterGTest.cxx b/Modules/Filtering/LabelMap/test/itkShapeLabelMapFilterGTest.cxx index 8b5f75f6514..9c349821037 100644 --- a/Modules/Filtering/LabelMap/test/itkShapeLabelMapFilterGTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkShapeLabelMapFilterGTest.cxx @@ -450,7 +450,7 @@ TEST_F(ShapeLabelMapFixture, 2D_T1_1_FlipDirection) image->SetPixel(itk::MakeIndex(5, 7), 1); image->SetPixel(itk::MakeIndex(6, 8), 1); - constexpr itk::SpacePrecisionType d[4] = { 0, 1.0, 1.0, 0 }; + constexpr itk::SpacePrecisionType d[4]{ 0, 1.0, 1.0, 0 }; const DirectionType direction = DirectionType::InternalMatrixType(d); @@ -482,7 +482,7 @@ TEST_F(ShapeLabelMapFixture, 2D_T1_2_Direction) image->SetPixel(itk::MakeIndex(5, 7), 1); image->SetPixel(itk::MakeIndex(5, 8), 1); - constexpr itk::SpacePrecisionType d[4] = { 0, 1.0, 1.0, 0 }; + constexpr itk::SpacePrecisionType d[4]{ 0, 1.0, 1.0, 0 }; const DirectionType direction = DirectionType::InternalMatrixType(d); diff --git a/Modules/Filtering/LabelMap/test/itkShapeLabelObjectAccessorsTest1.cxx b/Modules/Filtering/LabelMap/test/itkShapeLabelObjectAccessorsTest1.cxx index 904626eb934..36f7739d86c 100644 --- a/Modules/Filtering/LabelMap/test/itkShapeLabelObjectAccessorsTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkShapeLabelObjectAccessorsTest1.cxx @@ -36,7 +36,7 @@ itkShapeLabelObjectAccessorsTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 3; + constexpr unsigned int dim{ 3 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkShapeOpeningLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkShapeOpeningLabelMapFilterTest1.cxx index 0889c26da82..8ba8c1e9a36 100644 --- a/Modules/Filtering/LabelMap/test/itkShapeOpeningLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkShapeOpeningLabelMapFilterTest1.cxx @@ -38,7 +38,7 @@ itkShapeOpeningLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 3; + constexpr unsigned int dim{ 3 }; using PixelType = unsigned char; diff --git a/Modules/Filtering/LabelMap/test/itkShapePositionLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkShapePositionLabelMapFilterTest1.cxx index 0524706f448..ba5994d79a9 100644 --- a/Modules/Filtering/LabelMap/test/itkShapePositionLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkShapePositionLabelMapFilterTest1.cxx @@ -36,7 +36,7 @@ itkShapePositionLabelMapFilterTest1(int argc, char * argv[]) } // declare the dimension used, and the type of the input image - constexpr int dim = 3; + constexpr int dim{ 3 }; using PType = unsigned char; using IType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkShapeRelabelImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkShapeRelabelImageFilterTest1.cxx index d333ed2e2ed..46e629ea768 100644 --- a/Modules/Filtering/LabelMap/test/itkShapeRelabelImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkShapeRelabelImageFilterTest1.cxx @@ -36,7 +36,7 @@ itkShapeRelabelImageFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using IType = itk::Image; @@ -72,7 +72,7 @@ itkShapeRelabelImageFilterTest1(int argc, char * argv[]) const std::string attributeByName{ argv[5] }; opening->SetAttribute(attributeByName); // SetAttribute accepts a string for conversion to internal label code - constexpr RelabelType::AttributeType attributeByCode = RelabelType::LabelObjectType::LABEL; + constexpr RelabelType::AttributeType attributeByCode{ RelabelType::LabelObjectType::LABEL }; ITK_TEST_SET_GET_VALUE(attributeByCode, opening->GetAttribute()); const itk::SimpleFilterWatcher watcher(opening, "filter"); diff --git a/Modules/Filtering/LabelMap/test/itkShapeRelabelLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkShapeRelabelLabelMapFilterTest1.cxx index 022539af7a5..03cab841271 100644 --- a/Modules/Filtering/LabelMap/test/itkShapeRelabelLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkShapeRelabelLabelMapFilterTest1.cxx @@ -38,7 +38,7 @@ itkShapeRelabelLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using PixelType = unsigned char; diff --git a/Modules/Filtering/LabelMap/test/itkShapeUniqueLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkShapeUniqueLabelMapFilterTest1.cxx index dae142d011a..3b0a7c3aced 100644 --- a/Modules/Filtering/LabelMap/test/itkShapeUniqueLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkShapeUniqueLabelMapFilterTest1.cxx @@ -38,7 +38,7 @@ itkShapeUniqueLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 3; + constexpr unsigned int dim{ 3 }; using PixelType = unsigned char; diff --git a/Modules/Filtering/LabelMap/test/itkShiftLabelObjectTest.cxx b/Modules/Filtering/LabelMap/test/itkShiftLabelObjectTest.cxx index b6f1bbbea15..be929ddde59 100644 --- a/Modules/Filtering/LabelMap/test/itkShiftLabelObjectTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkShiftLabelObjectTest.cxx @@ -30,7 +30,7 @@ itkShiftLabelObjectTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 2; + constexpr int dim{ 2 }; using LabelObjectType = itk::LabelObject; using IndexType = LabelObjectType::IndexType; diff --git a/Modules/Filtering/LabelMap/test/itkShiftScaleLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkShiftScaleLabelMapFilterTest1.cxx index 6cd5bc811af..8449261f7d4 100644 --- a/Modules/Filtering/LabelMap/test/itkShiftScaleLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkShiftScaleLabelMapFilterTest1.cxx @@ -48,7 +48,7 @@ itkShiftScaleLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using ImageType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkStatisticsKeepNObjectsLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkStatisticsKeepNObjectsLabelMapFilterTest1.cxx index 8444a908ab9..6a8ef0d9bea 100644 --- a/Modules/Filtering/LabelMap/test/itkStatisticsKeepNObjectsLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkStatisticsKeepNObjectsLabelMapFilterTest1.cxx @@ -38,7 +38,7 @@ itkStatisticsKeepNObjectsLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 3; + constexpr unsigned int dim{ 3 }; using PixelType = unsigned char; diff --git a/Modules/Filtering/LabelMap/test/itkStatisticsLabelMapFilterGTest.cxx b/Modules/Filtering/LabelMap/test/itkStatisticsLabelMapFilterGTest.cxx index 2c29e24f9b9..ca96838aa14 100644 --- a/Modules/Filtering/LabelMap/test/itkStatisticsLabelMapFilterGTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkStatisticsLabelMapFilterGTest.cxx @@ -164,7 +164,7 @@ TEST_F(StatisticsLabelMapFixture, 2D_zero) auto image = Utils::CreateImage(); auto labelImage = Utils::CreateLabelImage(); - constexpr Utils::LabelPixelType label = 1; + constexpr Utils::LabelPixelType label{ 1 }; labelImage->FillBuffer(label); @@ -191,7 +191,7 @@ TEST_F(StatisticsLabelMapFixture, 2D_ones_with_outliers) using namespace itk::GTest::TypedefsAndConstructors::Dimension2; auto image = Utils::CreateImage(); - constexpr Utils::PixelType value = 1; + constexpr Utils::PixelType value{ 1 }; image->FillBuffer(value); // Test with outliers outside the label. @@ -200,7 +200,7 @@ TEST_F(StatisticsLabelMapFixture, 2D_ones_with_outliers) auto labelImage = Utils::CreateLabelImage(); - constexpr Utils::LabelPixelType label = 1; + constexpr Utils::LabelPixelType label{ 1 }; labelImage->FillBuffer(label); labelImage->SetPixel(itk::MakeIndex(0, 0), 0); labelImage->SetPixel(itk::MakeIndex(0, 1), 0); @@ -236,7 +236,7 @@ TEST_F(StatisticsLabelMapFixture, 2D_rand_with_outliers) image->SetPixel(itk::MakeIndex(0, 2), 0); image->SetPixel(itk::MakeIndex(0, 3), 500); - constexpr Utils::LabelPixelType label = 1; + constexpr Utils::LabelPixelType label{ 1 }; labelImage->FillBuffer(label); labelImage->SetPixel(itk::MakeIndex(0, 0), 0); labelImage->SetPixel(itk::MakeIndex(0, 1), 0); @@ -270,7 +270,7 @@ TEST_F(StatisticsLabelMapFixture, 2D_even) image->SetPixel(itk::MakeIndex(0, 2), 1); image->SetPixel(itk::MakeIndex(0, 3), 200); - constexpr Utils::LabelPixelType label = 1; + constexpr Utils::LabelPixelType label{ 1 }; labelImage->SetPixel(itk::MakeIndex(0, 0), label); labelImage->SetPixel(itk::MakeIndex(0, 1), label); labelImage->SetPixel(itk::MakeIndex(0, 2), label); @@ -307,7 +307,7 @@ TEST_F(StatisticsLabelMapFixture, 2D_three) image->SetPixel(itk::MakeIndex(0, 1), 3); image->SetPixel(itk::MakeIndex(0, 2), 10); - constexpr Utils::LabelPixelType label = 1; + constexpr Utils::LabelPixelType label{ 1 }; labelImage->SetPixel(itk::MakeIndex(0, 0), label); labelImage->SetPixel(itk::MakeIndex(0, 1), label); labelImage->SetPixel(itk::MakeIndex(0, 2), label); diff --git a/Modules/Filtering/LabelMap/test/itkStatisticsOpeningLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkStatisticsOpeningLabelMapFilterTest1.cxx index b85c1fd8bf3..87a704dc5c9 100644 --- a/Modules/Filtering/LabelMap/test/itkStatisticsOpeningLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkStatisticsOpeningLabelMapFilterTest1.cxx @@ -39,7 +39,7 @@ itkStatisticsOpeningLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 3; + constexpr unsigned int dim{ 3 }; using PixelType = unsigned char; diff --git a/Modules/Filtering/LabelMap/test/itkStatisticsPositionLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkStatisticsPositionLabelMapFilterTest1.cxx index 9137a4494a9..1e3f956c0f1 100644 --- a/Modules/Filtering/LabelMap/test/itkStatisticsPositionLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkStatisticsPositionLabelMapFilterTest1.cxx @@ -37,7 +37,7 @@ itkStatisticsPositionLabelMapFilterTest1(int argc, char * argv[]) } // declare the dimension used, and the type of the input image - constexpr int dim = 3; + constexpr int dim{ 3 }; using PType = unsigned char; using IType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkStatisticsRelabelImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkStatisticsRelabelImageFilterTest1.cxx index 2d939a224c5..0f161cdf3c9 100644 --- a/Modules/Filtering/LabelMap/test/itkStatisticsRelabelImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkStatisticsRelabelImageFilterTest1.cxx @@ -37,7 +37,7 @@ itkStatisticsRelabelImageFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using IType = itk::Image; diff --git a/Modules/Filtering/LabelMap/test/itkStatisticsRelabelLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkStatisticsRelabelLabelMapFilterTest1.cxx index 2833d84f03c..6e88d83b018 100644 --- a/Modules/Filtering/LabelMap/test/itkStatisticsRelabelLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkStatisticsRelabelLabelMapFilterTest1.cxx @@ -37,7 +37,7 @@ itkStatisticsRelabelLabelMapFilterTest1(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; diff --git a/Modules/Filtering/LabelMap/test/itkStatisticsUniqueLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkStatisticsUniqueLabelMapFilterTest1.cxx index 12d97f48a81..3200878a47c 100644 --- a/Modules/Filtering/LabelMap/test/itkStatisticsUniqueLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkStatisticsUniqueLabelMapFilterTest1.cxx @@ -80,7 +80,7 @@ itkStatisticsUniqueLabelMapFilterTest1(int argc, char * argv[]) const bool reverseOrdering = std::stoi(argv[4]); const unsigned int attribute = std::stoi(argv[5]); - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; @@ -97,7 +97,7 @@ itkStatisticsUniqueLabelMapFilterTest1(int argc, char * argv[]) // Dilate each label object to form overlapping label objects. - constexpr unsigned int radiusValue = 5; + constexpr unsigned int radiusValue{ 5 }; using LabelImageToLabelMapFilterType = itk::LabelImageToLabelMapFilter; auto labelMapConverter = LabelImageToLabelMapFilterType::New(); diff --git a/Modules/Filtering/LabelMap/test/itkUniqueLabelMapFiltersGTest.cxx b/Modules/Filtering/LabelMap/test/itkUniqueLabelMapFiltersGTest.cxx index 7d605e43594..eeeb81e1e9a 100644 --- a/Modules/Filtering/LabelMap/test/itkUniqueLabelMapFiltersGTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkUniqueLabelMapFiltersGTest.cxx @@ -77,7 +77,7 @@ class UniqueLabelMapFixture : public ::testing::Test static typename LabelImageType::Pointer CreateLabelImage(const std::vector & indices) { - constexpr size_t size = 25; + constexpr size_t size{ 25 }; auto image = LabelImageType::New(); auto imageSize = LabelImageType::SizeType::Filled(size); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkFlatStructuringElement.hxx b/Modules/Filtering/MathematicalMorphology/include/itkFlatStructuringElement.hxx index 632cb87d672..37b1a667cb8 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkFlatStructuringElement.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkFlatStructuringElement.hxx @@ -154,7 +154,7 @@ FlatStructuringElement::GeneratePolygon(itk::FlatStructuringElement< const float phi = (1.0 + std::sqrt(5.0)) / 2.0; float b = 1.0 / phi; float c = 2.0 - phi; - constexpr unsigned int facets = 12; + constexpr unsigned int facets{ 12 }; using FacetArrayType = std::vector; FacetArrayType FacetArray; FacetArray.resize(facets); @@ -409,7 +409,7 @@ FlatStructuringElement::GeneratePolygon(itk::FlatStructuringElement< const float phi = (1.0 + std::sqrt(5.0)) / 2.0; const float a = 0.5; const float b = 1.0 / (2.0 * phi); - constexpr unsigned int facets = 20; + constexpr unsigned int facets{ 20 }; using FacetArrayType = std::vector; FacetArrayType FacetArray; FacetArray.resize(facets); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkAnchorErodeDilateImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkAnchorErodeDilateImageFilterTest.cxx index 1a043d59871..067f74b9893 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkAnchorErodeDilateImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkAnchorErodeDilateImageFilterTest.cxx @@ -24,7 +24,7 @@ int itkAnchorErodeDilateImageFilterTest(int, char ** const) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkAnchorOpenCloseImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkAnchorOpenCloseImageFilterTest.cxx index befab84185f..d3a0f25bde0 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkAnchorOpenCloseImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkAnchorOpenCloseImageFilterTest.cxx @@ -24,7 +24,7 @@ int itkAnchorOpenCloseImageFilterTest(int, char ** const) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkClosingByReconstructionImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkClosingByReconstructionImageFilterTest.cxx index 1a61ab8736e..b1eb39c1436 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkClosingByReconstructionImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkClosingByReconstructionImageFilterTest.cxx @@ -35,7 +35,7 @@ itkClosingByReconstructionImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int Dimension = 2; + constexpr int Dimension{ 2 }; using PixelType = unsigned char; using InputImageType = itk::Image; using OutputImageType = itk::Image; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkDoubleThresholdImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkDoubleThresholdImageFilterTest.cxx index 0fde2d6245d..a097915a50d 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkDoubleThresholdImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkDoubleThresholdImageFilterTest.cxx @@ -42,7 +42,7 @@ itkDoubleThresholdImageFilterTest(int argc, char * argv[]) // The following code defines the input and output pixel types and their // associated image types. // - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned char; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest.cxx index 2e689c63321..ffc0890ecbf 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest.cxx @@ -27,9 +27,9 @@ ComputeAreaError(const SEType & k, unsigned int thickness = 0); int itkFlatStructuringElementTest(int, char *[]) { - constexpr int scalarRadius = 5; - constexpr int scalarThickness = 2; - constexpr bool radiusIsParametric = true; + constexpr int scalarRadius{ 5 }; + constexpr int scalarThickness{ 2 }; + constexpr bool radiusIsParametric{ true }; using SE2Type = itk::FlatStructuringElement<2>; auto r2 = itk::MakeFilled(scalarRadius); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest2.cxx b/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest2.cxx index dab093e952e..8b820e642a2 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest2.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest2.cxx @@ -135,7 +135,7 @@ itkFlatStructuringElementTest2(int argc, char * argv[]) lowerExtendRegion[0] = 1; lowerExtendRegion[1] = 1; padFilter->SetPadLowerBound(lowerExtendRegion); - constexpr ImageBoolType::PixelType constPixel = true; + constexpr ImageBoolType::PixelType constPixel{ true }; padFilter->SetConstant(constPixel); ITK_TRY_EXPECT_NO_EXCEPTION(padFilter->Update()); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleConnectedClosingImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleConnectedClosingImageFilterTest.cxx index b43b29aaa92..21cff2c455c 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleConnectedClosingImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleConnectedClosingImageFilterTest.cxx @@ -42,7 +42,7 @@ itkGrayscaleConnectedClosingImageFilterTest(int argc, char * argv[]) // The following code defines the input and output pixel types and their // associated image types. // - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned char; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleConnectedOpeningImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleConnectedOpeningImageFilterTest.cxx index 63a54fbd982..7af605e1a3a 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleConnectedOpeningImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleConnectedOpeningImageFilterTest.cxx @@ -42,7 +42,7 @@ itkGrayscaleConnectedOpeningImageFilterTest(int argc, char * argv[]) // The following code defines the input and output pixel types and their // associated image types. // - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned char; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleDilateImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleDilateImageFilterTest.cxx index de8dae19c52..a43c367e77f 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleDilateImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleDilateImageFilterTest.cxx @@ -37,7 +37,7 @@ itkGrayscaleDilateImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleErodeImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleErodeImageFilterTest.cxx index 711edc89bc9..4b0909b9a9a 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleErodeImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleErodeImageFilterTest.cxx @@ -37,7 +37,7 @@ itkGrayscaleErodeImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFillholeImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFillholeImageFilterTest.cxx index 258a9cf9252..a1068fc9753 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFillholeImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFillholeImageFilterTest.cxx @@ -43,7 +43,7 @@ itkGrayscaleFillholeImageFilterTest(int argc, char * argv[]) // The following code defines the input and output pixel types and their // associated image types. // - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = short; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFunctionDilateImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFunctionDilateImageFilterTest.cxx index f673caacf87..8fc9b844747 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFunctionDilateImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFunctionDilateImageFilterTest.cxx @@ -27,11 +27,11 @@ itkGrayscaleFunctionDilateImageFilterTest(int argc, char * argv[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 2; + constexpr unsigned int myDimension{ 2 }; // Define the values of the input images - constexpr unsigned short fgValue = 1; - constexpr unsigned short bgValue = 0; + constexpr unsigned short fgValue{ 1 }; + constexpr unsigned short bgValue{ 0 }; // Declare the types of the images using myImageType = itk::Image; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFunctionErodeImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFunctionErodeImageFilterTest.cxx index fd72fe68903..cba4af100e5 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFunctionErodeImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFunctionErodeImageFilterTest.cxx @@ -27,11 +27,11 @@ itkGrayscaleFunctionErodeImageFilterTest(int argc, char * argv[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 2; + constexpr unsigned int myDimension{ 2 }; // Define the values of the input images - constexpr unsigned short fgValue = 1; - constexpr unsigned short bgValue = 2; + constexpr unsigned short fgValue{ 1 }; + constexpr unsigned short bgValue{ 2 }; // Declare the types of the images using myImageType = itk::Image; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleGeodesicErodeDilateImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleGeodesicErodeDilateImageFilterTest.cxx index 0164e03819c..41799d2edeb 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleGeodesicErodeDilateImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleGeodesicErodeDilateImageFilterTest.cxx @@ -37,7 +37,7 @@ itkGrayscaleGeodesicErodeDilateImageFilterTest(int argc, char * argv[]) << " Inputimage OutputImage Height fullyConnected runOneIteration" << std::endl; return EXIT_FAILURE; } - constexpr int Dimension = 2; + constexpr int Dimension{ 2 }; using PixelType = unsigned char; using InputImageType = itk::Image; using OutputImageType = itk::Image; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleGrindPeakImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleGrindPeakImageFilterTest.cxx index 6f044c04fed..8d2cf286e81 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleGrindPeakImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleGrindPeakImageFilterTest.cxx @@ -41,7 +41,7 @@ itkGrayscaleGrindPeakImageFilterTest(int argc, char * argv[]) // The following code defines the input and output pixel types and their // associated image types. // - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned char; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalClosingImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalClosingImageFilterTest.cxx index 224c8f9e6c5..f4d39a23c4a 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalClosingImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalClosingImageFilterTest.cxx @@ -35,7 +35,7 @@ itkGrayscaleMorphologicalClosingImageFilterTest(int argc, char * argv[]) } // Define the dimension of the images - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; // Define the pixel type using PixelType = unsigned char; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalClosingImageFilterTest2.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalClosingImageFilterTest2.cxx index 1ea85be1974..2cb850bdb01 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalClosingImageFilterTest2.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalClosingImageFilterTest2.cxx @@ -39,7 +39,7 @@ itkGrayscaleMorphologicalClosingImageFilterTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalOpeningImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalOpeningImageFilterTest.cxx index 22811fa9b1b..0ee230a4111 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalOpeningImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalOpeningImageFilterTest.cxx @@ -35,7 +35,7 @@ itkGrayscaleMorphologicalOpeningImageFilterTest(int argc, char * argv[]) } // Define the dimension of the images - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; // Define the pixel type using PixelType = unsigned char; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalOpeningImageFilterTest2.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalOpeningImageFilterTest2.cxx index 927bdb2fa7f..6e454fa7e9e 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalOpeningImageFilterTest2.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalOpeningImageFilterTest2.cxx @@ -39,7 +39,7 @@ itkGrayscaleMorphologicalOpeningImageFilterTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkHConcaveImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkHConcaveImageFilterTest.cxx index a72bf12c12c..d9a148d9e90 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkHConcaveImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkHConcaveImageFilterTest.cxx @@ -40,7 +40,7 @@ itkHConcaveImageFilterTest(int argc, char * argv[]) // The following code defines the input and output pixel types and their // associated image types. // - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkHConvexConcaveImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkHConvexConcaveImageFilterTest.cxx index 97884de2030..5f165a5ff0e 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkHConvexConcaveImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkHConvexConcaveImageFilterTest.cxx @@ -42,7 +42,7 @@ itkHConvexConcaveImageFilterTest(int argc, char * argv[]) // The following code defines the input and output pixel types and their // associated image types. // - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = float; using OutputPixelType = float; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkHConvexImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkHConvexImageFilterTest.cxx index 4849484e3ba..e22d9b38b7c 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkHConvexImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkHConvexImageFilterTest.cxx @@ -40,7 +40,7 @@ itkHConvexImageFilterTest(int argc, char * argv[]) // The following code defines the input and output pixel types and their // associated image types. // - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkHMaximaImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkHMaximaImageFilterTest.cxx index 3a8999cc038..8e647056ab4 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkHMaximaImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkHMaximaImageFilterTest.cxx @@ -40,7 +40,7 @@ itkHMaximaImageFilterTest(int argc, char * argv[]) // The following code defines the input and output pixel types and their // associated image types. // - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkHMaximaMinimaImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkHMaximaMinimaImageFilterTest.cxx index 3d69cfdfe78..58012f23876 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkHMaximaMinimaImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkHMaximaMinimaImageFilterTest.cxx @@ -39,7 +39,7 @@ itkHMaximaMinimaImageFilterTest(int argc, char * argv[]) // The following code defines the input and output pixel types and their // associated image types. // - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InternalPixelType = short; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkHMinimaImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkHMinimaImageFilterTest.cxx index 0823c6ed40a..3e185c165b8 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkHMinimaImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkHMinimaImageFilterTest.cxx @@ -40,7 +40,7 @@ itkHMinimaImageFilterTest(int argc, char * argv[]) // The following code defines the input and output pixel types and their // associated image types. // - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleDilateImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleDilateImageFilterTest.cxx index d933ccff57b..1f7aa4b8ee4 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleDilateImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleDilateImageFilterTest.cxx @@ -37,7 +37,7 @@ itkMapGrayscaleDilateImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleErodeImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleErodeImageFilterTest.cxx index 461d71afb94..08794ef2ef8 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleErodeImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleErodeImageFilterTest.cxx @@ -37,7 +37,7 @@ itkMapGrayscaleErodeImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalClosingImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalClosingImageFilterTest.cxx index 954451a1230..0903f06a9d9 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalClosingImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalClosingImageFilterTest.cxx @@ -38,7 +38,7 @@ itkMapGrayscaleMorphologicalClosingImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalOpeningImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalOpeningImageFilterTest.cxx index 8bd29e48c55..e7dde6dbd82 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalOpeningImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalOpeningImageFilterTest.cxx @@ -38,7 +38,7 @@ itkMapGrayscaleMorphologicalOpeningImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMorphologicalGradientImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMorphologicalGradientImageFilterTest.cxx index 0b6c5c61fbf..6319f62a4e4 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMorphologicalGradientImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMorphologicalGradientImageFilterTest.cxx @@ -33,7 +33,7 @@ itkMorphologicalGradientImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 2; + constexpr int dim{ 2 }; using PType = unsigned char; using IType = itk::Image; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMorphologicalGradientImageFilterTest2.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMorphologicalGradientImageFilterTest2.cxx index 18d22f7b28f..78dbf768993 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMorphologicalGradientImageFilterTest2.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMorphologicalGradientImageFilterTest2.cxx @@ -34,7 +34,7 @@ itkMorphologicalGradientImageFilterTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 2; + constexpr int dim{ 2 }; using PType = unsigned char; using IType = itk::Image; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMovingHistogramMorphologyImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMovingHistogramMorphologyImageFilterTest.cxx index 1c04fae74d6..f17770cd9a8 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMovingHistogramMorphologyImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMovingHistogramMorphologyImageFilterTest.cxx @@ -25,7 +25,7 @@ int itkMovingHistogramMorphologyImageFilterTest(int, char ** const) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using ImageType = itk::Image; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkObjectMorphologyImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkObjectMorphologyImageFilterTest.cxx index 6f1955dee60..cbb90f7ca5b 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkObjectMorphologyImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkObjectMorphologyImageFilterTest.cxx @@ -33,11 +33,11 @@ int itkObjectMorphologyImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; // Define the values of the input images - constexpr unsigned short fgValue = 1; - constexpr unsigned short bgValue = 0; + constexpr unsigned short fgValue{ 1 }; + constexpr unsigned short bgValue{ 0 }; // Declare the types of the images using myImageType = itk::Image; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkOpeningByReconstructionImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkOpeningByReconstructionImageFilterTest.cxx index e715d666879..d25833659b9 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkOpeningByReconstructionImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkOpeningByReconstructionImageFilterTest.cxx @@ -34,7 +34,7 @@ itkOpeningByReconstructionImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int Dimension = 2; + constexpr int Dimension{ 2 }; using PixelType = unsigned char; using InputImageType = itk::Image; using OutputImageType = itk::Image; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkOpeningByReconstructionImageFilterTest2.cxx b/Modules/Filtering/MathematicalMorphology/test/itkOpeningByReconstructionImageFilterTest2.cxx index 2e8aa3c528f..11d3cff48bf 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkOpeningByReconstructionImageFilterTest2.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkOpeningByReconstructionImageFilterTest2.cxx @@ -35,7 +35,7 @@ itkOpeningByReconstructionImageFilterTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int Dimension = 2; + constexpr int Dimension{ 2 }; using PixelType = unsigned char; using InputImageType = itk::Image; using OutputImageType = itk::Image; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkRemoveBoundaryObjectsTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkRemoveBoundaryObjectsTest.cxx index 9bdb638507b..906034af247 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkRemoveBoundaryObjectsTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkRemoveBoundaryObjectsTest.cxx @@ -43,7 +43,7 @@ itkRemoveBoundaryObjectsTest(int argc, char * argv[]) // The following code defines the input and output pixel types and their // associated image types. // - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned char; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkRemoveBoundaryObjectsTest2.cxx b/Modules/Filtering/MathematicalMorphology/test/itkRemoveBoundaryObjectsTest2.cxx index 9d16215caa4..b56f209721a 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkRemoveBoundaryObjectsTest2.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkRemoveBoundaryObjectsTest2.cxx @@ -41,7 +41,7 @@ itkRemoveBoundaryObjectsTest2(int argc, char * argv[]) // The following code defines the input and output pixel types and their // associated image types. // - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned char; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkTopHatImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkTopHatImageFilterTest.cxx index 15fc22ceeea..d5350f29ba3 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkTopHatImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkTopHatImageFilterTest.cxx @@ -91,7 +91,7 @@ itkTopHatImageFilterTest(int argc, char * argv[]) } // Define the dimension of the images - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; // Define the pixel type using PixelType = unsigned char; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkValuedRegionalMaximaImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkValuedRegionalMaximaImageFilterTest.cxx index 06f06066997..ca837e3d042 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkValuedRegionalMaximaImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkValuedRegionalMaximaImageFilterTest.cxx @@ -41,7 +41,7 @@ itkValuedRegionalMaximaImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkValuedRegionalMinimaImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkValuedRegionalMinimaImageFilterTest.cxx index 2d60f9b005b..30860ea498d 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkValuedRegionalMinimaImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkValuedRegionalMinimaImageFilterTest.cxx @@ -43,7 +43,7 @@ itkValuedRegionalMinimaImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkVanHerkGilWermanErodeDilateImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkVanHerkGilWermanErodeDilateImageFilterTest.cxx index c08f34d3cf7..dea3067fa6d 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkVanHerkGilWermanErodeDilateImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkVanHerkGilWermanErodeDilateImageFilterTest.cxx @@ -24,7 +24,7 @@ int itkVanHerkGilWermanErodeDilateImageFilterTest(int, char ** const) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using ImageType = itk::Image; diff --git a/Modules/Filtering/Path/test/itkChainCodePathTest.cxx b/Modules/Filtering/Path/test/itkChainCodePathTest.cxx index 402b86f6951..3970a0f1176 100644 --- a/Modules/Filtering/Path/test/itkChainCodePathTest.cxx +++ b/Modules/Filtering/Path/test/itkChainCodePathTest.cxx @@ -23,7 +23,7 @@ int itkChainCodePathTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PathType = itk::ChainCodePath; using IndexType = PathType::IndexType; diff --git a/Modules/Filtering/Path/test/itkChainCodeToFourierSeriesPathFilterTest.cxx b/Modules/Filtering/Path/test/itkChainCodeToFourierSeriesPathFilterTest.cxx index 39a09540503..a2e36df04f9 100644 --- a/Modules/Filtering/Path/test/itkChainCodeToFourierSeriesPathFilterTest.cxx +++ b/Modules/Filtering/Path/test/itkChainCodeToFourierSeriesPathFilterTest.cxx @@ -27,7 +27,7 @@ int itkChainCodeToFourierSeriesPathFilterTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PolyLinePathType = itk::PolyLineParametricPath; using ChainPathType = itk::ChainCodePath; using FSPathType = itk::FourierSeriesPath; diff --git a/Modules/Filtering/Path/test/itkContourExtractor2DImageFilterTest.cxx b/Modules/Filtering/Path/test/itkContourExtractor2DImageFilterTest.cxx index 9abc06d8a01..21dcae4ce08 100644 --- a/Modules/Filtering/Path/test/itkContourExtractor2DImageFilterTest.cxx +++ b/Modules/Filtering/Path/test/itkContourExtractor2DImageFilterTest.cxx @@ -25,7 +25,7 @@ namespace itkContourExtractor2DImageFilterTestNamespace { -constexpr unsigned int Dimension = 2; +constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; @@ -34,7 +34,7 @@ using VertexType = ExtractorType::VertexType; using MyVertexType = std::pair; using MyVertexListType = std::vector; using MyVertexListList = std::vector; -constexpr float FLOAT_EPSILON = 0.0001; +constexpr float FLOAT_EPSILON{ 0.0001 }; } // namespace itkContourExtractor2DImageFilterTestNamespace /* ----------------------------------------------------------------------- */ @@ -719,7 +719,7 @@ itkContourExtractor2DImageFilterTest(int argc, char * argv[]) std::cout << "Test 6 ..."; { using PixelType = unsigned char; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ImageType = itk::Image; using ImagePointer = typename ImageType::Pointer; using RegionType = typename ImageType::RegionType; diff --git a/Modules/Filtering/Path/test/itkExtractOrthogonalSwath2DImageFilterTest.cxx b/Modules/Filtering/Path/test/itkExtractOrthogonalSwath2DImageFilterTest.cxx index 56ec6d84aaf..0728ce09416 100644 --- a/Modules/Filtering/Path/test/itkExtractOrthogonalSwath2DImageFilterTest.cxx +++ b/Modules/Filtering/Path/test/itkExtractOrthogonalSwath2DImageFilterTest.cxx @@ -35,7 +35,7 @@ itkExtractOrthogonalSwath2DImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/Path/test/itkFourierSeriesPathTest.cxx b/Modules/Filtering/Path/test/itkFourierSeriesPathTest.cxx index daf0b3cc8bc..f2cdeb29682 100644 --- a/Modules/Filtering/Path/test/itkFourierSeriesPathTest.cxx +++ b/Modules/Filtering/Path/test/itkFourierSeriesPathTest.cxx @@ -23,7 +23,7 @@ int itkFourierSeriesPathTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PathType = itk::FourierSeriesPath; using InputType = PathType::InputType; using OffsetType = PathType::OffsetType; diff --git a/Modules/Filtering/Path/test/itkHilbertPathTest.cxx b/Modules/Filtering/Path/test/itkHilbertPathTest.cxx index dd709668590..5f745c319f8 100644 --- a/Modules/Filtering/Path/test/itkHilbertPathTest.cxx +++ b/Modules/Filtering/Path/test/itkHilbertPathTest.cxx @@ -86,7 +86,7 @@ itkHilbertPathTest(int, char *[]) int testStatus = EXIT_SUCCESS; // Set a maximum Hilbert path order - constexpr unsigned int maxHilbertPathOder = 5; + constexpr unsigned int maxHilbertPathOder{ 5 }; // Test dimension = 2 using HilbertPathType2D = itk::HilbertPath; diff --git a/Modules/Filtering/Path/test/itkOrthogonalSwath2DPathFilterTest.cxx b/Modules/Filtering/Path/test/itkOrthogonalSwath2DPathFilterTest.cxx index 76fb6ea6c46..7192de0cf16 100644 --- a/Modules/Filtering/Path/test/itkOrthogonalSwath2DPathFilterTest.cxx +++ b/Modules/Filtering/Path/test/itkOrthogonalSwath2DPathFilterTest.cxx @@ -36,7 +36,7 @@ int itkOrthogonalSwath2DPathFilterTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using UCharPixelType = unsigned char; using DoublePixelType = double; @@ -141,13 +141,13 @@ itkOrthogonalSwath2DPathFilterTest(int, char *[]) // Smooth the (double pixel type) input image auto smoothFilter = SmoothFilterType::New(); smoothFilter->SetInput(castFilter->GetOutput()); - constexpr double gaussianVariance = 1.0; + constexpr double gaussianVariance{ 1.0 }; // We want a fast 3x3 kernel. A Gaussian operator will not truncate its kernel // width to any less than a 5x5 kernel (kernel width of 3 for 1 center pixel + // 2 edge pixels). However, a Gaussian operator always uses at least a 3x3 // kernel, and so setting the maximum error to 1.0 (no limit) will make it // stop growing the kernel at the desired 3x3 size. - constexpr double maxError = 0.9; + constexpr double maxError{ 0.9 }; smoothFilter->UseImageSpacingOff(); smoothFilter->SetVariance(gaussianVariance); smoothFilter->SetMaximumError(maxError); diff --git a/Modules/Filtering/Path/test/itkOrthogonallyCorrected2DParametricPathTest.cxx b/Modules/Filtering/Path/test/itkOrthogonallyCorrected2DParametricPathTest.cxx index e709507726d..33365eab3aa 100644 --- a/Modules/Filtering/Path/test/itkOrthogonallyCorrected2DParametricPathTest.cxx +++ b/Modules/Filtering/Path/test/itkOrthogonallyCorrected2DParametricPathTest.cxx @@ -24,7 +24,7 @@ int itkOrthogonallyCorrected2DParametricPathTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PathType = itk::OrthogonallyCorrected2DParametricPath; using OriginalPathType = itk::PolyLineParametricPath; diff --git a/Modules/Filtering/Path/test/itkPathFunctionsTest.cxx b/Modules/Filtering/Path/test/itkPathFunctionsTest.cxx index ea1cef407d3..2085eb84950 100644 --- a/Modules/Filtering/Path/test/itkPathFunctionsTest.cxx +++ b/Modules/Filtering/Path/test/itkPathFunctionsTest.cxx @@ -27,7 +27,7 @@ int itkPathFunctionsTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = double; using ImageType = itk::Image; diff --git a/Modules/Filtering/Path/test/itkPathIteratorTest.cxx b/Modules/Filtering/Path/test/itkPathIteratorTest.cxx index ea731271c86..b167eb016a0 100644 --- a/Modules/Filtering/Path/test/itkPathIteratorTest.cxx +++ b/Modules/Filtering/Path/test/itkPathIteratorTest.cxx @@ -25,7 +25,7 @@ int itkPathIteratorTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = double; using ImageType = itk::Image; diff --git a/Modules/Filtering/Path/test/itkPathToChainCodePathFilterTest.cxx b/Modules/Filtering/Path/test/itkPathToChainCodePathFilterTest.cxx index ee753e34310..fcc8028e673 100644 --- a/Modules/Filtering/Path/test/itkPathToChainCodePathFilterTest.cxx +++ b/Modules/Filtering/Path/test/itkPathToChainCodePathFilterTest.cxx @@ -25,7 +25,7 @@ int itkPathToChainCodePathFilterTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InPathType = itk::PolyLineParametricPath; using ChainPathType = itk::ChainCodePath2D; diff --git a/Modules/Filtering/Path/test/itkPathToImageFilterTest.cxx b/Modules/Filtering/Path/test/itkPathToImageFilterTest.cxx index fe4459540f7..0fe37337ff8 100644 --- a/Modules/Filtering/Path/test/itkPathToImageFilterTest.cxx +++ b/Modules/Filtering/Path/test/itkPathToImageFilterTest.cxx @@ -25,7 +25,7 @@ int itkPathToImageFilterTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = double; using ImageType = itk::Image; @@ -60,11 +60,11 @@ itkPathToImageFilterTest(int, char *[]) pathToImageFilter->SetInput(path); - constexpr PathToImageFilterType::ValueType pathValue = 1; + constexpr PathToImageFilterType::ValueType pathValue{ 1 }; pathToImageFilter->SetPathValue(pathValue); ITK_TEST_SET_GET_VALUE(pathValue, pathToImageFilter->GetPathValue()); - constexpr PathToImageFilterType::ValueType backgroundValue = 0; + constexpr PathToImageFilterType::ValueType backgroundValue{ 0 }; pathToImageFilter->SetBackgroundValue(backgroundValue); ITK_TEST_SET_GET_VALUE(backgroundValue, pathToImageFilter->GetBackgroundValue()); diff --git a/Modules/Filtering/Path/test/itkPolyLineParametricPathTest.cxx b/Modules/Filtering/Path/test/itkPolyLineParametricPathTest.cxx index d627bc78dea..be1efece4f8 100644 --- a/Modules/Filtering/Path/test/itkPolyLineParametricPathTest.cxx +++ b/Modules/Filtering/Path/test/itkPolyLineParametricPathTest.cxx @@ -23,7 +23,7 @@ int itkPolyLineParametricPathTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PathType = itk::PolyLineParametricPath; using InputType = PathType::InputType; diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkBinaryMask3DQuadEdgeMeshSourceTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkBinaryMask3DQuadEdgeMeshSourceTest.cxx index 70d2e16a2d6..08e3e7981b2 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkBinaryMask3DQuadEdgeMeshSourceTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkBinaryMask3DQuadEdgeMeshSourceTest.cxx @@ -28,7 +28,7 @@ itkBinaryMask3DQuadEdgeMeshSourceTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Declare the types of the output images using ImageType = itk::Image; @@ -47,8 +47,8 @@ itkBinaryMask3DQuadEdgeMeshSourceTest(int, char *[]) using MeshSourceType = itk::BinaryMask3DMeshSource; - constexpr PixelType backgroundValue = 0; - constexpr PixelType internalValue = 1; + constexpr PixelType backgroundValue{ 0 }; + constexpr PixelType internalValue{ 1 }; SizeType size; size[0] = 128; diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkCleanQuadEdgeMeshFilterTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkCleanQuadEdgeMeshFilterTest.cxx index 99961736a94..6548ae780b4 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkCleanQuadEdgeMeshFilterTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkCleanQuadEdgeMeshFilterTest.cxx @@ -39,7 +39,7 @@ itkCleanQuadEdgeMeshFilterTest(int argc, char * argv[]) // ** TYPEDEF ** using Coord = double; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using MeshType = itk::QuadEdgeMesh; using ReaderType = itk::MeshFileReader; @@ -71,7 +71,7 @@ itkCleanQuadEdgeMeshFilterTest(int argc, char * argv[]) ITK_TEST_SET_GET_VALUE(absTol, filter->GetAbsoluteTolerance()); filter->SetRelativeTolerance(tol); - constexpr Coord epsilon = 1e-6; + constexpr Coord epsilon{ 1e-6 }; const Coord obtainedValue = filter->GetRelativeTolerance(); if (!itk::Math::FloatAlmostEqual(tol, obtainedValue, 10, epsilon)) { diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDelaunayConformingQuadEdgeMeshFilterTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDelaunayConformingQuadEdgeMeshFilterTest.cxx index d77f96ec766..5f4f31e43e8 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDelaunayConformingQuadEdgeMeshFilterTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDelaunayConformingQuadEdgeMeshFilterTest.cxx @@ -49,7 +49,7 @@ itkDelaunayConformingQuadEdgeMeshFilterTestHelper(const std::string & input, const auto generator = GeneratorType::New(); generator->Initialize(0); - constexpr double sigma = 0.01; + constexpr double sigma{ 0.01 }; for (auto it = mesh->GetPoints()->Begin(); it != mesh->GetPoints()->End(); ++it) { diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteGaussianCurvatureQuadEdgeMeshFilterTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteGaussianCurvatureQuadEdgeMeshFilterTest.cxx index 098f2190e31..e4d9623b78d 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteGaussianCurvatureQuadEdgeMeshFilterTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteGaussianCurvatureQuadEdgeMeshFilterTest.cxx @@ -33,7 +33,7 @@ itkDiscreteGaussianCurvatureQuadEdgeMeshFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using CoordType = double; using Traits = itk::QuadEdgeMeshExtendedTraits; diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMaximumCurvatureQuadEdgeMeshFilterTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMaximumCurvatureQuadEdgeMeshFilterTest.cxx index 8db3f39675c..f3775fbcff4 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMaximumCurvatureQuadEdgeMeshFilterTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMaximumCurvatureQuadEdgeMeshFilterTest.cxx @@ -32,7 +32,7 @@ itkDiscreteMaximumCurvatureQuadEdgeMeshFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using CoordType = double; using Traits = itk::QuadEdgeMeshExtendedTraits; diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMeanCurvatureQuadEdgeMeshFilterTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMeanCurvatureQuadEdgeMeshFilterTest.cxx index 74560d5a05f..9cc0ba7464a 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMeanCurvatureQuadEdgeMeshFilterTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMeanCurvatureQuadEdgeMeshFilterTest.cxx @@ -32,7 +32,7 @@ itkDiscreteMeanCurvatureQuadEdgeMeshFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using CoordType = double; using Traits = itk::QuadEdgeMeshExtendedTraits; diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMinimumCurvatureQuadEdgeMeshFilterTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMinimumCurvatureQuadEdgeMeshFilterTest.cxx index a78344936c4..d9cd9e37d7d 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMinimumCurvatureQuadEdgeMeshFilterTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMinimumCurvatureQuadEdgeMeshFilterTest.cxx @@ -32,7 +32,7 @@ itkDiscreteMinimumCurvatureQuadEdgeMeshFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using CoordType = double; using Traits = itk::QuadEdgeMeshExtendedTraits; diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkLaplacianDeformationQuadEdgeMeshFilterWithHardConstraintsTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkLaplacianDeformationQuadEdgeMeshFilterWithHardConstraintsTest.cxx index cc65ddceb31..b55d253fb21 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkLaplacianDeformationQuadEdgeMeshFilterWithHardConstraintsTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkLaplacianDeformationQuadEdgeMeshFilterWithHardConstraintsTest.cxx @@ -36,7 +36,7 @@ itkLaplacianDeformationQuadEdgeMeshFilterWithHardConstraintsTest(int argc, char return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using CoordType = double; using MeshType = itk::QuadEdgeMesh; @@ -56,7 +56,7 @@ itkLaplacianDeformationQuadEdgeMeshFilterWithHardConstraintsTest(int argc, char filter->SetInput(reader->GetOutput()); - constexpr unsigned int order = 2; + constexpr unsigned int order{ 2 }; filter->SetOrder(order); ITK_TEST_SET_GET_VALUE(order, filter->GetOrder()); diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkLaplacianDeformationQuadEdgeMeshFilterWithSoftConstraintsTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkLaplacianDeformationQuadEdgeMeshFilterWithSoftConstraintsTest.cxx index 75cc129c97b..c9e5cd8d764 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkLaplacianDeformationQuadEdgeMeshFilterWithSoftConstraintsTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkLaplacianDeformationQuadEdgeMeshFilterWithSoftConstraintsTest.cxx @@ -36,7 +36,7 @@ itkLaplacianDeformationQuadEdgeMeshFilterWithSoftConstraintsTest(int argc, char return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using CoordType = double; using MeshType = itk::QuadEdgeMesh; diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkNormalQuadEdgeMeshFilterTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkNormalQuadEdgeMeshFilterTest.cxx index 71406a74ff7..a35551c899a 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkNormalQuadEdgeMeshFilterTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkNormalQuadEdgeMeshFilterTest.cxx @@ -36,7 +36,7 @@ itkNormalQuadEdgeMeshFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using CoordType = double; using InputMeshType = itk::QuadEdgeMesh; diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkQuadricDecimationQuadEdgeMeshFilterTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkQuadricDecimationQuadEdgeMeshFilterTest.cxx index feb15d96c0f..5fd44c5f792 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkQuadricDecimationQuadEdgeMeshFilterTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkQuadricDecimationQuadEdgeMeshFilterTest.cxx @@ -38,7 +38,7 @@ itkQuadricDecimationQuadEdgeMeshFilterTest(int argc, char * argv[]) // ** TYPEDEF ** using CoordType = double; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using MeshType = itk::QuadEdgeMesh; using ReaderType = itk::MeshFileReader; diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkSmoothingQuadEdgeMeshFilterTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkSmoothingQuadEdgeMeshFilterTest.cxx index 541c943c99a..2bf5cc451a1 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkSmoothingQuadEdgeMeshFilterTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkSmoothingQuadEdgeMeshFilterTest.cxx @@ -37,7 +37,7 @@ itkSmoothingQuadEdgeMeshFilterTest(int argc, char * argv[]) // ** TYPEDEF ** using Coord = float; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using MeshType = itk::QuadEdgeMesh; using ReaderType = itk::MeshFileReader; diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkSquaredEdgeLengthDecimationQuadEdgeMeshFilterTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkSquaredEdgeLengthDecimationQuadEdgeMeshFilterTest.cxx index 3626bdf528c..71f61b3a570 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkSquaredEdgeLengthDecimationQuadEdgeMeshFilterTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkSquaredEdgeLengthDecimationQuadEdgeMeshFilterTest.cxx @@ -38,7 +38,7 @@ itkSquaredEdgeLengthDecimationQuadEdgeMeshFilterTest(int argc, char * argv[]) // ** TYPEDEF ** using CoordType = double; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using MeshType = itk::QuadEdgeMesh; using ReaderType = itk::MeshFileReader; diff --git a/Modules/Filtering/Smoothing/include/itkRecursiveGaussianImageFilter.hxx b/Modules/Filtering/Smoothing/include/itkRecursiveGaussianImageFilter.hxx index df9b960f30d..f8b3902574d 100644 --- a/Modules/Filtering/Smoothing/include/itkRecursiveGaussianImageFilter.hxx +++ b/Modules/Filtering/Smoothing/include/itkRecursiveGaussianImageFilter.hxx @@ -67,7 +67,7 @@ template void RecursiveGaussianImageFilter::SetUp(ScalarRealType spacing) { - constexpr ScalarRealType spacingTolerance = 1e-8; + constexpr ScalarRealType spacingTolerance{ 1e-8 }; /** Parameters of exponential series. */ ScalarRealType A1[3]; diff --git a/Modules/Filtering/Smoothing/test/itkDiscreteGaussianImageFilterTest.cxx b/Modules/Filtering/Smoothing/test/itkDiscreteGaussianImageFilterTest.cxx index 06d6f12060e..d03e199321f 100644 --- a/Modules/Filtering/Smoothing/test/itkDiscreteGaussianImageFilterTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkDiscreteGaussianImageFilterTest.cxx @@ -35,7 +35,7 @@ itkDiscreteGaussianImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = float; @@ -63,7 +63,7 @@ itkDiscreteGaussianImageFilterTest(int argc, char * argv[]) filter->SetMaximumError(array.GetDataPointer()); // Set the value of the standard deviation of the Gaussian used for smoothing - constexpr FilterType::SigmaArrayType::ValueType sigmaValue = 1.0; + constexpr FilterType::SigmaArrayType::ValueType sigmaValue{ 1.0 }; auto sigma = itk::MakeFilled(sigmaValue); filter->SetSigma(sigmaValue); @@ -84,17 +84,17 @@ itkDiscreteGaussianImageFilterTest(int argc, char * argv[]) ITK_TEST_SET_GET_VALUE(&constantBoundaryCondition, filter->GetRealBoundaryCondition()); // Set other filter properties - constexpr FilterType::ArrayType::ValueType varianceValue = 1.0; + constexpr FilterType::ArrayType::ValueType varianceValue{ 1.0 }; auto variance = itk::MakeFilled(varianceValue); filter->SetVariance(variance); ITK_TEST_SET_GET_VALUE(variance, filter->GetVariance()); - constexpr FilterType::ArrayType::ValueType maximumErrorValue = 0.01; + constexpr FilterType::ArrayType::ValueType maximumErrorValue{ 0.01 }; auto maximumError = itk::MakeFilled(maximumErrorValue); filter->SetMaximumError(maximumError); ITK_TEST_SET_GET_VALUE(maximumError, filter->GetMaximumError()); - constexpr unsigned int maximumKernelWidth = 32; + constexpr unsigned int maximumKernelWidth{ 32 }; filter->SetMaximumKernelWidth(maximumKernelWidth); ITK_TEST_SET_GET_VALUE(maximumKernelWidth, filter->GetMaximumKernelWidth()); @@ -103,7 +103,7 @@ itkDiscreteGaussianImageFilterTest(int argc, char * argv[]) // Verify kernel radius matches expectations for test parameters filter->UseImageSpacingOff(); - constexpr unsigned int EXPECTED_RADIUS = 3; + constexpr unsigned int EXPECTED_RADIUS{ 3 }; auto radius = filter->GetKernelRadius(); auto kernelSize = filter->GetKernelSize(); for (unsigned int idx = 0; idx < Dimension; ++idx) diff --git a/Modules/Filtering/Smoothing/test/itkFFTDiscreteGaussianImageFilterFactoryTest.cxx b/Modules/Filtering/Smoothing/test/itkFFTDiscreteGaussianImageFilterFactoryTest.cxx index 3dd5b58d862..26f3504cbc8 100644 --- a/Modules/Filtering/Smoothing/test/itkFFTDiscreteGaussianImageFilterFactoryTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkFFTDiscreteGaussianImageFilterFactoryTest.cxx @@ -27,7 +27,7 @@ int itkFFTDiscreteGaussianImageFilterFactoryTest(int, char *[]) { - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using PixelType = float; using ImageType = itk::Image; using BaseFilterType = itk::DiscreteGaussianImageFilter; diff --git a/Modules/Filtering/Smoothing/test/itkFFTDiscreteGaussianImageFilterTest.cxx b/Modules/Filtering/Smoothing/test/itkFFTDiscreteGaussianImageFilterTest.cxx index 90623e49351..3c8baf98fb7 100644 --- a/Modules/Filtering/Smoothing/test/itkFFTDiscreteGaussianImageFilterTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkFFTDiscreteGaussianImageFilterTest.cxx @@ -51,7 +51,7 @@ itkFFTDiscreteGaussianImageFilterTestProcedure(int argc, char ** argv) } for (auto & param : filter->GetVariance()) { - constexpr double tolerance = 1e-6; + constexpr double tolerance{ 1e-6 }; ITK_TEST_EXPECT_TRUE(std::fabs((sigma * sigma) - param) < tolerance); } diff --git a/Modules/Filtering/Smoothing/test/itkMeanImageFilterTest.cxx b/Modules/Filtering/Smoothing/test/itkMeanImageFilterTest.cxx index e452c9b20b9..8a05e42c2e3 100644 --- a/Modules/Filtering/Smoothing/test/itkMeanImageFilterTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkMeanImageFilterTest.cxx @@ -31,7 +31,7 @@ itkMeanImageFilterTest(int, char *[]) // Comment the following if you want to use the itk text output window itk::OutputWindow::SetInstance(itk::TextOutput::New()); - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using FloatImage2DType = itk::Image; diff --git a/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFilterOnTensorsTest.cxx b/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFilterOnTensorsTest.cxx index c4775b83f56..4d25dea6ab4 100644 --- a/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFilterOnTensorsTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFilterOnTensorsTest.cxx @@ -26,9 +26,9 @@ itkRecursiveGaussianImageFilterOnTensorsTest(int, char *[]) // and (1,6) set to 'tensor1'. We will filter it using // RecursiveGaussianImageFilter and compare a few filtered pixels. // - constexpr unsigned int Dimension = 2; - constexpr double sigma = 1; - constexpr double tolerance = 0.001; + constexpr unsigned int Dimension{ 2 }; + constexpr double sigma{ 1 }; + constexpr double tolerance{ 0.001 }; // Create ON and OFF tensors. using Double3DTensorType = itk::SymmetricSecondRankTensor; diff --git a/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFilterOnVectorImageTest.cxx b/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFilterOnVectorImageTest.cxx index c49f8f85554..5256eb1f52c 100644 --- a/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFilterOnVectorImageTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFilterOnVectorImageTest.cxx @@ -26,11 +26,11 @@ itkRecursiveGaussianImageFilterOnVectorImageTest(int, char *[]) // and (1,6) set to 'vector1'. We will filter it using // RecursiveGaussianImageFilter and compare a few filtered pixels. // - constexpr unsigned int Dimension = 2; - constexpr double sigma = 1; - constexpr double tolerance = 0.001; + constexpr unsigned int Dimension{ 2 }; + constexpr double sigma{ 1 }; + constexpr double tolerance{ 0.001 }; - constexpr unsigned int NumberOfComponents = 4; + constexpr unsigned int NumberOfComponents{ 4 }; using PixelComponentType = double; using ImageType = itk::VectorImage; using PixelType = ImageType::PixelType; diff --git a/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFilterTest.cxx b/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFilterTest.cxx index 6fab7f0f2c2..b6fd3adebb6 100644 --- a/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFilterTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFilterTest.cxx @@ -34,7 +34,7 @@ itkRecursiveGaussianImageFilterTest(int, char *[]) { // 3D test // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; // Declare the types of the images using myImageType = itk::Image; @@ -104,7 +104,7 @@ itkRecursiveGaussianImageFilterTest(int, char *[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, RecursiveGaussianImageFilter, RecursiveSeparableImageFilter); - constexpr unsigned int direction = 2; // apply along Z + constexpr unsigned int direction{ 2 }; // apply along Z filter->SetDirection(direction); ITK_TEST_SET_GET_VALUE(direction, filter->GetDirection()); @@ -214,7 +214,7 @@ itkRecursiveGaussianImageFilterTest(int, char *[]) auto normalizeAcrossScale = true; ITK_TEST_SET_GET_BOOLEAN(filter, NormalizeAcrossScale, normalizeAcrossScale); - constexpr double sigmaA = 2.0; + constexpr double sigmaA{ 2.0 }; filter->SetSigma(sigmaA); ITK_TEST_SET_GET_VALUE(sigmaA, filter->GetSigma()); @@ -224,7 +224,7 @@ itkRecursiveGaussianImageFilterTest(int, char *[]) normalizeAcrossScale = false; filter->SetNormalizeAcrossScale(normalizeAcrossScale); - constexpr double sigmaB = 2.0; + constexpr double sigmaB{ 2.0 }; filter->SetSigma(sigmaB); filter->Update(); @@ -255,7 +255,7 @@ itkRecursiveGaussianImageFilterTest(int, char *[]) // size of image is 21, so a sigma of 2 gives up 5 std-devs and // an expected error of >1e-5 due to truncation - constexpr double sigmaA = 2.0; + constexpr double sigmaA{ 2.0 }; filter->SetSigma(sigmaA); filter->Update(); @@ -309,7 +309,7 @@ itkRecursiveGaussianImageFilterTest(int, char *[]) // positions and use them as bounds for the value of the first order // derivative returned by the filter. - constexpr double sigmaC = 3.0; + constexpr double sigmaC{ 3.0 }; filter->SetSigma(sigmaC); filter->SetZeroOrder(); diff --git a/Modules/Filtering/Smoothing/test/itkRecursiveGaussianScaleSpaceTest1.cxx b/Modules/Filtering/Smoothing/test/itkRecursiveGaussianScaleSpaceTest1.cxx index 884dcf6089f..026b8272efa 100644 --- a/Modules/Filtering/Smoothing/test/itkRecursiveGaussianScaleSpaceTest1.cxx +++ b/Modules/Filtering/Smoothing/test/itkRecursiveGaussianScaleSpaceTest1.cxx @@ -30,8 +30,8 @@ NormalizeSineWave(double frequencyPerImage, unsigned int order, double pixelSpac // frequency, this methods verifies that the normalized scale-scale // is with in reasonable tolerance of the theoretical value. - constexpr unsigned int ImageDimension = 1; - constexpr unsigned int imageSize = 1024; + constexpr unsigned int ImageDimension{ 1 }; + constexpr unsigned int imageSize{ 1024 }; const double tol = std::pow(.000001, 1.0 / order); const double frequency = frequencyPerImage * 2.0 * itk::Math::pi / (imageSize * pixelSpacing); diff --git a/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnImageAdaptorTest.cxx b/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnImageAdaptorTest.cxx index c5433144b68..79b5c86b293 100644 --- a/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnImageAdaptorTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnImageAdaptorTest.cxx @@ -26,7 +26,7 @@ itkSmoothingRecursiveGaussianImageFilterOnImageAdaptorTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; using RGBPixelType = itk::RGBPixel; @@ -44,7 +44,7 @@ itkSmoothingRecursiveGaussianImageFilterOnImageAdaptorTest(int, char *[]) // Declare the type of the Region using myRegionType = itk::ImageRegion; - constexpr unsigned int numberOfComponents = 3; + constexpr unsigned int numberOfComponents{ 3 }; // Create the image auto inputImage = myImageType::New(); diff --git a/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnImageOfVectorTest.cxx b/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnImageOfVectorTest.cxx index ef220a646a6..d2118bddf05 100644 --- a/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnImageOfVectorTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnImageOfVectorTest.cxx @@ -25,7 +25,7 @@ itkSmoothingRecursiveGaussianImageFilterOnImageOfVectorTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; using VectorPixelType = itk::Vector; @@ -41,7 +41,7 @@ itkSmoothingRecursiveGaussianImageFilterOnImageOfVectorTest(int, char *[]) // Declare the type of the Region using myRegionType = itk::ImageRegion; - constexpr unsigned int numberOfComponents = 3; + constexpr unsigned int numberOfComponents{ 3 }; // Create the image auto inputImage = myImageType::New(); diff --git a/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnVectorImageTest.cxx b/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnVectorImageTest.cxx index 1827d330365..02f342e7bd2 100644 --- a/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnVectorImageTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnVectorImageTest.cxx @@ -25,7 +25,7 @@ itkSmoothingRecursiveGaussianImageFilterOnVectorImageTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; // Declare the types of the images using myImageType = itk::VectorImage; @@ -39,7 +39,7 @@ itkSmoothingRecursiveGaussianImageFilterOnVectorImageTest(int, char *[]) // Declare the type of the Region using myRegionType = itk::ImageRegion; - constexpr unsigned int numberOfComponents = 3; + constexpr unsigned int numberOfComponents{ 3 }; // Create the image auto inputImage = myImageType::New(); diff --git a/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterTest.cxx b/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterTest.cxx index 01d6f64cbda..77802960f06 100644 --- a/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterTest.cxx @@ -73,7 +73,7 @@ InPlaceTest(char * inputFilename, bool normalizeAcrossScale, typename TFilter::S // Check whether the values of the in-place and not in-place executions are the same it1.GoToBegin(); it2.GoToBegin(); - constexpr double epsilon = itk::NumericTraits::epsilon(); + constexpr double epsilon{ itk::NumericTraits::epsilon() }; while (!it1.IsAtEnd()) { if (!itk::Math::FloatAlmostEqual(static_cast(it1.Get()), static_cast(it2.Get()), 10, epsilon)) @@ -112,7 +112,7 @@ itkSmoothingRecursiveGaussianImageFilterTest(int argc, char * argv[]) int testStatus = EXIT_SUCCESS; // Define the dimension of the images - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; // Declare the types of the images using PixelType = unsigned char; diff --git a/Modules/Filtering/SpatialFunction/test/itkSpatialFunctionImageEvaluatorFilterTest.cxx b/Modules/Filtering/SpatialFunction/test/itkSpatialFunctionImageEvaluatorFilterTest.cxx index b76d71413ba..31471971431 100644 --- a/Modules/Filtering/SpatialFunction/test/itkSpatialFunctionImageEvaluatorFilterTest.cxx +++ b/Modules/Filtering/SpatialFunction/test/itkSpatialFunctionImageEvaluatorFilterTest.cxx @@ -23,7 +23,7 @@ int itkSpatialFunctionImageEvaluatorFilterTest(int, char *[]) { - constexpr unsigned int dim = 3; + constexpr unsigned int dim{ 3 }; // Image typedef using ImageType = itk::Image; diff --git a/Modules/Filtering/Thresholding/include/itkMaximumEntropyThresholdCalculator.hxx b/Modules/Filtering/Thresholding/include/itkMaximumEntropyThresholdCalculator.hxx index 99ff7aa0ce2..fe4dbae0cfb 100644 --- a/Modules/Filtering/Thresholding/include/itkMaximumEntropyThresholdCalculator.hxx +++ b/Modules/Filtering/Thresholding/include/itkMaximumEntropyThresholdCalculator.hxx @@ -45,7 +45,7 @@ MaximumEntropyThresholdCalculator::GenerateData() typename HistogramType::InstanceIdentifier threshold = 0; - constexpr double tolerance = itk::NumericTraits::epsilon(); + constexpr double tolerance{ itk::NumericTraits::epsilon() }; const int total = histogram->GetTotalFrequency(); std::vector norm_histo(size); // normalized histogram @@ -114,7 +114,7 @@ MaximumEntropyThresholdCalculator::GenerateData() const double tot_ent = ent_back + ent_obj; // total entropy // IJ.log(""+max_ent+" "+tot_ent); - constexpr double tol = 0.00001; + constexpr double tol{ 0.00001 }; if (max_ent < (tot_ent - tol)) { diff --git a/Modules/Filtering/Thresholding/include/itkMomentsThresholdCalculator.hxx b/Modules/Filtering/Thresholding/include/itkMomentsThresholdCalculator.hxx index 065f25d47e8..aeb2083c64d 100644 --- a/Modules/Filtering/Thresholding/include/itkMomentsThresholdCalculator.hxx +++ b/Modules/Filtering/Thresholding/include/itkMomentsThresholdCalculator.hxx @@ -53,7 +53,7 @@ MomentsThresholdCalculator::GenerateData() } // Calculate the first, second, and third order moments - constexpr double m0 = 1.0; + constexpr double m0{ 1.0 }; double m1 = 0.0; double m2 = 0.0; double m3 = 0.0; diff --git a/Modules/Filtering/Thresholding/include/itkOtsuMultipleThresholdsCalculator.hxx b/Modules/Filtering/Thresholding/include/itkOtsuMultipleThresholdsCalculator.hxx index 66dd10b78ea..f74fcb59a69 100644 --- a/Modules/Filtering/Thresholding/include/itkOtsuMultipleThresholdsCalculator.hxx +++ b/Modules/Filtering/Thresholding/include/itkOtsuMultipleThresholdsCalculator.hxx @@ -299,7 +299,7 @@ OtsuMultipleThresholdsCalculator::Compute() varBetween = varBetween * valleyEmphasisFactor; } - constexpr unsigned int maxUlps = 1; + constexpr unsigned int maxUlps{ 1 }; if (varBetween > maxVarBetween && !Math::FloatAlmostEqual(maxVarBetween, varBetween, maxUlps)) { maxVarBetween = varBetween; diff --git a/Modules/Filtering/Thresholding/include/itkRenyiEntropyThresholdCalculator.hxx b/Modules/Filtering/Thresholding/include/itkRenyiEntropyThresholdCalculator.hxx index ee256ef2694..018ae2f0a5e 100644 --- a/Modules/Filtering/Thresholding/include/itkRenyiEntropyThresholdCalculator.hxx +++ b/Modules/Filtering/Thresholding/include/itkRenyiEntropyThresholdCalculator.hxx @@ -44,7 +44,7 @@ RenyiEntropyThresholdCalculator::GenerateData() return; } - constexpr double tolerance = itk::Math::eps; + constexpr double tolerance{ itk::Math::eps }; InstanceIdentifier ih; @@ -232,7 +232,7 @@ RenyiEntropyThresholdCalculator::MaxEntropyThresholding2( InstanceIdentifier threshold = 0; // was MIN_INT in original code, but if an empty image is processed it gives an error later on. double max_ent = NumericTraits::min(); - constexpr double alpha = 0.5; + constexpr double alpha{ 0.5 }; const double term = 1.0 / (1.0 - alpha); for (InstanceIdentifier it = m_FirstBin; it <= m_LastBin; ++it) @@ -281,7 +281,7 @@ RenyiEntropyThresholdCalculator::MaxEntropyThresholding3( InstanceIdentifier threshold = 0; // was MIN_INT in original code, but if an empty image is processed it gives an error later on. double max_ent = 0.0; - constexpr double alpha = 2.0; + constexpr double alpha{ 2.0 }; const double term = 1.0 / (1.0 - alpha); for (InstanceIdentifier it = m_FirstBin; it <= m_LastBin; ++it) { diff --git a/Modules/Filtering/Thresholding/include/itkShanbhagThresholdCalculator.hxx b/Modules/Filtering/Thresholding/include/itkShanbhagThresholdCalculator.hxx index 87f81c92958..aaefde2fa47 100644 --- a/Modules/Filtering/Thresholding/include/itkShanbhagThresholdCalculator.hxx +++ b/Modules/Filtering/Thresholding/include/itkShanbhagThresholdCalculator.hxx @@ -43,7 +43,7 @@ ShanbhagThresholdCalculator::GenerateData() const unsigned int size = histogram->GetSize(0); - constexpr double tolerance = 2.220446049250313E-16; + constexpr double tolerance{ 2.220446049250313E-16 }; typename HistogramType::InstanceIdentifier threshold = 0; std::vector norm_histo(size); // normalized histogram diff --git a/Modules/Filtering/Thresholding/test/itkBinaryThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkBinaryThresholdImageFilterTest.cxx index f702ea57a60..43ff64e554d 100644 --- a/Modules/Filtering/Thresholding/test/itkBinaryThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkBinaryThresholdImageFilterTest.cxx @@ -27,7 +27,7 @@ int itkBinaryThresholdImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using InputPixelType = unsigned char; using OutputPixelType = float; @@ -59,8 +59,8 @@ itkBinaryThresholdImageFilterTest(int, char *[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, BinaryThresholdImageFilter, UnaryFunctorImageFilter); // Set up ivars - constexpr InputPixelType lower = 64; - constexpr InputPixelType upper = 128; + constexpr InputPixelType lower{ 64 }; + constexpr InputPixelType upper{ 128 }; // No input set: check that thresholds are created using the input @@ -151,11 +151,11 @@ itkBinaryThresholdImageFilterTest(int, char *[]) filter->SetUpperThreshold(upper); ITK_TEST_SET_GET_VALUE(upper, filter->GetUpperThreshold()); - constexpr OutputPixelType inside = -0.5; + constexpr OutputPixelType inside{ -0.5 }; filter->SetInsideValue(inside); ITK_TEST_SET_GET_VALUE(inside, filter->GetInsideValue()); - constexpr OutputPixelType outside = 0.5; + constexpr OutputPixelType outside{ 0.5 }; filter->SetOutsideValue(outside); ITK_TEST_SET_GET_VALUE(outside, filter->GetOutsideValue()); diff --git a/Modules/Filtering/Thresholding/test/itkBinaryThresholdImageFilterTest2.cxx b/Modules/Filtering/Thresholding/test/itkBinaryThresholdImageFilterTest2.cxx index a7b428407ce..3ff6e595385 100644 --- a/Modules/Filtering/Thresholding/test/itkBinaryThresholdImageFilterTest2.cxx +++ b/Modules/Filtering/Thresholding/test/itkBinaryThresholdImageFilterTest2.cxx @@ -40,7 +40,7 @@ itkBinaryThresholdImageFilterTest2(int argc, char * argv[]) // // Define the dimension of the images - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; // Declare the types of the images using InputPixelType = double; diff --git a/Modules/Filtering/Thresholding/test/itkBinaryThresholdProjectionImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkBinaryThresholdProjectionImageFilterTest.cxx index 4229648a4b8..722d9599ed6 100644 --- a/Modules/Filtering/Thresholding/test/itkBinaryThresholdProjectionImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkBinaryThresholdProjectionImageFilterTest.cxx @@ -38,7 +38,7 @@ itkBinaryThresholdProjectionImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Filtering/Thresholding/test/itkBinaryThresholdSpatialFunctionTest.cxx b/Modules/Filtering/Thresholding/test/itkBinaryThresholdSpatialFunctionTest.cxx index 76573aaf287..163aea3f18a 100644 --- a/Modules/Filtering/Thresholding/test/itkBinaryThresholdSpatialFunctionTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkBinaryThresholdSpatialFunctionTest.cxx @@ -41,7 +41,7 @@ int itkBinaryThresholdSpatialFunctionTest(int, char *[]) { using CoordRep = double; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using SphereFunctionType = itk::SphereSignedDistanceFunction; using FunctionType = itk::BinaryThresholdSpatialFunction; @@ -71,8 +71,8 @@ itkBinaryThresholdSpatialFunctionTest(int, char *[]) function->SetFunction(sphere); // Set the thresholds - constexpr double lowerThreshold = -3.0; - constexpr double upperThreshold = 4.0; + constexpr double lowerThreshold{ -3.0 }; + constexpr double upperThreshold{ 4.0 }; function->SetLowerThreshold(lowerThreshold); ITK_TEST_SET_GET_VALUE(lowerThreshold, function->GetLowerThreshold()); function->SetUpperThreshold(upperThreshold); diff --git a/Modules/Filtering/Thresholding/test/itkHuangMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkHuangMaskedThresholdImageFilterTest.cxx index 4d706e5cba8..ecbd19d92e9 100644 --- a/Modules/Filtering/Thresholding/test/itkHuangMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkHuangMaskedThresholdImageFilterTest.cxx @@ -39,7 +39,7 @@ itkHuangMaskedThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/Thresholding/test/itkHuangThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkHuangThresholdImageFilterTest.cxx index a40d89956ad..a9e345ecf13 100644 --- a/Modules/Filtering/Thresholding/test/itkHuangThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkHuangThresholdImageFilterTest.cxx @@ -39,7 +39,7 @@ itkHuangThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/Thresholding/test/itkIntermodesMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkIntermodesMaskedThresholdImageFilterTest.cxx index 1ab476e08ed..3475142122e 100644 --- a/Modules/Filtering/Thresholding/test/itkIntermodesMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkIntermodesMaskedThresholdImageFilterTest.cxx @@ -40,7 +40,7 @@ itkIntermodesMaskedThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/Thresholding/test/itkIntermodesThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkIntermodesThresholdImageFilterTest.cxx index 4a4c189c0b1..cf3ca96e0e5 100644 --- a/Modules/Filtering/Thresholding/test/itkIntermodesThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkIntermodesThresholdImageFilterTest.cxx @@ -41,7 +41,7 @@ itkIntermodesThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/Thresholding/test/itkIsoDataMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkIsoDataMaskedThresholdImageFilterTest.cxx index fad892b9b0a..b275d9fa085 100644 --- a/Modules/Filtering/Thresholding/test/itkIsoDataMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkIsoDataMaskedThresholdImageFilterTest.cxx @@ -39,7 +39,7 @@ itkIsoDataMaskedThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/Thresholding/test/itkIsoDataThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkIsoDataThresholdImageFilterTest.cxx index 9c1273343a5..bfda775f305 100644 --- a/Modules/Filtering/Thresholding/test/itkIsoDataThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkIsoDataThresholdImageFilterTest.cxx @@ -38,7 +38,7 @@ itkIsoDataThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/Thresholding/test/itkKappaSigmaThresholdImageCalculatorTest.cxx b/Modules/Filtering/Thresholding/test/itkKappaSigmaThresholdImageCalculatorTest.cxx index 2dd37c7e435..5cdcdfc605a 100644 --- a/Modules/Filtering/Thresholding/test/itkKappaSigmaThresholdImageCalculatorTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkKappaSigmaThresholdImageCalculatorTest.cxx @@ -36,7 +36,7 @@ itkKappaSigmaThresholdImageCalculatorTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = short; @@ -74,7 +74,7 @@ itkKappaSigmaThresholdImageCalculatorTest(int argc, char * argv[]) // Regression test: compare computed threshold const CalculatorType::InputPixelType expectedThreshold = std::stod(argv[5]); const CalculatorType::InputPixelType resultThreshold = calculator->GetOutput(); - constexpr double tolerance = 1e-3; + constexpr double tolerance{ 1e-3 }; if (!itk::Math::FloatAlmostEqual( static_cast(expectedThreshold), static_cast(resultThreshold), 10, tolerance)) { diff --git a/Modules/Filtering/Thresholding/test/itkKappaSigmaThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkKappaSigmaThresholdImageFilterTest.cxx index a2b2509379f..02eeac7bd35 100644 --- a/Modules/Filtering/Thresholding/test/itkKappaSigmaThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkKappaSigmaThresholdImageFilterTest.cxx @@ -43,7 +43,7 @@ itkKappaSigmaThresholdImageFilterTest(int argc, char * argv[]) using MaskPixelType = unsigned char; using OutputPixelType = unsigned char; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputImageType = itk::Image; using MaskImageType = itk::Image; diff --git a/Modules/Filtering/Thresholding/test/itkKittlerIllingworthMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkKittlerIllingworthMaskedThresholdImageFilterTest.cxx index d8f44beff4e..6cb83b5698a 100644 --- a/Modules/Filtering/Thresholding/test/itkKittlerIllingworthMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkKittlerIllingworthMaskedThresholdImageFilterTest.cxx @@ -39,7 +39,7 @@ itkKittlerIllingworthMaskedThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/Thresholding/test/itkKittlerIllingworthThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkKittlerIllingworthThresholdImageFilterTest.cxx index b6f048ecd21..699c4dc60a7 100644 --- a/Modules/Filtering/Thresholding/test/itkKittlerIllingworthThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkKittlerIllingworthThresholdImageFilterTest.cxx @@ -38,7 +38,7 @@ itkKittlerIllingworthThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/Thresholding/test/itkLiMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkLiMaskedThresholdImageFilterTest.cxx index 3e1c8f4896b..adfdb3b289c 100644 --- a/Modules/Filtering/Thresholding/test/itkLiMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkLiMaskedThresholdImageFilterTest.cxx @@ -39,7 +39,7 @@ itkLiMaskedThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/Thresholding/test/itkLiThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkLiThresholdImageFilterTest.cxx index 0315c4b58a4..c937fc22c28 100644 --- a/Modules/Filtering/Thresholding/test/itkLiThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkLiThresholdImageFilterTest.cxx @@ -38,7 +38,7 @@ itkLiThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/Thresholding/test/itkMaximumEntropyMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkMaximumEntropyMaskedThresholdImageFilterTest.cxx index 900cdd0bb01..ba08be0c796 100644 --- a/Modules/Filtering/Thresholding/test/itkMaximumEntropyMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkMaximumEntropyMaskedThresholdImageFilterTest.cxx @@ -40,7 +40,7 @@ itkMaximumEntropyMaskedThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/Thresholding/test/itkMaximumEntropyThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkMaximumEntropyThresholdImageFilterTest.cxx index 76d443afca2..67aa3e5241b 100644 --- a/Modules/Filtering/Thresholding/test/itkMaximumEntropyThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkMaximumEntropyThresholdImageFilterTest.cxx @@ -38,7 +38,7 @@ itkMaximumEntropyThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/Thresholding/test/itkMomentsMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkMomentsMaskedThresholdImageFilterTest.cxx index 1de7dedf742..75423dda38e 100644 --- a/Modules/Filtering/Thresholding/test/itkMomentsMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkMomentsMaskedThresholdImageFilterTest.cxx @@ -40,7 +40,7 @@ itkMomentsMaskedThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/Thresholding/test/itkMomentsThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkMomentsThresholdImageFilterTest.cxx index 6afb4d0aeb6..c724f4fde15 100644 --- a/Modules/Filtering/Thresholding/test/itkMomentsThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkMomentsThresholdImageFilterTest.cxx @@ -38,7 +38,7 @@ itkMomentsThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/Thresholding/test/itkOtsuMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkOtsuMaskedThresholdImageFilterTest.cxx index 69b7ad93bab..fc58263860c 100644 --- a/Modules/Filtering/Thresholding/test/itkOtsuMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkOtsuMaskedThresholdImageFilterTest.cxx @@ -39,7 +39,7 @@ itkOtsuMaskedThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsCalculatorTest.cxx b/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsCalculatorTest.cxx index d37420916ca..782f1b5001e 100644 --- a/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsCalculatorTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsCalculatorTest.cxx @@ -58,7 +58,7 @@ itkOtsuMultipleThresholdsCalculatorTest(int argc, char * argv[]) values.push_back(32.0); values.push_back(48.0); - constexpr MeasurementType range = 2.0; + constexpr MeasurementType range{ 2.0 }; // Create histogram with samples at values +- range for (HistogramType::Iterator iter = histogram->Begin(); iter != histogram->End(); ++iter) diff --git a/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsCalculatorTest2.cxx b/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsCalculatorTest2.cxx index 53be4bf5cfa..6ac31c2117d 100644 --- a/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsCalculatorTest2.cxx +++ b/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsCalculatorTest2.cxx @@ -26,7 +26,7 @@ itkOtsuMultipleThresholdsCalculatorTest2(int, char *[]) auto histogram = HistogramType::New(); bool passed = true; - constexpr unsigned int pixelCount = 4; + constexpr unsigned int pixelCount{ 4 }; for (unsigned int thresholdCount = 1; thresholdCount < pixelCount; ++thresholdCount) { // initialize histogram diff --git a/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsImageFilterTest.cxx index 45001073e2c..55b8444df18 100644 --- a/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsImageFilterTest.cxx @@ -41,7 +41,7 @@ itkOtsuMultipleThresholdsImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using InternalPixelType = unsigned short; diff --git a/Modules/Filtering/Thresholding/test/itkOtsuThresholdCalculatorTest.cxx b/Modules/Filtering/Thresholding/test/itkOtsuThresholdCalculatorTest.cxx index 8695e35e4ef..606f4748882 100644 --- a/Modules/Filtering/Thresholding/test/itkOtsuThresholdCalculatorTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkOtsuThresholdCalculatorTest.cxx @@ -25,7 +25,7 @@ int itkOtsuThresholdCalculatorTest(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = short; using SizeType = itk::Size; @@ -39,7 +39,7 @@ itkOtsuThresholdCalculatorTest(int, char *[]) // Allocate a simple test image auto image = ImageType::New(); // Define the image size and physical coordinates - constexpr SizeType size = { { 20, 20, 20 } }; + constexpr SizeType size{ 20, 20, 20 }; ImageType::RegionType region; region.SetSize(size); @@ -57,10 +57,10 @@ itkOtsuThresholdCalculatorTest(int, char *[]) using IteratorType = itk::ImageRegionIterator; IteratorType iter(image, image->GetBufferedRegion()); - constexpr ImageType::PixelType value1 = 10; - constexpr ImageType::PixelType value2 = 50; - constexpr ImageType::PixelType range = 5; - constexpr ImageType::PixelType r2 = range * 2 + 1; + constexpr ImageType::PixelType value1{ 10 }; + constexpr ImageType::PixelType value2{ 50 }; + constexpr ImageType::PixelType range{ 5 }; + constexpr ImageType::PixelType r2{ range * 2 + 1 }; // Fill one half of with values of value1 +- 2 for (unsigned long i = 0; i < numPixels / 2; ++i) diff --git a/Modules/Filtering/Thresholding/test/itkOtsuThresholdCalculatorVersusOtsuMultipleThresholdsCalculatorTest.cxx b/Modules/Filtering/Thresholding/test/itkOtsuThresholdCalculatorVersusOtsuMultipleThresholdsCalculatorTest.cxx index 7d50676ba0f..39de672a681 100644 --- a/Modules/Filtering/Thresholding/test/itkOtsuThresholdCalculatorVersusOtsuMultipleThresholdsCalculatorTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkOtsuThresholdCalculatorVersusOtsuMultipleThresholdsCalculatorTest.cxx @@ -42,7 +42,7 @@ itkOtsuThresholdCalculatorVersusOtsuMultipleThresholdsCalculatorTest(int argc, c // histogram bins. // The two algorithms should output the same result. - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using InputImageType = itk::Image; using ReaderType = itk::ImageFileReader; diff --git a/Modules/Filtering/Thresholding/test/itkOtsuThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkOtsuThresholdImageFilterTest.cxx index acf6b854fe6..6eb1d37320e 100644 --- a/Modules/Filtering/Thresholding/test/itkOtsuThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkOtsuThresholdImageFilterTest.cxx @@ -40,7 +40,7 @@ itkOtsuThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/Thresholding/test/itkRenyiEntropyMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkRenyiEntropyMaskedThresholdImageFilterTest.cxx index e28002e1af4..e565b848c90 100644 --- a/Modules/Filtering/Thresholding/test/itkRenyiEntropyMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkRenyiEntropyMaskedThresholdImageFilterTest.cxx @@ -36,7 +36,7 @@ itkRenyiEntropyMaskedThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/Thresholding/test/itkRenyiEntropyThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkRenyiEntropyThresholdImageFilterTest.cxx index 8529befe145..df0a8cc112a 100644 --- a/Modules/Filtering/Thresholding/test/itkRenyiEntropyThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkRenyiEntropyThresholdImageFilterTest.cxx @@ -38,7 +38,7 @@ itkRenyiEntropyThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/Thresholding/test/itkShanbhagMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkShanbhagMaskedThresholdImageFilterTest.cxx index 5a8294865a6..38dac78f16b 100644 --- a/Modules/Filtering/Thresholding/test/itkShanbhagMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkShanbhagMaskedThresholdImageFilterTest.cxx @@ -39,7 +39,7 @@ itkShanbhagMaskedThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/Thresholding/test/itkShanbhagThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkShanbhagThresholdImageFilterTest.cxx index b2226167046..623cb91a1f9 100644 --- a/Modules/Filtering/Thresholding/test/itkShanbhagThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkShanbhagThresholdImageFilterTest.cxx @@ -38,7 +38,7 @@ itkShanbhagThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/Thresholding/test/itkThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkThresholdImageFilterTest.cxx index f9f63ce5d05..2e66e388923 100644 --- a/Modules/Filtering/Thresholding/test/itkThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkThresholdImageFilterTest.cxx @@ -146,29 +146,29 @@ itkThresholdImageFilterTest(int, char *[]) input->SetSpacing(inputSpacing); IntImage1DType::PointValueType inputOrigin[1] = { 15 }; input->SetOrigin(inputOrigin); - constexpr IntImage1DType::SizeValueType inputSize = 1; + constexpr IntImage1DType::SizeValueType inputSize{ 1 }; IntImage1DType::RegionType inputRegion; inputRegion.SetSize(0, inputSize); input->SetRegions(inputRegion); input->Allocate(); // The inputValue can be any random value. - constexpr PixelType inputValue = 9; + constexpr PixelType inputValue{ 9 }; input->FillBuffer(inputValue); itk::ThresholdImageFilter::Pointer threshold; threshold = itk::ThresholdImageFilter::New(); threshold->SetInput(input); - constexpr PixelType outsideValue = 99; + constexpr PixelType outsideValue{ 99 }; threshold->SetOutsideValue(outsideValue); ITK_TEST_SET_GET_VALUE(outsideValue, threshold->GetOutsideValue()); constexpr IntImage1DType::IndexType index{}; - constexpr PixelType lower = itk::NumericTraits::NonpositiveMin(); + constexpr PixelType lower{ itk::NumericTraits::NonpositiveMin() }; threshold->SetLower(lower); ITK_TEST_SET_GET_VALUE(lower, threshold->GetLower()); - constexpr PixelType upper = itk::NumericTraits::max(); + constexpr PixelType upper{ itk::NumericTraits::max() }; threshold->SetUpper(upper); ITK_TEST_SET_GET_VALUE(upper, threshold->GetUpper()); diff --git a/Modules/Filtering/Thresholding/test/itkThresholdLabelerImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkThresholdLabelerImageFilterTest.cxx index 6bcfc87ac1e..686a5482ec8 100644 --- a/Modules/Filtering/Thresholding/test/itkThresholdLabelerImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkThresholdLabelerImageFilterTest.cxx @@ -29,7 +29,7 @@ ThresholdLabelerImageFilterTestHelper(bool useRealTypeThresholds) // The following code defines the input and output pixel types and their // associated image types. // - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = float; using LabeledPixelType = unsigned long; @@ -67,7 +67,7 @@ ThresholdLabelerImageFilterTestHelper(bool useRealTypeThresholds) values.push_back(3.5); // Set the value for the offset - constexpr unsigned long offset = 4; + constexpr unsigned long offset{ 4 }; // Set the labels vector std::vector labels; diff --git a/Modules/Filtering/Thresholding/test/itkTriangleMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkTriangleMaskedThresholdImageFilterTest.cxx index a024e250b75..8d0fb4babbd 100644 --- a/Modules/Filtering/Thresholding/test/itkTriangleMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkTriangleMaskedThresholdImageFilterTest.cxx @@ -39,7 +39,7 @@ itkTriangleMaskedThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/Thresholding/test/itkYenMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkYenMaskedThresholdImageFilterTest.cxx index c60e34c2440..d7e45e06f4d 100644 --- a/Modules/Filtering/Thresholding/test/itkYenMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkYenMaskedThresholdImageFilterTest.cxx @@ -39,7 +39,7 @@ itkYenMaskedThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/Filtering/Thresholding/test/itkYenThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkYenThresholdImageFilterTest.cxx index 4545152d7b7..628236784d9 100644 --- a/Modules/Filtering/Thresholding/test/itkYenThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkYenThresholdImageFilterTest.cxx @@ -38,7 +38,7 @@ itkYenThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using OutputPixelType = unsigned char; diff --git a/Modules/IO/BMP/src/itkBMPImageIO.cxx b/Modules/IO/BMP/src/itkBMPImageIO.cxx index 9e7dc2cdfb8..7d96ea3e9c5 100644 --- a/Modules/IO/BMP/src/itkBMPImageIO.cxx +++ b/Modules/IO/BMP/src/itkBMPImageIO.cxx @@ -96,7 +96,7 @@ BMPImageIO::CanReadFile(const char * filename) // get the size of the file - constexpr size_t sizeLong = sizeof(long); + constexpr size_t sizeLong{ sizeof(long) }; if (sizeLong == 4) { long tmp = 0; @@ -360,7 +360,7 @@ BMPImageIO::ReadImageInformation() } // get the size of the file - constexpr size_t sizeLong = sizeof(long); + constexpr size_t sizeLong{ sizeof(long) }; if (sizeLong == 4) { long tmp = 0; @@ -757,7 +757,7 @@ BMPImageIO::Write(const void * buffer) } this->Write32BitsInteger(fileSize); - constexpr unsigned short applicationReservedValue = 0; + constexpr unsigned short applicationReservedValue{ 0 }; this->Write16BitsInteger(applicationReservedValue); this->Write16BitsInteger(applicationReservedValue); @@ -783,7 +783,7 @@ BMPImageIO::Write(const void * buffer) // blue, green and red intensities, respectively. // // Finally the pixel data - constexpr unsigned int bitmapHeaderSize = 40; + constexpr unsigned int bitmapHeaderSize{ 40 }; this->Write32BitsInteger(bitmapHeaderSize); // image width @@ -793,7 +793,7 @@ BMPImageIO::Write(const void * buffer) this->Write32BitsInteger(static_cast(m_Dimensions[1])); // Set `planes'=1 (mandatory) - constexpr unsigned short numberOfColorPlanes = 1; + constexpr unsigned short numberOfColorPlanes{ 1 }; this->Write16BitsInteger(numberOfColorPlanes); // Set bits per pixel. @@ -814,7 +814,7 @@ BMPImageIO::Write(const void * buffer) } this->Write16BitsInteger(numberOfBitsPerPixel); - constexpr unsigned int compressionMethod = 0; + constexpr unsigned int compressionMethod{ 0 }; this->Write32BitsInteger(compressionMethod); this->Write32BitsInteger(rawImageDataSize); @@ -830,11 +830,11 @@ BMPImageIO::Write(const void * buffer) this->Write32BitsInteger(verticalResolution); // zero here defaults to 2^n colors in the palette - constexpr unsigned int numberOfColorsInPalette = 0; + constexpr unsigned int numberOfColorsInPalette{ 0 }; this->Write32BitsInteger(numberOfColorsInPalette); // zero here indicates that all colors in the palette are important. - constexpr unsigned int numberOfImportantColorsInPalette = 0; + constexpr unsigned int numberOfImportantColorsInPalette{ 0 }; this->Write32BitsInteger(numberOfImportantColorsInPalette); // End of DIB header, 54 bytes written so far @@ -855,7 +855,7 @@ BMPImageIO::Write(const void * buffer) // Write down the raw binary pixel data for (unsigned int h = 0; h < m_Dimensions[1]; ++h) { - constexpr char paddingValue = 0; + constexpr char paddingValue{ 0 }; const auto * ptr = static_cast(buffer); ptr += (m_Dimensions[1] - (h + 1)) * m_Dimensions[0] * bpp; if (bpp == 1) diff --git a/Modules/IO/BMP/test/itkBMPImageIOTest.cxx b/Modules/IO/BMP/test/itkBMPImageIOTest.cxx index b9573bdb024..cc83fa2fdc4 100644 --- a/Modules/IO/BMP/test/itkBMPImageIOTest.cxx +++ b/Modules/IO/BMP/test/itkBMPImageIOTest.cxx @@ -32,7 +32,7 @@ itkBMPImageIOTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ComponentType = unsigned char; using PixelType = itk::RGBPixel; diff --git a/Modules/IO/BMP/test/itkBMPImageIOTest2.cxx b/Modules/IO/BMP/test/itkBMPImageIOTest2.cxx index 42c0f85511b..6800a59b086 100644 --- a/Modules/IO/BMP/test/itkBMPImageIOTest2.cxx +++ b/Modules/IO/BMP/test/itkBMPImageIOTest2.cxx @@ -34,7 +34,7 @@ itkBMPImageIOTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ComponentType = unsigned char; using PixelType = itk::RGBAPixel; diff --git a/Modules/IO/BMP/test/itkBMPImageIOTest3.cxx b/Modules/IO/BMP/test/itkBMPImageIOTest3.cxx index 10c7bf65b0c..3e790674b75 100644 --- a/Modules/IO/BMP/test/itkBMPImageIOTest3.cxx +++ b/Modules/IO/BMP/test/itkBMPImageIOTest3.cxx @@ -38,7 +38,7 @@ itkBMPImageIOTest3(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/IO/BMP/test/itkBMPImageIOTest4.cxx b/Modules/IO/BMP/test/itkBMPImageIOTest4.cxx index 76ec3666ddd..2e7a6a70af0 100644 --- a/Modules/IO/BMP/test/itkBMPImageIOTest4.cxx +++ b/Modules/IO/BMP/test/itkBMPImageIOTest4.cxx @@ -39,7 +39,7 @@ itkBMPImageIOTest4(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ComponentType = unsigned char; using PixelType = itk::RGBPixel; diff --git a/Modules/IO/BMP/test/itkBMPImageIOTest5.cxx b/Modules/IO/BMP/test/itkBMPImageIOTest5.cxx index 63dc9edd080..2461eb636a4 100644 --- a/Modules/IO/BMP/test/itkBMPImageIOTest5.cxx +++ b/Modules/IO/BMP/test/itkBMPImageIOTest5.cxx @@ -41,7 +41,7 @@ itkBMPImageIOTest5(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/IO/BMP/test/itkBMPImageIOTestExtension.cxx b/Modules/IO/BMP/test/itkBMPImageIOTestExtension.cxx index c4587934d16..aeb998a5f9b 100644 --- a/Modules/IO/BMP/test/itkBMPImageIOTestExtension.cxx +++ b/Modules/IO/BMP/test/itkBMPImageIOTestExtension.cxx @@ -71,7 +71,7 @@ itkBMPImageIOTestExtension(int argc, char * argv[]) ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); const itk::ImageRegion<2> expected_region{ itk::Size<2>{ { 1, 1 } } }; - constexpr ComponentType expected_rgb[] = { 255, 0, 0 }; + constexpr ComponentType expected_rgb[]{ 255, 0, 0 }; const PixelType expected_pixel{ expected_rgb }; // check that data has been actually read auto image = reader->GetOutput(); diff --git a/Modules/IO/BMP/test/itkBMPImageIOTestPalette.cxx b/Modules/IO/BMP/test/itkBMPImageIOTestPalette.cxx index 7ee6deaca97..06542ebcbb7 100644 --- a/Modules/IO/BMP/test/itkBMPImageIOTestPalette.cxx +++ b/Modules/IO/BMP/test/itkBMPImageIOTestPalette.cxx @@ -40,7 +40,7 @@ itkBMPImageIOTestPalette(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ScalarPixelType = unsigned char; using ScalarImageType = itk::Image; diff --git a/Modules/IO/BioRad/src/itkBioRadImageIO.cxx b/Modules/IO/BioRad/src/itkBioRadImageIO.cxx index cc61c67c1db..94e980ad207 100644 --- a/Modules/IO/BioRad/src/itkBioRadImageIO.cxx +++ b/Modules/IO/BioRad/src/itkBioRadImageIO.cxx @@ -30,12 +30,12 @@ #include "itksys/SystemTools.hxx" #include "itkMakeUniqueForOverwrite.h" -constexpr int32_t BIORAD_HEADER_LENGTH = 76; +constexpr int32_t BIORAD_HEADER_LENGTH{ 76 }; // constexpr int32_t BIORAD_NOTE_LENGTH = 96; // constexpr int32_t BIORAD_NOTE_LENGTH = 80; // constexpr int32_t BIORAD_RGB_LUT_LENGTH = 768; -constexpr int32_t BIORAD_FILE_ID_OFFSET = 54; -constexpr int32_t BIORAD_MAGIC_NUMBER = 12345; +constexpr int32_t BIORAD_FILE_ID_OFFSET{ 54 }; +constexpr int32_t BIORAD_MAGIC_NUMBER{ 12345 }; namespace itk { diff --git a/Modules/IO/CSV/test/itkCSVArray2DFileReaderTest.cxx b/Modules/IO/CSV/test/itkCSVArray2DFileReaderTest.cxx index f6e7e7b3c5e..4cb76533e5b 100644 --- a/Modules/IO/CSV/test/itkCSVArray2DFileReaderTest.cxx +++ b/Modules/IO/CSV/test/itkCSVArray2DFileReaderTest.cxx @@ -20,7 +20,7 @@ #include "itkTestingMacros.h" #include "itkMath.h" -constexpr double epsilon = 1e-10; +constexpr double epsilon{ 1e-10 }; // function for displaying vectors template @@ -117,7 +117,7 @@ itkCSVArray2DFileReaderTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr double nan = std::numeric_limits::quiet_NaN(); + constexpr double nan{ std::numeric_limits::quiet_NaN() }; // Read and Parse the data using ReaderType = itk::CSVArray2DFileReader; diff --git a/Modules/IO/CSV/test/itkCSVArray2DFileReaderWriterTest.cxx b/Modules/IO/CSV/test/itkCSVArray2DFileReaderWriterTest.cxx index 7335ffbc83d..55df30a326b 100644 --- a/Modules/IO/CSV/test/itkCSVArray2DFileReaderWriterTest.cxx +++ b/Modules/IO/CSV/test/itkCSVArray2DFileReaderWriterTest.cxx @@ -21,7 +21,7 @@ #include "itkMath.h" #include "itkTestingMacros.h" -constexpr double epsilon = 1e-20; +constexpr double epsilon{ 1e-20 }; // function for comparing matrices template @@ -66,11 +66,11 @@ testArray(const itk::Array2D & m1, const itk::Array2D & m2) int itkCSVFileReaderWriterTest_Func(int argc, char * argv[], bool headers) { - constexpr double nan = std::numeric_limits::quiet_NaN(); + constexpr double nan{ std::numeric_limits::quiet_NaN() }; using MatrixType = itk::Array2D; - constexpr unsigned int ARows = 3; - constexpr unsigned int ACols = 6; + constexpr unsigned int ARows{ 3 }; + constexpr unsigned int ACols{ 6 }; MatrixType matrix(ARows, ACols); matrix[0][0] = nan; matrix[0][1] = 1e+09; diff --git a/Modules/IO/CSV/test/itkCSVNumericObjectFileWriterTest.cxx b/Modules/IO/CSV/test/itkCSVNumericObjectFileWriterTest.cxx index b9e7932b13c..8e701950744 100644 --- a/Modules/IO/CSV/test/itkCSVNumericObjectFileWriterTest.cxx +++ b/Modules/IO/CSV/test/itkCSVNumericObjectFileWriterTest.cxx @@ -29,9 +29,9 @@ itkCSVNumericObjectFileWriterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr double nan = std::numeric_limits::quiet_NaN(); - constexpr unsigned int ARows = 3; - constexpr unsigned int ACols = 6; + constexpr double nan{ std::numeric_limits::quiet_NaN() }; + constexpr unsigned int ARows{ 3 }; + constexpr unsigned int ACols{ 6 }; using ArrayType = itk::Array2D; ArrayType array(ARows, ACols); @@ -60,7 +60,7 @@ itkCSVNumericObjectFileWriterTest(int argc, char * argv[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(array_writer, CSVNumericObjectFileWriter, LightProcessObject); - constexpr char delimiterCharacter = ','; + constexpr char delimiterCharacter{ ',' }; array_writer->SetFieldDelimiterCharacter(delimiterCharacter); // should throw an exception as there is no input file nor any object @@ -122,8 +122,8 @@ itkCSVNumericObjectFileWriterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int VMRows = 3; - constexpr unsigned int VMCols = 4; + constexpr unsigned int VMRows{ 3 }; + constexpr unsigned int VMCols{ 4 }; using vnlMatrixType = vnl_matrix; vnlMatrixType vnlmatrix(VMRows, VMCols); @@ -165,8 +165,8 @@ itkCSVNumericObjectFileWriterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int VRows = 3; - constexpr unsigned int VColumns = 3; + constexpr unsigned int VRows{ 3 }; + constexpr unsigned int VColumns{ 3 }; using fixedMatrixType = itk::Matrix; fixedMatrixType fixedmatrix; diff --git a/Modules/IO/GDCM/test/itkGDCMImageIOTest.cxx b/Modules/IO/GDCM/test/itkGDCMImageIOTest.cxx index 22b693da4ba..083c12d1f9d 100644 --- a/Modules/IO/GDCM/test/itkGDCMImageIOTest.cxx +++ b/Modules/IO/GDCM/test/itkGDCMImageIOTest.cxx @@ -41,7 +41,7 @@ itkGDCMImageIOTest(int argc, char * argv[]) const char * rescaledDicomFileName = argv[4]; const char * rescaledOutputImageFileName = argv[5]; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = short; using InputImageType = itk::Image; diff --git a/Modules/IO/GDCM/test/itkGDCMImageReadSeriesWriteTest.cxx b/Modules/IO/GDCM/test/itkGDCMImageReadSeriesWriteTest.cxx index c4a770a1e07..31daed07caf 100644 --- a/Modules/IO/GDCM/test/itkGDCMImageReadSeriesWriteTest.cxx +++ b/Modules/IO/GDCM/test/itkGDCMImageReadSeriesWriteTest.cxx @@ -39,7 +39,7 @@ itkGDCMImageReadSeriesWriteTest(int argc, char * argv[]) const char * singleOutputImage = argv[3]; using PixelType = short; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; @@ -58,7 +58,7 @@ itkGDCMImageReadSeriesWriteTest(int argc, char * argv[]) itksys::SystemTools::MakeDirectory(outputDirectory); using OutputPixelType = short; - constexpr unsigned int OutputDimension = 2; + constexpr unsigned int OutputDimension{ 2 }; using Image2DType = itk::Image; using SeriesWriterType = itk::ImageSeriesWriter; diff --git a/Modules/IO/GDCM/test/itkGDCMLegacyMultiFrameTest.cxx b/Modules/IO/GDCM/test/itkGDCMLegacyMultiFrameTest.cxx index 20b141d63b7..d0381d78079 100644 --- a/Modules/IO/GDCM/test/itkGDCMLegacyMultiFrameTest.cxx +++ b/Modules/IO/GDCM/test/itkGDCMLegacyMultiFrameTest.cxx @@ -39,7 +39,7 @@ itkGDCMLegacyMultiFrameTest(int argc, char * argv[]) const char * outputFileName = argv[2]; using PixelType = unsigned short; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; diff --git a/Modules/IO/GDCM/test/itkGDCMSeriesStreamReadImageWriteTest.cxx b/Modules/IO/GDCM/test/itkGDCMSeriesStreamReadImageWriteTest.cxx index c705155319b..7be26fc78b9 100644 --- a/Modules/IO/GDCM/test/itkGDCMSeriesStreamReadImageWriteTest.cxx +++ b/Modules/IO/GDCM/test/itkGDCMSeriesStreamReadImageWriteTest.cxx @@ -191,7 +191,7 @@ itkGDCMSeriesStreamReadImageWriteTest(int argc, char * argv[]) ImageType::SpacingType spacing = reader->GetOutput()->GetSpacing(); // we only give 4 bits of tolerance, IEEE float a 24-bit mantissa - constexpr double percentTolerance = 1.0 / static_cast(1U << 18); + constexpr double percentTolerance{ 1.0 / static_cast(1U << 18) }; if (!IsEqualTolerant(spacing[0], expectedSpacing[0], percentTolerance) || !IsEqualTolerant(spacing[1], expectedSpacing[1], percentTolerance) || diff --git a/Modules/IO/HDF5/test/itkHDF5ImageIOTest.cxx b/Modules/IO/HDF5/test/itkHDF5ImageIOTest.cxx index cbcab81bc64..a24aa67a055 100644 --- a/Modules/IO/HDF5/test/itkHDF5ImageIOTest.cxx +++ b/Modules/IO/HDF5/test/itkHDF5ImageIOTest.cxx @@ -65,22 +65,22 @@ HDF5ReadWriteTest(const char * fileName) constexpr unsigned char metaDataUChar('u'); itk::EncapsulateMetaData(metaDict, "TestUChar", metaDataUChar); - constexpr short metaDataShort(1); + constexpr short metaDataShort{ 1 }; itk::EncapsulateMetaData(metaDict, "TestShort", metaDataShort); - constexpr unsigned short metaDataUShort(3); + constexpr unsigned short metaDataUShort{ 3 }; itk::EncapsulateMetaData(metaDict, "TestUShort", metaDataUShort); - constexpr int metaDataInt(5); + constexpr int metaDataInt{ 5 }; itk::EncapsulateMetaData(metaDict, "TestInt", metaDataInt); - constexpr unsigned int metaDataUInt(7); + constexpr unsigned int metaDataUInt{ 7 }; itk::EncapsulateMetaData(metaDict, "TestUInt", metaDataUInt); - constexpr long metaDataLong(5); + constexpr long metaDataLong{ 5 }; itk::EncapsulateMetaData(metaDict, "TestLong", metaDataLong); - constexpr unsigned long metaDataULong(7); + constexpr unsigned long metaDataULong{ 7 }; itk::EncapsulateMetaData(metaDict, "TestULong", metaDataULong); constexpr long long metaDataLLong(-5); @@ -310,7 +310,7 @@ HDF5ReadWriteTest(const char * fileName) int HDF5ReuseReadWriteTest(const char * fileName) { - constexpr int success(EXIT_SUCCESS); + constexpr int success{ EXIT_SUCCESS }; const itk::HDF5ImageIO::Pointer io = itk::HDF5ImageIO::New(); io->SetFileName(fileName); diff --git a/Modules/IO/ImageBase/src/itkStreamingImageIOBase.cxx b/Modules/IO/ImageBase/src/itkStreamingImageIOBase.cxx index cc78b8c786f..65c1146590b 100644 --- a/Modules/IO/ImageBase/src/itkStreamingImageIOBase.cxx +++ b/Modules/IO/ImageBase/src/itkStreamingImageIOBase.cxx @@ -112,7 +112,7 @@ bool StreamingImageIOBase::ReadBufferAsBinary(std::istream & is, void * buffer, StreamingImageIOBase::SizeType num) { // some systems have a limit of 2GB to be read at once - constexpr SizeType maxChunk = 1024 * 1024 * 1024; + constexpr SizeType maxChunk{ 1024 * 1024 * 1024 }; auto bytesRemaining = static_cast(num); @@ -139,7 +139,7 @@ bool StreamingImageIOBase::WriteBufferAsBinary(std::ostream & os, const void * buffer, StreamingImageIOBase::SizeType num) { // some systems have a limit of 2GB to be written at once - constexpr SizeType maxChunk = 1024 * 1024 * 1024; + constexpr SizeType maxChunk{ 1024 * 1024 * 1024 }; std::streamsize bytesRemaining = num; diff --git a/Modules/IO/ImageBase/test/itkConvertBufferTest.cxx b/Modules/IO/ImageBase/test/itkConvertBufferTest.cxx index ca2cdaf1777..aeb658ee98f 100644 --- a/Modules/IO/ImageBase/test/itkConvertBufferTest.cxx +++ b/Modules/IO/ImageBase/test/itkConvertBufferTest.cxx @@ -99,7 +99,7 @@ itkConvertBufferTest(int, char *[]) // create an initial array of floats float farray[] = { 1.1f, 2.2f, 3.3f, 4.4f, 5.5f, 6.4f, 7.4f, 8.8f, 9.9f }; // set the size of the array in number of elements - constexpr int arraySize = std::size(farray); + constexpr int arraySize{ std::size(farray) }; double darray[arraySize]; // create a double array int iarray[arraySize]; // create an int array // convert the float array to a double array diff --git a/Modules/IO/ImageBase/test/itkImageFileReaderManyComponentVectorTest.cxx b/Modules/IO/ImageBase/test/itkImageFileReaderManyComponentVectorTest.cxx index dcca9fa51c0..a344ea35f81 100644 --- a/Modules/IO/ImageBase/test/itkImageFileReaderManyComponentVectorTest.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileReaderManyComponentVectorTest.cxx @@ -30,8 +30,8 @@ itkImageFileReaderManyComponentVectorTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Channels = 31; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Channels{ 31 }; + constexpr unsigned int Dimension{ 2 }; using ImageNDType = itk::Image, Dimension>; ImageNDType::Pointer image; diff --git a/Modules/IO/ImageBase/test/itkImageFileReaderStreamingTest.cxx b/Modules/IO/ImageBase/test/itkImageFileReaderStreamingTest.cxx index d2db53747a5..49286d1eb22 100644 --- a/Modules/IO/ImageBase/test/itkImageFileReaderStreamingTest.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileReaderStreamingTest.cxx @@ -32,7 +32,7 @@ itkImageFileReaderStreamingTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int numberOfDataPieces = 4; + constexpr unsigned int numberOfDataPieces{ 4 }; bool expectedToStream = true; if (argc > 2) @@ -60,7 +60,7 @@ itkImageFileReaderStreamingTest(int argc, char * argv[]) auto reader = ReaderType::New(); reader->SetFileName(argv[1]); - constexpr bool useStreaming = true; + constexpr bool useStreaming{ true }; ITK_TEST_SET_GET_BOOLEAN(reader, UseStreaming, useStreaming); using MonitorFilter = itk::PipelineMonitorImageFilter; diff --git a/Modules/IO/ImageBase/test/itkImageFileReaderStreamingTest2.cxx b/Modules/IO/ImageBase/test/itkImageFileReaderStreamingTest2.cxx index a9ee3da499e..018b9b060ec 100644 --- a/Modules/IO/ImageBase/test/itkImageFileReaderStreamingTest2.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileReaderStreamingTest2.cxx @@ -38,9 +38,9 @@ bool SameRegionImage(ImageConstPointer test, ImageConstPointer baseline) { - constexpr PixelType intensityTolerance = 0; - constexpr unsigned int radiusTolerance = 0; - constexpr unsigned int numberOfPixelTolerance = 0; + constexpr PixelType intensityTolerance{ 0 }; + constexpr unsigned int radiusTolerance{ 0 }; + constexpr unsigned int numberOfPixelTolerance{ 0 }; using ExtractImageFilter = itk::ExtractImageFilter; auto extractor = ExtractImageFilter::New(); diff --git a/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest1.cxx b/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest1.cxx index a74c42bbfb5..450c9a29f76 100644 --- a/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest1.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest1.cxx @@ -45,7 +45,7 @@ itkImageFileWriterPastingTest1(int argc, char * argv[]) reader->SetFileName(argv[1]); reader->SetUseStreaming(true); - constexpr unsigned int numberOfPieces = 10; + constexpr unsigned int numberOfPieces{ 10 }; // We decide how we want to read the image and we split accordingly // The image is read slice by slice diff --git a/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest2.cxx b/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest2.cxx index de527fc6793..4548b3472e7 100644 --- a/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest2.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest2.cxx @@ -31,9 +31,9 @@ using ImagePointer = ImageType::Pointer; bool SameImage(ImagePointer testImage, ImagePointer baselineImage) { - constexpr PixelType intensityTolerance = 0; - constexpr int radiusTolerance = 0; - constexpr unsigned long numberOfPixelTolerance = 0; + constexpr PixelType intensityTolerance{ 0 }; + constexpr int radiusTolerance{ 0 }; + constexpr unsigned long numberOfPixelTolerance{ 0 }; using DiffType = itk::Testing::ComparisonImageFilter; auto diff = DiffType::New(); diff --git a/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest3.cxx b/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest3.cxx index 94ca62ce793..a2ecee93bb6 100644 --- a/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest3.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest3.cxx @@ -33,9 +33,9 @@ namespace bool SameImage(ImagePointer testImage, ImagePointer baselineImage) { - constexpr PixelType intensityTolerance = 0; - constexpr int radiusTolerance = 0; - constexpr unsigned long numberOfPixelTolerance = 0; + constexpr PixelType intensityTolerance{ 0 }; + constexpr int radiusTolerance{ 0 }; + constexpr unsigned long numberOfPixelTolerance{ 0 }; using DiffType = itk::Testing::ComparisonImageFilter; auto diff = DiffType::New(); diff --git a/Modules/IO/ImageBase/test/itkImageFileWriterStreamingPastingCompressingTest1.cxx b/Modules/IO/ImageBase/test/itkImageFileWriterStreamingPastingCompressingTest1.cxx index d1f327bbefb..d1d870e4395 100644 --- a/Modules/IO/ImageBase/test/itkImageFileWriterStreamingPastingCompressingTest1.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileWriterStreamingPastingCompressingTest1.cxx @@ -25,7 +25,7 @@ #include "itkTestingMacros.h" -constexpr unsigned int VDimension = 3; +constexpr unsigned int VDimension{ 3 }; using PixelType = unsigned char; using ImageType = itk::Image; using ImagePointer = ImageType::Pointer; @@ -38,9 +38,9 @@ namespace bool SameImage(ImagePointer testImage, ImagePointer baselineImage) { - constexpr PixelType intensityTolerance = 5; // need this for compression - constexpr int radiusTolerance = 0; - constexpr unsigned long numberOfPixelTolerance = 0; + constexpr PixelType intensityTolerance{ 5 }; // need this for compression + constexpr int radiusTolerance{ 0 }; + constexpr unsigned long numberOfPixelTolerance{ 0 }; // NOTE ALEX: it looks like this filter does not take the spacing // into account, to check later. @@ -107,7 +107,7 @@ ActualTest(const std::string & inputFileName, const std::string outputFileName = outputFileNameStream.str(); std::cout << "Writing to File: " << outputFileName << std::endl; - constexpr unsigned int numberOfPieces = 10; + constexpr unsigned int numberOfPieces{ 10 }; // We remove the output file // NOTE ALEX: should we check it exists first? @@ -246,7 +246,7 @@ itkImageFileWriterStreamingPastingCompressingTest1(int argc, char * argv[]) } int expectException[8]; - constexpr int expectedExceptionOffset = 4; + constexpr int expectedExceptionOffset{ 4 }; for (int i = 0; i < 8; ++i) { if (argc > i + expectedExceptionOffset) diff --git a/Modules/IO/ImageBase/test/itkImageFileWriterStreamingTest1.cxx b/Modules/IO/ImageBase/test/itkImageFileWriterStreamingTest1.cxx index 864bc96709e..cf5dfa2d479 100644 --- a/Modules/IO/ImageBase/test/itkImageFileWriterStreamingTest1.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileWriterStreamingTest1.cxx @@ -45,7 +45,7 @@ itkImageFileWriterStreamingTest1(int argc, char * argv[]) } - constexpr unsigned int numberOfDataPieces = 4; + constexpr unsigned int numberOfDataPieces{ 4 }; bool forceNoStreamingInput = false; diff --git a/Modules/IO/ImageBase/test/itkImageFileWriterStreamingTest2.cxx b/Modules/IO/ImageBase/test/itkImageFileWriterStreamingTest2.cxx index 605ecd964db..3ff7fac12e7 100644 --- a/Modules/IO/ImageBase/test/itkImageFileWriterStreamingTest2.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileWriterStreamingTest2.cxx @@ -34,9 +34,9 @@ bool SameImage(std::string output, std::string baseline) { - constexpr PixelType intensityTolerance = 0; - constexpr unsigned int radiusTolerance = 0; - constexpr unsigned int numberOfPixelTolerance = 0; + constexpr PixelType intensityTolerance{ 0 }; + constexpr unsigned int radiusTolerance{ 0 }; + constexpr unsigned int numberOfPixelTolerance{ 0 }; auto testReader = ReaderType::New(); auto baselineReader = ReaderType::New(); @@ -79,7 +79,7 @@ itkImageFileWriterStreamingTest2(int argc, char * argv[]) // - constexpr unsigned int numberOfDataPieces = 4; + constexpr unsigned int numberOfDataPieces{ 4 }; auto reader = ReaderType::New(); reader->SetFileName(argv[1]); diff --git a/Modules/IO/ImageBase/test/itkImageIOBaseTest.cxx b/Modules/IO/ImageBase/test/itkImageIOBaseTest.cxx index a53adbbbd44..8e11b003dd4 100644 --- a/Modules/IO/ImageBase/test/itkImageIOBaseTest.cxx +++ b/Modules/IO/ImageBase/test/itkImageIOBaseTest.cxx @@ -296,8 +296,8 @@ itkImageIOBaseTest(int, char *[]) static_assert(std::size(listIOPixelType) == std::size(listIOPixelTypeString), "listIOPixelType and listIOPixelTypeString must be same length"); - constexpr size_t listComponentSize = std::size(listComponentType); - constexpr size_t listPixelSize = std::size(listIOPixelType); + constexpr size_t listComponentSize{ std::size(listComponentType) }; + constexpr size_t listPixelSize{ std::size(listIOPixelType) }; for (size_t i = 0; i < listComponentSize; ++i) { diff --git a/Modules/IO/ImageBase/test/itkImageIODirection2DTest.cxx b/Modules/IO/ImageBase/test/itkImageIODirection2DTest.cxx index 953714a54d5..cb7a152a5ec 100644 --- a/Modules/IO/ImageBase/test/itkImageIODirection2DTest.cxx +++ b/Modules/IO/ImageBase/test/itkImageIODirection2DTest.cxx @@ -33,7 +33,7 @@ itkImageIODirection2DTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; @@ -60,7 +60,7 @@ itkImageIODirection2DTest(int argc, char * argv[]) std::cout << directionCosines << std::endl; unsigned int element = 2; - constexpr double tolerance = 1e-5; + constexpr double tolerance{ 1e-5 }; for (unsigned int row = 0; row < Dimension; ++row) { diff --git a/Modules/IO/ImageBase/test/itkImageIODirection3DTest.cxx b/Modules/IO/ImageBase/test/itkImageIODirection3DTest.cxx index db565d29f7e..7ec92663f05 100644 --- a/Modules/IO/ImageBase/test/itkImageIODirection3DTest.cxx +++ b/Modules/IO/ImageBase/test/itkImageIODirection3DTest.cxx @@ -33,7 +33,7 @@ itkImageIODirection3DTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = unsigned char; using ImageType = itk::Image; @@ -60,7 +60,7 @@ itkImageIODirection3DTest(int argc, char * argv[]) std::cout << directionCosines << std::endl; unsigned int element = 2; - constexpr double tolerance = 1e-5; + constexpr double tolerance{ 1e-5 }; for (unsigned int row = 0; row < Dimension; ++row) { diff --git a/Modules/IO/ImageBase/test/itkImageSeriesWriterTest.cxx b/Modules/IO/ImageBase/test/itkImageSeriesWriterTest.cxx index 332b80c7057..f5dcea4ef9c 100644 --- a/Modules/IO/ImageBase/test/itkImageSeriesWriterTest.cxx +++ b/Modules/IO/ImageBase/test/itkImageSeriesWriterTest.cxx @@ -87,11 +87,11 @@ itkImageSeriesWriterTest(int argc, char * argv[]) writer->SetInput(rescaler->GetOutput()); - constexpr itk::SizeValueType startIndex = 1; + constexpr itk::SizeValueType startIndex{ 1 }; writer->SetStartIndex(startIndex); ITK_TEST_SET_GET_VALUE(startIndex, writer->GetStartIndex()); - constexpr itk::SizeValueType incrementIndex = 1; + constexpr itk::SizeValueType incrementIndex{ 1 }; writer->SetIncrementIndex(incrementIndex); ITK_TEST_SET_GET_VALUE(incrementIndex, writer->GetIncrementIndex()); @@ -132,7 +132,7 @@ itkImageSeriesWriterTest(int argc, char * argv[]) const ImageNDType::RegionType region = reader->GetOutput()->GetBufferedRegion(); ImageNDType::SizeType size = region.GetSize(); - constexpr itk::SizeValueType startIndex = 0; + constexpr itk::SizeValueType startIndex{ 0 }; fit->SetStartIndex(startIndex); ITK_TEST_SET_GET_VALUE(startIndex, fit->GetStartIndex()); @@ -140,7 +140,7 @@ itkImageSeriesWriterTest(int argc, char * argv[]) fit->SetEndIndex(endIndex); // The number of slices to write ITK_TEST_SET_GET_VALUE(endIndex, fit->GetEndIndex()); - constexpr itk::SizeValueType incrementIndex = 1; + constexpr itk::SizeValueType incrementIndex{ 1 }; fit->SetIncrementIndex(incrementIndex); ITK_TEST_SET_GET_VALUE(incrementIndex, fit->GetIncrementIndex()); @@ -156,7 +156,7 @@ itkImageSeriesWriterTest(int argc, char * argv[]) std::cerr << "Wrong default use compression value" << std::endl; return EXIT_FAILURE; } - constexpr bool useCompression = false; + constexpr bool useCompression{ false }; ITK_TEST_SET_GET_BOOLEAN(writer, UseCompression, useCompression); ITK_TRY_EXPECT_NO_EXCEPTION(writer->Update()); diff --git a/Modules/IO/ImageBase/test/itkLargeImageWriteReadTest.cxx b/Modules/IO/ImageBase/test/itkLargeImageWriteReadTest.cxx index 20cc46b6114..e87d5513157 100644 --- a/Modules/IO/ImageBase/test/itkLargeImageWriteReadTest.cxx +++ b/Modules/IO/ImageBase/test/itkLargeImageWriteReadTest.cxx @@ -167,7 +167,7 @@ itkLargeImageWriteReadTest(int argc, char * argv[]) if (argc == 3) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned short; using ImageType = itk::Image; @@ -177,7 +177,7 @@ itkLargeImageWriteReadTest(int argc, char * argv[]) return ActualTest(filename, size); } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = unsigned short; using ImageType = itk::Image; diff --git a/Modules/IO/ImageBase/test/itkMatrixImageWriteReadTest.cxx b/Modules/IO/ImageBase/test/itkMatrixImageWriteReadTest.cxx index 55f295a4147..9fbe7e52775 100644 --- a/Modules/IO/ImageBase/test/itkMatrixImageWriteReadTest.cxx +++ b/Modules/IO/ImageBase/test/itkMatrixImageWriteReadTest.cxx @@ -113,7 +113,7 @@ itkMatrixImageWriteReadTest(int argc, char * argv[]) const MatrixImageType::ConstPointer matrixImage2 = matrixReader->GetOutput(); // Compare the read values to the original values - constexpr float tolerance = 1e-5; + constexpr float tolerance{ 1e-5 }; itk::ImageRegionConstIterator tItr(matrixImage2, region); itk::ImageRegionConstIterator mItr(matrixImage1, region); diff --git a/Modules/IO/ImageBase/test/itkVectorImageReadWriteTest.cxx b/Modules/IO/ImageBase/test/itkVectorImageReadWriteTest.cxx index 58b75405df2..2049a5694cc 100644 --- a/Modules/IO/ImageBase/test/itkVectorImageReadWriteTest.cxx +++ b/Modules/IO/ImageBase/test/itkVectorImageReadWriteTest.cxx @@ -33,7 +33,7 @@ itkVectorImageReadWriteTest(int argc, char * argv[]) // Test for vector pixel type. - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; // Create image of vector pixels using PixelType = itk::Vector; diff --git a/Modules/IO/JPEG/test/itkJPEGImageIOBrokenCasesTest.cxx b/Modules/IO/JPEG/test/itkJPEGImageIOBrokenCasesTest.cxx index 4d829db1a05..d4121a3169c 100644 --- a/Modules/IO/JPEG/test/itkJPEGImageIOBrokenCasesTest.cxx +++ b/Modules/IO/JPEG/test/itkJPEGImageIOBrokenCasesTest.cxx @@ -32,7 +32,7 @@ itkJPEGImageIOBrokenCasesTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/IO/JPEG/test/itkJPEGImageIOCMYKTest.cxx b/Modules/IO/JPEG/test/itkJPEGImageIOCMYKTest.cxx index a0a9c6a3948..81c95aabe7e 100644 --- a/Modules/IO/JPEG/test/itkJPEGImageIOCMYKTest.cxx +++ b/Modules/IO/JPEG/test/itkJPEGImageIOCMYKTest.cxx @@ -31,7 +31,7 @@ itkJPEGImageIOCMYKTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/IO/JPEG/test/itkJPEGImageIODegenerateCasesTest.cxx b/Modules/IO/JPEG/test/itkJPEGImageIODegenerateCasesTest.cxx index 7c27a6618ca..3f9fd76daf3 100644 --- a/Modules/IO/JPEG/test/itkJPEGImageIODegenerateCasesTest.cxx +++ b/Modules/IO/JPEG/test/itkJPEGImageIODegenerateCasesTest.cxx @@ -32,7 +32,7 @@ itkJPEGImageIODegenerateCasesTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/IO/JPEG/test/itkJPEGImageIOTest.cxx b/Modules/IO/JPEG/test/itkJPEGImageIOTest.cxx index edcc08260db..e5ac94dcf46 100644 --- a/Modules/IO/JPEG/test/itkJPEGImageIOTest.cxx +++ b/Modules/IO/JPEG/test/itkJPEGImageIOTest.cxx @@ -38,7 +38,7 @@ itkJPEGImageIOTest(int argc, char * argv[]) // ATTENTION THIS IS THE PIXEL TYPE FOR // THE RESULTING IMAGE - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using myImage = itk::Image; diff --git a/Modules/IO/JPEG/test/itkJPEGImageIOTest2.cxx b/Modules/IO/JPEG/test/itkJPEGImageIOTest2.cxx index 6a367295cf5..a2c3b11980b 100644 --- a/Modules/IO/JPEG/test/itkJPEGImageIOTest2.cxx +++ b/Modules/IO/JPEG/test/itkJPEGImageIOTest2.cxx @@ -31,7 +31,7 @@ itkJPEGImageIOTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; @@ -72,7 +72,7 @@ itkJPEGImageIOTest2(int argc, char * argv[]) ImageType::SpacingType readSpacing = readImage->GetSpacing(); - constexpr double tolerance = 1e-1; + constexpr double tolerance{ 1e-1 }; if (itk::Math::abs(readSpacing[0] - spacing[0]) > tolerance) { diff --git a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIORegionOfInterest.cxx b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIORegionOfInterest.cxx index 8162a7b9bc8..0aaf67becd3 100644 --- a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIORegionOfInterest.cxx +++ b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIORegionOfInterest.cxx @@ -41,7 +41,7 @@ itkJPEG2000ImageIORegionOfInterest(int argc, char * argv[]) // Image types are defined below. using InputPixelType = unsigned char; using OutputPixelType = unsigned char; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputImageType = itk::Image; using OutputImageType = itk::Image; diff --git a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest01.cxx b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest01.cxx index c6c4c0f1abc..c8a8e932cc9 100644 --- a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest01.cxx +++ b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest01.cxx @@ -41,7 +41,7 @@ itkJPEG2000ImageIOTest01(int argc, char * argv[]) // Image types are defined below. using InputPixelType = unsigned char; using OutputPixelType = unsigned char; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputImageType = itk::Image; using OutputImageType = itk::Image; diff --git a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest02.cxx b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest02.cxx index 27f486e14b3..25033a27c2c 100644 --- a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest02.cxx +++ b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest02.cxx @@ -41,7 +41,7 @@ itkJPEG2000ImageIOTest02(int argc, char * argv[]) // Image types are defined below. using InputPixelType = unsigned short; using OutputPixelType = unsigned short; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputImageType = itk::Image; using OutputImageType = itk::Image; diff --git a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest03.cxx b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest03.cxx index c391ce58a45..e5dd6d234da 100644 --- a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest03.cxx +++ b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest03.cxx @@ -39,7 +39,7 @@ itkJPEG2000ImageIOTest03(int argc, char * argv[]) // Image types are defined below. using PixelType = itk::RGBPixel; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputImageType = itk::Image; using OutputImageType = itk::Image; diff --git a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest04.cxx b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest04.cxx index f4942554644..6741439e657 100644 --- a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest04.cxx +++ b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest04.cxx @@ -40,7 +40,7 @@ itkJPEG2000ImageIOTest04(int argc, char * argv[]) // Image types are defined below. using PixelType = itk::RGBPixel; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputImageType = itk::Image; using OutputImageType = itk::Image; diff --git a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest06.cxx b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest06.cxx index 67c88715994..5c8fe5f976f 100644 --- a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest06.cxx +++ b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest06.cxx @@ -40,7 +40,7 @@ itkJPEG2000ImageIOTest06(int argc, char * argv[]) // Image types are defined below. using PixelType = itk::RGBPixel; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputImageType = itk::Image; using OutputImageType = itk::Image; diff --git a/Modules/IO/LSM/src/itkLSMImageIO.cxx b/Modules/IO/LSM/src/itkLSMImageIO.cxx index 8a687fbb10c..868130b5f95 100644 --- a/Modules/IO/LSM/src/itkLSMImageIO.cxx +++ b/Modules/IO/LSM/src/itkLSMImageIO.cxx @@ -32,9 +32,9 @@ #include "itk_tiff.h" /* Structure with LSM-specific data ( only in the first image directory). */ -constexpr uint32_t TIF_CZ_LSMINFO = 34412; /* 0x866c, Type: TIF_BYTE, Length: 512 */ -constexpr uint32_t TIF_CZ_LSMINFO_SIZE_RESERVED = 90 + 6; -constexpr uint32_t TIF_CZ_LSMINFO_SIZE = 512; +constexpr uint32_t TIF_CZ_LSMINFO{ 34412 }; /* 0x866c, Type: TIF_BYTE, Length: 512 */ +constexpr uint32_t TIF_CZ_LSMINFO_SIZE_RESERVED{ 90 + 6 }; +constexpr uint32_t TIF_CZ_LSMINFO_SIZE{ 512 }; namespace itk { @@ -261,7 +261,7 @@ LSMImageIO::Write(const void * buffer) itkExceptionStringMacro("TIFF supports unsigned char and unsigned short"); } - constexpr float resolution = -1; + constexpr float resolution{ -1 }; TIFF * tif = TIFFOpen(m_FileName.c_str(), "w"); if (!tif) { diff --git a/Modules/IO/LSM/test/itkLSMImageIOTest.cxx b/Modules/IO/LSM/test/itkLSMImageIOTest.cxx index fbe1fb82cdd..94dc421c7b8 100644 --- a/Modules/IO/LSM/test/itkLSMImageIOTest.cxx +++ b/Modules/IO/LSM/test/itkLSMImageIOTest.cxx @@ -34,7 +34,7 @@ itkLSMImageIOTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimensions = 2; + constexpr unsigned int Dimensions{ 2 }; using InputPixelType = itk::RGBPixel; using InputImageType = itk::Image; diff --git a/Modules/IO/MINC/test/itkMINCImageIOTest2.cxx b/Modules/IO/MINC/test/itkMINCImageIOTest2.cxx index e89adefccb6..ab0061d0695 100644 --- a/Modules/IO/MINC/test/itkMINCImageIOTest2.cxx +++ b/Modules/IO/MINC/test/itkMINCImageIOTest2.cxx @@ -45,7 +45,7 @@ itkMINCImageIOTest2(int argc, char * argv[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(mincIO1, MINCImageIO, ImageIOBase); - constexpr unsigned int supportedDimCount = 4; // includes the degenerate 0-dimensional case + constexpr unsigned int supportedDimCount{ 4 }; // includes the degenerate 0-dimensional case std::vector supportedDims(supportedDimCount); std::iota(std::begin(supportedDims), std::end(supportedDims), 0); for (const auto & value : supportedDims) diff --git a/Modules/IO/MINC/test/itkMINCImageIOTest4.cxx b/Modules/IO/MINC/test/itkMINCImageIOTest4.cxx index be8f92310ac..7105e185989 100644 --- a/Modules/IO/MINC/test/itkMINCImageIOTest4.cxx +++ b/Modules/IO/MINC/test/itkMINCImageIOTest4.cxx @@ -157,7 +157,7 @@ itkMINCImageIOTest4(int argc, char * argv[]) } } - constexpr double epsilon = 1e-3; + constexpr double epsilon{ 1e-3 }; try { diff --git a/Modules/IO/MINC/test/itkMINCImageIOTest_2D.cxx b/Modules/IO/MINC/test/itkMINCImageIOTest_2D.cxx index 47effd032e7..e93872755e9 100644 --- a/Modules/IO/MINC/test/itkMINCImageIOTest_2D.cxx +++ b/Modules/IO/MINC/test/itkMINCImageIOTest_2D.cxx @@ -129,7 +129,7 @@ itkMINCImageIOTest_2D(int argc, char * argv[]) } } - constexpr double epsilon = 1e-3; + constexpr double epsilon{ 1e-3 }; try { diff --git a/Modules/IO/Mesh/test/itkMeshFileReadWriteTest.cxx b/Modules/IO/Mesh/test/itkMeshFileReadWriteTest.cxx index ea5e38bf73a..bae4d1d6d85 100644 --- a/Modules/IO/Mesh/test/itkMeshFileReadWriteTest.cxx +++ b/Modules/IO/Mesh/test/itkMeshFileReadWriteTest.cxx @@ -33,7 +33,7 @@ itkMeshFileReadWriteTest(int argc, char * argv[]) const bool IsBinary = (argc > 3); - constexpr unsigned int dimension = 3; + constexpr unsigned int dimension{ 3 }; using PixelType = float; using MeshType = itk::Mesh; diff --git a/Modules/IO/MeshBYU/test/itkBYUMeshIOTest.cxx b/Modules/IO/MeshBYU/test/itkBYUMeshIOTest.cxx index bf43f1ef599..36b3469ce0e 100644 --- a/Modules/IO/MeshBYU/test/itkBYUMeshIOTest.cxx +++ b/Modules/IO/MeshBYU/test/itkBYUMeshIOTest.cxx @@ -92,8 +92,8 @@ itkBYUMeshIOTest(int argc, char * argv[]) ITK_TEST_EXPECT_EQUAL(numberOfCellPixels, byuMeshIO->GetNumberOfCellPixels()); // Use sufficiently large buffer sizes - constexpr itk::SizeValueType pointBufferSize = 1000; - constexpr itk::SizeValueType cellBufferSize = 1000; + constexpr itk::SizeValueType pointBufferSize{ 1000 }; + constexpr itk::SizeValueType cellBufferSize{ 1000 }; const std::shared_ptr pointBuffer = itk::MeshIOTestHelper::AllocateBuffer(byuMeshIO->GetPointComponentType(), pointBufferSize); diff --git a/Modules/IO/MeshBYU/test/itkMeshFileReadWriteTest.cxx b/Modules/IO/MeshBYU/test/itkMeshFileReadWriteTest.cxx index 51c3190c394..060ea89cc03 100644 --- a/Modules/IO/MeshBYU/test/itkMeshFileReadWriteTest.cxx +++ b/Modules/IO/MeshBYU/test/itkMeshFileReadWriteTest.cxx @@ -34,7 +34,7 @@ itkMeshFileReadWriteTest(int argc, char * argv[]) const bool isBinary = (argc > 3); - constexpr unsigned int dimension = 3; + constexpr unsigned int dimension{ 3 }; using PixelType = float; using MeshType = itk::Mesh; diff --git a/Modules/IO/MeshBase/include/itkMeshFileTestHelper.h b/Modules/IO/MeshBase/include/itkMeshFileTestHelper.h index 9f24298c467..f7be85f0249 100644 --- a/Modules/IO/MeshBase/include/itkMeshFileTestHelper.h +++ b/Modules/IO/MeshBase/include/itkMeshFileTestHelper.h @@ -46,7 +46,7 @@ TestPointsContainer(typename TMesh::PointsContainerPointer points0, typename TMe PointsContainerConstIterator pt0 = points0->Begin(); PointsContainerConstIterator pt1 = points1->Begin(); - constexpr double tol = 1e-6; + constexpr double tol{ 1e-6 }; while ((pt0 != points0->End()) && (pt1 != points1->End())) { if (pt0->Index() != pt1->Index()) diff --git a/Modules/IO/MeshBase/include/itkMeshIOTestHelper.h b/Modules/IO/MeshBase/include/itkMeshIOTestHelper.h index 88958c1c404..07d0f29f15a 100644 --- a/Modules/IO/MeshBase/include/itkMeshIOTestHelper.h +++ b/Modules/IO/MeshBase/include/itkMeshIOTestHelper.h @@ -60,7 +60,7 @@ TestBaseClassMethodsMeshIO(typename TMeshIO::Pointer meshIO) { using FloatType = float; - constexpr FloatType floatValue = 1.0; + constexpr FloatType floatValue{ 1.0 }; bool usePointPixel = true; meshIO->SetPixelType(floatValue, usePointPixel); LOCAL_ITK_TEST_SET_GET_VALUE(1, meshIO->GetNumberOfPointPixelComponents()); @@ -112,7 +112,7 @@ TestBaseClassMethodsMeshIO(typename TMeshIO::Pointer meshIO) LOCAL_ITK_TEST_SET_GET_VALUE(itk::IOPixelEnum::RGBA, meshIO->GetCellPixelType()); - constexpr itk::SizeValueType length = 5; + constexpr itk::SizeValueType length{ 5 }; using VectorPixelType = itk::Vector; auto vectorValue = itk::MakeFilled(1.0); @@ -203,8 +203,8 @@ TestBaseClassMethodsMeshIO(typename TMeshIO::Pointer meshIO) LOCAL_ITK_TEST_SET_GET_VALUE(itk::IOPixelEnum::DIFFUSIONTENSOR3D, meshIO->GetCellPixelType()); - constexpr itk::SizeValueType rows = 2; - constexpr itk::SizeValueType cols = 2; + constexpr itk::SizeValueType rows{ 2 }; + constexpr itk::SizeValueType cols{ 2 }; using MatrixPixelType = itk::Matrix; auto matrixPixelValue = itk::MakeFilled(1.0); @@ -313,27 +313,27 @@ TestBaseClassMethodsMeshIO(typename TMeshIO::Pointer meshIO) meshIO->SetCellComponentType(cellComponentType); LOCAL_ITK_TEST_SET_GET_VALUE(cellComponentType, meshIO->GetCellComponentType()); - constexpr unsigned int pointDimension = 2; + constexpr unsigned int pointDimension{ 2 }; meshIO->SetPointDimension(pointDimension); LOCAL_ITK_TEST_SET_GET_VALUE(pointDimension, meshIO->GetPointDimension()); - constexpr itk::MeshIOBase::SizeValueType numberOfPoints = 400; + constexpr itk::MeshIOBase::SizeValueType numberOfPoints{ 400 }; meshIO->SetNumberOfPoints(numberOfPoints); LOCAL_ITK_TEST_SET_GET_VALUE(numberOfPoints, meshIO->GetNumberOfPoints()); - constexpr itk::MeshIOBase::SizeValueType numberOfCells = 100; + constexpr itk::MeshIOBase::SizeValueType numberOfCells{ 100 }; meshIO->SetNumberOfCells(numberOfCells); LOCAL_ITK_TEST_SET_GET_VALUE(numberOfCells, meshIO->GetNumberOfCells()); - constexpr itk::MeshIOBase::SizeValueType numberOfPointPixels = 200; + constexpr itk::MeshIOBase::SizeValueType numberOfPointPixels{ 200 }; meshIO->SetNumberOfPointPixels(numberOfPointPixels); LOCAL_ITK_TEST_SET_GET_VALUE(numberOfPointPixels, meshIO->GetNumberOfPointPixels()); - constexpr itk::MeshIOBase::SizeValueType numberOfCellPixels = 600; + constexpr itk::MeshIOBase::SizeValueType numberOfCellPixels{ 600 }; meshIO->SetNumberOfCellPixels(numberOfCellPixels); LOCAL_ITK_TEST_SET_GET_VALUE(numberOfCellPixels, meshIO->GetNumberOfCellPixels()); - constexpr itk::MeshIOBase::SizeValueType cellBufferSize = 1000; + constexpr itk::MeshIOBase::SizeValueType cellBufferSize{ 1000 }; meshIO->SetCellBufferSize(cellBufferSize); LOCAL_ITK_TEST_SET_GET_VALUE(cellBufferSize, meshIO->GetCellBufferSize()); diff --git a/Modules/IO/MeshBase/test/itkMeshFileReaderWriterTest.cxx b/Modules/IO/MeshBase/test/itkMeshFileReaderWriterTest.cxx index 486fe7782cb..ed357c595f5 100644 --- a/Modules/IO/MeshBase/test/itkMeshFileReaderWriterTest.cxx +++ b/Modules/IO/MeshBase/test/itkMeshFileReaderWriterTest.cxx @@ -35,7 +35,7 @@ itkMeshFileReaderWriterTest(int argc, char * argv[]) } using coord = double; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using MeshType = itk::QuadEdgeMesh; diff --git a/Modules/IO/MeshFreeSurfer/include/itkFreeSurferAsciiMeshIO.h b/Modules/IO/MeshFreeSurfer/include/itkFreeSurferAsciiMeshIO.h index 0358d9c6533..2703c1780bc 100644 --- a/Modules/IO/MeshFreeSurfer/include/itkFreeSurferAsciiMeshIO.h +++ b/Modules/IO/MeshFreeSurfer/include/itkFreeSurferAsciiMeshIO.h @@ -134,7 +134,7 @@ class ITKIOMeshFreeSurfer_EXPORT FreeSurferAsciiMeshIO : public MeshIOBase void WriteCells(T * buffer, std::ofstream & outputFile, T label = T{}) { - constexpr unsigned int numberOfCellPoints = 3; + constexpr unsigned int numberOfCellPoints{ 3 }; SizeValueType index = 0; const auto data = make_unique_for_overwrite(this->m_NumberOfCells * numberOfCellPoints); diff --git a/Modules/IO/MeshFreeSurfer/include/itkFreeSurferBinaryMeshIO.h b/Modules/IO/MeshFreeSurfer/include/itkFreeSurferBinaryMeshIO.h index 7701a087399..fffc0f4f74c 100644 --- a/Modules/IO/MeshFreeSurfer/include/itkFreeSurferBinaryMeshIO.h +++ b/Modules/IO/MeshFreeSurfer/include/itkFreeSurferBinaryMeshIO.h @@ -139,7 +139,7 @@ class ITKIOMeshFreeSurfer_EXPORT FreeSurferBinaryMeshIO : public MeshIOBase void WriteCells(T * buffer, std::ofstream & outputFile) { - constexpr itk::uint32_t numberOfCellPoints = 3; + constexpr itk::uint32_t numberOfCellPoints{ 3 }; const auto data = make_unique_for_overwrite(this->m_NumberOfCells * numberOfCellPoints); diff --git a/Modules/IO/MeshFreeSurfer/src/itkFreeSurferAsciiMeshIO.cxx b/Modules/IO/MeshFreeSurfer/src/itkFreeSurferAsciiMeshIO.cxx index 63ea898efba..c610eb5507c 100644 --- a/Modules/IO/MeshFreeSurfer/src/itkFreeSurferAsciiMeshIO.cxx +++ b/Modules/IO/MeshFreeSurfer/src/itkFreeSurferAsciiMeshIO.cxx @@ -91,8 +91,8 @@ FreeSurferAsciiMeshIO::ReadMeshInformation() OpenFile(); // Read the ASCII file information - constexpr int numberOfInfoLines = 1; - constexpr unsigned int numberOfCellPoints = 3; + constexpr int numberOfInfoLines{ 1 }; + constexpr unsigned int numberOfCellPoints{ 3 }; std::string line; for (int ii = 0; ii < numberOfInfoLines; ++ii) @@ -163,7 +163,7 @@ FreeSurferAsciiMeshIO::ReadCells(void * buffer) // Get cell buffer m_InputFile.precision(12); SizeValueType index = 0; - constexpr unsigned int numberOfCellPoints = 3; + constexpr unsigned int numberOfCellPoints{ 3 }; const auto data = make_unique_for_overwrite(this->m_NumberOfCells * numberOfCellPoints); float value = NAN; diff --git a/Modules/IO/MeshFreeSurfer/src/itkFreeSurferBinaryMeshIO.cxx b/Modules/IO/MeshFreeSurfer/src/itkFreeSurferBinaryMeshIO.cxx index 47e06a207d6..c14cce3e07b 100644 --- a/Modules/IO/MeshFreeSurfer/src/itkFreeSurferBinaryMeshIO.cxx +++ b/Modules/IO/MeshFreeSurfer/src/itkFreeSurferBinaryMeshIO.cxx @@ -98,7 +98,7 @@ FreeSurferBinaryMeshIO::ReadMeshInformation() OpenFile(); // Define required variables - constexpr unsigned int fileTypeIdLength = 3; + constexpr unsigned int fileTypeIdLength{ 3 }; unsigned char fileTypeId[fileTypeIdLength]; this->m_FileType = IOFileEnum::BINARY; @@ -118,7 +118,7 @@ FreeSurferBinaryMeshIO::ReadMeshInformation() // If input file is freesurfer binary surface file if (m_FileTypeIdentifier == (-2 & 0x00ffffff)) { - constexpr unsigned int numberOfCellPoints = 3; + constexpr unsigned int numberOfCellPoints{ 3 }; // Read input comment // Extract Comment, and ignore it. int byte = m_InputFile.get(); @@ -241,7 +241,7 @@ FreeSurferBinaryMeshIO::ReadPoints(void * buffer) void FreeSurferBinaryMeshIO::ReadCells(void * buffer) { - constexpr unsigned int numberOfCellPoints = 3; + constexpr unsigned int numberOfCellPoints{ 3 }; const auto data = make_unique_for_overwrite(this->m_NumberOfCells * numberOfCellPoints); m_InputFile.read(reinterpret_cast(data.get()), @@ -296,7 +296,7 @@ FreeSurferBinaryMeshIO::WriteMeshInformation() if (this->m_UpdatePoints && this->m_UpdateCells) { // MAGIC_NUMBER = 16777214 ( little endian ) - constexpr char buffer[3] = { static_cast(255), static_cast(255), static_cast(254) }; + constexpr char buffer[3]{ static_cast(255), static_cast(255), static_cast(254) }; outputFile.write(buffer, 3); const std::string creator = "Created by ITK \n\n"; @@ -310,12 +310,12 @@ FreeSurferBinaryMeshIO::WriteMeshInformation() else if (this->m_UpdatePointData && (!this->m_UpdatePoints && !this->m_UpdateCells)) { // MAGIC_NUMBER = 16777215 ( little endian ) - constexpr char buffer[3] = { static_cast(255), static_cast(255), static_cast(255) }; + constexpr char buffer[3]{ static_cast(255), static_cast(255), static_cast(255) }; outputFile.write(buffer, 3); auto numberOfPoints = static_cast(this->m_NumberOfPointPixels); auto numberOfCells = static_cast(this->m_NumberOfCells); - constexpr itk::uint32_t numberOfValuesPerPoint = 1; + constexpr itk::uint32_t numberOfValuesPerPoint{ 1 }; itk::ByteSwapper::SwapWriteRangeFromSystemToBigEndian(&numberOfPoints, 1, &outputFile); itk::ByteSwapper::SwapWriteRangeFromSystemToBigEndian(&numberOfCells, 1, &outputFile); itk::ByteSwapper::SwapWriteRangeFromSystemToBigEndian(&numberOfValuesPerPoint, 1, &outputFile); diff --git a/Modules/IO/MeshFreeSurfer/test/itkMeshFileReadWriteTest.cxx b/Modules/IO/MeshFreeSurfer/test/itkMeshFileReadWriteTest.cxx index fc2fdb68fdb..acf80848c2b 100644 --- a/Modules/IO/MeshFreeSurfer/test/itkMeshFileReadWriteTest.cxx +++ b/Modules/IO/MeshFreeSurfer/test/itkMeshFileReadWriteTest.cxx @@ -34,7 +34,7 @@ itkMeshFileReadWriteTest(int argc, char * argv[]) const bool isBinary = (argc > 3); - constexpr unsigned int dimension = 3; + constexpr unsigned int dimension{ 3 }; using PixelType = float; using MeshType = itk::Mesh; diff --git a/Modules/IO/MeshGifti/src/itkGiftiMeshIO.cxx b/Modules/IO/MeshGifti/src/itkGiftiMeshIO.cxx index 901d70c7a72..f428a5a0638 100644 --- a/Modules/IO/MeshGifti/src/itkGiftiMeshIO.cxx +++ b/Modules/IO/MeshGifti/src/itkGiftiMeshIO.cxx @@ -771,7 +771,7 @@ GiftiMeshIO::WriteMeshInformation() } m_GiftiImage->darray[dalist[0]]->nvals = nvals; - constexpr int dtype = NIFTI_TYPE_FLOAT32; + constexpr int dtype{ NIFTI_TYPE_FLOAT32 }; // Set intent of data array gifti_set_atr_in_DAs(m_GiftiImage, "Intent", gifti_intent_to_string(NIFTI_INTENT_POINTSET), dalist, 1); @@ -843,7 +843,7 @@ GiftiMeshIO::WriteMeshInformation() } m_GiftiImage->darray[dalist[0]]->nvals = nvals; - constexpr int dtype = NIFTI_TYPE_INT32; + constexpr int dtype{ NIFTI_TYPE_INT32 }; // Set intent of data array gifti_set_atr_in_DAs(m_GiftiImage, "Intent", gifti_intent_to_string(NIFTI_INTENT_TRIANGLE), dalist, 1); diff --git a/Modules/IO/MeshGifti/test/itkGiftiMeshIOTest.cxx b/Modules/IO/MeshGifti/test/itkGiftiMeshIOTest.cxx index a97994e495d..49419ab9216 100644 --- a/Modules/IO/MeshGifti/test/itkGiftiMeshIOTest.cxx +++ b/Modules/IO/MeshGifti/test/itkGiftiMeshIOTest.cxx @@ -134,11 +134,11 @@ itkGiftiMeshIOTest(int argc, char * argv[]) ITK_TEST_EXPECT_EQUAL(numberOfCellPixels, giftiMeshIO->GetNumberOfCellPixels()); // Use sufficiently large buffer sizes - constexpr itk::SizeValueType pointBufferSize = 1000000; - constexpr itk::SizeValueType pointDataBufferSize = 1000000; + constexpr itk::SizeValueType pointBufferSize{ 1000000 }; + constexpr itk::SizeValueType pointDataBufferSize{ 1000000 }; - constexpr itk::SizeValueType cellBufferSize = 1000000; - constexpr itk::SizeValueType cellDataBufferSize = 1000000; + constexpr itk::SizeValueType cellBufferSize{ 1000000 }; + constexpr itk::SizeValueType cellDataBufferSize{ 1000000 }; const std::shared_ptr pointBuffer = itk::MeshIOTestHelper::AllocateBuffer(giftiMeshIO->GetPointComponentType(), pointBufferSize); @@ -165,7 +165,7 @@ itkGiftiMeshIOTest(int argc, char * argv[]) const unsigned int numberOfPointPixelComponents = giftiMeshIO->GetNumberOfPointPixelComponents(); if (numberOfPointPixelComponents != 1 && numberOfPointPixelComponents != 3) { - constexpr bool localUpdatePointData = true; + constexpr bool localUpdatePointData{ true }; giftiMeshIO->SetUpdatePointData(localUpdatePointData); ITK_TRY_EXPECT_EXCEPTION(giftiMeshIO->WriteMeshInformation()); @@ -175,7 +175,7 @@ itkGiftiMeshIOTest(int argc, char * argv[]) const unsigned int numberOfCellPixelComponents = giftiMeshIO->GetNumberOfCellPixelComponents(); if (numberOfCellPixelComponents != 1 && numberOfCellPixelComponents != 3) { - constexpr bool localUpdateCellData = true; + constexpr bool localUpdateCellData{ true }; giftiMeshIO->SetUpdateCellData(localUpdateCellData); ITK_TRY_EXPECT_EXCEPTION(giftiMeshIO->WriteMeshInformation()); diff --git a/Modules/IO/MeshGifti/test/itkMeshFileReadWriteTest.cxx b/Modules/IO/MeshGifti/test/itkMeshFileReadWriteTest.cxx index fc2fdb68fdb..acf80848c2b 100644 --- a/Modules/IO/MeshGifti/test/itkMeshFileReadWriteTest.cxx +++ b/Modules/IO/MeshGifti/test/itkMeshFileReadWriteTest.cxx @@ -34,7 +34,7 @@ itkMeshFileReadWriteTest(int argc, char * argv[]) const bool isBinary = (argc > 3); - constexpr unsigned int dimension = 3; + constexpr unsigned int dimension{ 3 }; using PixelType = float; using MeshType = itk::Mesh; diff --git a/Modules/IO/MeshOBJ/test/itkMeshFileReadWriteTest.cxx b/Modules/IO/MeshOBJ/test/itkMeshFileReadWriteTest.cxx index fc2fdb68fdb..acf80848c2b 100644 --- a/Modules/IO/MeshOBJ/test/itkMeshFileReadWriteTest.cxx +++ b/Modules/IO/MeshOBJ/test/itkMeshFileReadWriteTest.cxx @@ -34,7 +34,7 @@ itkMeshFileReadWriteTest(int argc, char * argv[]) const bool isBinary = (argc > 3); - constexpr unsigned int dimension = 3; + constexpr unsigned int dimension{ 3 }; using PixelType = float; using MeshType = itk::Mesh; diff --git a/Modules/IO/MeshOBJ/test/itkOBJMeshIOTest.cxx b/Modules/IO/MeshOBJ/test/itkOBJMeshIOTest.cxx index 7a367a2c233..2c4fb0a3e2d 100644 --- a/Modules/IO/MeshOBJ/test/itkOBJMeshIOTest.cxx +++ b/Modules/IO/MeshOBJ/test/itkOBJMeshIOTest.cxx @@ -96,10 +96,10 @@ itkOBJMeshIOTest(int argc, char * argv[]) ITK_TEST_EXPECT_EQUAL(numberOfCellPixels, objMeshIO->GetNumberOfCellPixels()); // Use sufficiently large buffer sizes - constexpr itk::SizeValueType pointBufferSize = 100000; - constexpr itk::SizeValueType pointDataBufferSize = 100000; + constexpr itk::SizeValueType pointBufferSize{ 100000 }; + constexpr itk::SizeValueType pointDataBufferSize{ 100000 }; - constexpr itk::SizeValueType cellBufferSize = 100000; + constexpr itk::SizeValueType cellBufferSize{ 100000 }; const std::shared_ptr pointBuffer = itk::MeshIOTestHelper::AllocateBuffer(objMeshIO->GetPointComponentType(), pointBufferSize); const std::shared_ptr pointDataBuffer = diff --git a/Modules/IO/MeshOFF/src/itkOFFMeshIO.cxx b/Modules/IO/MeshOFF/src/itkOFFMeshIO.cxx index 30797bcca10..9373632d7a3 100644 --- a/Modules/IO/MeshOFF/src/itkOFFMeshIO.cxx +++ b/Modules/IO/MeshOFF/src/itkOFFMeshIO.cxx @@ -363,7 +363,7 @@ OFFMeshIO::WriteMeshInformation() outputFile << this->m_NumberOfCells << " "; // Write number of edges - constexpr unsigned int numberOfEdges = 0; + constexpr unsigned int numberOfEdges{ 0 }; outputFile << numberOfEdges << std::endl; } else if (this->m_FileType == IOFileEnum::BINARY) diff --git a/Modules/IO/MeshOFF/test/itkMeshFileReadWriteTest.cxx b/Modules/IO/MeshOFF/test/itkMeshFileReadWriteTest.cxx index fd2a1f16c67..0b312454db0 100644 --- a/Modules/IO/MeshOFF/test/itkMeshFileReadWriteTest.cxx +++ b/Modules/IO/MeshOFF/test/itkMeshFileReadWriteTest.cxx @@ -34,7 +34,7 @@ itkMeshFileReadWriteTest(int argc, char * argv[]) const bool isBinary = (argc > 3); - constexpr unsigned int dimension = 3; + constexpr unsigned int dimension{ 3 }; using PixelType = float; using MeshType = itk::Mesh; diff --git a/Modules/IO/MeshOFF/test/itkOFFMeshIOTest.cxx b/Modules/IO/MeshOFF/test/itkOFFMeshIOTest.cxx index b81c8cf3932..ff778f3195f 100644 --- a/Modules/IO/MeshOFF/test/itkOFFMeshIOTest.cxx +++ b/Modules/IO/MeshOFF/test/itkOFFMeshIOTest.cxx @@ -95,8 +95,8 @@ itkOFFMeshIOTest(int argc, char * argv[]) ITK_TEST_EXPECT_EQUAL(numberOfCellPixels, offMeshIO->GetNumberOfCellPixels()); // Use sufficiently large buffer sizes - constexpr itk::SizeValueType pointBufferSize = 1000; - constexpr itk::SizeValueType cellBufferSize = 1000; + constexpr itk::SizeValueType pointBufferSize{ 1000 }; + constexpr itk::SizeValueType cellBufferSize{ 1000 }; const std::shared_ptr pointBuffer = itk::MeshIOTestHelper::AllocateBuffer(offMeshIO->GetPointComponentType(), pointBufferSize); diff --git a/Modules/IO/MeshVTK/test/itkMeshFileReadWriteTest.cxx b/Modules/IO/MeshVTK/test/itkMeshFileReadWriteTest.cxx index 08781613a6e..fd97e85bca1 100644 --- a/Modules/IO/MeshVTK/test/itkMeshFileReadWriteTest.cxx +++ b/Modules/IO/MeshVTK/test/itkMeshFileReadWriteTest.cxx @@ -34,7 +34,7 @@ itkMeshFileReadWriteTest(int argc, char * argv[]) const bool isBinary = (argc > 3); - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = float; using MeshType = itk::Mesh; diff --git a/Modules/IO/MeshVTK/test/itkMeshFileReadWriteVectorAttributeTest.cxx b/Modules/IO/MeshVTK/test/itkMeshFileReadWriteVectorAttributeTest.cxx index cb9908ea487..ccd155a7f80 100644 --- a/Modules/IO/MeshVTK/test/itkMeshFileReadWriteVectorAttributeTest.cxx +++ b/Modules/IO/MeshVTK/test/itkMeshFileReadWriteVectorAttributeTest.cxx @@ -34,7 +34,7 @@ itkMeshFileReadWriteVectorAttributeTest(int argc, char * argv[]) const bool isBinary = (argc > 3); - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = itk::CovariantVector; using MeshType = itk::Mesh; diff --git a/Modules/IO/MeshVTK/test/itkMeshFileWriteReadTensorTest.cxx b/Modules/IO/MeshVTK/test/itkMeshFileWriteReadTensorTest.cxx index ebeaf32c1fe..462849f53e6 100644 --- a/Modules/IO/MeshVTK/test/itkMeshFileWriteReadTensorTest.cxx +++ b/Modules/IO/MeshVTK/test/itkMeshFileWriteReadTensorTest.cxx @@ -72,7 +72,7 @@ itkMeshFileWriteReadTensorTest(int argc, char * argv[]) mesh2dWriter->SetFileName(outputMesh2D); ITK_TEST_SET_GET_VALUE(outputMesh2D, std::string(mesh2dWriter->GetFileName())); - constexpr bool useCompression = false; + constexpr bool useCompression{ false }; ITK_TEST_SET_GET_BOOLEAN(mesh2dWriter, UseCompression, useCompression); mesh2dWriter->SetInput(mesh2d); diff --git a/Modules/IO/MeshVTK/test/itkPolylineReadWriteTest.cxx b/Modules/IO/MeshVTK/test/itkPolylineReadWriteTest.cxx index 71c0fcd7df3..3333280c17f 100644 --- a/Modules/IO/MeshVTK/test/itkPolylineReadWriteTest.cxx +++ b/Modules/IO/MeshVTK/test/itkPolylineReadWriteTest.cxx @@ -34,7 +34,7 @@ itkPolylineReadWriteTest(int argc, char * argv[]) const bool isBinary = (argc > 3); - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = itk::VariableLengthVector; using MeshType = itk::Mesh; diff --git a/Modules/IO/MeshVTK/test/itkVTKPolyDataMeshIOTest.cxx b/Modules/IO/MeshVTK/test/itkVTKPolyDataMeshIOTest.cxx index 887ff737f0e..de80f07d483 100644 --- a/Modules/IO/MeshVTK/test/itkVTKPolyDataMeshIOTest.cxx +++ b/Modules/IO/MeshVTK/test/itkVTKPolyDataMeshIOTest.cxx @@ -114,11 +114,11 @@ itkVTKPolyDataMeshIOTest(int argc, char * argv[]) // Use sufficiently large buffer sizes - constexpr itk::SizeValueType pointBufferSize = 1000; - constexpr itk::SizeValueType pointDataBufferSize = 1000; + constexpr itk::SizeValueType pointBufferSize{ 1000 }; + constexpr itk::SizeValueType pointDataBufferSize{ 1000 }; - constexpr itk::SizeValueType cellBufferSize = 2000; - constexpr itk::SizeValueType cellDataBufferSize = 2000; + constexpr itk::SizeValueType cellBufferSize{ 2000 }; + constexpr itk::SizeValueType cellDataBufferSize{ 2000 }; const std::shared_ptr pointBuffer = itk::MeshIOTestHelper::AllocateBuffer(vtkPolyDataMeshIO->GetPointComponentType(), pointBufferSize); diff --git a/Modules/IO/Meta/test/itkLargeMetaImageWriteReadTest.cxx b/Modules/IO/Meta/test/itkLargeMetaImageWriteReadTest.cxx index ea6b7ae21b5..f217ebde225 100644 --- a/Modules/IO/Meta/test/itkLargeMetaImageWriteReadTest.cxx +++ b/Modules/IO/Meta/test/itkLargeMetaImageWriteReadTest.cxx @@ -159,7 +159,7 @@ itkLargeMetaImageWriteReadTest(int argc, char * argv[]) if (argc == 3) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned short; using ImageType = itk::Image; @@ -169,7 +169,7 @@ itkLargeMetaImageWriteReadTest(int argc, char * argv[]) return ActualTest(filename, size); } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = unsigned short; using ImageType = itk::Image; diff --git a/Modules/IO/Meta/test/itkMetaImageIOMetaDataTest.cxx b/Modules/IO/Meta/test/itkMetaImageIOMetaDataTest.cxx index 571da75ad29..ebfc589ebdd 100644 --- a/Modules/IO/Meta/test/itkMetaImageIOMetaDataTest.cxx +++ b/Modules/IO/Meta/test/itkMetaImageIOMetaDataTest.cxx @@ -156,7 +156,7 @@ itkMetaImageIOMetaDataTest(int argc, char * argv[]) } // write out an image -- using a random image source, but // the image data is irrelevant - constexpr int Dim(2); + constexpr int Dim{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; @@ -211,7 +211,7 @@ itkMetaImageIOMetaDataTest(int argc, char * argv[]) { // Add unsigned long const std::string key("unsigned_long"); - constexpr unsigned long value(27182818); + constexpr unsigned long value{ 27182818 }; itk::EncapsulateMetaData(dict, key, value); } { @@ -235,7 +235,7 @@ itkMetaImageIOMetaDataTest(int argc, char * argv[]) { // Add unsigned int const std::string key("unsigned_int"); - constexpr unsigned int value(2718281); + constexpr unsigned int value{ 2718281 }; itk::EncapsulateMetaData(dict, key, value); } { @@ -247,7 +247,7 @@ itkMetaImageIOMetaDataTest(int argc, char * argv[]) { // Add short const std::string key("unsigned_short"); - constexpr unsigned int value(8192); + constexpr unsigned int value{ 8192 }; itk::EncapsulateMetaData(dict, key, value); } { diff --git a/Modules/IO/Meta/test/itkMetaImageIOTest.cxx b/Modules/IO/Meta/test/itkMetaImageIOTest.cxx index 282e36f307a..acc8e5029a5 100644 --- a/Modules/IO/Meta/test/itkMetaImageIOTest.cxx +++ b/Modules/IO/Meta/test/itkMetaImageIOTest.cxx @@ -62,7 +62,7 @@ itkMetaImageIOTest(int argc, char * argv[]) // Test subsampling factor (change it then change it back) const unsigned int origSubSamplingFactor = metaIn->GetSubSamplingFactor(); - constexpr unsigned int subSamplingFactor = 2; + constexpr unsigned int subSamplingFactor{ 2 }; metaIn->SetSubSamplingFactor(subSamplingFactor); ITK_TEST_SET_GET_VALUE(subSamplingFactor, metaIn->GetSubSamplingFactor()); diff --git a/Modules/IO/Meta/test/itkMetaImageIOTest2.cxx b/Modules/IO/Meta/test/itkMetaImageIOTest2.cxx index 58e9164dee0..ac15b1dba58 100644 --- a/Modules/IO/Meta/test/itkMetaImageIOTest2.cxx +++ b/Modules/IO/Meta/test/itkMetaImageIOTest2.cxx @@ -40,7 +40,7 @@ TestUnknowMetaDataBug(const std::string & fname) using ImageType = itk::Image; ImageType::RegionType region; - constexpr ImageType::SizeType size = { { 32, 32 } }; + constexpr ImageType::SizeType size{ 32, 32 }; region.SetSize(size); auto image = ImageType::New(); diff --git a/Modules/IO/Meta/test/itkMetaImageStreamingIOTest.cxx b/Modules/IO/Meta/test/itkMetaImageStreamingIOTest.cxx index 61c1e05ebc3..76f5b05cff7 100644 --- a/Modules/IO/Meta/test/itkMetaImageStreamingIOTest.cxx +++ b/Modules/IO/Meta/test/itkMetaImageStreamingIOTest.cxx @@ -38,7 +38,7 @@ itkMetaImageStreamingIOTest(int argc, char * argv[]) // Image types are defined below. using InputPixelType = unsigned char; using OutputPixelType = unsigned char; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using InputImageType = itk::Image; using OutputImageType = itk::Image; diff --git a/Modules/IO/NIFTI/src/itkNiftiImageIO.cxx b/Modules/IO/NIFTI/src/itkNiftiImageIO.cxx index 3aaf8c5aad3..440cb6eec30 100644 --- a/Modules/IO/NIFTI/src/itkNiftiImageIO.cxx +++ b/Modules/IO/NIFTI/src/itkNiftiImageIO.cxx @@ -1880,7 +1880,7 @@ IsAffine(const mat44 & nifti_mat) // Make sure we adhere to the conditions of a 4x4 invertible affine transform matrix const double diff_matrix_array_one_norm = (inv4x4Top3x3 - invTop3x3Matrix).array_one_norm(); const double diff_vector_translation_one_norm = (inv4x4Translation - inv3x3Translation).one_norm(); - constexpr double normed_tolerance_matrix_close = 1e-2; + constexpr double normed_tolerance_matrix_close{ 1e-2 }; return !((diff_matrix_array_one_norm > normed_tolerance_matrix_close) || (diff_vector_translation_one_norm > normed_tolerance_matrix_close)); } @@ -2011,7 +2011,7 @@ NiftiImageIO::SetImageIOOrientationFromNIfTI(unsigned short dims, double spacing { // Ensure that the scales are approximately the same for spacing directions bool sform_scales_ok{ true }; - constexpr float large_value_tolerance = 1e-3; // Numerical precision of sform is not very good + constexpr float large_value_tolerance{ 1e-3 }; // Numerical precision of sform is not very good if (itk::Math::abs(m_Holder->ptr->dx - rotation.get_column(0).magnitude()) > large_value_tolerance) { sform_scales_ok = false; diff --git a/Modules/IO/NIFTI/test/itkNiftiImageIOTest.h b/Modules/IO/NIFTI/test/itkNiftiImageIOTest.h index 4d4fe8c0abd..4b9ecce9f58 100644 --- a/Modules/IO/NIFTI/test/itkNiftiImageIOTest.h +++ b/Modules/IO/NIFTI/test/itkNiftiImageIOTest.h @@ -49,10 +49,10 @@ #include "itkIOTestHelper.h" -constexpr unsigned char RPI = 16; /*Bit pattern 0 0 0 10000*/ -constexpr unsigned char LEFT = 128; /*Bit pattern 1 0 0 00000*/ -constexpr unsigned char ANTERIOR = 64; /*Bit pattern 0 1 0 00000*/ -constexpr unsigned char SUPERIOR = 32; /*Bit pattern 0 0 1 00000*/ +constexpr unsigned char RPI{ 16 }; /*Bit pattern 0 0 0 10000*/ +constexpr unsigned char LEFT{ 128 }; /*Bit pattern 1 0 0 00000*/ +constexpr unsigned char ANTERIOR{ 64 }; /*Bit pattern 0 1 0 00000*/ +constexpr unsigned char SUPERIOR{ 32 }; /*Bit pattern 0 0 1 00000*/ // Specializations of this function template are only implemented for 1D to 4D (defined in the cxx file). template @@ -250,7 +250,7 @@ int TestImageOfSymMats(const std::string & fname) { - constexpr int dimsize = 2; + constexpr int dimsize{ 2 }; /** Deformation field pixel type. */ // using PixelType = typename itk::DiffusionTenor3D; diff --git a/Modules/IO/NIFTI/test/itkNiftiImageIOTest12.cxx b/Modules/IO/NIFTI/test/itkNiftiImageIOTest12.cxx index ba363735f34..9b7a6395b0c 100644 --- a/Modules/IO/NIFTI/test/itkNiftiImageIOTest12.cxx +++ b/Modules/IO/NIFTI/test/itkNiftiImageIOTest12.cxx @@ -31,10 +31,10 @@ itkNiftiImageIOTest12(int argc, char * argv[]) std::cerr << itkNameOfTestExecutableMacro(argv) << " " << std::endl; return EXIT_FAILURE; } - constexpr unsigned int CmdLineTestDirPos = 1; + constexpr unsigned int CmdLineTestDirPos{ 1 }; const std::string testdir{ argv[CmdLineTestDirPos] }; itksys::SystemTools::ChangeDirectory(testdir); - constexpr unsigned int CmdLineFilenamePos = 2; + constexpr unsigned int CmdLineFilenamePos{ 2 }; const std::string imgfilename{ argv[CmdLineFilenamePos] }; using ImageType = itk::VectorImage; @@ -45,12 +45,12 @@ itkNiftiImageIOTest12(int argc, char * argv[]) // test is too slow with large image ImageType::SizeType size = { { 2024, 1024, 1024 } }; // make small RGB Image - constexpr ImageType::SizeType size = { { 24, 10, 11 } }; + constexpr ImageType::SizeType size{ 24, 10, 11 }; region.SetSize(size); #if 0 // using non-zero start index exposes bug in ITK IO physical space preservation - constexpr ImageType::IndexType startIndex = { { 200, 300, 400 } }; + constexpr ImageType::IndexType startIndex{ 200, 300, 400 }; #else - constexpr ImageType::IndexType startIndex = { { 0, 0, 0 } }; + constexpr ImageType::IndexType startIndex{ 0, 0, 0 }; #endif region.SetIndex(startIndex); @@ -101,7 +101,7 @@ itkNiftiImageIOTest12(int argc, char * argv[]) ITK_TEST_EXPECT_EQUAL(originalHash, readHash); - constexpr ImageType::IndexType threeIndex = { { 3, 3, 3 } }; + constexpr ImageType::IndexType threeIndex{ 3, 3, 3 }; ImageType::PointType origPhysLocationIndexThree; image->TransformIndexToPhysicalPoint(threeIndex, origPhysLocationIndexThree); ImageType::PointType readPhysLocationIndexThree; diff --git a/Modules/IO/NIFTI/test/itkNiftiImageIOTest13.cxx b/Modules/IO/NIFTI/test/itkNiftiImageIOTest13.cxx index ac14540aa25..d1e15cbd199 100644 --- a/Modules/IO/NIFTI/test/itkNiftiImageIOTest13.cxx +++ b/Modules/IO/NIFTI/test/itkNiftiImageIOTest13.cxx @@ -31,7 +31,7 @@ itkNiftiImageIOTest13(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = float; using ImageType = itk::Image; diff --git a/Modules/IO/NIFTI/test/itkNiftiImageIOTest14.cxx b/Modules/IO/NIFTI/test/itkNiftiImageIOTest14.cxx index b67df30306d..f1767eaa692 100644 --- a/Modules/IO/NIFTI/test/itkNiftiImageIOTest14.cxx +++ b/Modules/IO/NIFTI/test/itkNiftiImageIOTest14.cxx @@ -46,7 +46,7 @@ itkNiftiImageIOTest14(int argc, char * argv[]) // third arg is the test image in different units const char * test_image_fn = argv[3]; - constexpr unsigned int Dimension = 4; + constexpr unsigned int Dimension{ 4 }; using PixelType = float; using ImageType = itk::Image; diff --git a/Modules/IO/NIFTI/test/itkNiftiImageIOTest3.cxx b/Modules/IO/NIFTI/test/itkNiftiImageIOTest3.cxx index b3f0a3af0fd..11bf7f86439 100644 --- a/Modules/IO/NIFTI/test/itkNiftiImageIOTest3.cxx +++ b/Modules/IO/NIFTI/test/itkNiftiImageIOTest3.cxx @@ -44,7 +44,7 @@ template int TestImageOfVectors(const std::string & fname, const std::string & intentCode = "") { - constexpr int dimsize = 2; + constexpr int dimsize{ 2 }; /** Deformation field pixel type. */ using FieldPixelType = typename itk::Vector; diff --git a/Modules/IO/NIFTI/test/itkNiftiImageIOTest4.cxx b/Modules/IO/NIFTI/test/itkNiftiImageIOTest4.cxx index 47938132df5..08623681942 100644 --- a/Modules/IO/NIFTI/test/itkNiftiImageIOTest4.cxx +++ b/Modules/IO/NIFTI/test/itkNiftiImageIOTest4.cxx @@ -50,7 +50,7 @@ itkNiftiImageIOTest4(int argc, char * argv[]) } // - constexpr unsigned int dimsize = 2; + constexpr unsigned int dimsize{ 2 }; constexpr Test4ImageType::SizeType size{ dimsize, dimsize, dimsize }; constexpr Test4ImageType::IndexType index{}; diff --git a/Modules/IO/NIFTI/test/itkNiftiLargeImageRegionReadTest.cxx b/Modules/IO/NIFTI/test/itkNiftiLargeImageRegionReadTest.cxx index 3099c5e62f9..ba62fb365fc 100644 --- a/Modules/IO/NIFTI/test/itkNiftiLargeImageRegionReadTest.cxx +++ b/Modules/IO/NIFTI/test/itkNiftiLargeImageRegionReadTest.cxx @@ -42,13 +42,13 @@ itkNiftiLargeImageRegionReadTest(int argc, char * argv[]) const std::string fname{ argv[1] }; - constexpr int Dimension = 3; + constexpr int Dimension{ 3 }; using PixelType = unsigned short; using ImageType = itk::Image; // Create a large image - constexpr ImageType::SizeType size = { { 1034, 1034, 1020 } }; + constexpr ImageType::SizeType size{ 1034, 1034, 1020 }; ImageType::RegionType region; region.SetSize(size); diff --git a/Modules/IO/NIFTI/test/itkNiftiWriteCoerceOrthogonalDirectionTest.cxx b/Modules/IO/NIFTI/test/itkNiftiWriteCoerceOrthogonalDirectionTest.cxx index ee9fb24fb94..9240edca41b 100644 --- a/Modules/IO/NIFTI/test/itkNiftiWriteCoerceOrthogonalDirectionTest.cxx +++ b/Modules/IO/NIFTI/test/itkNiftiWriteCoerceOrthogonalDirectionTest.cxx @@ -35,11 +35,11 @@ itkNiftiWriteCoerceOrthogonalDirectionTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int dim = 2; + constexpr unsigned int dim{ 2 }; using ImageType = itk::Image; - constexpr ImageType::IndexType startIndex = { { 0, 0 } }; - constexpr ImageType::SizeType imageSize = { { 2, 2 } }; + constexpr ImageType::IndexType startIndex{ 0, 0 }; + constexpr ImageType::SizeType imageSize{ 2, 2 }; const ImageType::RegionType region{ startIndex, imageSize }; auto image1 = ImageType::New(); image1->SetRegions(region); diff --git a/Modules/IO/NRRD/test/itkNrrd5dVectorImageReadWriteTest.cxx b/Modules/IO/NRRD/test/itkNrrd5dVectorImageReadWriteTest.cxx index 397abfe5691..2ed4910204b 100644 --- a/Modules/IO/NRRD/test/itkNrrd5dVectorImageReadWriteTest.cxx +++ b/Modules/IO/NRRD/test/itkNrrd5dVectorImageReadWriteTest.cxx @@ -373,7 +373,7 @@ itkNrrd5dVectorImageReadWriteTest(int argc, char * argv[]) // 2D scalar image sequence, written and read with list as the slowest axis { const char * filename = argv[1]; - constexpr int SpaceDimension = 2; + constexpr int SpaceDimension{ 2 }; const std::string expectedPixelType = "scalar"; typedef double PixelType; typedef itk::Image ImageType; @@ -390,7 +390,7 @@ itkNrrd5dVectorImageReadWriteTest(int argc, char * argv[]) // 3D scalar image sequence, written and read with list as the slowest axis { const char * filename = argv[2]; - constexpr int SpaceDimension = 3; + constexpr int SpaceDimension{ 3 }; const std::string expectedPixelType = "scalar"; typedef double PixelType; typedef itk::Image ImageType; @@ -407,7 +407,7 @@ itkNrrd5dVectorImageReadWriteTest(int argc, char * argv[]) // 3D scalar image sequence, written with list as the fastest axis, read with list as the slowest axis { const char * filename = argv[2]; - constexpr int SpaceDimension = 3; + constexpr int SpaceDimension{ 3 }; const std::string expectedPixelType = "scalar"; typedef double PixelType; typedef itk::Image ImageType; @@ -437,7 +437,7 @@ itkNrrd5dVectorImageReadWriteTest(int argc, char * argv[]) // 2D scalar image sequence, written and read with list as the fastest axis { const char * filename = argv[1]; - constexpr int SpaceDimension = 2; + constexpr int SpaceDimension{ 2 }; const std::string expectedPixelType = "vector"; const int numberOfTimePoints = 20; typedef double PixelTypeToWrite; @@ -464,7 +464,7 @@ itkNrrd5dVectorImageReadWriteTest(int argc, char * argv[]) // 3D scalar image sequence, written and read with list as the fastest axis { const char * filename = argv[2]; - constexpr int SpaceDimension = 3; + constexpr int SpaceDimension{ 3 }; const std::string expectedPixelType = "vector"; const int numberOfTimePoints = 20; typedef double PixelTypeToWrite; @@ -491,7 +491,7 @@ itkNrrd5dVectorImageReadWriteTest(int argc, char * argv[]) // 3D scalar image time sequence, written time as the fastest axis, read with time as slowest axis { const char * filename = argv[2]; - constexpr int SpaceDimension = 3; + constexpr int SpaceDimension{ 3 }; const std::string expectedPixelType = "vector"; const int numberOfTimePoints = 20; typedef double PixelTypeToWrite; @@ -518,7 +518,7 @@ itkNrrd5dVectorImageReadWriteTest(int argc, char * argv[]) // 2D gradient field sequence { const char * filename = argv[3]; - constexpr int SpaceDimension = 2; + constexpr int SpaceDimension{ 2 }; const std::string expectedPixelType = "covariant_vector"; typedef itk::CovariantVector PixelType; typedef itk::Image ImageType; @@ -535,7 +535,7 @@ itkNrrd5dVectorImageReadWriteTest(int argc, char * argv[]) // 3D displacement field sequence { const char * filename = argv[4]; - constexpr int SpaceDimension = 3; + constexpr int SpaceDimension{ 3 }; const std::string expectedPixelType = "vector"; typedef itk::Vector PixelType; typedef itk::Image ImageType; @@ -552,7 +552,7 @@ itkNrrd5dVectorImageReadWriteTest(int argc, char * argv[]) // 2D color image (RGB) sequence { const char * filename = argv[5]; - constexpr int SpaceDimension = 2; + constexpr int SpaceDimension{ 2 }; const std::string expectedPixelType = "rgb"; const unsigned int expectedComponents = 3; // RGB has 3 components typedef itk::RGBPixel PixelType; @@ -570,7 +570,7 @@ itkNrrd5dVectorImageReadWriteTest(int argc, char * argv[]) // 3D color image (RGBA) sequence { const char * filename = argv[6]; - constexpr int SpaceDimension = 3; + constexpr int SpaceDimension{ 3 }; const std::string expectedPixelType = "rgba"; const unsigned int expectedComponents = 4; // RGBA has 4 components typedef itk::RGBAPixel PixelType; @@ -590,7 +590,7 @@ itkNrrd5dVectorImageReadWriteTest(int argc, char * argv[]) // 2D displacement field can be distinguished from 3D { const char * filename = argv[3]; - constexpr int SpaceDimension = 3; + constexpr int SpaceDimension{ 3 }; const std::string expectedPixelType = "covariant_vector"; bool expectedErrorCaught = false; @@ -614,7 +614,7 @@ itkNrrd5dVectorImageReadWriteTest(int argc, char * argv[]) // RGB color can be distinguished from displacement field { const char * filename = argv[3]; - constexpr int SpaceDimension = 3; + constexpr int SpaceDimension{ 3 }; const std::string expectedPixelType = "rgb"; bool expectedErrorCaught = false; diff --git a/Modules/IO/NRRD/test/itkNrrdComplexImageReadTest.cxx b/Modules/IO/NRRD/test/itkNrrdComplexImageReadTest.cxx index 4c2e6a3da4e..b267866bf28 100644 --- a/Modules/IO/NRRD/test/itkNrrdComplexImageReadTest.cxx +++ b/Modules/IO/NRRD/test/itkNrrdComplexImageReadTest.cxx @@ -106,7 +106,7 @@ itkNrrdComplexImageReadTest(int argc, char * argv[]) err += itk::Math::abs(sample.real() - -0.036674671); err += itk::Math::abs(sample.imag() - -0.0061681992); - constexpr double thresh = 0.00000038; + constexpr double thresh{ 0.00000038 }; if (err > thresh) { std::cout << "failure because err == " << err << "> " << thresh << std::endl; diff --git a/Modules/IO/NRRD/test/itkNrrdDiffusionTensor3DImageReadTest.cxx b/Modules/IO/NRRD/test/itkNrrdDiffusionTensor3DImageReadTest.cxx index 70331e7bc98..b8bd4b6cedd 100644 --- a/Modules/IO/NRRD/test/itkNrrdDiffusionTensor3DImageReadTest.cxx +++ b/Modules/IO/NRRD/test/itkNrrdDiffusionTensor3DImageReadTest.cxx @@ -116,7 +116,7 @@ itkNrrdDiffusionTensor3DImageReadTest(int argc, char * argv[]) err += itk::Math::abs(sample(1, 2) - 0.43205333); err += itk::Math::abs(sample(2, 2) - 5.3755102); - constexpr double thresh = 0.00000041; + constexpr double thresh{ 0.00000041 }; if (err > thresh) { std::cout << "failure because err == " << err << "> " << thresh << std::endl; diff --git a/Modules/IO/NRRD/test/itkNrrdImageIOTest.cxx b/Modules/IO/NRRD/test/itkNrrdImageIOTest.cxx index 55c4eaf2aac..1727107e994 100644 --- a/Modules/IO/NRRD/test/itkNrrdImageIOTest.cxx +++ b/Modules/IO/NRRD/test/itkNrrdImageIOTest.cxx @@ -43,7 +43,7 @@ itkNrrdImageIOTest(int argc, char * argv[]) { inputFile = std::string("null"); } - constexpr int sz = 10; + constexpr int sz{ 10 }; int ret = EXIT_SUCCESS; ret += itkNrrdImageIOTestReadWriteTest(std::string(argv[1]), sz, inputFile); diff --git a/Modules/IO/NRRD/test/itkNrrdImageIOTest.h b/Modules/IO/NRRD/test/itkNrrdImageIOTest.h index eddc5bc4c5f..d96a2ef1300 100644 --- a/Modules/IO/NRRD/test/itkNrrdImageIOTest.h +++ b/Modules/IO/NRRD/test/itkNrrdImageIOTest.h @@ -74,7 +74,7 @@ itkNrrdImageIOTestReadWriteTest(const std::string & fn, ITK_TEST_EXPECT_TRUE(io->SupportsDimension(VImageDimension)); - constexpr unsigned int NRRD_DIM_MAX = 16; // taken from NrrdIO.h which is not in the include path + constexpr unsigned int NRRD_DIM_MAX{ 16 }; // taken from NrrdIO.h which is not in the include path const unsigned long dim = NRRD_DIM_MAX + 1; ITK_TEST_EXPECT_TRUE(!io->SupportsDimension(dim)); diff --git a/Modules/IO/NRRD/test/itkNrrdImageReadWriteTest.cxx b/Modules/IO/NRRD/test/itkNrrdImageReadWriteTest.cxx index 6dfdc59a3ab..3260048d0d6 100644 --- a/Modules/IO/NRRD/test/itkNrrdImageReadWriteTest.cxx +++ b/Modules/IO/NRRD/test/itkNrrdImageReadWriteTest.cxx @@ -35,7 +35,7 @@ itkNrrdImageReadWriteTest(int argc, char * argv[]) } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = float; using myImage = itk::Image; diff --git a/Modules/IO/NRRD/test/itkNrrdMetaDataTest.cxx b/Modules/IO/NRRD/test/itkNrrdMetaDataTest.cxx index 120330b7a4e..ae173fa2118 100644 --- a/Modules/IO/NRRD/test/itkNrrdMetaDataTest.cxx +++ b/Modules/IO/NRRD/test/itkNrrdMetaDataTest.cxx @@ -43,7 +43,7 @@ itkNrrdMetaDataTest(int argc, char * argv[]) using ImageType = itk::Image; // create dummy image auto image1 = ImageType::New(); - constexpr ImageType::SizeType size = { { 2, 2, 2 } }; + constexpr ImageType::SizeType size{ 2, 2, 2 }; image1->SetRegions(size); image1->Allocate(); image1->FillBuffer(1); diff --git a/Modules/IO/PNG/test/itkPNGImageIOTest.cxx b/Modules/IO/PNG/test/itkPNGImageIOTest.cxx index 55b1a9aeaed..7f7a82d8d1e 100644 --- a/Modules/IO/PNG/test/itkPNGImageIOTest.cxx +++ b/Modules/IO/PNG/test/itkPNGImageIOTest.cxx @@ -39,7 +39,7 @@ itkPNGImageIOTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned long Dimension = 2; + constexpr unsigned long Dimension{ 2 }; using PixelType = unsigned char; // We are converting read data into RGB pixel image diff --git a/Modules/IO/PNG/test/itkPNGImageIOTest2.cxx b/Modules/IO/PNG/test/itkPNGImageIOTest2.cxx index 80485fba77c..9836740a506 100644 --- a/Modules/IO/PNG/test/itkPNGImageIOTest2.cxx +++ b/Modules/IO/PNG/test/itkPNGImageIOTest2.cxx @@ -58,7 +58,7 @@ itkPNGImageIOTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; // We are converting read data into grayscale pixel image diff --git a/Modules/IO/PNG/test/itkPNGImageIOTest3.cxx b/Modules/IO/PNG/test/itkPNGImageIOTest3.cxx index 50bceabca08..39d89331c02 100644 --- a/Modules/IO/PNG/test/itkPNGImageIOTest3.cxx +++ b/Modules/IO/PNG/test/itkPNGImageIOTest3.cxx @@ -34,7 +34,7 @@ itkPNGImageIOTest3(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; diff --git a/Modules/IO/PNG/test/itkPNGImageIOTestPalette.cxx b/Modules/IO/PNG/test/itkPNGImageIOTestPalette.cxx index 1bd1157c007..88a6cc890ed 100644 --- a/Modules/IO/PNG/test/itkPNGImageIOTestPalette.cxx +++ b/Modules/IO/PNG/test/itkPNGImageIOTestPalette.cxx @@ -46,7 +46,7 @@ itkPNGImageIOTestPalette(int argc, char * argv[]) std::cout << "Expanding palette: " << ((expandRGBPalette) ? "True" : "False") << std::endl; std::cout << "Is palette: " << ((isPaletteImage) ? "True" : "False") << std::endl; - constexpr unsigned long Dimension = 2; + constexpr unsigned long Dimension{ 2 }; using ScalarPixelType = unsigned char; using ScalarImageType = itk::Image; diff --git a/Modules/IO/RAW/test/itkRawImageIOTest.cxx b/Modules/IO/RAW/test/itkRawImageIOTest.cxx index a6cf5f13cc5..dcbfa83ca6d 100644 --- a/Modules/IO/RAW/test/itkRawImageIOTest.cxx +++ b/Modules/IO/RAW/test/itkRawImageIOTest.cxx @@ -36,7 +36,7 @@ itkRawImageIOTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ImageType = itk::Image; using PixelType = ImageType::PixelType; @@ -69,7 +69,7 @@ itkRawImageIOTest(int argc, char * argv[]) ITK_TEST_EXPECT_TRUE(io->SupportsDimension(Dimension)); - constexpr unsigned long dim = 3; + constexpr unsigned long dim{ 3 }; ITK_TEST_EXPECT_TRUE(!io->SupportsDimension(dim)); // Binary files have no image information to read diff --git a/Modules/IO/RAW/test/itkRawImageIOTest2.cxx b/Modules/IO/RAW/test/itkRawImageIOTest2.cxx index 40204738bf8..eda9653420f 100644 --- a/Modules/IO/RAW/test/itkRawImageIOTest2.cxx +++ b/Modules/IO/RAW/test/itkRawImageIOTest2.cxx @@ -50,9 +50,9 @@ itkRawImageIOTest2(int argc, char * argv[]) io->SetFileName(argv[1]); io->SetFileDimensionality(3); io->SetNumberOfDimensions(3); - constexpr unsigned int dim[3] = { 50, 50, 10 }; - constexpr double spacing[3] = { 1.0, 1.0, 1.0 }; - constexpr double origin[3] = { 0.0, 0.0, 0.0 }; + constexpr unsigned int dim[3]{ 50, 50, 10 }; + constexpr double spacing[3]{ 1.0, 1.0, 1.0 }; + constexpr double origin[3]{ 0.0, 0.0, 0.0 }; for (unsigned int i = 0; i < 3; ++i) { io->SetDimensions(i, dim[i]); @@ -60,7 +60,7 @@ itkRawImageIOTest2(int argc, char * argv[]) io->SetOrigin(i, origin[i]); } io->SetHeaderSize(0); - constexpr unsigned short imageMask = 0x7fff; + constexpr unsigned short imageMask{ 0x7fff }; io->SetImageMask(imageMask); ITK_TEST_SET_GET_VALUE(imageMask, io->GetImageMask()); diff --git a/Modules/IO/RAW/test/itkRawImageIOTest4.cxx b/Modules/IO/RAW/test/itkRawImageIOTest4.cxx index b4c505e8046..2ee6ee9f9a6 100644 --- a/Modules/IO/RAW/test/itkRawImageIOTest4.cxx +++ b/Modules/IO/RAW/test/itkRawImageIOTest4.cxx @@ -112,7 +112,7 @@ itkRawImageIOTest4(int argc, char * argv[]) } using PixelType = unsigned short; - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using ImageType = itk::Image; diff --git a/Modules/IO/RAW/test/itkRawImageIOTest5.cxx b/Modules/IO/RAW/test/itkRawImageIOTest5.cxx index 47e0e246f0e..e79f7547357 100644 --- a/Modules/IO/RAW/test/itkRawImageIOTest5.cxx +++ b/Modules/IO/RAW/test/itkRawImageIOTest5.cxx @@ -90,9 +90,9 @@ class RawImageReaderAndWriter auto rawImageIO = RawImageIOType::New(); reader->SetImageIO(rawImageIO); - constexpr unsigned int dim[2] = { 16, 16 }; - constexpr double spacing[2] = { 1.0, 1.0 }; - constexpr double origin[2] = { 0.0, 0.0 }; + constexpr unsigned int dim[2]{ 16, 16 }; + constexpr double spacing[2]{ 1.0, 1.0 }; + constexpr double origin[2]{ 0.0, 0.0 }; for (unsigned int i = 0; i < 2; ++i) { diff --git a/Modules/IO/SpatialObjects/test/itkReadVesselTubeSpatialObjectTest.cxx b/Modules/IO/SpatialObjects/test/itkReadVesselTubeSpatialObjectTest.cxx index bb963a5e55b..1f44dd08c5e 100644 --- a/Modules/IO/SpatialObjects/test/itkReadVesselTubeSpatialObjectTest.cxx +++ b/Modules/IO/SpatialObjects/test/itkReadVesselTubeSpatialObjectTest.cxx @@ -29,7 +29,7 @@ itkReadVesselTubeSpatialObjectTest(int argc, char * argv[]) } const char * inputVessel = argv[1]; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using ReaderType = itk::SpatialObjectReader; diff --git a/Modules/IO/SpatialObjects/test/itkReadWriteSpatialObjectTest.cxx b/Modules/IO/SpatialObjects/test/itkReadWriteSpatialObjectTest.cxx index 27333a38fba..c1138491e2f 100644 --- a/Modules/IO/SpatialObjects/test/itkReadWriteSpatialObjectTest.cxx +++ b/Modules/IO/SpatialObjects/test/itkReadWriteSpatialObjectTest.cxx @@ -270,7 +270,7 @@ itkReadWriteSpatialObjectTest(int argc, char * argv[]) SizeType size; - constexpr unsigned int dim = 3; + constexpr unsigned int dim{ 3 }; double spacing[3]; for (unsigned int i = 0; i < dim; ++i) diff --git a/Modules/IO/TIFF/src/itkTIFFImageIO.cxx b/Modules/IO/TIFF/src/itkTIFFImageIO.cxx index 5b44af6ab22..9952bad6a08 100644 --- a/Modules/IO/TIFF/src/itkTIFFImageIO.cxx +++ b/Modules/IO/TIFF/src/itkTIFFImageIO.cxx @@ -617,10 +617,10 @@ TIFFImageIO::InternalWrite(const void * buffer) const char * mode = "w"; // If the size of the image is greater than 2 GiB then use big tiff - constexpr SizeType oneKibiByte = 1024; - constexpr SizeType oneMebiByte = 1024 * oneKibiByte; - constexpr SizeType oneGibiByte = 1024 * oneMebiByte; - constexpr SizeType twoGibiBytes = 2 * oneGibiByte; + constexpr SizeType oneKibiByte{ 1024 }; + constexpr SizeType oneMebiByte{ 1024 * oneKibiByte }; + constexpr SizeType oneGibiByte{ 1024 * oneMebiByte }; + constexpr SizeType twoGibiBytes{ 2 * oneGibiByte }; if (this->GetImageSizeInBytes() > twoGibiBytes) { diff --git a/Modules/IO/TIFF/test/itkImageSeriesReaderReverse.cxx b/Modules/IO/TIFF/test/itkImageSeriesReaderReverse.cxx index 4a6a9308cd4..254449d5c04 100644 --- a/Modules/IO/TIFF/test/itkImageSeriesReaderReverse.cxx +++ b/Modules/IO/TIFF/test/itkImageSeriesReaderReverse.cxx @@ -90,7 +90,7 @@ TEST_F(ITKIOTIFF, ReverseOrder_with_ImageIO) // Create a series of 3 TIFF files with different values using native itk::Image const unsigned int z_size = 3; using PixelType = unsigned char; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using ImageType = itk::Image; diff --git a/Modules/IO/TIFF/test/itkLargeTIFFImageWriteReadTest.cxx b/Modules/IO/TIFF/test/itkLargeTIFFImageWriteReadTest.cxx index d15ee4acae7..aeecdf97b4b 100644 --- a/Modules/IO/TIFF/test/itkLargeTIFFImageWriteReadTest.cxx +++ b/Modules/IO/TIFF/test/itkLargeTIFFImageWriteReadTest.cxx @@ -52,7 +52,7 @@ itkLargeTIFFImageWriteReadTestHelper(std::string filename, typename TImage::Size const SizeValueType numberOfPixels = size.CalculateProductOfElements(); - constexpr SizeValueType oneMebiByte = static_cast(1024) * static_cast(1024); + constexpr SizeValueType oneMebiByte{ static_cast(1024) * static_cast(1024) }; const SizeValueType sizeInBytes = sizeof(PixelType) * numberOfPixels; @@ -158,7 +158,7 @@ itkLargeTIFFImageWriteReadTest(int argc, char * argv[]) if (argc == 3) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned short; using ImageType = itk::Image; @@ -168,7 +168,7 @@ itkLargeTIFFImageWriteReadTest(int argc, char * argv[]) return itkLargeTIFFImageWriteReadTestHelper(filename, size); } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = unsigned short; using ImageType = itk::Image; diff --git a/Modules/IO/TIFF/test/itkTIFFImageIOTest2.cxx b/Modules/IO/TIFF/test/itkTIFFImageIOTest2.cxx index 516cede56dd..5094a4ffe5f 100644 --- a/Modules/IO/TIFF/test/itkTIFFImageIOTest2.cxx +++ b/Modules/IO/TIFF/test/itkTIFFImageIOTest2.cxx @@ -31,7 +31,7 @@ itkTIFFImageIOTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; @@ -69,7 +69,7 @@ itkTIFFImageIOTest2(int argc, char * argv[]) ImageType::SpacingType readSpacing = readImage->GetSpacing(); - constexpr double tolerance = 1e-5; + constexpr double tolerance{ 1e-5 }; for (unsigned int i = 0; i < ImageType::SpacingType::Dimension; ++i) { diff --git a/Modules/IO/TIFF/test/itkTIFFImageIOTestPalette.cxx b/Modules/IO/TIFF/test/itkTIFFImageIOTestPalette.cxx index c1a8127421b..2c929b6eed2 100644 --- a/Modules/IO/TIFF/test/itkTIFFImageIOTestPalette.cxx +++ b/Modules/IO/TIFF/test/itkTIFFImageIOTestPalette.cxx @@ -54,7 +54,7 @@ itkTIFFImageIOTestPalette(int argc, char * argv[]) std::cout << "Expanding palette: " << ((expandRGBPalette) ? "True" : "False") << std::endl; std::cout << "Is palette: " << ((isPaletteImage) ? "True" : "False") << std::endl; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ScalarPixelType = unsigned char; using ScalarImageType = itk::Image; diff --git a/Modules/IO/TransformHDF5/src/itkHDF5TransformIO.cxx b/Modules/IO/TransformHDF5/src/itkHDF5TransformIO.cxx index 7a3af583793..760a94d8835 100644 --- a/Modules/IO/TransformHDF5/src/itkHDF5TransformIO.cxx +++ b/Modules/IO/TransformHDF5/src/itkHDF5TransformIO.cxx @@ -132,7 +132,7 @@ HDF5TransformIOTemplate::WriteParameters(const std::string // region const H5::DSetCreatPropList plist; plist.setDeflate(5); // Set intermediate compression level - constexpr hsize_t oneMegabyte = 1024 * 1024; + constexpr hsize_t oneMegabyte{ 1024 * 1024 }; const hsize_t chunksize = (dim > oneMegabyte) ? oneMegabyte : dim; // Use chunks of 1 MB if large, else use dim plist.setChunk(1, &chunksize); diff --git a/Modules/IO/TransformHDF5/test/itkIOTransformHDF5Test.cxx b/Modules/IO/TransformHDF5/test/itkIOTransformHDF5Test.cxx index c97bad5eaff..d1ff13a17a0 100644 --- a/Modules/IO/TransformHDF5/test/itkIOTransformHDF5Test.cxx +++ b/Modules/IO/TransformHDF5/test/itkIOTransformHDF5Test.cxx @@ -42,14 +42,14 @@ static int ReadWriteTest(const std::string & fileName, const bool isRealDisplacementField, const bool useCompression) { // First make a DisplacementField with known values - constexpr double aNumberThatCanNotBeRepresentedInFloatingPoint = 1e-5 + 1e-7 + 1e-9 + 1e-13; - constexpr double requiredSpacing = 1.2 + aNumberThatCanNotBeRepresentedInFloatingPoint; - constexpr double requiredOrigin = 23.0 + aNumberThatCanNotBeRepresentedInFloatingPoint; + constexpr double aNumberThatCanNotBeRepresentedInFloatingPoint{ 1e-5 + 1e-7 + 1e-9 + 1e-13 }; + constexpr double requiredSpacing{ 1.2 + aNumberThatCanNotBeRepresentedInFloatingPoint }; + constexpr double requiredOrigin{ 23.0 + aNumberThatCanNotBeRepresentedInFloatingPoint }; auto displacementTransform = DisplacementTransformType::New(); using FieldType = typename DisplacementTransformType::DisplacementFieldType; auto knownField = FieldType::New(); // This is based on itk::Image { - constexpr int dimLength = 20; + constexpr int dimLength{ 20 }; auto size = FieldType::SizeType::Filled(dimLength); const typename FieldType::IndexType start{}; const typename FieldType::RegionType region{ start, size }; diff --git a/Modules/IO/TransformHDF5/test/itkThinPlateTransformWriteReadTest.cxx b/Modules/IO/TransformHDF5/test/itkThinPlateTransformWriteReadTest.cxx index 876a0aabe7c..226b4a5a368 100644 --- a/Modules/IO/TransformHDF5/test/itkThinPlateTransformWriteReadTest.cxx +++ b/Modules/IO/TransformHDF5/test/itkThinPlateTransformWriteReadTest.cxx @@ -39,7 +39,7 @@ template static int ReadWriteTest(const char * const fileName) { - constexpr double epsilon = 1e-12; + constexpr double epsilon{ 1e-12 }; using ParametersValueType = typename TransformType::ScalarType; // Create transform diff --git a/Modules/IO/TransformMINC/include/itkMINCTransformAdapter.h b/Modules/IO/TransformMINC/include/itkMINCTransformAdapter.h index a2585eff5ce..32917bcdc09 100644 --- a/Modules/IO/TransformMINC/include/itkMINCTransformAdapter.h +++ b/Modules/IO/TransformMINC/include/itkMINCTransformAdapter.h @@ -131,7 +131,7 @@ class ITK_TEMPLATE_EXPORT MINCTransformAdapter { double u1, v1, w1; double u2, v2, w2; - constexpr double delta = 1e-4; + constexpr double delta{ 1e-4 }; general_transform_point((m_Invert ? &m_Xfm_inv : &m_Xfm), orig[0] - delta, orig[1], orig[2], &u1, &v1, &w1); general_transform_point((m_Invert ? &m_Xfm_inv : &m_Xfm), orig[0] + delta, orig[1], orig[2], &u2, &v2, &w2); diff --git a/Modules/IO/TransformMINC/test/itkIOTransformMINCTest.cxx b/Modules/IO/TransformMINC/test/itkIOTransformMINCTest.cxx index 98028a8041f..11806cd2a1f 100644 --- a/Modules/IO/TransformMINC/test/itkIOTransformMINCTest.cxx +++ b/Modules/IO/TransformMINC/test/itkIOTransformMINCTest.cxx @@ -67,7 +67,7 @@ check_linear(const char * linear_transform, bool ras_to_lps) int testStatus = EXIT_SUCCESS; using AffineTransformType = itk::AffineTransform; - constexpr double tolerance = 1e-5; + constexpr double tolerance{ 1e-5 }; auto affine = AffineTransformType::New(); @@ -160,7 +160,7 @@ check_nonlinear_double(const char * nonlinear_transform, bool ras_to_lps) std::cout << "check_nonlinear_double, ras_to_lps=" << ras_to_lps << std::endl << std::endl; int testStatus = EXIT_SUCCESS; - constexpr double tolerance = 1e-5; + constexpr double tolerance{ 1e-5 }; using DisplacementFieldTransform = itk::DisplacementFieldTransform; using DisplacementFieldType = DisplacementFieldTransform::DisplacementFieldType; @@ -461,7 +461,7 @@ check_composite(const char * transform_file, bool ras_to_lps) using AffineTransformType = itk::AffineTransform; using CompositeTransformType = itk::CompositeTransform; - constexpr double tolerance = 1e-5; + constexpr double tolerance{ 1e-5 }; auto affine1 = AffineTransformType::New(); auto affine2 = AffineTransformType::New(); @@ -562,7 +562,7 @@ check_composite2(const char * transform_file, const char * transform_grid_file, int testStatus = EXIT_SUCCESS; - constexpr double tolerance = 1e-5; + constexpr double tolerance{ 1e-5 }; std::filebuf fb; if (!fb.open(transform_file, std::ios::out)) diff --git a/Modules/IO/TransformMINC/test/itkMINCTransformAdapterTest.cxx b/Modules/IO/TransformMINC/test/itkMINCTransformAdapterTest.cxx index e963323cd87..47a450ca779 100644 --- a/Modules/IO/TransformMINC/test/itkMINCTransformAdapterTest.cxx +++ b/Modules/IO/TransformMINC/test/itkMINCTransformAdapterTest.cxx @@ -238,8 +238,8 @@ itkMINCTransformAdapterTest(int argc, char * argv[]) } - constexpr unsigned int InputDimension = 3; - constexpr unsigned int OutputDimension = 3; + constexpr unsigned int InputDimension{ 3 }; + constexpr unsigned int OutputDimension{ 3 }; using ParametersValueType = double; @@ -278,24 +278,24 @@ itkMINCTransformAdapterTest(int argc, char * argv[]) ITK_TRY_EXPECT_EXCEPTION(xfm->GetParameters()); - constexpr unsigned int InputDimensionExcp1 = 1; - constexpr unsigned int OutputDimensionExcp1 = 1; + constexpr unsigned int InputDimensionExcp1{ 1 }; + constexpr unsigned int OutputDimensionExcp1{ 1 }; using TransformAdapterTypeExcp11 = itk::MINCTransformAdapter; ITK_TRY_EXPECT_EXCEPTION(TransformAdapterTypeExcp11::New()); - constexpr unsigned int InputDimensionExcp2 = 2; - constexpr unsigned int OutputDimensionExcp2 = 2; + constexpr unsigned int InputDimensionExcp2{ 2 }; + constexpr unsigned int OutputDimensionExcp2{ 2 }; using TransformAdapterTypeExcp22 = itk::MINCTransformAdapter; ITK_TRY_EXPECT_EXCEPTION(TransformAdapterTypeExcp22::New()); - constexpr unsigned int InputDimensionExcp4 = 4; - constexpr unsigned int OutputDimensionExcp4 = 4; + constexpr unsigned int InputDimensionExcp4{ 4 }; + constexpr unsigned int OutputDimensionExcp4{ 4 }; using TransformAdapterTypeExcp44 = itk::MINCTransformAdapter; diff --git a/Modules/IO/VTK/test/itkVTKImageIO2Test.cxx b/Modules/IO/VTK/test/itkVTKImageIO2Test.cxx index 8a1e8c31c37..344818ef21b 100644 --- a/Modules/IO/VTK/test/itkVTKImageIO2Test.cxx +++ b/Modules/IO/VTK/test/itkVTKImageIO2Test.cxx @@ -25,7 +25,7 @@ static unsigned int m_CallNumber; -constexpr unsigned int TEST_VECTOR_PIXEL_DIM = 3; +constexpr unsigned int TEST_VECTOR_PIXEL_DIM{ 3 }; template class VTKImageIOTester diff --git a/Modules/IO/VTK/test/itkVTKImageIO2Test2.cxx b/Modules/IO/VTK/test/itkVTKImageIO2Test2.cxx index fa22d81f532..aa2e5b4f6b0 100644 --- a/Modules/IO/VTK/test/itkVTKImageIO2Test2.cxx +++ b/Modules/IO/VTK/test/itkVTKImageIO2Test2.cxx @@ -100,7 +100,7 @@ itkVTKImageIO2Test2(int argc, char * argv[]) using MonitorFilter = itk::PipelineMonitorImageFilter; auto monitor = MonitorFilter::New(); monitor->SetInput(reader->GetOutput()); - constexpr unsigned int numberOfDataPieces = 10; + constexpr unsigned int numberOfDataPieces{ 10 }; using StreamingFilter = itk::StreamingImageFilter; @@ -140,7 +140,7 @@ itkVTKImageIO2Test2(int argc, char * argv[]) using MonitorFilter = itk::PipelineMonitorImageFilter; auto monitor = MonitorFilter::New(); monitor->SetInput(reader->GetOutput()); - constexpr unsigned int numberOfDataPieces = 10; + constexpr unsigned int numberOfDataPieces{ 10 }; auto writer = WriterType::New(); writer->SetImageIO(vtkIO); diff --git a/Modules/IO/VTK/test/itkVTKImageIOStreamTest.cxx b/Modules/IO/VTK/test/itkVTKImageIOStreamTest.cxx index 30eabc754b8..5535673a254 100644 --- a/Modules/IO/VTK/test/itkVTKImageIOStreamTest.cxx +++ b/Modules/IO/VTK/test/itkVTKImageIOStreamTest.cxx @@ -291,7 +291,7 @@ itkVTKImageIOStreamTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int numberOfStreams = 2; + constexpr unsigned int numberOfStreams{ 2 }; int status = 0; #define ReadWriteTestMACRO(scalarType) \ diff --git a/Modules/IO/VTK/test/itkVTKImageIOTest2.cxx b/Modules/IO/VTK/test/itkVTKImageIOTest2.cxx index ea71be788a1..7c39ba12c30 100644 --- a/Modules/IO/VTK/test/itkVTKImageIOTest2.cxx +++ b/Modules/IO/VTK/test/itkVTKImageIOTest2.cxx @@ -36,7 +36,7 @@ itkVTKImageIOTest2(int argc, char * argv[]) } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Test writing images of vectors as VTK images. diff --git a/Modules/IO/XML/test/itkDOMTest6.cxx b/Modules/IO/XML/test/itkDOMTest6.cxx index 232c72d87e3..c6ee0e086a0 100644 --- a/Modules/IO/XML/test/itkDOMTest6.cxx +++ b/Modules/IO/XML/test/itkDOMTest6.cxx @@ -81,7 +81,7 @@ testStringToolsWithBasicType() std::string s; // write out - constexpr DataType dataIn = '*'; + constexpr DataType dataIn{ '*' }; itk::StringTools::FromData(s, dataIn); // read back @@ -104,7 +104,7 @@ testStringToolsWithBasicType() std::string s; // write out - constexpr DataType dataIn = -1024; + constexpr DataType dataIn{ -1024 }; itk::StringTools::FromData(s, dataIn); // read back @@ -127,7 +127,7 @@ testStringToolsWithBasicType() std::string s; // write out - constexpr DataType dataIn = -0.1; + constexpr DataType dataIn{ -0.1 }; itk::StringTools::FromData(s, dataIn); // read back diff --git a/Modules/IO/XML/test/itkFancyStringTest.cxx b/Modules/IO/XML/test/itkFancyStringTest.cxx index 1e3b50327f6..872deba4c45 100644 --- a/Modules/IO/XML/test/itkFancyStringTest.cxx +++ b/Modules/IO/XML/test/itkFancyStringTest.cxx @@ -77,7 +77,7 @@ testFancyStringWithBasicType() itk::FancyString s; // write out - constexpr DataType dataIn = '*'; + constexpr DataType dataIn{ '*' }; s << dataIn; // read back @@ -100,7 +100,7 @@ testFancyStringWithBasicType() itk::FancyString s; // write out - constexpr DataType dataIn = -1024; + constexpr DataType dataIn{ -1024 }; s << dataIn; // read back @@ -123,7 +123,7 @@ testFancyStringWithBasicType() itk::FancyString s; // write out - constexpr DataType dataIn = -0.1; + constexpr DataType dataIn{ -0.1 }; s << dataIn; // read back diff --git a/Modules/Nonunit/IntegratedTest/test/itkFilterImageAddTest.cxx b/Modules/Nonunit/IntegratedTest/test/itkFilterImageAddTest.cxx index 380e8ea64e4..30a5ab36bdd 100644 --- a/Modules/Nonunit/IntegratedTest/test/itkFilterImageAddTest.cxx +++ b/Modules/Nonunit/IntegratedTest/test/itkFilterImageAddTest.cxx @@ -23,7 +23,7 @@ int itkFilterImageAddTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; // Declare the types of the images using myImageType1 = itk::Image; diff --git a/Modules/Nonunit/IntegratedTest/test/itkImageToHistogramFilterTest4.cxx b/Modules/Nonunit/IntegratedTest/test/itkImageToHistogramFilterTest4.cxx index 4c0ee86dbf3..0cc3bf82c0d 100644 --- a/Modules/Nonunit/IntegratedTest/test/itkImageToHistogramFilterTest4.cxx +++ b/Modules/Nonunit/IntegratedTest/test/itkImageToHistogramFilterTest4.cxx @@ -46,7 +46,7 @@ itkImageToHistogramFilterTest4Templated(int argc, char * argv[]) using PixelComponentType = unsigned char; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using VectorPixelType = itk::Vector; using ImageType = itk::Image; diff --git a/Modules/Nonunit/IntegratedTest/test/itkMaskedImageToHistogramFilterTest1.cxx b/Modules/Nonunit/IntegratedTest/test/itkMaskedImageToHistogramFilterTest1.cxx index 3ce55e2c934..546c1a66ec5 100644 --- a/Modules/Nonunit/IntegratedTest/test/itkMaskedImageToHistogramFilterTest1.cxx +++ b/Modules/Nonunit/IntegratedTest/test/itkMaskedImageToHistogramFilterTest1.cxx @@ -41,7 +41,7 @@ itkMaskedImageToHistogramFilterTest1(int argc, char * argv[]) using PixelComponentType = unsigned char; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using VectorPixelType = itk::Vector; using ImageType = itk::Image; diff --git a/Modules/Nonunit/IntegratedTest/test/itkNumericsPrintTest.cxx b/Modules/Nonunit/IntegratedTest/test/itkNumericsPrintTest.cxx index c21f5159a67..ba10ad577ad 100644 --- a/Modules/Nonunit/IntegratedTest/test/itkNumericsPrintTest.cxx +++ b/Modules/Nonunit/IntegratedTest/test/itkNumericsPrintTest.cxx @@ -59,8 +59,8 @@ itkNumericsPrintTest(int, char *[]) std::cout << "----------LevenbergMarquardtOptimizer " << LevenbergMarquardtOptimizerObj; using PolynomialType = itk::MultivariateLegendrePolynomial; - constexpr unsigned int dimension = 3; - constexpr unsigned int degree = 3; + constexpr unsigned int dimension{ 3 }; + constexpr unsigned int degree{ 3 }; const PolynomialType::DomainSizeType domainSize(dimension); auto * MultivariateLegendrePolynomialObj = new itk::MultivariateLegendrePolynomial(dimension, degree, domainSize); std::cout << "----------MultivariateLegendrePolynomial " << *MultivariateLegendrePolynomialObj; diff --git a/Modules/Nonunit/IntegratedTest/test/itkTriangleHelperTest.cxx b/Modules/Nonunit/IntegratedTest/test/itkTriangleHelperTest.cxx index e33c8af5855..95c977dd8a0 100644 --- a/Modules/Nonunit/IntegratedTest/test/itkTriangleHelperTest.cxx +++ b/Modules/Nonunit/IntegratedTest/test/itkTriangleHelperTest.cxx @@ -22,7 +22,7 @@ int itkTriangleHelperTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using CoordinateType = double; using PointType = itk::Point; using VectorType = PointType::VectorType; diff --git a/Modules/Nonunit/Review/include/itkDirectFourierReconstructionImageToImageFilter.hxx b/Modules/Nonunit/Review/include/itkDirectFourierReconstructionImageToImageFilter.hxx index ad965348b76..c9620ec056e 100644 --- a/Modules/Nonunit/Review/include/itkDirectFourierReconstructionImageToImageFilter.hxx +++ b/Modules/Nonunit/Review/include/itkDirectFourierReconstructionImageToImageFilter.hxx @@ -35,7 +35,7 @@ DirectFourierReconstructionImageToImageFilter; diff --git a/Modules/Nonunit/Review/test/itkAreaOpeningImageFilterTest.cxx b/Modules/Nonunit/Review/test/itkAreaOpeningImageFilterTest.cxx index 918cee0342f..ebe2ed7c27c 100644 --- a/Modules/Nonunit/Review/test/itkAreaOpeningImageFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkAreaOpeningImageFilterTest.cxx @@ -37,7 +37,7 @@ itkAreaOpeningImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int dim = 3; + constexpr int dim{ 3 }; using PType = unsigned char; using IType = itk::Image; diff --git a/Modules/Nonunit/Review/test/itkGridForwardWarpImageFilterTest.cxx b/Modules/Nonunit/Review/test/itkGridForwardWarpImageFilterTest.cxx index cfe47ebc205..b61a25c4bfd 100644 --- a/Modules/Nonunit/Review/test/itkGridForwardWarpImageFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkGridForwardWarpImageFilterTest.cxx @@ -35,7 +35,7 @@ itkGridForwardWarpImageFilterTest(int argc, char * argv[]) } // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using DeformationPixelType = itk::Vector; using OutputPixelType = unsigned char; diff --git a/Modules/Nonunit/Review/test/itkImageFunctionTest.cxx b/Modules/Nonunit/Review/test/itkImageFunctionTest.cxx index bd42f21d82c..3dc0152d163 100644 --- a/Modules/Nonunit/Review/test/itkImageFunctionTest.cxx +++ b/Modules/Nonunit/Review/test/itkImageFunctionTest.cxx @@ -104,7 +104,7 @@ itkImageFunctionTest(int, char *[]) bool result = EXIT_SUCCESS; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = float; using ImageType = itk::Image; using RegionType = ImageType::RegionType; diff --git a/Modules/Nonunit/Review/test/itkMultiphaseDenseFiniteDifferenceImageFilterTest.cxx b/Modules/Nonunit/Review/test/itkMultiphaseDenseFiniteDifferenceImageFilterTest.cxx index 5dcd689c009..ef132cbc675 100644 --- a/Modules/Nonunit/Review/test/itkMultiphaseDenseFiniteDifferenceImageFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkMultiphaseDenseFiniteDifferenceImageFilterTest.cxx @@ -77,7 +77,7 @@ class MultiphaseDenseFiniteDifferenceImageFilterTestHelper int itkMultiphaseDenseFiniteDifferenceImageFilterTest(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using LevelSetImageType = itk::Image; using FeatureImageType = itk::Image; diff --git a/Modules/Nonunit/Review/test/itkMultiphaseFiniteDifferenceImageFilterTest.cxx b/Modules/Nonunit/Review/test/itkMultiphaseFiniteDifferenceImageFilterTest.cxx index 090cf59429a..a7802e473cd 100644 --- a/Modules/Nonunit/Review/test/itkMultiphaseFiniteDifferenceImageFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkMultiphaseFiniteDifferenceImageFilterTest.cxx @@ -74,7 +74,7 @@ class MultiphaseFiniteDifferenceImageFilterTestHelper int itkMultiphaseFiniteDifferenceImageFilterTest(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using LevelSetImageType = itk::Image; using FeatureImageType = itk::Image; diff --git a/Modules/Nonunit/Review/test/itkMultiphaseSparseFiniteDifferenceImageFilterTest.cxx b/Modules/Nonunit/Review/test/itkMultiphaseSparseFiniteDifferenceImageFilterTest.cxx index 49723cd1b6c..72cf50e40ce 100644 --- a/Modules/Nonunit/Review/test/itkMultiphaseSparseFiniteDifferenceImageFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkMultiphaseSparseFiniteDifferenceImageFilterTest.cxx @@ -79,7 +79,7 @@ class MultiphaseSparseFiniteDifferenceImageFilterTestHelper int itkMultiphaseSparseFiniteDifferenceImageFilterTest(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using LevelSetImageType = itk::Image; using FeatureImageType = itk::Image; diff --git a/Modules/Nonunit/Review/test/itkOptImageToImageMetricsTest2.h b/Modules/Nonunit/Review/test/itkOptImageToImageMetricsTest2.h index 3cfd2c769c6..0ff5f80f429 100644 --- a/Modules/Nonunit/Review/test/itkOptImageToImageMetricsTest2.h +++ b/Modules/Nonunit/Review/test/itkOptImageToImageMetricsTest2.h @@ -188,8 +188,8 @@ BSplineLinearTest(FixedImageReaderType * fixedImageReader, MovingImageReaderType typename FixedImageType::RegionType fixedRegion = fixedImage->GetBufferedRegion(); typename FixedImageType::SizeType fixedSize = fixedRegion.GetSize(); - constexpr unsigned int SpaceDimension = 2; - constexpr unsigned int VSplineOrder = 3; + constexpr unsigned int SpaceDimension{ 2 }; + constexpr unsigned int VSplineOrder{ 3 }; using CoordinateRepType = double; using TransformType = itk::BSplineTransform; diff --git a/Modules/Nonunit/Review/test/itkOptMattesMutualInformationImageToImageMetricThreadsTest1.cxx b/Modules/Nonunit/Review/test/itkOptMattesMutualInformationImageToImageMetricThreadsTest1.cxx index b6bb2f0f183..d5bc4952ab4 100644 --- a/Modules/Nonunit/Review/test/itkOptMattesMutualInformationImageToImageMetricThreadsTest1.cxx +++ b/Modules/Nonunit/Review/test/itkOptMattesMutualInformationImageToImageMetricThreadsTest1.cxx @@ -46,7 +46,7 @@ itkOptMattesMutualInformationImageToImageMetricThreadsTest1(int argc, char * arg using PixelType = unsigned char; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ImageType = itk::Image; @@ -151,7 +151,7 @@ itkOptMattesMutualInformationImageToImageMetricThreadsTest1(int argc, char * arg bool testFailed = false; - constexpr double tolerance = 1e-7; + constexpr double tolerance{ 1e-7 }; for (unsigned int i = 0; i < values.size(); ++i) { diff --git a/Modules/Nonunit/Review/test/itkRegionBasedLevelSetFunctionTest.cxx b/Modules/Nonunit/Review/test/itkRegionBasedLevelSetFunctionTest.cxx index cad8f4f01bd..6d7e21ef1d2 100644 --- a/Modules/Nonunit/Review/test/itkRegionBasedLevelSetFunctionTest.cxx +++ b/Modules/Nonunit/Review/test/itkRegionBasedLevelSetFunctionTest.cxx @@ -114,7 +114,7 @@ class RegionBasedLevelSetFunctionSharedDataHelper : public DataObject int itkRegionBasedLevelSetFunctionTest(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = double; using ImageType = itk::Image; diff --git a/Modules/Nonunit/Review/test/itkRobustAutomaticThresholdCalculatorTest.cxx b/Modules/Nonunit/Review/test/itkRobustAutomaticThresholdCalculatorTest.cxx index 3560a7ce141..e1c8b43342d 100644 --- a/Modules/Nonunit/Review/test/itkRobustAutomaticThresholdCalculatorTest.cxx +++ b/Modules/Nonunit/Review/test/itkRobustAutomaticThresholdCalculatorTest.cxx @@ -35,7 +35,7 @@ itkRobustAutomaticThresholdCalculatorTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned short; using ImageType = itk::Image; diff --git a/Modules/Nonunit/Review/test/itkRobustAutomaticThresholdImageFilterTest.cxx b/Modules/Nonunit/Review/test/itkRobustAutomaticThresholdImageFilterTest.cxx index 038772032fc..570ee208c9c 100644 --- a/Modules/Nonunit/Review/test/itkRobustAutomaticThresholdImageFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkRobustAutomaticThresholdImageFilterTest.cxx @@ -37,7 +37,7 @@ itkRobustAutomaticThresholdImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned short; using ImageType = itk::Image; diff --git a/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest1.cxx b/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest1.cxx index 219ca2ddca7..ec2254737ab 100644 --- a/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest1.cxx +++ b/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest1.cxx @@ -21,7 +21,7 @@ int itkScalarChanAndVeseDenseLevelSetImageFilterTest1(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = double; using ImageType = itk::Image; diff --git a/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest2.cxx b/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest2.cxx index 99033351c26..6edaa76d8ff 100644 --- a/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest2.cxx +++ b/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest2.cxx @@ -47,7 +47,7 @@ itkScalarChanAndVeseDenseLevelSetImageFilterTest2(int argc, char * argv[]) double l1 = 1.; double l2 = 1.; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ScalarPixelType = float; using LevelSetImageType = itk::Image; diff --git a/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest3.cxx b/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest3.cxx index 1de601f293c..d34f0d3d6d2 100644 --- a/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest3.cxx +++ b/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest3.cxx @@ -22,7 +22,7 @@ int itkScalarChanAndVeseDenseLevelSetImageFilterTest3(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = double; using ImageType = itk::Image; diff --git a/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest4.cxx b/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest4.cxx index 6c7210ad6f1..5494afd82cc 100644 --- a/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest4.cxx +++ b/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest4.cxx @@ -48,7 +48,7 @@ itkScalarChanAndVeseDenseLevelSetImageFilterTest4(int argc, char * argv[]) double l1 = 1.; double l2 = 1.; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ScalarPixelType = float; using LevelSetImageType = itk::Image; diff --git a/Modules/Nonunit/Review/test/itkScalarChanAndVeseLevelSetFunctionTest1.cxx b/Modules/Nonunit/Review/test/itkScalarChanAndVeseLevelSetFunctionTest1.cxx index b43712eb1b4..00f4587ba08 100644 --- a/Modules/Nonunit/Review/test/itkScalarChanAndVeseLevelSetFunctionTest1.cxx +++ b/Modules/Nonunit/Review/test/itkScalarChanAndVeseLevelSetFunctionTest1.cxx @@ -132,7 +132,7 @@ class ScalarChanAndVeseLevelSetFunctionSharedDataHelper : public DataObject int itkScalarChanAndVeseLevelSetFunctionTest1(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = double; using ImageType = itk::Image; diff --git a/Modules/Nonunit/Review/test/itkScalarChanAndVeseLevelSetFunctionTest2.cxx b/Modules/Nonunit/Review/test/itkScalarChanAndVeseLevelSetFunctionTest2.cxx index 385278191da..22ddefef544 100644 --- a/Modules/Nonunit/Review/test/itkScalarChanAndVeseLevelSetFunctionTest2.cxx +++ b/Modules/Nonunit/Review/test/itkScalarChanAndVeseLevelSetFunctionTest2.cxx @@ -78,7 +78,7 @@ class ScalarChanAndVeseLevelSetFunctionTest2Helper int itkScalarChanAndVeseLevelSetFunctionTest2(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = double; using ImageType = itk::Image; diff --git a/Modules/Nonunit/Review/test/itkScalarChanAndVeseSparseLevelSetImageFilterTest1.cxx b/Modules/Nonunit/Review/test/itkScalarChanAndVeseSparseLevelSetImageFilterTest1.cxx index fd1695d7483..4755ab9178c 100644 --- a/Modules/Nonunit/Review/test/itkScalarChanAndVeseSparseLevelSetImageFilterTest1.cxx +++ b/Modules/Nonunit/Review/test/itkScalarChanAndVeseSparseLevelSetImageFilterTest1.cxx @@ -22,7 +22,7 @@ int itkScalarChanAndVeseSparseLevelSetImageFilterTest1(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = double; using ImageType = itk::Image; diff --git a/Modules/Nonunit/Review/test/itkScalarChanAndVeseSparseLevelSetImageFilterTest2.cxx b/Modules/Nonunit/Review/test/itkScalarChanAndVeseSparseLevelSetImageFilterTest2.cxx index 454722c39f1..d97b3ef81bc 100644 --- a/Modules/Nonunit/Review/test/itkScalarChanAndVeseSparseLevelSetImageFilterTest2.cxx +++ b/Modules/Nonunit/Review/test/itkScalarChanAndVeseSparseLevelSetImageFilterTest2.cxx @@ -43,7 +43,7 @@ itkScalarChanAndVeseSparseLevelSetImageFilterTest2(int argc, char * argv[]) double l1 = 1.; double l2 = 3.; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ScalarPixelType = float; using LevelSetImageType = itk::Image; diff --git a/Modules/Nonunit/Review/test/itkScalarRegionBasedLevelSetFunctionTest.cxx b/Modules/Nonunit/Review/test/itkScalarRegionBasedLevelSetFunctionTest.cxx index 07a69caa1b8..cf33f0b18b6 100644 --- a/Modules/Nonunit/Review/test/itkScalarRegionBasedLevelSetFunctionTest.cxx +++ b/Modules/Nonunit/Review/test/itkScalarRegionBasedLevelSetFunctionTest.cxx @@ -144,7 +144,7 @@ class ScalarRegionBasedLevelSetFunctionSharedDataHelper : public DataObject int itkScalarRegionBasedLevelSetFunctionTest(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = double; using ImageType = itk::Image; diff --git a/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest1.cxx b/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest1.cxx index 4e31fc0f88f..c677647abe7 100644 --- a/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest1.cxx +++ b/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest1.cxx @@ -35,7 +35,7 @@ itkShapedFloodFilledImageFunctionConditionalConstIteratorTest1(int argc, char * return EXIT_FAILURE; } - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest2.cxx b/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest2.cxx index f9a45a48a46..ed990e0fede 100644 --- a/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest2.cxx +++ b/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest2.cxx @@ -29,7 +29,7 @@ itkShapedFloodFilledImageFunctionConditionalConstIteratorTest2(int, char *[]) { try { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest3.cxx b/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest3.cxx index 10303d060f7..61fa5c7289b 100644 --- a/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest3.cxx +++ b/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest3.cxx @@ -29,7 +29,7 @@ itkShapedFloodFilledImageFunctionConditionalConstIteratorTest3(int, char *[]) { try { - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Nonunit/Review/test/itkWarpHarmonicEnergyCalculatorTest.cxx b/Modules/Nonunit/Review/test/itkWarpHarmonicEnergyCalculatorTest.cxx index b0d63be3886..27c4bd0100d 100644 --- a/Modules/Nonunit/Review/test/itkWarpHarmonicEnergyCalculatorTest.cxx +++ b/Modules/Nonunit/Review/test/itkWarpHarmonicEnergyCalculatorTest.cxx @@ -36,7 +36,7 @@ itkWarpHarmonicEnergyCalculatorTest(int argc, char * argv[]) } // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using DeformationPixelType = itk::Vector; diff --git a/Modules/Nonunit/Review/test/itkWarpJacobianDeterminantFilterTest.cxx b/Modules/Nonunit/Review/test/itkWarpJacobianDeterminantFilterTest.cxx index 92c853b3e6c..d9b4c4dfe89 100644 --- a/Modules/Nonunit/Review/test/itkWarpJacobianDeterminantFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkWarpJacobianDeterminantFilterTest.cxx @@ -24,7 +24,7 @@ itkWarpJacobianDeterminantFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using DeformationPixelType = itk::Vector; using OutputPixelType = unsigned char; diff --git a/Modules/Numerics/Eigen/test/itkEigenAnalysis2DImageFilterTest.cxx b/Modules/Numerics/Eigen/test/itkEigenAnalysis2DImageFilterTest.cxx index 46301877dc5..acead50027c 100644 --- a/Modules/Numerics/Eigen/test/itkEigenAnalysis2DImageFilterTest.cxx +++ b/Modules/Numerics/Eigen/test/itkEigenAnalysis2DImageFilterTest.cxx @@ -168,21 +168,21 @@ itkEigenAnalysis2DImageFilterTest(int, char *[]) int status = EXIT_SUCCESS; { using myComputeType = double; - constexpr unsigned int myDimension = 2; + constexpr unsigned int myDimension{ 2 }; using myVectorType = itk::Vector; auto t1 = EigenAnalysis2DImageFilterTester(); status |= t1.Run(); } { using myComputeType = float; - constexpr unsigned int myDimension = 2; + constexpr unsigned int myDimension{ 2 }; using myVectorType = itk::Vector; auto t1 = EigenAnalysis2DImageFilterTester(); status |= t1.Run(); } { using myComputeType = float; - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; using myVectorType = itk::Vector; auto t1 = EigenAnalysis2DImageFilterTester(); status |= t1.Run(); @@ -190,7 +190,7 @@ itkEigenAnalysis2DImageFilterTest(int, char *[]) /* The two test below should cause compilation errors. { using myComputeType = float; - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; <-- ******* error: static assertion failed: Error: PixelType of EigenVector Image must have exactly 2 elements! using myVectorType = itk::Vector; auto t1 = EigenAnalysis2DImageFilterTester(); @@ -198,7 +198,7 @@ itkEigenAnalysis2DImageFilterTest(int, char *[]) } { using myComputeType = float; - constexpr unsigned int myDimension = 3; + constexpr unsigned int myDimension{ 3 }; using myVectorType = std::array; <-- ******* error: no type named ‘ValueType’ in ‘using PixelType = struct std::array auto t1 = EigenAnalysis2DImageFilterTester(); diff --git a/Modules/Numerics/FEM/include/itkFEMImageMetricLoad.hxx b/Modules/Numerics/FEM/include/itkFEMImageMetricLoad.hxx index e2537288e30..1f18f82ffa1 100644 --- a/Modules/Numerics/FEM/include/itkFEMImageMetricLoad.hxx +++ b/Modules/Numerics/FEM/include/itkFEMImageMetricLoad.hxx @@ -711,9 +711,9 @@ template void ImageMetricLoad::ApplyLoad(Element::ConstPointer element, Element::VectorType & _Fe) { - constexpr unsigned int TotalSolutionIndex = 1; /* Need to change if the index - * changes in CrankNicolsonSolver - */ + constexpr unsigned int TotalSolutionIndex{ 1 }; /* Need to change if the index + * changes in CrankNicolsonSolver + */ // has current solution state const typename Solution::ConstPointer S = this->GetSolution(); diff --git a/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx b/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx index 3521b2df534..3e40bef6185 100644 --- a/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx +++ b/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx @@ -53,7 +53,7 @@ RobustSolver::Initialization() { this->SetLinearSystemWrapper(&m_Itpack); - constexpr FEMIndexType maximumNonZeroMatrixEntriesFactor = 100; + constexpr FEMIndexType maximumNonZeroMatrixEntriesFactor{ 100 }; const FEMIndexType maxNumberOfNonZeroValues = this->m_NGFN * maximumNonZeroMatrixEntriesFactor; diff --git a/Modules/Numerics/FEM/include/itkFEMScatteredDataPointSetToImageFilter.h b/Modules/Numerics/FEM/include/itkFEMScatteredDataPointSetToImageFilter.h index 12fa68b163d..508cc23f04c 100644 --- a/Modules/Numerics/FEM/include/itkFEMScatteredDataPointSetToImageFilter.h +++ b/Modules/Numerics/FEM/include/itkFEMScatteredDataPointSetToImageFilter.h @@ -65,8 +65,8 @@ namespace itk::fem * \code - constexpr unsigned int ParametricDimension = 3; - constexpr unsigned int DataDimension = 3; + constexpr unsigned int ParametricDimension{ 3 }; + constexpr unsigned int DataDimension{ 3 }; using PixelType = int; using InputImageType = itk::Image; diff --git a/Modules/Numerics/FEM/src/itkFEMElement3DC0LinearTetrahedron.cxx b/Modules/Numerics/FEM/src/itkFEMElement3DC0LinearTetrahedron.cxx index ef46d41fd5e..11b3bd2f36f 100644 --- a/Modules/Numerics/FEM/src/itkFEMElement3DC0LinearTetrahedron.cxx +++ b/Modules/Numerics/FEM/src/itkFEMElement3DC0LinearTetrahedron.cxx @@ -140,7 +140,7 @@ Element3DC0LinearTetrahedron::GetLocalFromGlobalCoordinates(const VectorType & g (y - y0) * ((x1 - x0) * (z2 - z0) - (z1 - z0) * (x2 - x0)) + (z - z0) * ((x1 - x0) * (y2 - y0) - (y1 - y0) * (x2 - x0))); - constexpr double FEM_TETRA_EPSILON = 1e-5; + constexpr double FEM_TETRA_EPSILON{ 1e-5 }; if (localPt[0] < (0.0 - FEM_TETRA_EPSILON) || localPt[0] > (1.0 + FEM_TETRA_EPSILON) || localPt[1] < (0.0 - FEM_TETRA_EPSILON) || localPt[1] > (1.0 + FEM_TETRA_EPSILON) || diff --git a/Modules/Numerics/FEM/src/itkFEMElement3DC0LinearTriangular.cxx b/Modules/Numerics/FEM/src/itkFEMElement3DC0LinearTriangular.cxx index c24f2db07b1..f6cc6be35aa 100644 --- a/Modules/Numerics/FEM/src/itkFEMElement3DC0LinearTriangular.cxx +++ b/Modules/Numerics/FEM/src/itkFEMElement3DC0LinearTriangular.cxx @@ -218,9 +218,9 @@ Element3DC0LinearTriangular::Float Element3DC0LinearTriangular::JacobianDeterminant(const VectorType & /*HACK pt*/, const MatrixType * /*HACK pJ*/) const { // use heron's formula - constexpr int na = 0; - constexpr int nb = 1; - constexpr int nc = 2; + constexpr int na{ 0 }; + constexpr int nb{ 1 }; + constexpr int nc{ 2 }; const VectorType & A = this->GetNode(na)->GetCoordinates(); const VectorType & B = this->GetNode(nb)->GetCoordinates(); diff --git a/Modules/Numerics/FEM/src/itkFEMLoadLandmark.cxx b/Modules/Numerics/FEM/src/itkFEMLoadLandmark.cxx index 3f911a7821a..56bc8fb75cb 100644 --- a/Modules/Numerics/FEM/src/itkFEMLoadLandmark.cxx +++ b/Modules/Numerics/FEM/src/itkFEMLoadLandmark.cxx @@ -145,7 +145,7 @@ LoadLandmark::ApplyLoad(Element::ConstPointer element, Element::VectorType & Fe) Solution::ConstPointer sol = this->GetSolution(); // Determine the displacement at point pt - constexpr unsigned int TotalSolutionIndex = 1; + constexpr unsigned int TotalSolutionIndex{ 1 }; disp = element->InterpolateSolution(pt, *sol, TotalSolutionIndex); // Convert the source to global coordinates diff --git a/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralStressTest.cxx b/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralStressTest.cxx index 7871bf96aea..92c4c206335 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralStressTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralStressTest.cxx @@ -34,7 +34,7 @@ itkFEMElement2DC0LinearQuadrilateralStressTest(int argc, char * argv[]) itk::FEMFactoryBase::RegisterDefaultTypes(); - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using Solver2DType = itk::fem::Solver; auto solver = Solver2DType::New(); diff --git a/Modules/Numerics/FEM/test/itkFEMRobustSolverTest.cxx b/Modules/Numerics/FEM/test/itkFEMRobustSolverTest.cxx index 747944a4f3a..65084f12b98 100644 --- a/Modules/Numerics/FEM/test/itkFEMRobustSolverTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMRobustSolverTest.cxx @@ -51,8 +51,8 @@ int itkFEMRobustSolverTest(int, char *[]) { - constexpr unsigned int DataDimension = 2; - constexpr unsigned int ParameterDimension = 2; + constexpr unsigned int DataDimension{ 2 }; + constexpr unsigned int ParameterDimension{ 2 }; /** Solver type alias support */ using SolverType = itk::fem::RobustSolver; diff --git a/Modules/Numerics/FEM/test/itkFEMScatteredDataPointSetToImageFilterTest.cxx b/Modules/Numerics/FEM/test/itkFEMScatteredDataPointSetToImageFilterTest.cxx index 63b310e555b..b7369a53059 100644 --- a/Modules/Numerics/FEM/test/itkFEMScatteredDataPointSetToImageFilterTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMScatteredDataPointSetToImageFilterTest.cxx @@ -46,8 +46,8 @@ int itkFEMScatteredDataPointSetToImageFilterTest(int, char *[]) { - constexpr unsigned int ParametricDimension = 2; - constexpr unsigned int DataDimension = 2; + constexpr unsigned int ParametricDimension{ 2 }; + constexpr unsigned int DataDimension{ 2 }; using RealType = float; using VectorType = itk::Vector; diff --git a/Modules/Numerics/FEM/test/itkImageToRectilinearFEMObjectFilter2DTest.cxx b/Modules/Numerics/FEM/test/itkImageToRectilinearFEMObjectFilter2DTest.cxx index 36174028694..496a7b0faaa 100644 --- a/Modules/Numerics/FEM/test/itkImageToRectilinearFEMObjectFilter2DTest.cxx +++ b/Modules/Numerics/FEM/test/itkImageToRectilinearFEMObjectFilter2DTest.cxx @@ -26,11 +26,11 @@ int itkImageToRectilinearFEMObjectFilter2DTest(int argc, char * argv[]) { - constexpr int inputFileDataCheckArgs = 8; + constexpr int inputFileDataCheckArgs{ 8 }; // numberOfNodesToTest (a least 1) + nodeNumber (at least 1) + nodeCoords (2 per node) - constexpr unsigned int minArgNodes = 4; + constexpr unsigned int minArgNodes{ 4 }; // numberOfElementsToTest (a least 1) + elementNumber (at least 1) + elementNodes (4 per element) - constexpr unsigned int minArgElements = 6; + constexpr unsigned int minArgElements{ 6 }; int minArgC = inputFileDataCheckArgs + minArgNodes + minArgElements; if (argc < minArgC) @@ -53,8 +53,8 @@ itkImageToRectilinearFEMObjectFilter2DTest(int argc, char * argv[]) } - constexpr unsigned int Dimension = 2; - constexpr unsigned int nodeSize = 4; + constexpr unsigned int Dimension{ 2 }; + constexpr unsigned int nodeSize{ 4 }; // Check the provided node and element argument numbers const auto numberOfNodesToTest = static_cast(std::stoi(argv[8])); diff --git a/Modules/Numerics/FEM/test/itkImageToRectilinearFEMObjectFilter3DTest.cxx b/Modules/Numerics/FEM/test/itkImageToRectilinearFEMObjectFilter3DTest.cxx index c5e56aeb6e3..b1b97ae2583 100644 --- a/Modules/Numerics/FEM/test/itkImageToRectilinearFEMObjectFilter3DTest.cxx +++ b/Modules/Numerics/FEM/test/itkImageToRectilinearFEMObjectFilter3DTest.cxx @@ -26,11 +26,11 @@ int itkImageToRectilinearFEMObjectFilter3DTest(int argc, char * argv[]) { - constexpr int inputFileDataCheckArgs = 10; + constexpr int inputFileDataCheckArgs{ 10 }; // numberOfNodesToTest (a least 1) + nodeNumber (at least 1) + nodeCoords (3 per node) - constexpr unsigned int minArgNodes = 5; + constexpr unsigned int minArgNodes{ 5 }; // numberOfElementsToTest (a least 1) + elementNumber (at least 1) + elementNodes (8 per element) - constexpr unsigned int minArgElements = 10; + constexpr unsigned int minArgElements{ 10 }; int minArgC = inputFileDataCheckArgs + minArgNodes + minArgElements; if (argc < minArgC) @@ -55,8 +55,8 @@ itkImageToRectilinearFEMObjectFilter3DTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; - constexpr unsigned int nodeSize = 8; + constexpr unsigned int Dimension{ 3 }; + constexpr unsigned int nodeSize{ 8 }; // Check the provided node and element argument numbers const auto numberOfNodesToTest = static_cast(std::stoi(argv[10])); diff --git a/Modules/Numerics/NarrowBand/include/itkNarrowBandImageFilterBase.hxx b/Modules/Numerics/NarrowBand/include/itkNarrowBandImageFilterBase.hxx index 25fb8d561b7..e8a33b24ccc 100644 --- a/Modules/Numerics/NarrowBand/include/itkNarrowBandImageFilterBase.hxx +++ b/Modules/Numerics/NarrowBand/include/itkNarrowBandImageFilterBase.hxx @@ -223,7 +223,7 @@ NarrowBandImageFilterBase::ThreadedApplyUpdate(const ThreadIdType threadId) { // constexpr int INNER_MASK = 2; - constexpr signed char INNER_MASK = 2; + constexpr signed char INNER_MASK{ 2 }; const typename OutputImageType::Pointer image = this->GetOutput(); for (auto it = regionToProcess.first; it != regionToProcess.last; ++it) diff --git a/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx b/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx index f9d2922907b..defd03f91d9 100644 --- a/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx +++ b/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx @@ -94,7 +94,7 @@ double SimpleSignedDistance(const TPoint & p) { auto center = itk::MakeFilled(32); - constexpr double radius = 19.5; + constexpr double radius{ 19.5 }; double accum = 0.0; for (unsigned int j = 0; j < TPoint::PointDimension; ++j) @@ -118,13 +118,13 @@ itkNarrowBandImageFilterBaseTest(int argc, char * argv[]) using PixelType = float; using WriterPixelType = unsigned char; - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using ImageType = itk::Image; using WriterImageType = itk::Image; using PointType = itk::Point; - constexpr ImageType::SizeType size = { { 64, 64 } }; - constexpr ImageType::IndexType index = { { 0, 0 } }; + constexpr ImageType::SizeType size{ 64, 64 }; + constexpr ImageType::IndexType index{ 0, 0 }; const ImageType::RegionType region{ index, size }; auto inputImage = ImageType::New(); diff --git a/Modules/Numerics/Optimizers/src/itkAmoebaOptimizer.cxx b/Modules/Numerics/Optimizers/src/itkAmoebaOptimizer.cxx index eeb5fb725ef..3b9405d8851 100644 --- a/Modules/Numerics/Optimizers/src/itkAmoebaOptimizer.cxx +++ b/Modules/Numerics/Optimizers/src/itkAmoebaOptimizer.cxx @@ -184,8 +184,8 @@ AmoebaOptimizer::StartOptimization() // automated initialization - previously hidden inside vnl if (this->m_AutomaticInitialSimplex) { - constexpr double relativeDiameter = 0.05; - constexpr double zeroTermDelta = 0.00025; + constexpr double relativeDiameter{ 0.05 }; + constexpr double zeroTermDelta{ 0.00025 }; InternalParametersType automaticDelta(n); for (unsigned int i = 0; i < n; ++i) { diff --git a/Modules/Numerics/Optimizers/src/itkCumulativeGaussianOptimizer.cxx b/Modules/Numerics/Optimizers/src/itkCumulativeGaussianOptimizer.cxx index d289f4c302d..18b7124f242 100644 --- a/Modules/Numerics/Optimizers/src/itkCumulativeGaussianOptimizer.cxx +++ b/Modules/Numerics/Optimizers/src/itkCumulativeGaussianOptimizer.cxx @@ -105,7 +105,7 @@ CumulativeGaussianOptimizer::FindParametersOfGaussian(MeasureType * sampledGauss extendedArray = ExtendGaussian(sampledGaussianArray, extendedArray, sampledGaussianArraySize); MeasureGaussianParameters(extendedArray); - constexpr bool smallChangeBetweenIterations = false; + constexpr bool smallChangeBetweenIterations{ false }; while (averageSumOfSquaredDifferences >= m_DifferenceTolerance) { for (int j = 0; j < extendedArraySize; ++j) diff --git a/Modules/Numerics/Optimizers/src/itkFRPROptimizer.cxx b/Modules/Numerics/Optimizers/src/itkFRPROptimizer.cxx index cab815c542e..763a7425d1e 100644 --- a/Modules/Numerics/Optimizers/src/itkFRPROptimizer.cxx +++ b/Modules/Numerics/Optimizers/src/itkFRPROptimizer.cxx @@ -20,7 +20,7 @@ namespace itk { -constexpr double FRPR_TINY = 1e-20; +constexpr double FRPR_TINY{ 1e-20 }; FRPROptimizer::FRPROptimizer() : m_OptimizationType(OptimizationEnum::PolakRibiere) diff --git a/Modules/Numerics/Optimizers/src/itkPowellOptimizer.cxx b/Modules/Numerics/Optimizers/src/itkPowellOptimizer.cxx index 050886239eb..01d403807e3 100644 --- a/Modules/Numerics/Optimizers/src/itkPowellOptimizer.cxx +++ b/Modules/Numerics/Optimizers/src/itkPowellOptimizer.cxx @@ -236,7 +236,7 @@ PowellOptimizer::BracketedLineOptimize(double ax, const double goldenSectionRatio = (3.0 - std::sqrt(5.0)) / 2; /* Gold section ratio */ - constexpr double POWELL_TINY = 1.0e-20; + constexpr double POWELL_TINY{ 1.0e-20 }; /* f(x) */ double functionValueOfV = functionValueOfb; diff --git a/Modules/Numerics/Optimizers/test/itkAmoebaOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkAmoebaOptimizerTest.cxx index 8ff409007aa..0d9da62c770 100644 --- a/Modules/Numerics/Optimizers/test/itkAmoebaOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkAmoebaOptimizerTest.cxx @@ -354,7 +354,7 @@ AmoebaTest1() OptimizerType::ParametersType finalPosition = itkOptimizer->GetCurrentPosition(); - constexpr double trueParameters[2] = { 2, -2 }; + constexpr double trueParameters[2]{ 2, -2 }; bool pass = true; std::cout << "Right answer = " << trueParameters[0] << " , " << trueParameters[1] << std::endl; @@ -471,13 +471,13 @@ AmoebaTest2() auto itkOptimizer = OptimizerType::New(); // set optimizer parameters - constexpr unsigned int maxIterations = 100; + constexpr unsigned int maxIterations{ 100 }; itkOptimizer->SetMaximumNumberOfIterations(maxIterations); - constexpr double xTolerance = 0.01; + constexpr double xTolerance{ 0.01 }; itkOptimizer->SetParametersConvergenceTolerance(xTolerance); - constexpr double fTolerance = 0.001; + constexpr double fTolerance{ 0.001 }; itkOptimizer->SetFunctionConvergenceTolerance(fTolerance); // the initial simplex is constructed as: @@ -521,7 +521,7 @@ AmoebaTest2() // we should have converged to the local minimum, -2 { OptimizerType::ParametersType finalParameters = itkOptimizer->GetCurrentPosition(); - constexpr double knownParameters = -2.0; + constexpr double knownParameters{ -2.0 }; std::cout << "Standard Amoeba:\n"; std::cout << "Known parameters = " << knownParameters << " "; std::cout << "Estimated parameters = " << finalParameters << std::endl; @@ -554,7 +554,7 @@ AmoebaTest2() { // we should have converged to the global minimum, 2 OptimizerType::ParametersType finalParameters = itkOptimizer->GetCurrentPosition(); - constexpr double knownParameters = 2.0; + constexpr double knownParameters{ 2.0 }; std::cout << "Amoeba with restarts:\n"; std::cout << "Known parameters = " << knownParameters << " "; std::cout << "Estimated parameters = " << finalParameters << std::endl; diff --git a/Modules/Numerics/Optimizers/test/itkConjugateGradientOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkConjugateGradientOptimizerTest.cxx index cfca86565e4..da0b5c9cadd 100644 --- a/Modules/Numerics/Optimizers/test/itkConjugateGradientOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkConjugateGradientOptimizerTest.cxx @@ -176,11 +176,11 @@ itkConjugateGradientOptimizerTest(int, char *[]) vnlOptimizerType * vnlOptimizer = itkOptimizer->GetOptimizer(); - constexpr double F_Tolerance = 1e-3; // Function value tolerance - constexpr double G_Tolerance = 1e-4; // Gradient magnitude tolerance - constexpr double X_Tolerance = 1e-8; // Search space tolerance - constexpr double Epsilon_Function = 1e-10; // Step - constexpr int Max_Iterations = 100; // Maximum number of iterations + constexpr double F_Tolerance{ 1e-3 }; // Function value tolerance + constexpr double G_Tolerance{ 1e-4 }; // Gradient magnitude tolerance + constexpr double X_Tolerance{ 1e-8 }; // Search space tolerance + constexpr double Epsilon_Function{ 1e-10 }; // Step + constexpr int Max_Iterations{ 100 }; // Maximum number of iterations vnlOptimizer->set_f_tolerance(F_Tolerance); vnlOptimizer->set_g_tolerance(G_Tolerance); @@ -241,7 +241,7 @@ itkConjugateGradientOptimizerTest(int, char *[]) std::cout << finalPosition[1] << ')' << std::endl; bool pass = true; - constexpr double trueParameters[2] = { 2, -2 }; + constexpr double trueParameters[2]{ 2, -2 }; for (unsigned int j = 0; j < 2; ++j) { if (itk::Math::abs(finalPosition[j] - trueParameters[j]) > 0.01) diff --git a/Modules/Numerics/Optimizers/test/itkCumulativeGaussianOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkCumulativeGaussianOptimizerTest.cxx index 3a60caa43d3..f1fc33e4c17 100644 --- a/Modules/Numerics/Optimizers/test/itkCumulativeGaussianOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkCumulativeGaussianOptimizerTest.cxx @@ -34,13 +34,13 @@ int itkCumulativeGaussianOptimizerTest(int, char *[]) { - constexpr double mean = 3; // Mean of the Cumulative Gaussian. - // Ranges from 0 to N-1, where N is numberOfSamples. - constexpr double standardDeviation = 2; // Standard deviation of the Cumulative Gaussian. - constexpr double lowerAsymptote = -10; // Lower asymptotic value of the Cumulative Gaussian. - constexpr int numberOfSamples = 9; // Number of data samples. - constexpr double upperAsymptote = 10; // Upper asymptotic value of the Cumulative Gaussian. - constexpr double differenceTolerance = 1e-20; // Tolerance allowed for the difference between Gaussian iterations. + constexpr double mean{ 3 }; // Mean of the Cumulative Gaussian. + // Ranges from 0 to N-1, where N is numberOfSamples. + constexpr double standardDeviation{ 2 }; // Standard deviation of the Cumulative Gaussian. + constexpr double lowerAsymptote{ -10 }; // Lower asymptotic value of the Cumulative Gaussian. + constexpr int numberOfSamples{ 9 }; // Number of data samples. + constexpr double upperAsymptote{ 10 }; // Upper asymptotic value of the Cumulative Gaussian. + constexpr double differenceTolerance{ 1e-20 }; // Tolerance allowed for the difference between Gaussian iterations. // Typedef and initialization for the Cumulative Gaussian Optimizer. using CumulativeGaussianOptimizerType = itk::CumulativeGaussianOptimizer; @@ -86,7 +86,7 @@ itkCumulativeGaussianOptimizerTest(int, char *[]) ITK_TEST_SET_GET_VALUE(differenceTolerance, optimizer->GetDifferenceTolerance()); // Print results after each iteration. - constexpr bool verbose = true; + constexpr bool verbose{ true }; ITK_TEST_SET_GET_BOOLEAN(optimizer, Verbose, verbose); // Set the data array. diff --git a/Modules/Numerics/Optimizers/test/itkExhaustiveOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkExhaustiveOptimizerTest.cxx index 8a1c89101ac..880b5b45cd1 100644 --- a/Modules/Numerics/Optimizers/test/itkExhaustiveOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkExhaustiveOptimizerTest.cxx @@ -256,7 +256,7 @@ itkExhaustiveOptimizerTest(int, char *[]) // check results to see if it is within range // bool trueParamsPass = true; - constexpr double trueParameters[2] = { 2, -2 }; + constexpr double trueParameters[2]{ 2, -2 }; for (unsigned int j = 0; j < 2; ++j) { if (itk::Math::abs(finalPosition[j] - trueParameters[j]) > 0.01) diff --git a/Modules/Numerics/Optimizers/test/itkFRPROptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkFRPROptimizerTest.cxx index 15cc35a67ba..2ffea7f4ea2 100644 --- a/Modules/Numerics/Optimizers/test/itkFRPROptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkFRPROptimizerTest.cxx @@ -140,7 +140,7 @@ itkFRPROptimizerTest(int, char *[]) itkOptimizer->SetMaximize(false); itkOptimizer->SetMaximumIteration(50); - constexpr bool useUnitLengthGradient = false; + constexpr bool useUnitLengthGradient{ false }; ITK_TEST_SET_GET_BOOLEAN(itkOptimizer, UseUnitLengthGradient, useUnitLengthGradient); { @@ -172,7 +172,7 @@ itkFRPROptimizerTest(int, char *[]) // check results to see if it is within range // bool pass = true; - constexpr double trueParameters[2] = { 2, -2 }; + constexpr double trueParameters[2]{ 2, -2 }; for (unsigned int j = 0; j < 2; ++j) { if (itk::Math::abs(finalPosition[j] - trueParameters[j]) > 0.01) @@ -227,7 +227,7 @@ itkFRPROptimizerTest(int, char *[]) // check results to see if it is within range // bool pass = true; - constexpr double trueParameters[2] = { 2, -2 }; + constexpr double trueParameters[2]{ 2, -2 }; for (unsigned int j = 0; j < 2; ++j) { if (itk::Math::abs(finalPosition[j] - trueParameters[j]) > 0.01) diff --git a/Modules/Numerics/Optimizers/test/itkGradientDescentOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkGradientDescentOptimizerTest.cxx index 6d8bf431e74..6bcac5a28e5 100644 --- a/Modules/Numerics/Optimizers/test/itkGradientDescentOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkGradientDescentOptimizerTest.cxx @@ -141,17 +141,17 @@ itkGradientDescentOptimizerTest(int, char *[]) initialPosition[1] = -100; - constexpr bool maximize = false; + constexpr bool maximize{ false }; ITK_TEST_SET_GET_BOOLEAN(itkOptimizer, Maximize, maximize); - constexpr bool minimize = !maximize; + constexpr bool minimize{ !maximize }; ITK_TEST_SET_GET_BOOLEAN(itkOptimizer, Minimize, minimize); - constexpr double learningRate = 0.1; + constexpr double learningRate{ 0.1 }; itkOptimizer->SetLearningRate(learningRate); ITK_TEST_SET_GET_VALUE(learningRate, itkOptimizer->GetLearningRate()); - constexpr itk::SizeValueType numberOfIterations = 50; + constexpr itk::SizeValueType numberOfIterations{ 50 }; itkOptimizer->SetNumberOfIterations(numberOfIterations); ITK_TEST_SET_GET_VALUE(numberOfIterations, itkOptimizer->GetNumberOfIterations()); @@ -180,7 +180,7 @@ itkGradientDescentOptimizerTest(int, char *[]) // check results to see if it is within range // bool pass = true; - constexpr double trueParameters[2] = { 2, -2 }; + constexpr double trueParameters[2]{ 2, -2 }; for (unsigned int j = 0; j < 2; ++j) { if (itk::Math::abs(finalPosition[j] - trueParameters[j]) > 0.01) diff --git a/Modules/Numerics/Optimizers/test/itkInitializationBiasedParticleSwarmOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkInitializationBiasedParticleSwarmOptimizerTest.cxx index 42e386b1a42..ac8b1130079 100644 --- a/Modules/Numerics/Optimizers/test/itkInitializationBiasedParticleSwarmOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkInitializationBiasedParticleSwarmOptimizerTest.cxx @@ -92,7 +92,7 @@ itkInitializationBiasedParticleSwarmOptimizerTest(int argc, char * argv[]) unsigned int success1{ 0 }; unsigned int success2{ 0 }; unsigned int success3{ 0 }; - constexpr unsigned int allIterations = 10; + constexpr unsigned int allIterations{ 10 }; for (unsigned int i = 0; i < allIterations; ++i) { if (EXIT_SUCCESS == @@ -113,7 +113,7 @@ itkInitializationBiasedParticleSwarmOptimizerTest(int argc, char * argv[]) } std::cout << "All Tests Completed." << std::endl; - constexpr double threshold = 0.8; + constexpr double threshold{ 0.8 }; if (static_cast(success1) / static_cast(allIterations) <= threshold || static_cast(success2) / static_cast(allIterations) <= threshold || static_cast(success3) / static_cast(allIterations) <= threshold) @@ -135,7 +135,7 @@ IBPSOTest1(typename OptimizerType::CoefficientType inertiaCoefficient, std::cout << "Particle Swarm Optimizer Test 1 [f(x) = if(x<0) x^2+4x; else 2x^2-8x]\n"; std::cout << "-------------------------------\n"; - constexpr double knownParameters = 2.0; + constexpr double knownParameters{ 2.0 }; // the function we want to optimize const itk::ParticleSwarmTestF1::Pointer costFunction = itk::ParticleSwarmTestF1::New(); @@ -164,10 +164,10 @@ IBPSOTest1(typename OptimizerType::CoefficientType inertiaCoefficient, // set optimizer parameters OptimizerType::ParameterBoundsType bounds; bounds.emplace_back(-10, 10); - constexpr unsigned int numberOfParticles = 10; - constexpr unsigned int maxIterations = 200; - constexpr double xTolerance = 0.1; - constexpr double fTolerance = 0.001; + constexpr unsigned int numberOfParticles{ 10 }; + constexpr unsigned int maxIterations{ 200 }; + constexpr double xTolerance{ 0.1 }; + constexpr double fTolerance{ 0.001 }; OptimizerType::ParametersType initialParameters(1); itkOptimizer->SetParameterBounds(bounds); @@ -291,10 +291,10 @@ IBPSOTest2(typename OptimizerType::CoefficientType inertiaCoefficient, OptimizerType::ParameterBoundsType bounds; bounds.emplace_back(-10, 10); bounds.emplace_back(-10, 10); - constexpr unsigned int numberOfParticles = 10; - constexpr unsigned int maxIterations = 200; - constexpr double xTolerance = 0.1; - constexpr double fTolerance = 0.001; + constexpr unsigned int numberOfParticles{ 10 }; + constexpr unsigned int maxIterations{ 200 }; + constexpr double xTolerance{ 0.1 }; + constexpr double fTolerance{ 0.001 }; OptimizerType::ParametersType initialParameters(2); itkOptimizer->SetParameterBounds(bounds); @@ -390,10 +390,10 @@ IBPSOTest3(typename OptimizerType::CoefficientType inertiaCoefficient, OptimizerType::ParameterBoundsType bounds; bounds.emplace_back(-100, 100); bounds.emplace_back(-100, 100); - constexpr unsigned int numberOfParticles = 100; - constexpr unsigned int maxIterations = 1000; - constexpr double xTolerance = 0.1; - constexpr double fTolerance = 0.01; + constexpr unsigned int numberOfParticles{ 100 }; + constexpr unsigned int maxIterations{ 1000 }; + constexpr double xTolerance{ 0.1 }; + constexpr double fTolerance{ 0.01 }; OptimizerType::ParametersType initialParameters(2); itkOptimizer->SetParameterBounds(bounds); diff --git a/Modules/Numerics/Optimizers/test/itkLBFGSBOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkLBFGSBOptimizerTest.cxx index f509b06228a..f9c293bfe09 100644 --- a/Modules/Numerics/Optimizers/test/itkLBFGSBOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkLBFGSBOptimizerTest.cxx @@ -193,12 +193,12 @@ itkLBFGSBOptimizerTest(int, char *[]) itkOptimizer->SetCostFunction(costFunction); - constexpr bool trace = false; + constexpr bool trace{ false }; ITK_TEST_SET_GET_BOOLEAN(itkOptimizer, Trace, trace); - constexpr double F_Convergence_Factor = 1e+7; // Function value tolerance - constexpr double Projected_G_Tolerance = 1e-5; // Proj gradient tolerance - constexpr int Max_Iterations = 100; // Maximum number of iterations + constexpr double F_Convergence_Factor{ 1e+7 }; // Function value tolerance + constexpr double Projected_G_Tolerance{ 1e-5 }; // Proj gradient tolerance + constexpr int Max_Iterations{ 100 }; // Maximum number of iterations itkOptimizer->SetCostFunctionConvergenceFactor(F_Convergence_Factor); ITK_TEST_SET_GET_VALUE(F_Convergence_Factor, itkOptimizer->GetCostFunctionConvergenceFactor()); @@ -212,13 +212,13 @@ itkLBFGSBOptimizerTest(int, char *[]) itkOptimizer->SetMaximumNumberOfEvaluations(Max_Iterations); ITK_TEST_SET_GET_VALUE(Max_Iterations, itkOptimizer->GetMaximumNumberOfEvaluations()); - constexpr unsigned int maximumNumberOfCorrections = 5; + constexpr unsigned int maximumNumberOfCorrections{ 5 }; itkOptimizer->SetMaximumNumberOfCorrections(maximumNumberOfCorrections); ITK_TEST_SET_GET_VALUE(maximumNumberOfCorrections, itkOptimizer->GetMaximumNumberOfCorrections()); ITK_TEST_EXPECT_TRUE(!itkOptimizer->CanUseScales()); - constexpr unsigned int SpaceDimension = 2; + constexpr unsigned int SpaceDimension{ 2 }; OptimizerType::ParametersType initialValue(SpaceDimension); // Starting point @@ -299,7 +299,7 @@ itkLBFGSBOptimizerTest(int, char *[]) bool pass = true; std::string errorIn; - constexpr double trueParameters[2] = { 4.0 / 3.0, -1.0 }; + constexpr double trueParameters[2]{ 4.0 / 3.0, -1.0 }; for (unsigned int j = 0; j < 2; ++j) { if (itk::Math::abs(finalPosition[j] - trueParameters[j]) > 0.01) diff --git a/Modules/Numerics/Optimizers/test/itkLBFGSOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkLBFGSOptimizerTest.cxx index 39d40e2da27..55ccd96a1e1 100644 --- a/Modules/Numerics/Optimizers/test/itkLBFGSOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkLBFGSOptimizerTest.cxx @@ -128,7 +128,7 @@ itkLBFGSOptimizerTest(int, char *[]) auto costFunction = LBFGSCostFunction::New(); // Set some optimizer parameters - constexpr bool trace = false; + constexpr bool trace{ false }; ITK_TEST_SET_GET_BOOLEAN(itkOptimizer, Trace, trace); unsigned int maximumNumberOfFunctionEvaluations = 1000; @@ -158,7 +158,7 @@ itkLBFGSOptimizerTest(int, char *[]) vnlOptimizer->set_check_derivatives(0); - constexpr unsigned int SpaceDimension = 2; + constexpr unsigned int SpaceDimension{ 2 }; OptimizerType::ParametersType initialValue(SpaceDimension); // We start not so far from | 2 -2 | @@ -219,7 +219,7 @@ itkLBFGSOptimizerTest(int, char *[]) // check results to see if it is within range // bool pass = true; - constexpr double trueParameters[2] = { 2, -2 }; + constexpr double trueParameters[2]{ 2, -2 }; for (unsigned int j = 0; j < 2; ++j) { if (itk::Math::abs(finalPosition[j] - trueParameters[j]) > 0.01) diff --git a/Modules/Numerics/Optimizers/test/itkLevenbergMarquardtOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkLevenbergMarquardtOptimizerTest.cxx index 9696065ec83..250fa9c93e1 100644 --- a/Modules/Numerics/Optimizers/test/itkLevenbergMarquardtOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkLevenbergMarquardtOptimizerTest.cxx @@ -23,9 +23,9 @@ using MatrixType = vnl_matrix; using VectorType = vnl_vector; -constexpr double ra = 11.0; -constexpr double rb = 17.0; -constexpr double rc = 29.0; +constexpr double ra{ 11.0 }; +constexpr double rb{ 17.0 }; +constexpr double rc{ 29.0 }; /** * @@ -372,7 +372,7 @@ itkRunLevenbergMarquardOptimization(bool useGradient, // check results to see if it is within range // bool pass = true; - constexpr double trueParameters[3] = { ra, rb, rc }; + constexpr double trueParameters[3]{ ra, rb, rc }; for (unsigned int j = 0; j < LMCostFunction::SpaceDimension; ++j) { if (itk::Math::abs(finalPosition[j] - trueParameters[j]) > 0.01) diff --git a/Modules/Numerics/Optimizers/test/itkOnePlusOneEvolutionaryOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkOnePlusOneEvolutionaryOptimizerTest.cxx index 47422ac64bf..0c85667596a 100644 --- a/Modules/Numerics/Optimizers/test/itkOnePlusOneEvolutionaryOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkOnePlusOneEvolutionaryOptimizerTest.cxx @@ -180,7 +180,7 @@ itkOnePlusOneEvolutionaryOptimizerTest(int, char *[]) ITK_TEST_SET_GET_VALUE(!maximize, itkOptimizer->GetMinimize()); ITK_TEST_SET_GET_BOOLEAN(itkOptimizer, Maximize, maximize); - constexpr unsigned int maximumIteration = 8000; + constexpr unsigned int maximumIteration{ 8000 }; itkOptimizer->SetMaximumIteration(8000); ITK_TEST_SET_GET_VALUE(maximumIteration, itkOptimizer->GetMaximumIteration()); @@ -234,7 +234,7 @@ itkOnePlusOneEvolutionaryOptimizerTest(int, char *[]) // check results to see if it is within range // bool pass = true; - constexpr double trueParameters[2] = { 2, -2 }; + constexpr double trueParameters[2]{ 2, -2 }; for (unsigned int j = 0; j < 2; ++j) { if (itk::Math::abs(finalPosition[j] - trueParameters[j]) > 0.01) diff --git a/Modules/Numerics/Optimizers/test/itkOptimizersHierarchyTest.cxx b/Modules/Numerics/Optimizers/test/itkOptimizersHierarchyTest.cxx index 072ae73b0f1..4bc59418755 100644 --- a/Modules/Numerics/Optimizers/test/itkOptimizersHierarchyTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkOptimizersHierarchyTest.cxx @@ -45,7 +45,7 @@ itkOptimizersHierarchyTest(int, char *[]) using OptimizerType = itk::Optimizer; auto genericOptimizer = OptimizerType::New(); - constexpr unsigned int spaceDimension = 10; + constexpr unsigned int spaceDimension{ 10 }; OptimizerType::ParametersType initialPosition(spaceDimension); const OptimizerType::ParametersType currentPosition(spaceDimension); @@ -59,7 +59,7 @@ itkOptimizersHierarchyTest(int, char *[]) const OptimizerType::ScalesType & parameterScaleGot = genericOptimizer->GetScales(); - constexpr double tolerance = 1e-10; + constexpr double tolerance{ 1e-10 }; for (unsigned int i = 0; i < spaceDimension; ++i) { diff --git a/Modules/Numerics/Optimizers/test/itkParticleSwarmOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkParticleSwarmOptimizerTest.cxx index aee128f20aa..5b5004aa461 100644 --- a/Modules/Numerics/Optimizers/test/itkParticleSwarmOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkParticleSwarmOptimizerTest.cxx @@ -66,8 +66,8 @@ itkParticleSwarmOptimizerTest(int argc, char * argv[]) verboseFlag = std::stoi(argv[1]) ? true : false; } - constexpr unsigned int allIterations = 10; - constexpr double threshold = 0.8; + constexpr unsigned int allIterations{ 10 }; + constexpr double threshold{ 0.8 }; unsigned int success1{}; unsigned int success2{}; unsigned int success3{}; @@ -110,7 +110,7 @@ PSOTest1() std::cout << "Particle Swarm Optimizer Test 1 [f(x) = if(x<0) x^2+4x; else 2x^2-8x]\n"; std::cout << "-------------------------------\n"; - constexpr double knownParameters = 2.0; + constexpr double knownParameters{ 2.0 }; // the function we want to optimize const itk::ParticleSwarmTestF1::Pointer costFunction = itk::ParticleSwarmTestF1::New(); @@ -122,10 +122,10 @@ PSOTest1() // set optimizer parameters OptimizerType::ParameterBoundsType bounds; bounds.emplace_back(-10, 10); - constexpr unsigned int numberOfParticles = 10; - constexpr unsigned int maxIterations = 100; - constexpr double xTolerance = 0.1; - constexpr double fTolerance = 0.001; + constexpr unsigned int numberOfParticles{ 10 }; + constexpr unsigned int maxIterations{ 100 }; + constexpr double xTolerance{ 0.1 }; + constexpr double fTolerance{ 0.001 }; OptimizerType::ParametersType initialParameters(1); @@ -222,10 +222,10 @@ PSOTest2() OptimizerType::ParameterBoundsType bounds; bounds.emplace_back(-10, 10); bounds.emplace_back(-10, 10); - constexpr unsigned int numberOfParticles = 10; - constexpr unsigned int maxIterations = 100; - constexpr double xTolerance = 0.1; - constexpr double fTolerance = 0.001; + constexpr unsigned int numberOfParticles{ 10 }; + constexpr unsigned int maxIterations{ 100 }; + constexpr double xTolerance{ 0.1 }; + constexpr double fTolerance{ 0.001 }; OptimizerType::ParametersType initialParameters(2); itkOptimizer->SetParameterBounds(bounds); @@ -284,7 +284,7 @@ PSOTest3() std::cout << "----------------------------------\n"; - constexpr double tolerance = 1e-16; + constexpr double tolerance{ 1e-16 }; itk::Array knownParameters(2); knownParameters[0] = 1.0; @@ -301,10 +301,10 @@ PSOTest3() OptimizerType::ParameterBoundsType bounds; bounds.emplace_back(-100, 100); bounds.emplace_back(-100, 100); - constexpr unsigned int numberOfParticles = 100; - constexpr unsigned int maxIterations = 200; - constexpr double xTolerance = 0.1; - constexpr double fTolerance = 0.01; + constexpr unsigned int numberOfParticles{ 100 }; + constexpr unsigned int maxIterations{ 200 }; + constexpr double xTolerance{ 0.1 }; + constexpr double fTolerance{ 0.01 }; OptimizerType::ParametersType initialParameters(2); // Exercise Get/Set methods @@ -325,7 +325,7 @@ PSOTest3() return EXIT_FAILURE; } - constexpr unsigned int numberOfGenerationsWithMinimalImprovement = 1; + constexpr unsigned int numberOfGenerationsWithMinimalImprovement{ 1 }; itkOptimizer->SetNumberOfGenerationsWithMinimalImprovement(numberOfGenerationsWithMinimalImprovement); if (itkOptimizer->GetNumberOfGenerationsWithMinimalImprovement() != numberOfGenerationsWithMinimalImprovement) { @@ -343,7 +343,7 @@ PSOTest3() } itkOptimizer->SetCostFunction(costFunction); - constexpr double percentageParticlesConverged = 0.6; + constexpr double percentageParticlesConverged{ 0.6 }; itkOptimizer->SetPercentageParticlesConverged(percentageParticlesConverged); if (itk::Math::abs(itkOptimizer->GetPercentageParticlesConverged() - percentageParticlesConverged) > tolerance) { @@ -351,7 +351,7 @@ PSOTest3() return EXIT_FAILURE; } - constexpr double inertiaCoefficient = 0.7298; + constexpr double inertiaCoefficient{ 0.7298 }; itkOptimizer->SetInertiaCoefficient(inertiaCoefficient); if (itk::Math::abs(itkOptimizer->GetInertiaCoefficient() - inertiaCoefficient)) { @@ -359,7 +359,7 @@ PSOTest3() return EXIT_FAILURE; } - constexpr double personalCoefficient = 1.496; + constexpr double personalCoefficient{ 1.496 }; itkOptimizer->SetPersonalCoefficient(personalCoefficient); if (itk::Math::abs(itkOptimizer->GetPersonalCoefficient() - personalCoefficient)) { @@ -367,7 +367,7 @@ PSOTest3() return EXIT_FAILURE; } - constexpr double gobalCoefficient = 1.496; + constexpr double gobalCoefficient{ 1.496 }; itkOptimizer->SetGlobalCoefficient(gobalCoefficient); if (itk::Math::abs(itkOptimizer->GetGlobalCoefficient() - gobalCoefficient)) { diff --git a/Modules/Numerics/Optimizers/test/itkPowellOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkPowellOptimizerTest.cxx index 6b475a13178..425f070a221 100644 --- a/Modules/Numerics/Optimizers/test/itkPowellOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkPowellOptimizerTest.cxx @@ -184,7 +184,7 @@ itkPowellOptimizerTest(int argc, char * argv[]) // check results to see if it is within range // bool pass = true; - constexpr double trueParameters[2] = { 2, -2 }; + constexpr double trueParameters[2]{ 2, -2 }; for (unsigned int j = 0; j < 2; ++j) { if (itk::Math::abs(finalPosition[j] - trueParameters[j]) > 0.01) diff --git a/Modules/Numerics/Optimizers/test/itkRegularStepGradientDescentOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkRegularStepGradientDescentOptimizerTest.cxx index e6baa3bcac1..fb6dbdad8c0 100644 --- a/Modules/Numerics/Optimizers/test/itkRegularStepGradientDescentOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkRegularStepGradientDescentOptimizerTest.cxx @@ -174,7 +174,7 @@ itkRegularStepGradientDescentOptimizerTest(int, char *[]) // Check results to see if it is within range bool pass = true; - constexpr double trueParameters[2] = { 2, -2 }; + constexpr double trueParameters[2]{ 2, -2 }; for (unsigned int j = 0; j < 2; ++j) { if (itk::Math::abs(finalPosition[j] - trueParameters[j]) > 0.01) diff --git a/Modules/Numerics/Optimizers/test/itkSPSAOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkSPSAOptimizerTest.cxx index a2e9bde0e47..d0ac17a8187 100644 --- a/Modules/Numerics/Optimizers/test/itkSPSAOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkSPSAOptimizerTest.cxx @@ -128,48 +128,48 @@ itkSPSAOptimizerTest(int, char *[]) parametersScale[1] = 2.0; itkOptimizer->SetScales(parametersScale); - constexpr bool maximize = false; + constexpr bool maximize{ false }; ITK_TEST_SET_GET_BOOLEAN(itkOptimizer, Maximize, maximize); - constexpr bool minimize = !maximize; + constexpr bool minimize{ !maximize }; ITK_TEST_SET_GET_BOOLEAN(itkOptimizer, Minimize, minimize); - constexpr double a = 10.0; + constexpr double a{ 10.0 }; itkOptimizer->SetA(a); ITK_TEST_SET_GET_VALUE(a, itkOptimizer->GetA()); - constexpr double alpha = 0.602; + constexpr double alpha{ 0.602 }; itkOptimizer->SetAlpha(alpha); ITK_TEST_SET_GET_VALUE(alpha, itkOptimizer->GetAlpha()); - constexpr double c = 0.0001; + constexpr double c{ 0.0001 }; itkOptimizer->Setc(c); ITK_TEST_SET_GET_VALUE(c, itkOptimizer->Getc()); itkOptimizer->SetSc(c); ITK_TEST_SET_GET_VALUE(c, itkOptimizer->GetSc()); - constexpr double gamma = 0.101; + constexpr double gamma{ 0.101 }; itkOptimizer->SetGamma(gamma); ITK_TEST_SET_GET_VALUE(gamma, itkOptimizer->GetGamma()); - constexpr double tolerance = 1e-5; + constexpr double tolerance{ 1e-5 }; itkOptimizer->SetTolerance(tolerance); ITK_TEST_SET_GET_VALUE(tolerance, itkOptimizer->GetTolerance()); - constexpr double stateOfConvergenceDecayRate = 0.5; + constexpr double stateOfConvergenceDecayRate{ 0.5 }; itkOptimizer->SetStateOfConvergenceDecayRate(stateOfConvergenceDecayRate); ITK_TEST_SET_GET_VALUE(stateOfConvergenceDecayRate, itkOptimizer->GetStateOfConvergenceDecayRate()); - constexpr itk::SizeValueType minimumNumberOfIterations = 10; + constexpr itk::SizeValueType minimumNumberOfIterations{ 10 }; itkOptimizer->SetMinimumNumberOfIterations(10); ITK_TEST_SET_GET_VALUE(minimumNumberOfIterations, itkOptimizer->GetMinimumNumberOfIterations()); - constexpr itk::SizeValueType maximumNumberOfIterations = 100; + constexpr itk::SizeValueType maximumNumberOfIterations{ 100 }; itkOptimizer->SetMaximumNumberOfIterations(maximumNumberOfIterations); ITK_TEST_SET_GET_VALUE(maximumNumberOfIterations, itkOptimizer->GetMaximumNumberOfIterations()); - constexpr itk::SizeValueType numberOfPerturbations = 1; + constexpr itk::SizeValueType numberOfPerturbations{ 1 }; itkOptimizer->SetNumberOfPerturbations(numberOfPerturbations); ITK_TEST_SET_GET_VALUE(numberOfPerturbations, itkOptimizer->GetNumberOfPerturbations()); @@ -226,7 +226,7 @@ itkSPSAOptimizerTest(int, char *[]) // check results to see if it is within range // bool pass = true; - constexpr double trueParameters[2] = { 2, -2 }; + constexpr double trueParameters[2]{ 2, -2 }; for (unsigned int j = 0; j < 2; ++j) { if (itk::Math::abs(finalPosition[j] - trueParameters[j]) > 0.01) diff --git a/Modules/Numerics/Optimizers/test/itkVersorRigid3DTransformOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkVersorRigid3DTransformOptimizerTest.cxx index 266a2470fed..d3c6dd4147f 100644 --- a/Modules/Numerics/Optimizers/test/itkVersorRigid3DTransformOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkVersorRigid3DTransformOptimizerTest.cxx @@ -149,7 +149,7 @@ class versorRigid3DCostFunction : public itk::SingleValuedCostFunction VersorType versorY; VersorType versorZ; - constexpr double deltaAngle = 0.00175; // in radians = about 0.1 degree + constexpr double deltaAngle{ 0.00175 }; // in radians = about 0.1 degree versorX.SetRotationAroundX(deltaAngle); versorY.SetRotationAroundY(deltaAngle); @@ -189,7 +189,7 @@ class versorRigid3DCostFunction : public itk::SingleValuedCostFunction derivative[1] = (turnYValue - baseValue) / deltaAngle; derivative[2] = (turnZValue - baseValue) / deltaAngle; - constexpr double deltaTranslation = deltaAngle; // just to keep the scaling + constexpr double deltaTranslation{ deltaAngle }; // just to keep the scaling parametersPlustDeltaTX[3] += deltaTranslation; parametersPlustDeltaTY[4] += deltaTranslation; @@ -250,7 +250,7 @@ itkVersorRigid3DTransformOptimizerTest(int, char *[]) axis[1] = 0.0f; axis[2] = 0.0f; - constexpr VersorType::ValueType angle = 0.0f; + constexpr VersorType::ValueType angle{ 0.0f }; VersorType initialRotation; initialRotation.Set(axis, angle); @@ -266,7 +266,7 @@ itkVersorRigid3DTransformOptimizerTest(int, char *[]) initialPosition[5] = 0.0; ScalesType parametersScale(parametersDimensions); - constexpr double translationScaleFactor = 50.0; + constexpr double translationScaleFactor{ 50.0 }; parametersScale[0] = 1.0; parametersScale[1] = 1.0; parametersScale[2] = 1.0; @@ -302,7 +302,7 @@ itkVersorRigid3DTransformOptimizerTest(int, char *[]) ParametersType finalPosition(parametersDimensions); finalPosition = itkOptimizer->GetCurrentPosition(); - constexpr unsigned int spaceDimensions = 3; + constexpr unsigned int spaceDimensions{ 3 }; VersorType finalRotation; VersorType::VectorType finalRightPart; diff --git a/Modules/Numerics/Optimizers/test/itkVersorTransformOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkVersorTransformOptimizerTest.cxx index c4040870c61..40bf32f77c4 100644 --- a/Modules/Numerics/Optimizers/test/itkVersorTransformOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkVersorTransformOptimizerTest.cxx @@ -129,7 +129,7 @@ class versorCostFunction : public itk::SingleValuedCostFunction VersorType versorY; VersorType versorZ; - constexpr double deltaAngle = 0.00175; // in radians = about 0.1 degree + constexpr double deltaAngle{ 0.00175 }; // in radians = about 0.1 degree versorX.SetRotationAroundX(deltaAngle); versorY.SetRotationAroundY(deltaAngle); @@ -207,7 +207,7 @@ itkVersorTransformOptimizerTest(int, char *[]) axis[1] = 0.0f; axis[2] = 0.0f; - constexpr VersorType::ValueType angle = 0.0f; + constexpr VersorType::ValueType angle{ 0.0f }; VersorType initialRotation; initialRotation.Set(axis, angle); diff --git a/Modules/Numerics/Optimizersv4/include/itkObjectToObjectMetric.hxx b/Modules/Numerics/Optimizersv4/include/itkObjectToObjectMetric.hxx index 2bd907248af..a7895daba01 100644 --- a/Modules/Numerics/Optimizersv4/include/itkObjectToObjectMetric.hxx +++ b/Modules/Numerics/Optimizersv4/include/itkObjectToObjectMetric.hxx @@ -479,7 +479,7 @@ ObjectToObjectMetricGetVirtualSpacing()[0]; - constexpr double directionTol = 1.0e-6; + constexpr double directionTol{ 1.0e-6 }; if (!this->GetVirtualOrigin().GetVnlVector().is_equal(field->GetOrigin().GetVnlVector(), coordinateTol) || !this->GetVirtualSpacing().GetVnlVector().is_equal(field->GetSpacing().GetVnlVector(), coordinateTol) || diff --git a/Modules/Numerics/Optimizersv4/include/itkPowellOptimizerv4.hxx b/Modules/Numerics/Optimizersv4/include/itkPowellOptimizerv4.hxx index 851cf37ee48..3893c60d89e 100644 --- a/Modules/Numerics/Optimizersv4/include/itkPowellOptimizerv4.hxx +++ b/Modules/Numerics/Optimizersv4/include/itkPowellOptimizerv4.hxx @@ -244,7 +244,7 @@ PowellOptimizerv4::BracketedLineOptimize(double const double goldenSectionRatio = (3.0 - std::sqrt(5.0)) / 2; /* Gold section ratio */ - constexpr double POWELL_TINY = 1.0e-20; + constexpr double POWELL_TINY{ 1.0e-20 }; double functionValueOfV = functionValueOfb; /* f(x) */ double functionValueOfX = functionValueOfV; /* f(v) */ diff --git a/Modules/Numerics/Optimizersv4/src/itkAmoebaOptimizerv4.cxx b/Modules/Numerics/Optimizersv4/src/itkAmoebaOptimizerv4.cxx index d78587b102b..35626176af6 100644 --- a/Modules/Numerics/Optimizersv4/src/itkAmoebaOptimizerv4.cxx +++ b/Modules/Numerics/Optimizersv4/src/itkAmoebaOptimizerv4.cxx @@ -160,8 +160,8 @@ AmoebaOptimizerv4::StartOptimization(bool /* doOnlyInitialization */) // automated initialization - previously hidden inside vnl if (this->m_AutomaticInitialSimplex) { - constexpr double relativeDiameter = 0.05; - constexpr double zeroTermDelta = 0.00025; + constexpr double relativeDiameter{ 0.05 }; + constexpr double zeroTermDelta{ 0.00025 }; InternalParametersType automaticDelta(n); for (unsigned int i = 0; i < n; ++i) { diff --git a/Modules/Numerics/Optimizersv4/test/itkAmoebaOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkAmoebaOptimizerv4Test.cxx index 0b522a9fa84..96c0e429c21 100644 --- a/Modules/Numerics/Optimizersv4/test/itkAmoebaOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkAmoebaOptimizerv4Test.cxx @@ -338,11 +338,11 @@ AmoebaTest1() ITK_TEST_EXPECT_TRUE(itkOptimizer->CanUseScales()); - constexpr bool doEstimateScales = true; + constexpr bool doEstimateScales{ true }; ITK_TEST_SET_GET_BOOLEAN(itkOptimizer, DoEstimateScales, doEstimateScales); // set optimizer parameters - constexpr itk::SizeValueType numberOfIterations = 10; + constexpr itk::SizeValueType numberOfIterations{ 10 }; itkOptimizer->SetNumberOfIterations(numberOfIterations); ITK_TEST_SET_GET_VALUE(numberOfIterations, itkOptimizer->GetNumberOfIterations()); @@ -426,7 +426,7 @@ AmoebaTest1() // OptimizerType::ParametersType finalPosition = itkOptimizer->GetCurrentPosition(); - constexpr double trueParameters[2] = { 2, -2 }; + constexpr double trueParameters[2]{ 2, -2 }; bool pass = true; std::cout << "Right answer = " << trueParameters[0] << " , " << trueParameters[1] << std::endl; @@ -470,13 +470,13 @@ AmoebaTest2() auto itkOptimizer = OptimizerType::New(); // set optimizer parameters - constexpr unsigned int maxIterations = 100; + constexpr unsigned int maxIterations{ 100 }; itkOptimizer->SetNumberOfIterations(maxIterations); - constexpr double xTolerance = 0.01; + constexpr double xTolerance{ 0.01 }; itkOptimizer->SetParametersConvergenceTolerance(xTolerance); - constexpr double fTolerance = 0.001; + constexpr double fTolerance{ 0.001 }; itkOptimizer->SetFunctionConvergenceTolerance(fTolerance); // the initial simplex is constructed as: @@ -521,7 +521,7 @@ AmoebaTest2() { // we should have converged to the local minimum, -2 OptimizerType::ParametersType finalParameters = itkOptimizer->GetCurrentPosition(); - constexpr double knownParameters = -2.0; + constexpr double knownParameters{ -2.0 }; std::cout << "Standard Amoeba:\n"; std::cout << "Known parameters = " << knownParameters << " "; std::cout << "Estimated parameters = " << finalParameters << std::endl; @@ -554,7 +554,7 @@ AmoebaTest2() { // we should have converged to the global minimum, 2 OptimizerType::ParametersType finalParameters = itkOptimizer->GetCurrentPosition(); - constexpr double knownParameters = 2.0; + constexpr double knownParameters{ 2.0 }; std::cout << "Amoeba with restarts:\n"; std::cout << "Known parameters = " << knownParameters << " "; std::cout << "Estimated parameters = " << finalParameters << std::endl; diff --git a/Modules/Numerics/Optimizersv4/test/itkAutoScaledGradientDescentRegistrationOnVectorTest.cxx b/Modules/Numerics/Optimizersv4/test/itkAutoScaledGradientDescentRegistrationOnVectorTest.cxx index 4965edfae6f..5c67f88ec2a 100644 --- a/Modules/Numerics/Optimizersv4/test/itkAutoScaledGradientDescentRegistrationOnVectorTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkAutoScaledGradientDescentRegistrationOnVectorTest.cxx @@ -136,7 +136,7 @@ itkAutoScaledGradientDescentRegistrationOnVectorTestTemplated(int auto transformForward = true; ITK_TEST_SET_GET_BOOLEAN(shiftScalesEstimator, TransformForward, transformForward); - constexpr itk::IndexValueType centralRegionRadius = 5; + constexpr itk::IndexValueType centralRegionRadius{ 5 }; shiftScalesEstimator->SetCentralRegionRadius(centralRegionRadius); ITK_TEST_SET_GET_VALUE(centralRegionRadius, shiftScalesEstimator->GetCentralRegionRadius()); @@ -201,7 +201,7 @@ itkAutoScaledGradientDescentRegistrationOnVectorTestTemplated(int // the end of the list of parameters. const unsigned int offsetOrder = finalParameters.Size() - actualParameters.Size(); - constexpr double tolerance = 1.0; // equivalent to 1 pixel. + constexpr double tolerance{ 1.0 }; // equivalent to 1 pixel. for (unsigned int i = 0; i < numbeOfParameters; ++i) { @@ -248,7 +248,7 @@ itkAutoScaledGradientDescentRegistrationOnVectorTest(int argc, char ** const arg shiftOfStep = std::stod(argv[2]); } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; std::cout << std::endl << "Optimizing translation transform with shift scales" << std::endl; using TranslationTransformType = itk::TranslationTransform; diff --git a/Modules/Numerics/Optimizersv4/test/itkAutoScaledGradientDescentRegistrationTest.cxx b/Modules/Numerics/Optimizersv4/test/itkAutoScaledGradientDescentRegistrationTest.cxx index 837d22c31e6..81d7f33d26d 100644 --- a/Modules/Numerics/Optimizersv4/test/itkAutoScaledGradientDescentRegistrationTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkAutoScaledGradientDescentRegistrationTest.cxx @@ -167,7 +167,7 @@ itkAutoScaledGradientDescentRegistrationTestTemplated(int number // If no learning rate estimate is performed, test with a fixed value // close to the result of running this test with learning rate estimation // for only the first step. - constexpr OptimizerType::InternalComputationValueType fixedLearningRate = 0.01501010101010101; + constexpr OptimizerType::InternalComputationValueType fixedLearningRate{ 0.01501010101010101 }; if (!estimateLearningRateOnce && !estimateLearningRateAtEachIteration) { optimizer->SetLearningRate(fixedLearningRate); @@ -234,7 +234,7 @@ itkAutoScaledGradientDescentRegistrationTestTemplated(int number // the end of the list of parameters. const unsigned int offsetOrder = finalParameters.Size() - actualParameters.Size(); - constexpr double tolerance = 1.0; // equivalent to 1 pixel. + constexpr double tolerance{ 1.0 }; // equivalent to 1 pixel. for (unsigned int i = 0; i < numbeOfParameters; ++i) { @@ -299,11 +299,11 @@ itkAutoScaledGradientDescentRegistrationTest(int argc, char ** const argv) estimateScales = std::stoi(argv[5]); } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; std::cout << std::endl << "Optimizing translation transform with shift scales" << std::endl; using TranslationTransformType = itk::TranslationTransform; - constexpr bool usePhysicalSpaceForShift = false; + constexpr bool usePhysicalSpaceForShift{ false }; const int ret1 = itkAutoScaledGradientDescentRegistrationTestTemplated(numberOfIterations, shiftOfStep, diff --git a/Modules/Numerics/Optimizersv4/test/itkConjugateGradientLineSearchOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkConjugateGradientLineSearchOptimizerv4Test.cxx index 7a35c34f028..697ce88b66f 100644 --- a/Modules/Numerics/Optimizersv4/test/itkConjugateGradientLineSearchOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkConjugateGradientLineSearchOptimizerv4Test.cxx @@ -184,7 +184,7 @@ ConjugateGradientLineSearchOptimizerv4RunTest(itk::ConjugateGradientLineSearchOp // // check results to see if it is within range // - constexpr double trueParameters[2] = { 2, -2 }; + constexpr double trueParameters[2]{ 2, -2 }; for (unsigned int j = 0; j < 2; ++j) { if (itk::Math::abs(finalPosition[j] - trueParameters[j]) > 0.01) diff --git a/Modules/Numerics/Optimizersv4/test/itkExhaustiveOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkExhaustiveOptimizerv4Test.cxx index 32ad45b07b0..96a6a02d8c1 100644 --- a/Modules/Numerics/Optimizersv4/test/itkExhaustiveOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkExhaustiveOptimizerv4Test.cxx @@ -308,7 +308,7 @@ itkExhaustiveOptimizerv4Test(int, char *[]) // check results to see if it is within range // bool trueParamsPass = true; - constexpr double trueParameters[2] = { 2, -2 }; + constexpr double trueParameters[2]{ 2, -2 }; for (unsigned int j = 0; j < 2; ++j) { if (itk::Math::abs(finalPosition[j] - trueParameters[j]) > 0.01) diff --git a/Modules/Numerics/Optimizersv4/test/itkGradientDescentLineSearchOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkGradientDescentLineSearchOptimizerv4Test.cxx index c18a0f27940..3f24a102441 100644 --- a/Modules/Numerics/Optimizersv4/test/itkGradientDescentLineSearchOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkGradientDescentLineSearchOptimizerv4Test.cxx @@ -265,7 +265,7 @@ itkGradientDescentLineSearchOptimizerv4Test(int, char *[]) itkOptimizer->SetUpperLimit(upperLimit); ITK_TEST_SET_GET_VALUE(upperLimit, itkOptimizer->GetUpperLimit()); - constexpr unsigned int maximumLineSearchIterations = 100; + constexpr unsigned int maximumLineSearchIterations{ 100 }; itkOptimizer->SetMaximumLineSearchIterations(maximumLineSearchIterations); ITK_TEST_SET_GET_VALUE(maximumLineSearchIterations, itkOptimizer->GetMaximumLineSearchIterations()); diff --git a/Modules/Numerics/Optimizersv4/test/itkGradientDescentOptimizerBasev4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkGradientDescentOptimizerBasev4Test.cxx index e29e827fad8..ea54180fcde 100644 --- a/Modules/Numerics/Optimizersv4/test/itkGradientDescentOptimizerBasev4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkGradientDescentOptimizerBasev4Test.cxx @@ -165,7 +165,7 @@ class GradientDescentOptimizerBasev4TestOptimizer : public itk::GradientDescentO int itkGradientDescentOptimizerBasev4Test(int, char *[]) { - constexpr int ImageDimension = 2; + constexpr int ImageDimension{ 2 }; using ImageType = itk::Image; using MetricType = GradientDescentOptimizerBasev4TestMetric; @@ -173,7 +173,7 @@ itkGradientDescentOptimizerBasev4Test(int, char *[]) auto metric = MetricType::New(); auto optimizer = GradientDescentOptimizerBasev4TestOptimizer::New(); - constexpr bool doEstimateScales = true; + constexpr bool doEstimateScales{ true }; ITK_TEST_SET_GET_BOOLEAN(optimizer, DoEstimateScales, doEstimateScales); optimizer->SetMetric(metric); diff --git a/Modules/Numerics/Optimizersv4/test/itkGradientDescentOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkGradientDescentOptimizerv4Test.cxx index 100c64e9345..71d961ce7f2 100644 --- a/Modules/Numerics/Optimizersv4/test/itkGradientDescentOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkGradientDescentOptimizerv4Test.cxx @@ -180,7 +180,7 @@ GradientDescentOptimizerv4RunTest(itk::GradientDescentOptimizerv4::Pointer & std::cout << "ConvergenceValue: " << itkOptimizer->GetConvergenceValue() << std::endl; // check results to see if it is within range - constexpr ParametersType::ValueType eps = 0.03; + constexpr ParametersType::ValueType eps{ 0.03 }; for (unsigned int j = 0; j < 2; ++j) { if (itk::Math::abs(finalPosition[j] - trueParameters[j]) > eps) @@ -229,25 +229,25 @@ itkGradientDescentOptimizerv4Test(int, char *[]) initialPosition[1] = -100; metric->SetParameters(initialPosition); - constexpr double learningRate = 0.1; + constexpr double learningRate{ 0.1 }; itkOptimizer->SetLearningRate(learningRate); ITK_TEST_SET_GET_VALUE(learningRate, itkOptimizer->GetLearningRate()); - constexpr itk::SizeValueType numberOfIterations = 50; + constexpr itk::SizeValueType numberOfIterations{ 50 }; itkOptimizer->SetNumberOfIterations(numberOfIterations); ITK_TEST_SET_GET_VALUE(numberOfIterations, itkOptimizer->GetNumberOfIterations()); - constexpr double maximumStepSizeInPhysicalUnits = 0.0; + constexpr double maximumStepSizeInPhysicalUnits{ 0.0 }; itkOptimizer->SetMaximumStepSizeInPhysicalUnits(maximumStepSizeInPhysicalUnits); ITK_TEST_SET_GET_VALUE(maximumStepSizeInPhysicalUnits, itkOptimizer->GetMaximumStepSizeInPhysicalUnits()); - constexpr bool doEstimateLearningRateAtEachIteration = false; + constexpr bool doEstimateLearningRateAtEachIteration{ false }; ITK_TEST_SET_GET_BOOLEAN(itkOptimizer, DoEstimateLearningRateAtEachIteration, doEstimateLearningRateAtEachIteration); - constexpr bool doEstimateLearningRateOnce = true; + constexpr bool doEstimateLearningRateOnce{ true }; ITK_TEST_SET_GET_BOOLEAN(itkOptimizer, DoEstimateLearningRateOnce, doEstimateLearningRateOnce); - constexpr bool returnBestParametersAndValue = false; + constexpr bool returnBestParametersAndValue{ false }; ITK_TEST_SET_GET_BOOLEAN(itkOptimizer, ReturnBestParametersAndValue, returnBestParametersAndValue); // Truth diff --git a/Modules/Numerics/Optimizersv4/test/itkLBFGS2Optimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkLBFGS2Optimizerv4Test.cxx index 480034ef939..a0992dac37e 100644 --- a/Modules/Numerics/Optimizersv4/test/itkLBFGS2Optimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkLBFGS2Optimizerv4Test.cxx @@ -247,7 +247,7 @@ itkLBFGS2Optimizerv4Test(int, char *[]) itkOptimizer->SetMetric(metric); - constexpr unsigned int SpaceDimension = 2; + constexpr unsigned int SpaceDimension{ 2 }; OptimizerType::ParametersType initialValue(SpaceDimension); // We start not so far from | 2 -2 | @@ -292,7 +292,7 @@ itkLBFGS2Optimizerv4Test(int, char *[]) // check results to see if it is within range // bool pass = true; - constexpr double trueParameters[2] = { 2, -2 }; + constexpr double trueParameters[2]{ 2, -2 }; for (unsigned int j = 0; j < 2; ++j) { if (itk::Math::FloatAlmostEqual(finalPosition[j], trueParameters[j])) diff --git a/Modules/Numerics/Optimizersv4/test/itkLBFGSBOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkLBFGSBOptimizerv4Test.cxx index 3f7008bde88..c6e6ec70032 100644 --- a/Modules/Numerics/Optimizersv4/test/itkLBFGSBOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkLBFGSBOptimizerv4Test.cxx @@ -242,12 +242,12 @@ itkLBFGSBOptimizerv4Test(int, char *[]) itkOptimizer->SetMetric(metric); - constexpr bool trace = false; + constexpr bool trace{ false }; ITK_TEST_SET_GET_BOOLEAN(itkOptimizer, Trace, trace); - constexpr double F_Convergence_Factor = 1e+7; // Function value tolerance - constexpr double Projected_G_Tolerance = 1e-5; // Proj gradient tolerance - constexpr int Max_Iterations = 25; // Maximum number of iterations + constexpr double F_Convergence_Factor{ 1e+7 }; // Function value tolerance + constexpr double Projected_G_Tolerance{ 1e-5 }; // Proj gradient tolerance + constexpr int Max_Iterations{ 25 }; // Maximum number of iterations itkOptimizer->SetCostFunctionConvergenceFactor(F_Convergence_Factor); ITK_TEST_SET_GET_VALUE(F_Convergence_Factor, itkOptimizer->GetCostFunctionConvergenceFactor()); @@ -258,15 +258,15 @@ itkLBFGSBOptimizerv4Test(int, char *[]) itkOptimizer->SetNumberOfIterations(Max_Iterations); ITK_TEST_SET_GET_VALUE(Max_Iterations, itkOptimizer->GetNumberOfIterations()); - constexpr unsigned int maximumNumberOfEvaluations = 100; + constexpr unsigned int maximumNumberOfEvaluations{ 100 }; itkOptimizer->SetMaximumNumberOfFunctionEvaluations(maximumNumberOfEvaluations); ITK_TEST_SET_GET_VALUE(maximumNumberOfEvaluations, itkOptimizer->GetMaximumNumberOfFunctionEvaluations()); - constexpr unsigned int maximumNumberOfCorrections = 5; + constexpr unsigned int maximumNumberOfCorrections{ 5 }; itkOptimizer->SetMaximumNumberOfCorrections(maximumNumberOfCorrections); ITK_TEST_SET_GET_VALUE(maximumNumberOfCorrections, itkOptimizer->GetMaximumNumberOfCorrections()); - constexpr unsigned int SpaceDimension = 2; + constexpr unsigned int SpaceDimension{ 2 }; OptimizerType::ParametersType initialValue(SpaceDimension); // Starting point diff --git a/Modules/Numerics/Optimizersv4/test/itkLBFGSOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkLBFGSOptimizerv4Test.cxx index 7e9188da123..13bf3af7297 100644 --- a/Modules/Numerics/Optimizersv4/test/itkLBFGSOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkLBFGSOptimizerv4Test.cxx @@ -170,7 +170,7 @@ itkLBFGSOptimizerv4Test(int, char *[]) auto metric = itkLBFGSOptimizerv4TestMetric::New(); // Set some optimizer parameters - constexpr bool trace = false; + constexpr bool trace{ false }; itkOptimizer->SetTrace(trace); ITK_TEST_SET_GET_VALUE(trace, itkOptimizer->GetTrace()); @@ -205,7 +205,7 @@ itkLBFGSOptimizerv4Test(int, char *[]) vnlOptimizer->set_check_derivatives(0); - constexpr unsigned int SpaceDimension = 2; + constexpr unsigned int SpaceDimension{ 2 }; OptimizerType::ParametersType initialValue(SpaceDimension); // We start not so far from | 2 -2 | @@ -266,7 +266,7 @@ itkLBFGSOptimizerv4Test(int, char *[]) // check results to see if it is within range // bool pass = true; - constexpr double trueParameters[2] = { 2, -2 }; + constexpr double trueParameters[2]{ 2, -2 }; for (unsigned int j = 0; j < 2; ++j) { if (itk::Math::FloatAlmostEqual(finalPosition[j], trueParameters[j])) diff --git a/Modules/Numerics/Optimizersv4/test/itkMultiGradientOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkMultiGradientOptimizerv4Test.cxx index 94df5b92d50..51355e1804c 100644 --- a/Modules/Numerics/Optimizersv4/test/itkMultiGradientOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkMultiGradientOptimizerv4Test.cxx @@ -342,7 +342,7 @@ itkMultiGradientOptimizerv4Test(int, char *[]) // Declaration of the Metric auto metric = MultiGradientOptimizerv4TestMetric::New(); auto metric2 = MultiGradientOptimizerv4TestMetric2::New(); - constexpr unsigned int spaceDimension = 2; + constexpr unsigned int spaceDimension{ 2 }; itkOptimizer->SetMetric(metric); itkOptimizer->SetNumberOfIterations(50); diff --git a/Modules/Numerics/Optimizersv4/test/itkObjectToObjectOptimizerBaseTest.cxx b/Modules/Numerics/Optimizersv4/test/itkObjectToObjectOptimizerBaseTest.cxx index 00f56177cd1..d4b32990a9f 100644 --- a/Modules/Numerics/Optimizersv4/test/itkObjectToObjectOptimizerBaseTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkObjectToObjectOptimizerBaseTest.cxx @@ -147,7 +147,7 @@ class ObjectToObjectOptimizerBaseTestOptimizer : public itk::ObjectToObjectOptim int itkObjectToObjectOptimizerBaseTest(int, char *[]) { - constexpr int ImageDimension = 2; + constexpr int ImageDimension{ 2 }; using ImageType = itk::Image; using MetricType = ObjectToObjectOptimizerBaseTestMetric; diff --git a/Modules/Numerics/Optimizersv4/test/itkOnePlusOneEvolutionaryOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkOnePlusOneEvolutionaryOptimizerv4Test.cxx index 2f2df06b614..93f82fbf2cb 100644 --- a/Modules/Numerics/Optimizersv4/test/itkOnePlusOneEvolutionaryOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkOnePlusOneEvolutionaryOptimizerv4Test.cxx @@ -221,7 +221,7 @@ itkOnePlusOneEvolutionaryOptimizerv4Test(int, char *[]) itkOptimizer->Initialize(10); - constexpr double growthFactor = 1.05; + constexpr double growthFactor{ 1.05 }; itkOptimizer->SetGrowthFactor(growthFactor); ITK_TEST_SET_GET_VALUE(growthFactor, itkOptimizer->GetGrowthFactor()); @@ -229,19 +229,19 @@ itkOnePlusOneEvolutionaryOptimizerv4Test(int, char *[]) itkOptimizer->SetShrinkFactor(shrinkFactor); ITK_TEST_SET_GET_VALUE(shrinkFactor, itkOptimizer->GetShrinkFactor()); - constexpr double initialRadius = 1.01; + constexpr double initialRadius{ 1.01 }; itkOptimizer->SetInitialRadius(initialRadius); ITK_TEST_SET_GET_VALUE(initialRadius, itkOptimizer->GetInitialRadius()); - constexpr double epsilon = 0.1; + constexpr double epsilon{ 0.1 }; itkOptimizer->SetEpsilon(epsilon); ITK_TEST_SET_GET_VALUE(epsilon, itkOptimizer->GetEpsilon()); - constexpr unsigned int maximumIteration = 8000; + constexpr unsigned int maximumIteration{ 8000 }; itkOptimizer->SetMaximumIteration(maximumIteration); ITK_TEST_SET_GET_VALUE(maximumIteration, itkOptimizer->GetMaximumIteration()); - constexpr double metricWorstPossibleValue = 0; + constexpr double metricWorstPossibleValue{ 0 }; itkOptimizer->SetMetricWorstPossibleValue(metricWorstPossibleValue); ITK_TEST_SET_GET_VALUE(metricWorstPossibleValue, itkOptimizer->GetMetricWorstPossibleValue()); @@ -249,7 +249,7 @@ itkOnePlusOneEvolutionaryOptimizerv4Test(int, char *[]) auto generator = GeneratorType::New(); itkOptimizer->SetNormalVariateGenerator(generator); - constexpr bool catchGetValueException = false; + constexpr bool catchGetValueException{ false }; ITK_TEST_SET_GET_BOOLEAN(itkOptimizer, CatchGetValueException, catchGetValueException); // Set the initial position by setting the metric @@ -269,7 +269,7 @@ itkOnePlusOneEvolutionaryOptimizerv4Test(int, char *[]) // check results to see if it is within range // bool pass = true; - constexpr double trueParameters[2] = { 2, -2 }; + constexpr double trueParameters[2]{ 2, -2 }; for (unsigned int j = 0; j < 2; ++j) { if (itk::Math::abs(finalPosition[j] - trueParameters[j]) > 0.01) diff --git a/Modules/Numerics/Optimizersv4/test/itkPowellOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkPowellOptimizerv4Test.cxx index 2a3152b81be..7cb3d9a999c 100644 --- a/Modules/Numerics/Optimizersv4/test/itkPowellOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkPowellOptimizerv4Test.cxx @@ -225,7 +225,7 @@ itkPowellOptimizerv4Test(int argc, char * argv[]) // check results to see if it is within range // bool pass = true; - constexpr double trueParameters[2] = { 2, -2 }; + constexpr double trueParameters[2]{ 2, -2 }; for (unsigned int j = 0; j < 2; ++j) { if (itk::Math::abs(finalPosition[j] - trueParameters[j]) > 0.01) diff --git a/Modules/Numerics/Optimizersv4/test/itkQuasiNewtonOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkQuasiNewtonOptimizerv4Test.cxx index c963ebf8fe9..6a0e466e2ce 100644 --- a/Modules/Numerics/Optimizersv4/test/itkQuasiNewtonOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkQuasiNewtonOptimizerv4Test.cxx @@ -192,7 +192,7 @@ itkQuasiNewtonOptimizerv4TestTemplated(int numberOfIterations, // the end of the list of parameters. const unsigned int offsetOrder = finalParameters.Size() - actualParameters.Size(); - constexpr double tolerance = 1.0; // equivalent to 1 pixel. + constexpr double tolerance{ 1.0 }; // equivalent to 1 pixel. for (unsigned int i = 0; i < numbeOfParameters; ++i) { @@ -239,7 +239,7 @@ itkQuasiNewtonOptimizerv4Test(int argc, char ** const argv) shiftOfStep = std::stod(argv[2]); } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; std::cout << std::endl << "Optimizing translation transform with shift scales" << std::endl; using TranslationTransformType = itk::TranslationTransform; diff --git a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesEstimatorTest.cxx b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesEstimatorTest.cxx index 11599528baf..52dc61eb28e 100644 --- a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesEstimatorTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesEstimatorTest.cxx @@ -223,7 +223,7 @@ itkRegistrationParameterScalesEstimatorTest(int, char *[]) { // Image begins - constexpr itk::SizeValueType ImageDimension = 2; + constexpr itk::SizeValueType ImageDimension{ 2 }; using PixelType = double; // Image Types diff --git a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromIndexShiftTest.cxx b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromIndexShiftTest.cxx index 9b3f99b447d..d9cd6b2189a 100644 --- a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromIndexShiftTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromIndexShiftTest.cxx @@ -115,7 +115,7 @@ itkRegistrationParameterScalesFromIndexShiftTest(int, char *[]) { // Image begins - constexpr itk::SizeValueType ImageDimension = 2; + constexpr itk::SizeValueType ImageDimension{ 2 }; using PixelType = double; using FloatType = double; diff --git a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromJacobianTest.cxx b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromJacobianTest.cxx index 6edda70309d..2ec6fa361f4 100644 --- a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromJacobianTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromJacobianTest.cxx @@ -115,7 +115,7 @@ itkRegistrationParameterScalesFromJacobianTest(int, char *[]) { // Image begins - constexpr itk::SizeValueType ImageDimension = 2; + constexpr itk::SizeValueType ImageDimension{ 2 }; using PixelType = double; using FloatType = double; diff --git a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftPointSetTest.cxx b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftPointSetTest.cxx index 1d85033cebf..bdf056f969e 100644 --- a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftPointSetTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftPointSetTest.cxx @@ -78,7 +78,7 @@ class RegistrationParameterScalesFromPhysicalShiftPointSetTestMetric int itkRegistrationParameterScalesFromPhysicalShiftPointSetTest(int, char *[]) { - constexpr itk::SizeValueType Dimension = 2; + constexpr itk::SizeValueType Dimension{ 2 }; using PixelType = double; using FloatType = double; diff --git a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftTest.cxx b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftTest.cxx index 6a13f9862d3..e457172df55 100644 --- a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftTest.cxx @@ -115,7 +115,7 @@ itkRegistrationParameterScalesFromPhysicalShiftTest(int, char *[]) { // Image begins - constexpr itk::SizeValueType ImageDimension = 2; + constexpr itk::SizeValueType ImageDimension{ 2 }; using PixelType = double; using FloatType = double; diff --git a/Modules/Numerics/Optimizersv4/test/itkRegularStepGradientDescentOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkRegularStepGradientDescentOptimizerv4Test.cxx index dbcadab3702..f995fca7633 100644 --- a/Modules/Numerics/Optimizersv4/test/itkRegularStepGradientDescentOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkRegularStepGradientDescentOptimizerv4Test.cxx @@ -242,7 +242,7 @@ RegularStepGradientDescentOptimizerv4TestHelper( // Check results to see if it is within range // bool pass = true; - constexpr double trueParameters[2] = { 2, -2 }; + constexpr double trueParameters[2]{ 2, -2 }; for (unsigned int j = 0; j < 2; ++j) { if (itk::Math::FloatAlmostEqual(finalPosition[j], trueParameters[j])) @@ -275,15 +275,15 @@ itkRegularStepGradientDescentOptimizerv4Test(int, char *[]) bool testStatus = EXIT_SUCCESS; - constexpr bool doEstimateLearningRateAtEachIteration = false; - constexpr bool doEstimateLearningRateOnce = false; + constexpr bool doEstimateLearningRateAtEachIteration{ false }; + constexpr bool doEstimateLearningRateOnce{ false }; - constexpr itk::SizeValueType numberOfIterations = 900; + constexpr itk::SizeValueType numberOfIterations{ 900 }; - constexpr OptimizerType::InternalComputationValueType relaxationFactor = 0.5; - constexpr OptimizerType::InternalComputationValueType minimumStepLength = 1e-6; - constexpr OptimizerType::InternalComputationValueType gradientMagnitudeTolerance = 1e-6; - constexpr OptimizerType::MeasureType currentLearningRateRelaxation = 0; + constexpr OptimizerType::InternalComputationValueType relaxationFactor{ 0.5 }; + constexpr OptimizerType::InternalComputationValueType minimumStepLength{ 1e-6 }; + constexpr OptimizerType::InternalComputationValueType gradientMagnitudeTolerance{ 1e-6 }; + constexpr OptimizerType::MeasureType currentLearningRateRelaxation{ 0 }; testStatus = RegularStepGradientDescentOptimizerv4TestHelper(numberOfIterations, doEstimateLearningRateAtEachIteration, @@ -299,8 +299,8 @@ itkRegularStepGradientDescentOptimizerv4Test(int, char *[]) "iteration: true; estimate learning rate once: false." << std::endl; { - constexpr bool doEstimateLearningRateAtEachIteration2 = true; - constexpr bool doEstimateLearningRateOnce2 = false; + constexpr bool doEstimateLearningRateAtEachIteration2{ true }; + constexpr bool doEstimateLearningRateOnce2{ false }; testStatus = RegularStepGradientDescentOptimizerv4TestHelper(numberOfIterations, doEstimateLearningRateAtEachIteration2, doEstimateLearningRateOnce2, @@ -315,8 +315,8 @@ itkRegularStepGradientDescentOptimizerv4Test(int, char *[]) "iteration: false; estimate learning rate once: true." << std::endl; { - constexpr bool doEstimateLearningRateAtEachIteration3 = false; - constexpr bool doEstimateLearningRateOnce3 = true; + constexpr bool doEstimateLearningRateAtEachIteration3{ false }; + constexpr bool doEstimateLearningRateOnce3{ true }; testStatus = RegularStepGradientDescentOptimizerv4TestHelper(numberOfIterations, doEstimateLearningRateAtEachIteration3, @@ -332,8 +332,8 @@ itkRegularStepGradientDescentOptimizerv4Test(int, char *[]) "iteration: true; estimate learning rate once: true." << std::endl; { - constexpr bool doEstimateLearningRateAtEachIteration4 = true; - constexpr bool doEstimateLearningRateOnce4 = true; + constexpr bool doEstimateLearningRateAtEachIteration4{ true }; + constexpr bool doEstimateLearningRateOnce4{ true }; testStatus = RegularStepGradientDescentOptimizerv4TestHelper(numberOfIterations, doEstimateLearningRateAtEachIteration4, @@ -347,7 +347,7 @@ itkRegularStepGradientDescentOptimizerv4Test(int, char *[]) // Run now with a different relaxation factor std::cout << "\nRun test with a different relaxation factor: 0.8, instead of default value: 0.5." << std::endl; { - constexpr OptimizerType::InternalComputationValueType relaxationFactor2 = 0.8; + constexpr OptimizerType::InternalComputationValueType relaxationFactor2{ 0.8 }; testStatus = RegularStepGradientDescentOptimizerv4TestHelper(numberOfIterations, doEstimateLearningRateAtEachIteration, @@ -362,7 +362,7 @@ itkRegularStepGradientDescentOptimizerv4Test(int, char *[]) // Verify that the optimizer doesn't run if the number of iterations is set to zero. std::cout << "\nCheck the optimizer when number of iterations is set to zero:" << std::endl; { - constexpr itk::SizeValueType numberOfIterations2 = 0; + constexpr itk::SizeValueType numberOfIterations2{ 0 }; testStatus = RegularStepGradientDescentOptimizerv4TestHelper(numberOfIterations2, doEstimateLearningRateAtEachIteration, @@ -378,7 +378,7 @@ itkRegularStepGradientDescentOptimizerv4Test(int, char *[]) // std::cout << "\nTest the Exception if the GradientMagnitudeTolerance is set to a negative value:" << std::endl; { - constexpr OptimizerType::InternalComputationValueType gradientMagnitudeTolerance2 = -1.0; + constexpr OptimizerType::InternalComputationValueType gradientMagnitudeTolerance2{ -1.0 }; const bool expectedExceptionReceived = RegularStepGradientDescentOptimizerv4TestHelper(numberOfIterations, doEstimateLearningRateAtEachIteration, @@ -402,9 +402,9 @@ itkRegularStepGradientDescentOptimizerv4Test(int, char *[]) // std::cout << "\nTest the Exception if the RelaxationFactor is set to a negative value:" << std::endl; { - constexpr itk::SizeValueType numberOfIterations3 = 100; - constexpr OptimizerType::InternalComputationValueType relaxationFactor3 = -1.0; - constexpr OptimizerType::InternalComputationValueType gradientMagnitudeTolerance3 = 0.01; + constexpr itk::SizeValueType numberOfIterations3{ 100 }; + constexpr OptimizerType::InternalComputationValueType relaxationFactor3{ -1.0 }; + constexpr OptimizerType::InternalComputationValueType gradientMagnitudeTolerance3{ 0.01 }; const bool expectedExceptionReceived = RegularStepGradientDescentOptimizerv4TestHelper(numberOfIterations3, doEstimateLearningRateAtEachIteration, @@ -427,9 +427,9 @@ itkRegularStepGradientDescentOptimizerv4Test(int, char *[]) // std::cout << "\nTest the Exception if the RelaxationFactor is set to a value larger than one:" << std::endl; { - constexpr itk::SizeValueType numberOfIterations4 = 100; - constexpr OptimizerType::InternalComputationValueType relaxationFactor4 = 1.1; - constexpr OptimizerType::InternalComputationValueType gradientMagnitudeTolerance4 = 0.01; + constexpr itk::SizeValueType numberOfIterations4{ 100 }; + constexpr OptimizerType::InternalComputationValueType relaxationFactor4{ 1.1 }; + constexpr OptimizerType::InternalComputationValueType gradientMagnitudeTolerance4{ 0.01 }; const bool expectedExceptionReceived = RegularStepGradientDescentOptimizerv4TestHelper(numberOfIterations4, doEstimateLearningRateAtEachIteration, diff --git a/Modules/Numerics/Polynomials/test/itkMultivariateLegendrePolynomialTest.cxx b/Modules/Numerics/Polynomials/test/itkMultivariateLegendrePolynomialTest.cxx index eabd7c87d3e..7dbfa07c0ef 100644 --- a/Modules/Numerics/Polynomials/test/itkMultivariateLegendrePolynomialTest.cxx +++ b/Modules/Numerics/Polynomials/test/itkMultivariateLegendrePolynomialTest.cxx @@ -33,8 +33,8 @@ itkMultivariateLegendrePolynomialTest(int, char *[]) using PolynomialType = itk::MultivariateLegendrePolynomial; - constexpr unsigned int dimension = 3; - constexpr unsigned int degree = 3; + constexpr unsigned int dimension{ 3 }; + constexpr unsigned int degree{ 3 }; PolynomialType::DomainSizeType domainSize(dimension); domainSize[0] = 2; diff --git a/Modules/Numerics/Statistics/include/itkExpectationMaximizationMixtureModelEstimator.hxx b/Modules/Numerics/Statistics/include/itkExpectationMaximizationMixtureModelEstimator.hxx index 7ba24839393..a14eae30b46 100644 --- a/Modules/Numerics/Statistics/include/itkExpectationMaximizationMixtureModelEstimator.hxx +++ b/Modules/Numerics/Statistics/include/itkExpectationMaximizationMixtureModelEstimator.hxx @@ -159,7 +159,7 @@ ExpectationMaximizationMixtureModelEstimator::CalculateDensities() using FrequencyType = typename TSample::AbsoluteFrequencyType; constexpr FrequencyType zeroFrequency{}; - constexpr double minDouble = NumericTraits::epsilon(); + constexpr double minDouble{ NumericTraits::epsilon() }; SizeValueType measurementVectorIndex = 0; while (iter != last) { diff --git a/Modules/Numerics/Statistics/include/itkGaussianMembershipFunction.hxx b/Modules/Numerics/Statistics/include/itkGaussianMembershipFunction.hxx index 45bfe479ebf..84039712603 100644 --- a/Modules/Numerics/Statistics/include/itkGaussianMembershipFunction.hxx +++ b/Modules/Numerics/Statistics/include/itkGaussianMembershipFunction.hxx @@ -113,7 +113,7 @@ GaussianMembershipFunction::SetCovariance(const CovarianceMa } // 1e-6 is an arbitrary value!!! - constexpr double singularThreshold = 1.0e-6; + constexpr double singularThreshold{ 1.0e-6 }; m_CovarianceNonsingular = (det > singularThreshold); if (m_CovarianceNonsingular) diff --git a/Modules/Numerics/Statistics/include/itkKdTree.hxx b/Modules/Numerics/Statistics/include/itkKdTree.hxx index b30c3fa2e73..99d032447dc 100644 --- a/Modules/Numerics/Statistics/include/itkKdTree.hxx +++ b/Modules/Numerics/Statistics/include/itkKdTree.hxx @@ -494,8 +494,8 @@ template void KdTree::PrintTree(std::ostream & os) const { - constexpr unsigned int topLevel = 0; - constexpr unsigned int activeDimension = 0; + constexpr unsigned int topLevel{ 0 }; + constexpr unsigned int activeDimension{ 0 }; this->PrintTree(this->m_Root, topLevel, activeDimension, os); } diff --git a/Modules/Numerics/Statistics/include/itkMahalanobisDistanceMembershipFunction.hxx b/Modules/Numerics/Statistics/include/itkMahalanobisDistanceMembershipFunction.hxx index e299220aedd..68536c75f0d 100644 --- a/Modules/Numerics/Statistics/include/itkMahalanobisDistanceMembershipFunction.hxx +++ b/Modules/Numerics/Statistics/include/itkMahalanobisDistanceMembershipFunction.hxx @@ -103,7 +103,7 @@ MahalanobisDistanceMembershipFunction::SetCovariance(const CovarianceMa } // 1e-6 is an arbitrary value!!! - constexpr double singularThreshold = 1.0e-6; + constexpr double singularThreshold{ 1.0e-6 }; m_CovarianceNonsingular = (det > singularThreshold); if (m_CovarianceNonsingular) diff --git a/Modules/Numerics/Statistics/include/itkScalarImageToCooccurrenceListSampleFilter.hxx b/Modules/Numerics/Statistics/include/itkScalarImageToCooccurrenceListSampleFilter.hxx index 083e93970ac..fd70ac5dc88 100644 --- a/Modules/Numerics/Statistics/include/itkScalarImageToCooccurrenceListSampleFilter.hxx +++ b/Modules/Numerics/Statistics/include/itkScalarImageToCooccurrenceListSampleFilter.hxx @@ -88,7 +88,7 @@ ScalarImageToCooccurrenceListSampleFilter::GenerateData() auto * output = static_cast(this->ProcessObject::GetOutput(0)); // constant for a cooccurrence matrix. - constexpr unsigned int measurementVectorSize = 2; + constexpr unsigned int measurementVectorSize{ 2 }; output->SetMeasurementVectorSize(measurementVectorSize); diff --git a/Modules/Numerics/Statistics/include/itkScalarImageToCooccurrenceMatrixFilter.hxx b/Modules/Numerics/Statistics/include/itkScalarImageToCooccurrenceMatrixFilter.hxx index b443e2e696b..2a214e8d7e0 100644 --- a/Modules/Numerics/Statistics/include/itkScalarImageToCooccurrenceMatrixFilter.hxx +++ b/Modules/Numerics/Statistics/include/itkScalarImageToCooccurrenceMatrixFilter.hxx @@ -38,7 +38,7 @@ ScalarImageToCooccurrenceMatrixFilterProcessObject::SetNthOutput(0, this->MakeOutput(0)); // constant for a cooccurrence matrix. - constexpr unsigned int measurementVectorSize = 2; + constexpr unsigned int measurementVectorSize{ 2 }; auto * output = const_cast(this->GetOutput()); output->SetMeasurementVectorSize(measurementVectorSize); diff --git a/Modules/Numerics/Statistics/include/itkScalarImageToRunLengthMatrixFilter.hxx b/Modules/Numerics/Statistics/include/itkScalarImageToRunLengthMatrixFilter.hxx index 66712d75b66..480b08cf280 100644 --- a/Modules/Numerics/Statistics/include/itkScalarImageToRunLengthMatrixFilter.hxx +++ b/Modules/Numerics/Statistics/include/itkScalarImageToRunLengthMatrixFilter.hxx @@ -39,7 +39,7 @@ ScalarImageToRunLengthMatrixFilter::Sc this->SetNumberOfRequiredInputs(1); this->SetNumberOfRequiredOutputs(1); - constexpr unsigned int measurementVectorSize = 2; + constexpr unsigned int measurementVectorSize{ 2 }; this->ProcessObject::SetNthOutput(0, this->MakeOutput(0)); auto * output = const_cast(this->GetOutput()); diff --git a/Modules/Numerics/Statistics/src/itkNormalVariateGenerator.cxx b/Modules/Numerics/Statistics/src/itkNormalVariateGenerator.cxx index 4bd6d02ef2b..31b37124f5a 100644 --- a/Modules/Numerics/Statistics/src/itkNormalVariateGenerator.cxx +++ b/Modules/Numerics/Statistics/src/itkNormalVariateGenerator.cxx @@ -82,7 +82,7 @@ NormalVariateGenerator::Initialize(int randomSeed) // We set m_Chic1 = A * std::sqrt(0.5 / TLEN), m_Chic2 = B // spell-check-enable - constexpr double fake = 1.0 + 0.125 / m_TLEN; // This is A + constexpr double fake{ 1.0 + 0.125 / m_TLEN }; // This is A m_Chic2 = std::sqrt(2.0 * m_TLEN - fake * fake) / fake; m_Chic1 = fake * std::sqrt(0.5 / m_TLEN); diff --git a/Modules/Numerics/Statistics/test/itkChiSquareDistributionTest.cxx b/Modules/Numerics/Statistics/test/itkChiSquareDistributionTest.cxx index 780a4199227..56187b45e96 100644 --- a/Modules/Numerics/Statistics/test/itkChiSquareDistributionTest.cxx +++ b/Modules/Numerics/Statistics/test/itkChiSquareDistributionTest.cxx @@ -47,12 +47,12 @@ itkChiSquareDistributionTest(int, char *[]) // expected values for Chi-Square cdf with 1 degree of freedom at // values of 0:1:5 - constexpr double expected1[] = { 0, - 6.826894921370859e-001, - 8.427007929497149e-001, - 9.167354833364458e-001, - 9.544997361036416e-001, - 9.746526813225318e-001 }; + constexpr double expected1[]{ 0, + 6.826894921370859e-001, + 8.427007929497149e-001, + 9.167354833364458e-001, + 9.544997361036416e-001, + 9.746526813225318e-001 }; std::cout << "Testing distribution with 1 degree of freedom" << std::endl; @@ -136,17 +136,17 @@ itkChiSquareDistributionTest(int, char *[]) // expected values for Chi-Square cdf with 11 degrees of freedom at // values of 0:2:20 - constexpr double expected11[] = { 0, - 1.504118282583805e-003, - 3.008297612122607e-002, - 1.266357467726155e-001, - 2.866961703699681e-001, - 4.696128489989594e-001, - 6.363567794831719e-001, - 7.670065225437422e-001, - 8.588691197329420e-001, - 9.184193863071046e-001, - 9.546593255659396e-001 }; + constexpr double expected11[]{ 0, + 1.504118282583805e-003, + 3.008297612122607e-002, + 1.266357467726155e-001, + 2.866961703699681e-001, + 4.696128489989594e-001, + 6.363567794831719e-001, + 7.670065225437422e-001, + 8.588691197329420e-001, + 9.184193863071046e-001, + 9.546593255659396e-001 }; std::cout << "-----------------------------------------------" << std::endl << std::endl; std::cout << "Testing distribution with 11 degrees of freedom" << std::endl; @@ -227,8 +227,8 @@ itkChiSquareDistributionTest(int, char *[]) // expected values for Chi-Square cdf with 100 degrees of freedom at // values of 50:20:150 - constexpr double expected100[] = { 6.953305247616148e-006, 9.845502476408603e-003, 2.468020344001694e-001, - 7.677952194991408e-001, 9.764876021901918e-001, 9.990960679576461e-001 }; + constexpr double expected100[]{ 6.953305247616148e-006, 9.845502476408603e-003, 2.468020344001694e-001, + 7.677952194991408e-001, 9.764876021901918e-001, 9.990960679576461e-001 }; std::cout << "-----------------------------------------------" << std::endl << std::endl; std::cout << "Testing distribution with 100 degrees of freedom" << std::endl; @@ -475,7 +475,7 @@ itkChiSquareDistributionTest(int, char *[]) DistributionType::ParametersType parameters(distributionFunction->GetNumberOfParameters()); parameters[0] = 1.0; - constexpr long dof = 2; + constexpr long dof{ 2 }; std::cout << "Variance() = " << distributionFunction->GetVariance() << std::endl; std::cout << "PDF(x,p) = " << distributionFunction->PDF(last_x, parameters) << std::endl; @@ -513,7 +513,7 @@ itkChiSquareDistributionTest(int, char *[]) ITK_TRY_EXPECT_EXCEPTION(distributionFunction->EvaluateInverseCDF(last_x, wrongParameters)); distributionFunction->SetParameters(wrongParameters); - constexpr unsigned long newdof = 17; + constexpr unsigned long newdof{ 17 }; distributionFunction->SetDegreesOfFreedom(newdof); ITK_TEST_SET_GET_VALUE(newdof, distributionFunction->GetDegreesOfFreedom()); diff --git a/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest.cxx b/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest.cxx index cdc7c108e85..c1b8af3ea01 100644 --- a/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest.cxx @@ -117,7 +117,7 @@ itkCovarianceSampleFilterTest(int, char *[]) covarianceFilter->Print(std::cout); - constexpr double epsilon = 1e-6; + constexpr double epsilon{ 1e-6 }; // CHECK THE RESULTS const CovarianceSampleFilterType::MeasurementVectorDecoratedType * meanDecorator = covarianceFilter->GetMeanOutput(); diff --git a/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest2.cxx b/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest2.cxx index 8e95777a29e..cd1a29ee38f 100644 --- a/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest2.cxx @@ -24,8 +24,8 @@ itkCovarianceSampleFilterTest2(int, char *[]) { std::cout << "CovarianceSampleFilter test \n \n"; - constexpr unsigned int MeasurementVectorSize = 3; - constexpr unsigned int numberOfMeasurementVectors = 3; + constexpr unsigned int MeasurementVectorSize{ 3 }; + constexpr unsigned int numberOfMeasurementVectors{ 3 }; using MeasurementVectorType = itk::FixedArray; using SampleType = itk::Statistics::ListSample; @@ -85,7 +85,7 @@ itkCovarianceSampleFilterTest2(int, char *[]) meanExpected.Fill(1.0); - constexpr double epsilon = 1e-4; + constexpr double epsilon{ 1e-4 }; for (unsigned int i = 0; i < MeasurementVectorSize; ++i) { diff --git a/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest3.cxx b/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest3.cxx index a2aaeced472..71e8887fa4b 100644 --- a/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest3.cxx +++ b/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest3.cxx @@ -41,7 +41,7 @@ class MyCovarianceSampleFilter : public CovarianceSampleFilter void CreateInvalidOutput() { - constexpr unsigned int index = 3; + constexpr unsigned int index{ 3 }; Superclass::MakeOutput(index); } [[nodiscard]] unsigned int @@ -63,7 +63,7 @@ itkCovarianceSampleFilterTest3(int, char *[]) std::cout << "CovarianceSampleFilter test \n \n"; using MeasurementType = double; - constexpr unsigned int MeasurementVectorSize = 3; + constexpr unsigned int MeasurementVectorSize{ 3 }; using HistogramType = itk::Statistics::Histogram; diff --git a/Modules/Numerics/Statistics/test/itkDecisionRuleTest.cxx b/Modules/Numerics/Statistics/test/itkDecisionRuleTest.cxx index 884638117e9..f2c7be8c644 100644 --- a/Modules/Numerics/Statistics/test/itkDecisionRuleTest.cxx +++ b/Modules/Numerics/Statistics/test/itkDecisionRuleTest.cxx @@ -78,13 +78,13 @@ itkDecisionRuleTest(int, char *[]) MembershipVectorType membershipScoreVector; - constexpr double membershipScore1 = 0.1; + constexpr double membershipScore1{ 0.1 }; membershipScoreVector.push_back(membershipScore1); - constexpr double membershipScore2 = 0.5; + constexpr double membershipScore2{ 0.5 }; membershipScoreVector.push_back(membershipScore2); - constexpr double membershipScore3 = 1.9; + constexpr double membershipScore3{ 1.9 }; membershipScoreVector.push_back(membershipScore3); // the maximum score is the third component. The decision rule should diff --git a/Modules/Numerics/Statistics/test/itkDenseFrequencyContainer2Test.cxx b/Modules/Numerics/Statistics/test/itkDenseFrequencyContainer2Test.cxx index 73fc210ba41..13a62a82287 100644 --- a/Modules/Numerics/Statistics/test/itkDenseFrequencyContainer2Test.cxx +++ b/Modules/Numerics/Statistics/test/itkDenseFrequencyContainer2Test.cxx @@ -32,7 +32,7 @@ itkDenseFrequencyContainer2Test(int, char *[]) using AbsoluteFrequencyType = DenseFrequencyContainer2Type::AbsoluteFrequencyType; - constexpr unsigned int numberOfBins = 1250; + constexpr unsigned int numberOfBins{ 1250 }; container->Initialize(numberOfBins); @@ -63,7 +63,7 @@ itkDenseFrequencyContainer2Test(int, char *[]) } // Test Set/Get frequency of an out of bound bin - constexpr unsigned int binOutOfBound = numberOfBins; + constexpr unsigned int binOutOfBound{ numberOfBins }; constexpr auto frequency = static_cast(binOutOfBound * binOutOfBound); if (container->SetFrequency(binOutOfBound, frequency)) @@ -118,7 +118,7 @@ itkDenseFrequencyContainer2Test(int, char *[]) return EXIT_FAILURE; } } - constexpr unsigned int binOutOfBound = numberOfBins; + constexpr unsigned int binOutOfBound{ numberOfBins }; constexpr auto frequency = static_cast(binOutOfBound); if (container->IncreaseFrequency(binOutOfBound, frequency)) diff --git a/Modules/Numerics/Statistics/test/itkDistanceMetricTest.cxx b/Modules/Numerics/Statistics/test/itkDistanceMetricTest.cxx index 59c82199049..188ac8af1fa 100644 --- a/Modules/Numerics/Statistics/test/itkDistanceMetricTest.cxx +++ b/Modules/Numerics/Statistics/test/itkDistanceMetricTest.cxx @@ -41,14 +41,14 @@ class MyDistanceMetric : public DistanceMetric double Evaluate(const TMeasurementVector &) const override { - constexpr double score = 1; + constexpr double score{ 1 }; return score; } double Evaluate(const TMeasurementVector &, const TMeasurementVector &) const override { - constexpr double score = 1; + constexpr double score{ 1 }; return score; } }; @@ -61,7 +61,7 @@ itkDistanceMetricTest(int, char *[]) using MeasurementVectorSizeType = unsigned int; - constexpr MeasurementVectorSizeType MeasurementVectorSize = 17; + constexpr MeasurementVectorSizeType MeasurementVectorSize{ 17 }; using MeasurementVectorType = itk::FixedArray; @@ -80,7 +80,7 @@ itkDistanceMetricTest(int, char *[]) // try changing the measurement vector size, it should throw an exception try { - constexpr MeasurementVectorSizeType newSize = 20; + constexpr MeasurementVectorSizeType newSize{ 20 }; distance->SetMeasurementVectorSize(newSize); std::cerr << "Changing measurement vector size is not allowed for a fixed array vector\n" @@ -96,7 +96,7 @@ itkDistanceMetricTest(int, char *[]) // thrown try { - constexpr MeasurementVectorSizeType sameSize = 17; + constexpr MeasurementVectorSizeType sameSize{ 17 }; distance->SetMeasurementVectorSize(sameSize); } catch (const itk::ExceptionObject & excpt) @@ -110,7 +110,7 @@ itkDistanceMetricTest(int, char *[]) try { DistanceMetricType::OriginType origin; - constexpr MeasurementVectorSizeType newSize = 25; + constexpr MeasurementVectorSizeType newSize{ 25 }; origin.SetSize(newSize); distance->SetOrigin(origin); diff --git a/Modules/Numerics/Statistics/test/itkDistanceMetricTest2.cxx b/Modules/Numerics/Statistics/test/itkDistanceMetricTest2.cxx index b66ca6bd866..5daea31e52f 100644 --- a/Modules/Numerics/Statistics/test/itkDistanceMetricTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkDistanceMetricTest2.cxx @@ -41,14 +41,14 @@ class MyDistanceMetric : public DistanceMetric double Evaluate(const TMeasurementVector &) const override { - constexpr double score = 1; + constexpr double score{ 1 }; return score; } double Evaluate(const TMeasurementVector &, const TMeasurementVector &) const override { - constexpr double score = 1; + constexpr double score{ 1 }; return score; } }; @@ -75,7 +75,7 @@ itkDistanceMetricTest2(int, char *[]) distance->Print(std::cout); - constexpr MeasurementVectorSizeType measurementVectorSize = 3; + constexpr MeasurementVectorSizeType measurementVectorSize{ 3 }; distance->SetMeasurementVectorSize(measurementVectorSize); if (distance->GetMeasurementVectorSize() != measurementVectorSize) @@ -88,7 +88,7 @@ itkDistanceMetricTest2(int, char *[]) // thrown try { - constexpr MeasurementVectorSizeType sameSize = 3; + constexpr MeasurementVectorSizeType sameSize{ 3 }; distance->SetMeasurementVectorSize(sameSize); } catch (const itk::ExceptionObject & excpt) @@ -102,7 +102,7 @@ itkDistanceMetricTest2(int, char *[]) try { DistanceMetricType::OriginType origin; - constexpr MeasurementVectorSizeType newSize = 4; + constexpr MeasurementVectorSizeType newSize{ 4 }; origin.SetSize(newSize); distance->SetOrigin(origin); diff --git a/Modules/Numerics/Statistics/test/itkDistanceToCentroidMembershipFunctionTest.cxx b/Modules/Numerics/Statistics/test/itkDistanceToCentroidMembershipFunctionTest.cxx index 3324c4c6c13..6470c19a769 100644 --- a/Modules/Numerics/Statistics/test/itkDistanceToCentroidMembershipFunctionTest.cxx +++ b/Modules/Numerics/Statistics/test/itkDistanceToCentroidMembershipFunctionTest.cxx @@ -23,7 +23,7 @@ int itkDistanceToCentroidMembershipFunctionTest(int, char *[]) { - constexpr unsigned int MeasurementVectorSize = 3; + constexpr unsigned int MeasurementVectorSize{ 3 }; using MeasurementVectorType = itk::FixedArray; @@ -61,7 +61,7 @@ itkDistanceToCentroidMembershipFunctionTest(int, char *[]) // size try { - constexpr MeasurementVectorSizeType measurementVector2 = MeasurementVectorSize + 1; + constexpr MeasurementVectorSizeType measurementVector2{ MeasurementVectorSize + 1 }; function->SetMeasurementVectorSize(measurementVector2); std::cerr << "Exception should have been thrown since we are trying to resize non-resizeable measurement vector type " @@ -82,7 +82,7 @@ itkDistanceToCentroidMembershipFunctionTest(int, char *[]) origin[2] = 1.0; function->SetCentroid(origin); - constexpr double tolerance = 0.001; + constexpr double tolerance{ 0.001 }; if (itk::Math::abs(function->GetCentroid()[0] - origin[0]) > tolerance || itk::Math::abs(function->GetCentroid()[1] - origin[1]) > tolerance || @@ -98,7 +98,7 @@ itkDistanceToCentroidMembershipFunctionTest(int, char *[]) measurement[1] = 3.3; measurement[2] = 4.0; - constexpr double trueValue = 3.31662; + constexpr double trueValue{ 3.31662 }; const double distanceComputed = function->Evaluate(measurement); if (itk::Math::abs(distanceComputed - trueValue) > tolerance) diff --git a/Modules/Numerics/Statistics/test/itkEuclideanDistanceMetricTest.cxx b/Modules/Numerics/Statistics/test/itkEuclideanDistanceMetricTest.cxx index 4c7e862990b..cfbc031f892 100644 --- a/Modules/Numerics/Statistics/test/itkEuclideanDistanceMetricTest.cxx +++ b/Modules/Numerics/Statistics/test/itkEuclideanDistanceMetricTest.cxx @@ -21,7 +21,7 @@ int itkEuclideanDistanceMetricTest(int, char *[]) { - constexpr unsigned int MeasurementVectorSize = 3; + constexpr unsigned int MeasurementVectorSize{ 3 }; using MeasurementVectorType = itk::Array; @@ -75,9 +75,9 @@ itkEuclideanDistanceMetricTest(int, char *[]) measurement[1] = 3.3; measurement[2] = 4.0; - constexpr double trueValue = 3.31662; + constexpr double trueValue{ 3.31662 }; const double distanceComputed = distance->Evaluate(measurement); - constexpr double tolerance = 0.001; + constexpr double tolerance{ 0.001 }; if (itk::Math::abs(distanceComputed - trueValue) > tolerance) { @@ -93,7 +93,7 @@ itkEuclideanDistanceMetricTest(int, char *[]) measurement2[1] = 3.5; measurement2[2] = 3.5; - constexpr double trueValue2 = 1.136; + constexpr double trueValue2{ 1.136 }; const double distanceComputed2 = distance->Evaluate(measurement, measurement2); if (itk::Math::abs(distanceComputed2 - trueValue2) > tolerance) diff --git a/Modules/Numerics/Statistics/test/itkEuclideanSquareDistanceMetricTest.cxx b/Modules/Numerics/Statistics/test/itkEuclideanSquareDistanceMetricTest.cxx index 644e026ad79..42fb29d86ed 100644 --- a/Modules/Numerics/Statistics/test/itkEuclideanSquareDistanceMetricTest.cxx +++ b/Modules/Numerics/Statistics/test/itkEuclideanSquareDistanceMetricTest.cxx @@ -21,7 +21,7 @@ int itkEuclideanSquareDistanceMetricTest(int, char *[]) { - constexpr unsigned int MeasurementVectorSize = 3; + constexpr unsigned int MeasurementVectorSize{ 3 }; using MeasurementVectorType = itk::Array; @@ -77,9 +77,9 @@ itkEuclideanSquareDistanceMetricTest(int, char *[]) measurement[1] = 3.3; measurement[2] = 4.0; - constexpr double trueValue = 11.0; + constexpr double trueValue{ 11.0 }; const double distanceComputed = distance->Evaluate(measurement); - constexpr double tolerance = 0.001; + constexpr double tolerance{ 0.001 }; if (itk::Math::abs(distanceComputed - trueValue) > tolerance) { @@ -95,7 +95,7 @@ itkEuclideanSquareDistanceMetricTest(int, char *[]) measurement2[1] = 3.5; measurement2[2] = 3.5; - constexpr double trueValue2 = 1.29; + constexpr double trueValue2{ 1.29 }; const double distanceComputed2 = distance->Evaluate(measurement, measurement2); if (itk::Math::abs(distanceComputed2 - trueValue2) > tolerance) diff --git a/Modules/Numerics/Statistics/test/itkExpectationMaximizationMixtureModelEstimatorTest.cxx b/Modules/Numerics/Statistics/test/itkExpectationMaximizationMixtureModelEstimatorTest.cxx index 316363288aa..5b8a4874c6b 100644 --- a/Modules/Numerics/Statistics/test/itkExpectationMaximizationMixtureModelEstimatorTest.cxx +++ b/Modules/Numerics/Statistics/test/itkExpectationMaximizationMixtureModelEstimatorTest.cxx @@ -42,11 +42,11 @@ itkExpectationMaximizationMixtureModelEstimatorTest(int argc, char * argv[]) } char * dataFileName = argv[1]; - constexpr int dataSize = 2000; - constexpr int maximumIteration = 200; + constexpr int dataSize{ 2000 }; + constexpr int maximumIteration{ 200 }; using ParametersType = itk::Array; - constexpr double minStandardDeviation = 28.54746; - constexpr unsigned int numberOfClasses = 2; + constexpr double minStandardDeviation{ 28.54746 }; + constexpr unsigned int numberOfClasses{ 2 }; std::vector trueParameters(numberOfClasses); ParametersType params(6); params[0] = 99.261; diff --git a/Modules/Numerics/Statistics/test/itkGaussianDistributionTest.cxx b/Modules/Numerics/Statistics/test/itkGaussianDistributionTest.cxx index df9cc2c75b6..1d3ebdedfba 100644 --- a/Modules/Numerics/Statistics/test/itkGaussianDistributionTest.cxx +++ b/Modules/Numerics/Statistics/test/itkGaussianDistributionTest.cxx @@ -44,7 +44,7 @@ itkGaussianDistributionTest(int, char *[]) int status = EXIT_SUCCESS; // Tolerance for the values. - constexpr double tol = 1e-8; + constexpr double tol{ 1e-8 }; std::cout << "Tolerance used for test: "; std::cout.width(22); std::cout.precision(15); @@ -53,10 +53,10 @@ itkGaussianDistributionTest(int, char *[]) // expected values for Gaussian cdf with mean 0 and variance 1 at // values of -5:1:5 - constexpr double expected1[] = { 2.866515718791942e-007, 3.167124183311998e-005, 1.349898031630095e-003, - 2.275013194817922e-002, 1.586552539314571e-001, 5.000000000000000e-001, - 8.413447460685429e-001, 9.772498680518208e-001, 9.986501019683699e-001, - 9.999683287581669e-001, 9.999997133484281e-001 }; + constexpr double expected1[]{ 2.866515718791942e-007, 3.167124183311998e-005, 1.349898031630095e-003, + 2.275013194817922e-002, 1.586552539314571e-001, 5.000000000000000e-001, + 8.413447460685429e-001, 9.772498680518208e-001, 9.986501019683699e-001, + 9.999683287581669e-001, 9.999997133484281e-001 }; std::cout << "Gaussian CDF" << std::endl; for (int i = -5; i <= 5; ++i) @@ -124,10 +124,10 @@ itkGaussianDistributionTest(int, char *[]) std::cout << "Testing mean = " << distributionFunction->GetMean() << ", variance = " << distributionFunction->GetVariance() << std::endl; - constexpr double expected2[] = { 7.687298972140230e-013, 9.830802207714426e-011, 7.708628950140045e-009, - 3.715491861707074e-007, 1.104524849929275e-005, 2.034760087224798e-004, - 2.338867490523635e-003, 1.694742676234465e-002, 7.864960352514258e-002, - 2.397500610934768e-001, 5.000000000000000e-001 }; + constexpr double expected2[]{ 7.687298972140230e-013, 9.830802207714426e-011, 7.708628950140045e-009, + 3.715491861707074e-007, 1.104524849929275e-005, 2.034760087224798e-004, + 2.338867490523635e-003, 1.694742676234465e-002, 7.864960352514258e-002, + 2.397500610934768e-001, 5.000000000000000e-001 }; std::cout << "Gaussian CDF" << std::endl; for (int i = -5; i <= 5; ++i) @@ -169,10 +169,10 @@ itkGaussianDistributionTest(int, char *[]) distributionFunction->SetMean(0.0); // clear settings distributionFunction->SetVariance(1.0); // clear settings - constexpr double expected3[] = { 7.687298972140230e-013, 9.830802207714426e-011, 7.708628950140045e-009, - 3.715491861707074e-007, 1.104524849929275e-005, 2.034760087224798e-004, - 2.338867490523635e-003, 1.694742676234465e-002, 7.864960352514258e-002, - 2.397500610934768e-001, 5.000000000000000e-001 }; + constexpr double expected3[]{ 7.687298972140230e-013, 9.830802207714426e-011, 7.708628950140045e-009, + 3.715491861707074e-007, 1.104524849929275e-005, 2.034760087224798e-004, + 2.338867490523635e-003, 1.694742676234465e-002, 7.864960352514258e-002, + 2.397500610934768e-001, 5.000000000000000e-001 }; std::cout << "Gaussian CDF (parameter vector API)" << std::endl; for (int i = -5; i <= 5; ++i) @@ -207,10 +207,10 @@ itkGaussianDistributionTest(int, char *[]) // same test but using the separate parameters std::cout << "Testing mean = " << params[0] << ", variance = " << params[1] << std::endl; - constexpr double expected4[] = { 7.687298972140230e-013, 9.830802207714426e-011, 7.708628950140045e-009, - 3.715491861707074e-007, 1.104524849929275e-005, 2.034760087224798e-004, - 2.338867490523635e-003, 1.694742676234465e-002, 7.864960352514258e-002, - 2.397500610934768e-001, 5.000000000000000e-001 }; + constexpr double expected4[]{ 7.687298972140230e-013, 9.830802207714426e-011, 7.708628950140045e-009, + 3.715491861707074e-007, 1.104524849929275e-005, 2.034760087224798e-004, + 2.338867490523635e-003, 1.694742676234465e-002, 7.864960352514258e-002, + 2.397500610934768e-001, 5.000000000000000e-001 }; std::cout << "Gaussian CDF (separate parameter API)" << std::endl; for (int i = -5; i <= 5; ++i) @@ -272,8 +272,8 @@ itkGaussianDistributionTest(int, char *[]) } std::cout << std::endl; - constexpr double mean1 = 1.0; - constexpr double variance1 = 2.5; + constexpr double mean1{ 1.0 }; + constexpr double variance1{ 2.5 }; DistributionType::ParametersType parameters(distributionFunction->GetNumberOfParameters()); parameters[0] = mean1; @@ -331,17 +331,17 @@ itkGaussianDistributionTest(int, char *[]) ITK_TRY_EXPECT_EXCEPTION(distributionFunction->InverseCDF(x, wrongParameters)); distributionFunction->SetParameters(wrongParameters); - constexpr double newMean = 17.0; + constexpr double newMean{ 17.0 }; distributionFunction->SetMean(newMean); ITK_TEST_SET_GET_VALUE(newMean, distributionFunction->GetMean()); distributionFunction->SetParameters(wrongParameters); - constexpr double newVariance = 42.0; + constexpr double newVariance{ 42.0 }; distributionFunction->SetVariance(newVariance); ITK_TEST_SET_GET_VALUE(newVariance, distributionFunction->GetVariance()); - constexpr double mean2 = 0.0; - constexpr double variance2 = 1.0; + constexpr double mean2{ 0.0 }; + constexpr double variance2{ 1.0 }; parameters[0] = mean2; parameters[1] = variance2; diff --git a/Modules/Numerics/Statistics/test/itkGaussianMembershipFunctionTest.cxx b/Modules/Numerics/Statistics/test/itkGaussianMembershipFunctionTest.cxx index 704b510aaf8..f753720e104 100644 --- a/Modules/Numerics/Statistics/test/itkGaussianMembershipFunctionTest.cxx +++ b/Modules/Numerics/Statistics/test/itkGaussianMembershipFunctionTest.cxx @@ -23,7 +23,7 @@ int itkGaussianMembershipFunctionTest(int, char *[]) { - constexpr unsigned int MeasurementVectorSize = 1; + constexpr unsigned int MeasurementVectorSize{ 1 }; using MeasurementVectorType = itk::FixedArray; @@ -37,7 +37,7 @@ itkGaussianMembershipFunctionTest(int, char *[]) // Test if an exception will be thrown if we try to resize the measurement vector // size - constexpr MeasurementVectorSizeType measurementVector2 = MeasurementVectorSize + 1; + constexpr MeasurementVectorSizeType measurementVector2{ MeasurementVectorSize + 1 }; ITK_TRY_EXPECT_EXCEPTION(function->SetMeasurementVectorSize(measurementVector2)); // Test non-square covariance matrix exception @@ -67,7 +67,7 @@ itkGaussianMembershipFunctionTest(int, char *[]) mean[0] = 1.5; function->SetMean(mean); - constexpr double tolerance = 0.001; + constexpr double tolerance{ 0.001 }; if (itk::Math::abs(function->GetMean()[0] - mean[0]) > tolerance) { @@ -79,7 +79,7 @@ itkGaussianMembershipFunctionTest(int, char *[]) itk::NumericTraits::SetLength(measurement, MeasurementVectorSize); measurement[0] = 1.5; - constexpr double trueValue = 0.3989; + constexpr double trueValue{ 0.3989 }; const double distanceComputed = function->Evaluate(measurement); if (itk::Math::abs(distanceComputed - trueValue) > tolerance) diff --git a/Modules/Numerics/Statistics/test/itkGaussianMixtureModelComponentTest.cxx b/Modules/Numerics/Statistics/test/itkGaussianMixtureModelComponentTest.cxx index 3d255151018..cb2accbb4a1 100644 --- a/Modules/Numerics/Statistics/test/itkGaussianMixtureModelComponentTest.cxx +++ b/Modules/Numerics/Statistics/test/itkGaussianMixtureModelComponentTest.cxx @@ -37,9 +37,9 @@ itkGaussianMixtureModelComponentTest(int argc, char * argv[]) } char * dataFileName = argv[1]; - constexpr int dataSize = 2000; + constexpr int dataSize{ 2000 }; using ParametersType = itk::Array; - constexpr unsigned int numberOfClasses = 2; + constexpr unsigned int numberOfClasses{ 2 }; ParametersType params(6); diff --git a/Modules/Numerics/Statistics/test/itkHistogramTest.cxx b/Modules/Numerics/Statistics/test/itkHistogramTest.cxx index 3e2793d9164..96e549e78a8 100644 --- a/Modules/Numerics/Statistics/test/itkHistogramTest.cxx +++ b/Modules/Numerics/Statistics/test/itkHistogramTest.cxx @@ -29,7 +29,7 @@ itkHistogramTest(int, char *[]) int pass = EXIT_SUCCESS; using MeasurementType = float; - constexpr unsigned int numberOfComponents = 3; + constexpr unsigned int numberOfComponents{ 3 }; // create a histogram with 3 components measurement vectors using HistogramType = itk::Statistics::Histogram; @@ -327,14 +327,14 @@ itkHistogramTest(int, char *[]) ITK_TEST_EXPECT_EQUAL(histogram->GetMeasurementVectorSize(), numberOfComponents); - constexpr unsigned int measurementVectorSize = 17; + constexpr unsigned int measurementVectorSize{ 17 }; ITK_TRY_EXPECT_EXCEPTION(histogram->SetMeasurementVectorSize(measurementVectorSize)); index.Fill(0); MeasurementVectorType measurement = histogram->GetMeasurementVector(index); for (unsigned int kid0 = 0; kid0 < numberOfComponents; ++kid0) { - constexpr float expectedValF = 8.0; + constexpr float expectedValF{ 8.0 }; const float obtainedValF = measurement[kid0]; if (itk::Math::NotAlmostEquals(obtainedValF, expectedValF)) { @@ -352,7 +352,7 @@ itkHistogramTest(int, char *[]) measurement = histogram->GetMeasurementVector(index); for (unsigned int kid1 = 0; kid1 < numberOfComponents; ++kid1) { - constexpr float expectedValF = 8.0; + constexpr float expectedValF{ 8.0 }; const float obtainedValF = measurement[kid1]; if (itk::Math::NotAlmostEquals(obtainedValF, expectedValF)) { @@ -365,11 +365,11 @@ itkHistogramTest(int, char *[]) } } - constexpr InstanceIdentifier instanceId = 0; + constexpr InstanceIdentifier instanceId{ 0 }; measurement = histogram->GetMeasurementVector(instanceId); for (unsigned int kid2 = 0; kid2 < numberOfComponents; ++kid2) { - constexpr float expectedValF = 8.0; + constexpr float expectedValF{ 8.0 }; const float obtainedValF = measurement[kid2]; if (itk::Math::NotAlmostEquals(obtainedValF, expectedValF)) { @@ -502,7 +502,7 @@ itkHistogramTest(int, char *[]) ITK_TEST_EXPECT_TRUE(histogram->GetIndex(measurementVectorAbove, aboveUpperIndex)); // Get the mean value for a dimension - constexpr unsigned int dimension = 0; + constexpr unsigned int dimension{ 0 }; const double mean = histogram->Mean(dimension); std::cout << "Mean value along dimension " << dimension << " : " << mean << std::endl; @@ -536,7 +536,7 @@ itkHistogramTest(int, char *[]) // Exercise GetMin / GetMax methods { - constexpr double epsilon = 1e-6; + constexpr double epsilon{ 1e-6 }; HistogramType::SizeType size2 = histogram->GetSize(); HistogramType::BinMinContainerType binMinimums = histogram->GetMins(); diff --git a/Modules/Numerics/Statistics/test/itkHistogramToTextureFeaturesFilterNaNTest.cxx b/Modules/Numerics/Statistics/test/itkHistogramToTextureFeaturesFilterNaNTest.cxx index 21468dc84ec..12de49a56eb 100644 --- a/Modules/Numerics/Statistics/test/itkHistogramToTextureFeaturesFilterNaNTest.cxx +++ b/Modules/Numerics/Statistics/test/itkHistogramToTextureFeaturesFilterNaNTest.cxx @@ -25,7 +25,7 @@ int itkHistogramToTextureFeaturesFilterNaNTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; diff --git a/Modules/Numerics/Statistics/test/itkHistogramToTextureFeaturesFilterTest.cxx b/Modules/Numerics/Statistics/test/itkHistogramToTextureFeaturesFilterTest.cxx index 4e682a07d32..1e05c146ccc 100644 --- a/Modules/Numerics/Statistics/test/itkHistogramToTextureFeaturesFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkHistogramToTextureFeaturesFilterTest.cxx @@ -22,7 +22,7 @@ int itkHistogramToTextureFeaturesFilterTest(int, char *[]) { // Data definitions - constexpr unsigned int HISTOGRAM_AXIS_LEN = 25; + constexpr unsigned int HISTOGRAM_AXIS_LEN{ 25 }; //------------------------------------------------------ @@ -33,7 +33,7 @@ itkHistogramToTextureFeaturesFilterTest(int, char *[]) using HistogramType = itk::Statistics::Histogram; auto histogram = HistogramType::New(); - constexpr unsigned int measurementVectorSize = 2; + constexpr unsigned int measurementVectorSize{ 2 }; histogram->SetMeasurementVectorSize(measurementVectorSize); @@ -134,14 +134,14 @@ itkHistogramToTextureFeaturesFilterTest(int, char *[]) return EXIT_FAILURE; } - constexpr double trueEnergy = 0.295; - constexpr double trueEntropy = 2.26096; - constexpr double trueCorrelation = 0.12819; - constexpr double trueInverseDifferenceMoment = 0.85; - constexpr double trueInertia = 0.3; - constexpr double trueClusterShade = 139.1879; - constexpr double trueClusterProminence = 2732.557; - constexpr double trueHaralickCorrelation = 2264.549; + constexpr double trueEnergy{ 0.295 }; + constexpr double trueEntropy{ 2.26096 }; + constexpr double trueCorrelation{ 0.12819 }; + constexpr double trueInverseDifferenceMoment{ 0.85 }; + constexpr double trueInertia{ 0.3 }; + constexpr double trueClusterShade{ 139.1879 }; + constexpr double trueClusterProminence{ 2732.557 }; + constexpr double trueHaralickCorrelation{ 2264.549 }; const double energy = filter->GetEnergy(); const double entropy = filter->GetEntropy(); diff --git a/Modules/Numerics/Statistics/test/itkImageToHistogramFilterTest.cxx b/Modules/Numerics/Statistics/test/itkImageToHistogramFilterTest.cxx index 01f4d807e88..c3bf53e78ef 100644 --- a/Modules/Numerics/Statistics/test/itkImageToHistogramFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkImageToHistogramFilterTest.cxx @@ -29,9 +29,9 @@ itkImageToHistogramFilterTest(int, char *[]) { using PixelComponentType = unsigned char; using RGBPixelType = itk::RGBPixel; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using RGBImageType = itk::Image; - constexpr unsigned int MeasurementVectorSize = 3; // RGB + constexpr unsigned int MeasurementVectorSize{ 3 }; // RGB int result = EXIT_SUCCESS; @@ -75,7 +75,7 @@ itkImageToHistogramFilterTest(int, char *[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, ImageToHistogramFilter, ImageSink); - constexpr unsigned int numberOfStreamDivisions = 1; + constexpr unsigned int numberOfStreamDivisions{ 1 }; filter->SetNumberOfStreamDivisions(numberOfStreamDivisions); ITK_TEST_SET_GET_VALUE(numberOfStreamDivisions, filter->GetNumberOfStreamDivisions()); diff --git a/Modules/Numerics/Statistics/test/itkImageToHistogramFilterTest2.cxx b/Modules/Numerics/Statistics/test/itkImageToHistogramFilterTest2.cxx index 0bb99fd8d5e..8f28689ea32 100644 --- a/Modules/Numerics/Statistics/test/itkImageToHistogramFilterTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkImageToHistogramFilterTest2.cxx @@ -44,11 +44,11 @@ itkImageToHistogramFilterTest2(int argc, char * argv[]) using RGBPixelType = itk::RGBPixel; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using RGBImageType = itk::Image; - constexpr unsigned int MeasurementVectorSize = 3; // RGB + constexpr unsigned int MeasurementVectorSize{ 3 }; // RGB using ReaderType = itk::ImageFileReader; diff --git a/Modules/Numerics/Statistics/test/itkImageToListSampleAdaptorTest.cxx b/Modules/Numerics/Statistics/test/itkImageToListSampleAdaptorTest.cxx index 13e2a91b97d..b4ae370b09a 100644 --- a/Modules/Numerics/Statistics/test/itkImageToListSampleAdaptorTest.cxx +++ b/Modules/Numerics/Statistics/test/itkImageToListSampleAdaptorTest.cxx @@ -38,8 +38,8 @@ itkImageToListSampleAdaptorTestTemplate() const itk::SizeValueType totalSize = size[0] * size[1] * size[2]; source->SetSize(size); - constexpr float minValue = -100.0; - constexpr float maxValue = 1000.0; + constexpr float minValue{ -100.0 }; + constexpr float maxValue{ 1000.0 }; source->SetMin(static_cast(minValue)); source->SetMax(static_cast(maxValue)); @@ -292,7 +292,7 @@ itkImageToListSampleAdaptorTest(int, char *[]) { int returnValue = EXIT_SUCCESS; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using VectorImageType = itk::VectorImage; returnValue += itkImageToListSampleAdaptorTestTemplate(); diff --git a/Modules/Numerics/Statistics/test/itkImageToListSampleAdaptorTest2.cxx b/Modules/Numerics/Statistics/test/itkImageToListSampleAdaptorTest2.cxx index 2eb02051339..4071c788684 100644 --- a/Modules/Numerics/Statistics/test/itkImageToListSampleAdaptorTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkImageToListSampleAdaptorTest2.cxx @@ -25,11 +25,11 @@ int itkImageToListSampleAdaptorTest2(int, char *[]) { - constexpr unsigned int MeasurementVectorSize = 8; + constexpr unsigned int MeasurementVectorSize{ 8 }; using MeasurementComponentType = unsigned long; using PixelType = itk::FixedArray; - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using ImageType = itk::Image; auto image = ImageType::New(); @@ -118,7 +118,7 @@ itkImageToListSampleAdaptorTest2(int, char *[]) using VariableLengthImageType = itk::Image; - constexpr unsigned int vMeasurementVectorSize = 4; + constexpr unsigned int vMeasurementVectorSize{ 4 }; auto vImage = VariableLengthImageType::New(); @@ -192,7 +192,7 @@ itkImageToListSampleAdaptorTest2(int, char *[]) // using RGBPixelType = itk::RGBPixel; - constexpr unsigned int rgbMeasurementVectorSize = 3; + constexpr unsigned int rgbMeasurementVectorSize{ 3 }; using RGBImageType = itk::Image; diff --git a/Modules/Numerics/Statistics/test/itkImageToListSampleFilterTest2.cxx b/Modules/Numerics/Statistics/test/itkImageToListSampleFilterTest2.cxx index 0ef9c730bba..5d0696c577d 100644 --- a/Modules/Numerics/Statistics/test/itkImageToListSampleFilterTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkImageToListSampleFilterTest2.cxx @@ -26,11 +26,11 @@ int itkImageToListSampleFilterTest2(int, char *[]) { - constexpr unsigned int MeasurementVectorSize = 8; + constexpr unsigned int MeasurementVectorSize{ 8 }; using MeasurementComponentType = unsigned long; using PixelType = itk::FixedArray; - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using ImageType = itk::Image; using MaskImageType = itk::Image; diff --git a/Modules/Numerics/Statistics/test/itkImageToListSampleFilterTest3.cxx b/Modules/Numerics/Statistics/test/itkImageToListSampleFilterTest3.cxx index 99168a5a195..3639ee84b45 100644 --- a/Modules/Numerics/Statistics/test/itkImageToListSampleFilterTest3.cxx +++ b/Modules/Numerics/Statistics/test/itkImageToListSampleFilterTest3.cxx @@ -27,10 +27,10 @@ int itkImageToListSampleFilterTest3(int, char *[]) { - constexpr unsigned int MeasurementVectorSize = 8; + constexpr unsigned int MeasurementVectorSize{ 8 }; using MeasurementComponentType = float; - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using ImageType = itk::VectorImage; using MaskImageType = itk::Image; @@ -124,7 +124,7 @@ itkImageToListSampleFilterTest3(int, char *[]) ++lit; } - constexpr double epsilon = 1e-6; + constexpr double epsilon{ 1e-6 }; if (itk::Math::abs(sum - 420.0) > epsilon) { diff --git a/Modules/Numerics/Statistics/test/itkJointDomainImageToListSampleAdaptorTest.cxx b/Modules/Numerics/Statistics/test/itkJointDomainImageToListSampleAdaptorTest.cxx index d38d5d27805..116e3f2967c 100644 --- a/Modules/Numerics/Statistics/test/itkJointDomainImageToListSampleAdaptorTest.cxx +++ b/Modules/Numerics/Statistics/test/itkJointDomainImageToListSampleAdaptorTest.cxx @@ -25,11 +25,11 @@ int itkJointDomainImageToListSampleAdaptorTest(int, char *[]) { - constexpr unsigned int MeasurementVectorSize = 8; + constexpr unsigned int MeasurementVectorSize{ 8 }; using MeasurementComponentType = unsigned long; using PixelType = itk::FixedArray; - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using ImageType = itk::Image; auto image = ImageType::New(); @@ -206,7 +206,7 @@ itkJointDomainImageToListSampleAdaptorTest(int, char *[]) adaptor->UsePixelContainerOff(); JointDomainImageToListSampleAdaptorType::MeasurementVectorType v2 = adaptor->GetMeasurementVector(4); - constexpr double epsilon = 1e-3; + constexpr double epsilon{ 1e-3 }; for (unsigned int m = 0; m < 5; ++m) { diff --git a/Modules/Numerics/Statistics/test/itkKalmanLinearEstimatorTest.cxx b/Modules/Numerics/Statistics/test/itkKalmanLinearEstimatorTest.cxx index 61684e68143..ff019e4e57a 100644 --- a/Modules/Numerics/Statistics/test/itkKalmanLinearEstimatorTest.cxx +++ b/Modules/Numerics/Statistics/test/itkKalmanLinearEstimatorTest.cxx @@ -52,7 +52,7 @@ itkKalmanLinearEstimatorTest(int, char *[]) planeEquation(4) = 4.0; planeEquation(5) = 6.0; - constexpr unsigned int N = 10; + constexpr unsigned int N{ 10 }; VectorType predictor; predictor(5) = 1.0; @@ -105,7 +105,7 @@ itkKalmanLinearEstimatorTest(int, char *[]) bool pass = true; - constexpr float tolerance = 1e-4; + constexpr float tolerance{ 1e-4 }; if (errorMagnitude > tolerance) { diff --git a/Modules/Numerics/Statistics/test/itkKdTreeBasedKmeansEstimatorTest.cxx b/Modules/Numerics/Statistics/test/itkKdTreeBasedKmeansEstimatorTest.cxx index 700213f7613..65ccf377505 100644 --- a/Modules/Numerics/Statistics/test/itkKdTreeBasedKmeansEstimatorTest.cxx +++ b/Modules/Numerics/Statistics/test/itkKdTreeBasedKmeansEstimatorTest.cxx @@ -40,7 +40,7 @@ itkKdTreeBasedKmeansEstimatorTest(int argc, char * argv[]) char * dataFileName = argv[1]; - constexpr int dataSize = 2000; + constexpr int dataSize{ 2000 }; const int bucketSize = std::stoi(argv[2]); const double minStandardDeviation = std::stod(argv[3]); @@ -55,7 +55,7 @@ itkKdTreeBasedKmeansEstimatorTest(int argc, char * argv[]) initialMeans[1] = 80.0; initialMeans[2] = 180.0; initialMeans[3] = 180.0; - constexpr int maximumIteration = 200; + constexpr int maximumIteration{ 200 }; /* Loading point data */ using PointSetType = itk::PointSet; @@ -114,7 +114,7 @@ itkKdTreeBasedKmeansEstimatorTest(int argc, char * argv[]) // Set the centroid position change threshold estimator->SetCentroidPositionChangesThreshold(0.0); - constexpr double tolerance = 0.1; + constexpr double tolerance{ 0.1 }; if (itk::Math::abs(estimator->GetCentroidPositionChangesThreshold() - 0.0) > tolerance) { std::cerr << "Set/GetCentroidPositionChangesThreshold() " << std::endl; diff --git a/Modules/Numerics/Statistics/test/itkKdTreeGeneratorTest.cxx b/Modules/Numerics/Statistics/test/itkKdTreeGeneratorTest.cxx index f3069c14f79..ae26fca1741 100644 --- a/Modules/Numerics/Statistics/test/itkKdTreeGeneratorTest.cxx +++ b/Modules/Numerics/Statistics/test/itkKdTreeGeneratorTest.cxx @@ -29,7 +29,7 @@ itkKdTreeGeneratorTest(int, char *[]) using SampleType = itk::Statistics::ListSample; - constexpr SampleType::MeasurementVectorSizeType measurementVectorSize = 2; + constexpr SampleType::MeasurementVectorSizeType measurementVectorSize{ 2 }; auto sample = SampleType::New(); sample->SetMeasurementVectorSize(measurementVectorSize); @@ -51,7 +51,7 @@ itkKdTreeGeneratorTest(int, char *[]) treeGenerator->SetSample(sample); ITK_TEST_SET_GET_VALUE(sample, treeGenerator->GetSourceSample()); - constexpr unsigned int bucketSize = 16; + constexpr unsigned int bucketSize{ 16 }; treeGenerator->SetBucketSize(bucketSize); ITK_TEST_SET_GET_VALUE(bucketSize, treeGenerator->GetBucketSize()); @@ -96,7 +96,7 @@ itkKdTreeGeneratorTest(int, char *[]) } distanceMetric->SetOrigin(origin); - constexpr unsigned int numberOfNeighbors = 3; + constexpr unsigned int numberOfNeighbors{ 3 }; TreeType::InstanceIdentifierVectorType neighbors; tree->Search(queryPoint, numberOfNeighbors, neighbors); @@ -110,7 +110,7 @@ itkKdTreeGeneratorTest(int, char *[]) << "] : " << distanceMetric->Evaluate(tree->GetMeasurementVector(neighbors[i])) << std::endl; } - constexpr double radius = 437.0; + constexpr double radius{ 437.0 }; tree->Search(queryPoint, radius, neighbors); @@ -187,7 +187,7 @@ itkKdTreeGeneratorTest(int, char *[]) } distanceMetric->SetOrigin(origin); - constexpr unsigned int numberOfNeighbors = 3; + constexpr unsigned int numberOfNeighbors{ 3 }; TreeType::InstanceIdentifierVectorType neighbors; tree->Search(queryPoint, numberOfNeighbors, neighbors); @@ -201,7 +201,7 @@ itkKdTreeGeneratorTest(int, char *[]) << "] : " << distanceMetric->Evaluate(tree->GetMeasurementVector(neighbors[i])) << std::endl; } - constexpr double radius = 437.0; + constexpr double radius{ 437.0 }; tree->Search(queryPoint, radius, neighbors); diff --git a/Modules/Numerics/Statistics/test/itkKdTreeTest1.cxx b/Modules/Numerics/Statistics/test/itkKdTreeTest1.cxx index 5bc0d716baf..6b5ad55784d 100644 --- a/Modules/Numerics/Statistics/test/itkKdTreeTest1.cxx +++ b/Modules/Numerics/Statistics/test/itkKdTreeTest1.cxx @@ -43,7 +43,7 @@ itkKdTreeTest1(int argc, char * argv[]) using MeasurementVectorType = itk::Array; using SampleType = itk::Statistics::ListSample; - constexpr SampleType::MeasurementVectorSizeType measurementVectorSize = 2; + constexpr SampleType::MeasurementVectorSizeType measurementVectorSize{ 2 }; auto sample = SampleType::New(); sample->SetMeasurementVectorSize(measurementVectorSize); @@ -77,7 +77,7 @@ itkKdTreeTest1(int argc, char * argv[]) MeasurementVectorType queryPoint(measurementVectorSize); - constexpr unsigned int numberOfNeighbors = 1; + constexpr unsigned int numberOfNeighbors{ 1 }; TreeType::InstanceIdentifierVectorType neighbors; MeasurementVectorType result(measurementVectorSize); diff --git a/Modules/Numerics/Statistics/test/itkKdTreeTest2.cxx b/Modules/Numerics/Statistics/test/itkKdTreeTest2.cxx index 338ac41878a..33ed7ae48be 100644 --- a/Modules/Numerics/Statistics/test/itkKdTreeTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkKdTreeTest2.cxx @@ -36,7 +36,7 @@ itkKdTreeTest2(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using MeasurementValueType = float; using MeasurementVectorType = itk::Vector; @@ -104,7 +104,7 @@ itkKdTreeTest2(int argc, char * argv[]) distanceMetric->SetOrigin(origin); - constexpr unsigned int numberOfNeighbors = 1; + constexpr unsigned int numberOfNeighbors{ 1 }; TreeType::InstanceIdentifierVectorType neighbors; tree->Search(queryPoint, numberOfNeighbors, neighbors); diff --git a/Modules/Numerics/Statistics/test/itkKdTreeTest3.cxx b/Modules/Numerics/Statistics/test/itkKdTreeTest3.cxx index b049675a561..6363d7a5eb7 100644 --- a/Modules/Numerics/Statistics/test/itkKdTreeTest3.cxx +++ b/Modules/Numerics/Statistics/test/itkKdTreeTest3.cxx @@ -44,7 +44,7 @@ itkKdTreeTest3(int argc, char * argv[]) using MeasurementVectorType = itk::Array; using SampleType = itk::Statistics::ListSample; - constexpr SampleType::MeasurementVectorSizeType measurementVectorSize = 2; + constexpr SampleType::MeasurementVectorSizeType measurementVectorSize{ 2 }; auto sample = SampleType::New(); sample->SetMeasurementVectorSize(measurementVectorSize); diff --git a/Modules/Numerics/Statistics/test/itkKdTreeTestSamplePoints.cxx b/Modules/Numerics/Statistics/test/itkKdTreeTestSamplePoints.cxx index a219a2326b2..f711610a0cd 100644 --- a/Modules/Numerics/Statistics/test/itkKdTreeTestSamplePoints.cxx +++ b/Modules/Numerics/Statistics/test/itkKdTreeTestSamplePoints.cxx @@ -26,12 +26,12 @@ itkKdTreeTestSamplePoints(int, char *[]) using MeasurementVectorType = itk::Array; using SampleType = itk::Statistics::ListSample; - constexpr SampleType::MeasurementVectorSizeType measurementVectorSize = 2; + constexpr SampleType::MeasurementVectorSizeType measurementVectorSize{ 2 }; auto sample = SampleType::New(); sample->SetMeasurementVectorSize(measurementVectorSize); - constexpr unsigned int numberOfDataPoints = 5; + constexpr unsigned int numberOfDataPoints{ 5 }; MeasurementVectorType mv(measurementVectorSize); mv[0] = 0.0342; mv[1] = 0.5175; @@ -60,7 +60,7 @@ itkKdTreeTestSamplePoints(int, char *[]) using TreeGeneratorType = itk::Statistics::KdTreeGenerator; auto treeGenerator = TreeGeneratorType::New(); - constexpr unsigned int bucketSize = 1; + constexpr unsigned int bucketSize{ 1 }; treeGenerator->SetSample(sample); treeGenerator->SetBucketSize(bucketSize); @@ -72,7 +72,7 @@ itkKdTreeTestSamplePoints(int, char *[]) MeasurementVectorType queryPoint(measurementVectorSize); - constexpr unsigned int numberOfNeighbors = 1; + constexpr unsigned int numberOfNeighbors{ 1 }; TreeType::InstanceIdentifierVectorType neighbors; MeasurementVectorType result(measurementVectorSize); diff --git a/Modules/Numerics/Statistics/test/itkListSampleTest.cxx b/Modules/Numerics/Statistics/test/itkListSampleTest.cxx index 4cd5fc1b4b1..95b685b5126 100644 --- a/Modules/Numerics/Statistics/test/itkListSampleTest.cxx +++ b/Modules/Numerics/Statistics/test/itkListSampleTest.cxx @@ -33,7 +33,7 @@ itkListSampleTest(int argc, char * argv[]) const SampleType::MeasurementVectorSizeType measurementVectorSize = std::stoi(argv[1]); std::cerr << "Measurement vector size: " << measurementVectorSize << std::endl; - constexpr unsigned int sampleSize = 25; + constexpr unsigned int sampleSize{ 25 }; auto sample = SampleType::New(); @@ -369,7 +369,7 @@ itkListSampleTest(int argc, char * argv[]) auto variableSizeSample = VariableSizeListSampleType::New(); - constexpr unsigned int initialSize = 19; + constexpr unsigned int initialSize{ 19 }; variableSizeSample->SetMeasurementVectorSize(initialSize); const unsigned int returnedSize = variableSizeSample->GetMeasurementVectorSize(); @@ -381,7 +381,7 @@ itkListSampleTest(int argc, char * argv[]) } VariableSizeMeasurementVectorType variableLengthVector; - constexpr unsigned int newsize = 42; + constexpr unsigned int newsize{ 42 }; variableLengthVector.SetSize(newsize); variableSizeSample->Clear(); @@ -402,7 +402,7 @@ itkListSampleTest(int argc, char * argv[]) // Now, verify that it can be changed - constexpr unsigned int initialSize2 = 37; + constexpr unsigned int initialSize2{ 37 }; variableSizeSample->Clear(); variableSizeSample->SetMeasurementVectorSize(initialSize2); diff --git a/Modules/Numerics/Statistics/test/itkMahalanobisDistanceMetricTest.cxx b/Modules/Numerics/Statistics/test/itkMahalanobisDistanceMetricTest.cxx index 2d38c13a1e4..d9089a6259e 100644 --- a/Modules/Numerics/Statistics/test/itkMahalanobisDistanceMetricTest.cxx +++ b/Modules/Numerics/Statistics/test/itkMahalanobisDistanceMetricTest.cxx @@ -21,7 +21,7 @@ int itkMahalanobisDistanceMetricTest(int, char *[]) { - constexpr unsigned int MeasurementVectorSize = 3; + constexpr unsigned int MeasurementVectorSize{ 3 }; using MeasurementVectorType = itk::Array; @@ -50,7 +50,7 @@ itkMahalanobisDistanceMetricTest(int, char *[]) distance->SetMean(origin); // double value comparison tolerance - constexpr double tolerance = 0.001; + constexpr double tolerance{ 0.001 }; if (itk::Math::abs(distance->GetMean()[0] - origin[0]) > tolerance || itk::Math::abs(distance->GetMean()[1] - origin[1]) > tolerance || itk::Math::abs(distance->GetMean()[2] - origin[2]) > tolerance) @@ -87,8 +87,8 @@ itkMahalanobisDistanceMetricTest(int, char *[]) return EXIT_FAILURE; } - constexpr double epsilon = 1e-200; - constexpr double doubleMax = 1e+25; + constexpr double epsilon{ 1e-200 }; + constexpr double doubleMax{ 1e+25 }; distance->SetEpsilon(epsilon); distance->SetDoubleMax(doubleMax); @@ -118,7 +118,7 @@ itkMahalanobisDistanceMetricTest(int, char *[]) // Test if an exception is thrown if a covariance matrix is set with different // size DistanceMetricType::CovarianceMatrixType covarianceMatrix2; - constexpr DistanceMetricType::MeasurementVectorSizeType measurementSize2 = 4; + constexpr DistanceMetricType::MeasurementVectorSizeType measurementSize2{ 4 }; covarianceMatrix2.set_size(measurementSize2, measurementSize2); try @@ -185,7 +185,7 @@ itkMahalanobisDistanceMetricTest(int, char *[]) } // Run the distance metric with a single component measurement vector size - constexpr DistanceMetricType::MeasurementVectorSizeType singleComponentMeasurementVectorSize = 1; + constexpr DistanceMetricType::MeasurementVectorSizeType singleComponentMeasurementVectorSize{ 1 }; distance->SetMeasurementVectorSize(singleComponentMeasurementVectorSize); diff --git a/Modules/Numerics/Statistics/test/itkManhattanDistanceMetricTest.cxx b/Modules/Numerics/Statistics/test/itkManhattanDistanceMetricTest.cxx index 63f5a31d80c..1ccb9b64cfc 100644 --- a/Modules/Numerics/Statistics/test/itkManhattanDistanceMetricTest.cxx +++ b/Modules/Numerics/Statistics/test/itkManhattanDistanceMetricTest.cxx @@ -21,7 +21,7 @@ int itkManhattanDistanceMetricTest(int, char *[]) { - constexpr unsigned int MeasurementVectorSize = 3; + constexpr unsigned int MeasurementVectorSize{ 3 }; using MeasurementVectorType = itk::Array; @@ -76,9 +76,9 @@ itkManhattanDistanceMetricTest(int, char *[]) measurement[1] = 3.3; measurement[2] = 4.0; - constexpr double trueValue = 5.0; + constexpr double trueValue{ 5.0 }; const double distanceComputed = distance->Evaluate(measurement); - constexpr double tolerance = 0.001; + constexpr double tolerance{ 0.001 }; if (itk::Math::abs(distanceComputed - trueValue) > tolerance) { @@ -94,7 +94,7 @@ itkManhattanDistanceMetricTest(int, char *[]) measurement2[1] = 3.5; measurement2[2] = 3.5; - constexpr double trueValue2 = 1.7; + constexpr double trueValue2{ 1.7 }; const double distanceComputed2 = distance->Evaluate(measurement, measurement2); if (itk::Math::abs(distanceComputed2 - trueValue2) > tolerance) diff --git a/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest.cxx b/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest.cxx index 11e9409473a..c2e2864cdd1 100644 --- a/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest.cxx @@ -26,8 +26,8 @@ itkMeanSampleFilterTest(int, char *[]) bool pass = true; std::string failureMeassage = ""; - constexpr unsigned int MeasurementVectorSize = 2; - constexpr unsigned int numberOfMeasurementVectors = 5; + constexpr unsigned int MeasurementVectorSize{ 2 }; + constexpr unsigned int numberOfMeasurementVectors{ 5 }; using MeasurementVectorType = itk::FixedArray; using SampleType = itk::Statistics::ListSample; @@ -99,7 +99,7 @@ itkMeanSampleFilterTest(int, char *[]) std::cout << meanOutput[0] << ' ' << mean[0] << ' ' << meanOutput[1] << ' ' << mean[1] << ' ' << std::endl; - constexpr FilterType::MeasurementVectorType::ValueType epsilon = 1e-6; + constexpr FilterType::MeasurementVectorType::ValueType epsilon{ 1e-6 }; if ((itk::Math::abs(meanOutput[0] - mean[0]) > epsilon) || (itk::Math::abs(meanOutput[1] - mean[1]) > epsilon)) { diff --git a/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest2.cxx b/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest2.cxx index 597824a7d61..fc8f284f283 100644 --- a/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest2.cxx @@ -26,8 +26,8 @@ itkMeanSampleFilterTest2(int, char *[]) bool pass = true; std::string failureMeassage = ""; - constexpr unsigned int MeasurementVectorSize = 2; - constexpr unsigned int numberOfMeasurementVectors = 2; + constexpr unsigned int MeasurementVectorSize{ 2 }; + constexpr unsigned int numberOfMeasurementVectors{ 2 }; using MeasurementVectorType = itk::FixedArray; @@ -80,7 +80,7 @@ itkMeanSampleFilterTest2(int, char *[]) << std::endl; // FilterType::MeasurementVectorType::ValueType is an int in this case - constexpr FilterType::MeasurementVectorType::ValueType epsilon = 0; + constexpr FilterType::MeasurementVectorType::ValueType epsilon{ 0 }; if ((itk::Math::abs(meanOutput[0] - expectedMean[0]) > epsilon) || (itk::Math::abs(meanOutput[1] - expectedMean[1]) > epsilon)) diff --git a/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest3.cxx b/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest3.cxx index 9c8bbdaf82d..34f4e6fb2c9 100644 --- a/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest3.cxx +++ b/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest3.cxx @@ -26,7 +26,7 @@ itkMeanSampleFilterTest3(int, char *[]) std::cout << "CovarianceSampleFilter test \n \n"; using MeasurementType = double; - constexpr unsigned int MeasurementVectorSize = 3; + constexpr unsigned int MeasurementVectorSize{ 3 }; using HistogramType = itk::Statistics::Histogram; @@ -120,7 +120,7 @@ itkMeanSampleFilterTest3(int, char *[]) std::cout << "GetMeasurementVectorSize = " << filter->GetMeasurementVectorSize() << std::endl; - constexpr double epsilon = 1; + constexpr double epsilon{ 1 }; for (unsigned int i = 0; i < MeasurementVectorSize; ++i) { diff --git a/Modules/Numerics/Statistics/test/itkMeasurementVectorTraitsTest.cxx b/Modules/Numerics/Statistics/test/itkMeasurementVectorTraitsTest.cxx index b2fc3b78480..b0fd32d1207 100644 --- a/Modules/Numerics/Statistics/test/itkMeasurementVectorTraitsTest.cxx +++ b/Modules/Numerics/Statistics/test/itkMeasurementVectorTraitsTest.cxx @@ -74,7 +74,7 @@ itkMeasurementVectorTraitsTest(int, char *[]) { std::cout << "MeasurementVectorTraits Test" << std::endl; - constexpr unsigned int length1 = 7; + constexpr unsigned int length1{ 7 }; using MeasurementVectorType1 = itk::FixedArray; using MeasurementVectorType2 = itk::Array; @@ -82,7 +82,7 @@ itkMeasurementVectorTraitsTest(int, char *[]) using MeasurementVectorType4 = std::vector; using MeasurementVectorType5 = itk::NumericTraits::MeasurementVectorType; - constexpr unsigned int length2 = 9; + constexpr unsigned int length2{ 9 }; using MeasurementVectorType1b = itk::FixedArray; using MeasurementVectorType2b = itk::Array; @@ -168,7 +168,7 @@ itkMeasurementVectorTraitsTest(int, char *[]) itkAssertLengthExceptionMacro(measure1, measure3b); itkAssertLengthExceptionMacro(measure1, measure4b); - constexpr unsigned int zeroLength = 0; + constexpr unsigned int zeroLength{ 0 }; itkAssertLengthSameValueReturn(measure1b, MeasurementVectorType1b, zeroLength); itkAssertLengthSameValueReturn(measure2b, MeasurementVectorType2b, zeroLength); diff --git a/Modules/Numerics/Statistics/test/itkMembershipFunctionBaseTest.cxx b/Modules/Numerics/Statistics/test/itkMembershipFunctionBaseTest.cxx index c74dbb9aad8..b2b610dff80 100644 --- a/Modules/Numerics/Statistics/test/itkMembershipFunctionBaseTest.cxx +++ b/Modules/Numerics/Statistics/test/itkMembershipFunctionBaseTest.cxx @@ -45,7 +45,7 @@ class MyMembershipFunctionBase : public MembershipFunctionBase; diff --git a/Modules/Numerics/Statistics/test/itkMembershipFunctionBaseTest2.cxx b/Modules/Numerics/Statistics/test/itkMembershipFunctionBaseTest2.cxx index e81ef4c09f9..012b00c851e 100644 --- a/Modules/Numerics/Statistics/test/itkMembershipFunctionBaseTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkMembershipFunctionBaseTest2.cxx @@ -45,7 +45,7 @@ class MyMembershipFunctionBase : public MembershipFunctionBase; @@ -88,7 +88,7 @@ itkMembershipFunctionBaseTest2(int, char *[]) } // test if it is possible to change the measurement vector size - constexpr MembershipFunctionBaseType::MeasurementVectorSizeType newSize = 5; + constexpr MembershipFunctionBaseType::MeasurementVectorSizeType newSize{ 5 }; function->SetMeasurementVectorSize(newSize); // for code coverage if (function->GetMeasurementVectorSize() != newSize) diff --git a/Modules/Numerics/Statistics/test/itkMembershipSampleTest1.cxx b/Modules/Numerics/Statistics/test/itkMembershipSampleTest1.cxx index 78c4423c9ca..1352ade2dbb 100644 --- a/Modules/Numerics/Statistics/test/itkMembershipSampleTest1.cxx +++ b/Modules/Numerics/Statistics/test/itkMembershipSampleTest1.cxx @@ -25,9 +25,9 @@ int itkMembershipSampleTest1(int, char *[]) { - constexpr unsigned int MeasurementVectorSize = 3; + constexpr unsigned int MeasurementVectorSize{ 3 }; - constexpr unsigned int numberOfClasses1 = 2; + constexpr unsigned int numberOfClasses1{ 2 }; using MeasurementVectorType = itk::FixedArray; @@ -59,7 +59,7 @@ itkMembershipSampleTest1(int, char *[]) membershipSample->Print(std::cout); // Add measurement vectors to the list sample - constexpr unsigned int sampleSize = 10; + constexpr unsigned int sampleSize{ 10 }; MeasurementVectorType mv; std::cout << "Sample length = " << sample->GetMeasurementVectorSize() << std::endl; diff --git a/Modules/Numerics/Statistics/test/itkMembershipSampleTest2.cxx b/Modules/Numerics/Statistics/test/itkMembershipSampleTest2.cxx index c89b639567e..ca6ae4ec53f 100644 --- a/Modules/Numerics/Statistics/test/itkMembershipSampleTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkMembershipSampleTest2.cxx @@ -25,9 +25,9 @@ int itkMembershipSampleTest2(int, char *[]) { - constexpr unsigned int MeasurementVectorSize = 3; + constexpr unsigned int MeasurementVectorSize{ 3 }; - constexpr unsigned int numberOfClasses1 = 2; + constexpr unsigned int numberOfClasses1{ 2 }; using MeasurementVectorType = itk::Array; @@ -59,7 +59,7 @@ itkMembershipSampleTest2(int, char *[]) membershipSample->Print(std::cout); // Add measurement vectors to the list sample - constexpr unsigned int sampleSize = 10; + constexpr unsigned int sampleSize{ 10 }; MeasurementVectorType mv; itk::NumericTraits::SetLength(mv, MeasurementVectorSize); diff --git a/Modules/Numerics/Statistics/test/itkMembershipSampleTest3.cxx b/Modules/Numerics/Statistics/test/itkMembershipSampleTest3.cxx index 1a51903de4b..c7841f08457 100644 --- a/Modules/Numerics/Statistics/test/itkMembershipSampleTest3.cxx +++ b/Modules/Numerics/Statistics/test/itkMembershipSampleTest3.cxx @@ -25,9 +25,9 @@ int itkMembershipSampleTest3(int, char *[]) { - constexpr unsigned int MeasurementVectorSize = 3; + constexpr unsigned int MeasurementVectorSize{ 3 }; - constexpr unsigned int numberOfClasses1 = 2; + constexpr unsigned int numberOfClasses1{ 2 }; using MeasurementVectorType = itk::VariableLengthVector; @@ -60,7 +60,7 @@ itkMembershipSampleTest3(int, char *[]) membershipSample->Print(std::cout); // Add measurement vectors to the list sample - constexpr unsigned int sampleSize = 10; + constexpr unsigned int sampleSize{ 10 }; MeasurementVectorType mv; itk::NumericTraits::SetLength(mv, MeasurementVectorSize); diff --git a/Modules/Numerics/Statistics/test/itkMembershipSampleTest4.cxx b/Modules/Numerics/Statistics/test/itkMembershipSampleTest4.cxx index 8498c037fa0..6cb872c6634 100644 --- a/Modules/Numerics/Statistics/test/itkMembershipSampleTest4.cxx +++ b/Modules/Numerics/Statistics/test/itkMembershipSampleTest4.cxx @@ -25,9 +25,9 @@ int itkMembershipSampleTest4(int, char *[]) { - constexpr unsigned int MeasurementVectorSize = 3; + constexpr unsigned int MeasurementVectorSize{ 3 }; - constexpr unsigned int numberOfClasses1 = 2; + constexpr unsigned int numberOfClasses1{ 2 }; using MeasurementVectorType = std::vector; @@ -60,7 +60,7 @@ itkMembershipSampleTest4(int, char *[]) membershipSample->Print(std::cout); // Add measurement vectors to the list sample - constexpr unsigned int sampleSize = 10; + constexpr unsigned int sampleSize{ 10 }; MeasurementVectorType mv; itk::NumericTraits::SetLength(mv, MeasurementVectorSize); diff --git a/Modules/Numerics/Statistics/test/itkNeighborhoodSamplerTest1.cxx b/Modules/Numerics/Statistics/test/itkNeighborhoodSamplerTest1.cxx index cfa21a7dd3f..a28f97a726a 100644 --- a/Modules/Numerics/Statistics/test/itkNeighborhoodSamplerTest1.cxx +++ b/Modules/Numerics/Statistics/test/itkNeighborhoodSamplerTest1.cxx @@ -25,7 +25,7 @@ int itkNeighborhoodSamplerTest1(int, char *[]) { - constexpr unsigned int MeasurementVectorSize = 17; + constexpr unsigned int MeasurementVectorSize{ 17 }; using MeasurementVectorType = itk::FixedArray; @@ -64,8 +64,8 @@ itkNeighborhoodSamplerTest1(int, char *[]) // Testing the settings of the Radius. - constexpr RadiusType radius1 = 237; - constexpr RadiusType radius2 = 179; + constexpr RadiusType radius1{ 237 }; + constexpr RadiusType radius2{ 179 }; filter->SetRadius(radius1); diff --git a/Modules/Numerics/Statistics/test/itkNormalVariateGeneratorTest1.cxx b/Modules/Numerics/Statistics/test/itkNormalVariateGeneratorTest1.cxx index 64e00fc51e1..17825a8aaf8 100644 --- a/Modules/Numerics/Statistics/test/itkNormalVariateGeneratorTest1.cxx +++ b/Modules/Numerics/Statistics/test/itkNormalVariateGeneratorTest1.cxx @@ -31,7 +31,7 @@ itkNormalVariateGeneratorTest1(int, char *[]) normalGenerator->Print(std::cout); - constexpr unsigned int numberOfSamples = 1000; + constexpr unsigned int numberOfSamples{ 1000 }; double sum = 0.0; double sum2 = 0.0; diff --git a/Modules/Numerics/Statistics/test/itkPointSetToListSampleAdaptorTest.cxx b/Modules/Numerics/Statistics/test/itkPointSetToListSampleAdaptorTest.cxx index ff3f7b802ba..2644d29ad30 100644 --- a/Modules/Numerics/Statistics/test/itkPointSetToListSampleAdaptorTest.cxx +++ b/Modules/Numerics/Statistics/test/itkPointSetToListSampleAdaptorTest.cxx @@ -30,7 +30,7 @@ itkPointSetToListSampleAdaptorTest(int, char *[]) auto pointSet = PointSetType::New(); PointSetType::PointType point; - constexpr unsigned int numberOfPoints = 10; + constexpr unsigned int numberOfPoints{ 10 }; for (unsigned int i = 0; i < numberOfPoints; ++i) { point[0] = i * 3; diff --git a/Modules/Numerics/Statistics/test/itkRandomVariateGeneratorBaseTest.cxx b/Modules/Numerics/Statistics/test/itkRandomVariateGeneratorBaseTest.cxx index 592bc641f63..9ab7897e0f0 100644 --- a/Modules/Numerics/Statistics/test/itkRandomVariateGeneratorBaseTest.cxx +++ b/Modules/Numerics/Statistics/test/itkRandomVariateGeneratorBaseTest.cxx @@ -37,7 +37,7 @@ class VariateGeneratorTestHelper : public RandomVariateGeneratorBase double GetVariate() override { - constexpr double theAnswerToTheQuestionOfLifeTheUniverseAndEverything = 42.0; + constexpr double theAnswerToTheQuestionOfLifeTheUniverseAndEverything{ 42.0 }; return theAnswerToTheQuestionOfLifeTheUniverseAndEverything; } diff --git a/Modules/Numerics/Statistics/test/itkSampleTest.cxx b/Modules/Numerics/Statistics/test/itkSampleTest.cxx index cb69e89eb36..ebe812d6c7b 100644 --- a/Modules/Numerics/Statistics/test/itkSampleTest.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleTest.cxx @@ -116,7 +116,7 @@ int itkSampleTest(int, char *[]) { - constexpr unsigned int MeasurementVectorSize = 17; + constexpr unsigned int MeasurementVectorSize{ 17 }; using MeasurementVectorType = itk::FixedArray; @@ -148,7 +148,7 @@ itkSampleTest(int, char *[]) using AbsoluteFrequencyType = SampleType::AbsoluteFrequencyType; - constexpr AbsoluteFrequencyType frequency = 17; + constexpr AbsoluteFrequencyType frequency{ 17 }; sample->AddMeasurementVector(measure, frequency); diff --git a/Modules/Numerics/Statistics/test/itkSampleTest2.cxx b/Modules/Numerics/Statistics/test/itkSampleTest2.cxx index 09c4b3ada20..eae9f89becc 100644 --- a/Modules/Numerics/Statistics/test/itkSampleTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleTest2.cxx @@ -123,7 +123,7 @@ int itkSampleTest2(int, char *[]) { - constexpr unsigned int MeasurementVectorSize = 17; + constexpr unsigned int MeasurementVectorSize{ 17 }; using MeasurementVectorType = itk::Array; @@ -155,7 +155,7 @@ itkSampleTest2(int, char *[]) using AbsoluteFrequencyType = SampleType::AbsoluteFrequencyType; - constexpr AbsoluteFrequencyType frequency = 17; + constexpr AbsoluteFrequencyType frequency{ 17 }; sample->AddMeasurementVector(measure, frequency); diff --git a/Modules/Numerics/Statistics/test/itkSampleTest3.cxx b/Modules/Numerics/Statistics/test/itkSampleTest3.cxx index 502801c9f48..d9f340fe56a 100644 --- a/Modules/Numerics/Statistics/test/itkSampleTest3.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleTest3.cxx @@ -124,7 +124,7 @@ int itkSampleTest3(int, char *[]) { - constexpr unsigned int MeasurementVectorSize = 17; + constexpr unsigned int MeasurementVectorSize{ 17 }; using MeasurementVectorType = itk::VariableLengthVector; @@ -156,7 +156,7 @@ itkSampleTest3(int, char *[]) using AbsoluteFrequencyType = SampleType::AbsoluteFrequencyType; - constexpr AbsoluteFrequencyType frequency = 17; + constexpr AbsoluteFrequencyType frequency{ 17 }; sample->AddMeasurementVector(measure, frequency); diff --git a/Modules/Numerics/Statistics/test/itkSampleTest4.cxx b/Modules/Numerics/Statistics/test/itkSampleTest4.cxx index b5be055e7b5..cd965e99a7e 100644 --- a/Modules/Numerics/Statistics/test/itkSampleTest4.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleTest4.cxx @@ -124,7 +124,7 @@ int itkSampleTest4(int, char *[]) { - constexpr unsigned int MeasurementVectorSize = 17; + constexpr unsigned int MeasurementVectorSize{ 17 }; using MeasurementVectorType = std::vector; @@ -156,7 +156,7 @@ itkSampleTest4(int, char *[]) using AbsoluteFrequencyType = SampleType::AbsoluteFrequencyType; - constexpr AbsoluteFrequencyType frequency = 17; + constexpr AbsoluteFrequencyType frequency{ 17 }; sample->AddMeasurementVector(measure, frequency); diff --git a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest.cxx b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest.cxx index 02974ca9bc2..ae00f167ab0 100644 --- a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest.cxx @@ -27,7 +27,7 @@ int itkSampleToHistogramFilterTest(int, char *[]) { - constexpr unsigned int numberOfComponents = 3; + constexpr unsigned int numberOfComponents{ 3 }; using MeasurementType = float; using MeasurementVectorType = itk::Array; @@ -249,8 +249,8 @@ itkSampleToHistogramFilterTest(int, char *[]) // Testing the settings of the MarginalScale. - constexpr HistogramMeasurementType marginalScale1 = 237; - constexpr HistogramMeasurementType marginalScale2 = 179; + constexpr HistogramMeasurementType marginalScale1{ 237 }; + constexpr HistogramMeasurementType marginalScale2{ 179 }; filter->SetMarginalScale(marginalScale1); @@ -583,8 +583,8 @@ itkSampleToHistogramFilterTest(int, char *[]) } // Testing the settings of the AutoMinimumMaximum Flag. - constexpr bool autoMinimumMaximum1 = true; - constexpr bool autoMinimumMaximum2 = false; + constexpr bool autoMinimumMaximum1{ true }; + constexpr bool autoMinimumMaximum2{ false }; filter->SetAutoMinimumMaximum(autoMinimumMaximum1); diff --git a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest2.cxx b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest2.cxx index 14103da0f33..1d09214e16a 100644 --- a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest2.cxx @@ -24,7 +24,7 @@ int itkSampleToHistogramFilterTest2(int, char *[]) { - constexpr unsigned int numberOfComponents = 3; + constexpr unsigned int numberOfComponents{ 3 }; using MeasurementType = float; using MeasurementVectorType = itk::Array; @@ -130,7 +130,7 @@ itkSampleToHistogramFilterTest2(int, char *[]) HistogramType::ConstIterator histogramItr = histogram->Begin(); HistogramType::ConstIterator histogramEnd = histogram->End(); - constexpr unsigned int expectedFrequency1 = 1; + constexpr unsigned int expectedFrequency1{ 1 }; while (histogramItr != histogramEnd) { if (histogramItr.GetFrequency() != expectedFrequency1) @@ -178,7 +178,7 @@ itkSampleToHistogramFilterTest2(int, char *[]) histogramItr = histogram->Begin(); histogramEnd = histogram->End(); - constexpr unsigned int expectedFrequency2 = 5; + constexpr unsigned int expectedFrequency2{ 5 }; while (histogramItr != histogramEnd) { if (histogramItr.GetFrequency() != expectedFrequency2) @@ -226,7 +226,7 @@ itkSampleToHistogramFilterTest2(int, char *[]) histogramItr = histogram->Begin(); histogramEnd = histogram->End(); - constexpr unsigned int expectedFrequency3 = 15; + constexpr unsigned int expectedFrequency3{ 15 }; while (histogramItr != histogramEnd) { if (histogramItr.GetFrequency() != expectedFrequency3) @@ -274,7 +274,7 @@ itkSampleToHistogramFilterTest2(int, char *[]) histogramItr = histogram->Begin(); histogramEnd = histogram->End(); - constexpr unsigned int expectedFrequency4 = 105; + constexpr unsigned int expectedFrequency4{ 105 }; while (histogramItr != histogramEnd) { if (histogramItr.GetFrequency() != expectedFrequency4) diff --git a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest3.cxx b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest3.cxx index 0fb76a17890..e6f9ffb725d 100644 --- a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest3.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest3.cxx @@ -24,7 +24,7 @@ int itkSampleToHistogramFilterTest3(int, char *[]) { - constexpr unsigned int numberOfComponents = 3; + constexpr unsigned int numberOfComponents{ 3 }; using MeasurementType = int; // Exercise an integer type for the samples using MeasurementVectorType = itk::Array; @@ -130,7 +130,7 @@ itkSampleToHistogramFilterTest3(int, char *[]) HistogramType::ConstIterator histogramItr = histogram->Begin(); const HistogramType::ConstIterator histogramEnd = histogram->End(); - constexpr unsigned int expectedFrequency1 = 1; + constexpr unsigned int expectedFrequency1{ 1 }; while (histogramItr != histogramEnd) { if (histogramItr.GetFrequency() != expectedFrequency1) diff --git a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest4.cxx b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest4.cxx index 6d3a34de95c..ce352c4ab0f 100644 --- a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest4.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest4.cxx @@ -24,7 +24,7 @@ int itkSampleToHistogramFilterTest4(int, char *[]) { - constexpr unsigned int numberOfComponents = 3; + constexpr unsigned int numberOfComponents{ 3 }; // // Note: @@ -146,7 +146,7 @@ itkSampleToHistogramFilterTest4(int, char *[]) HistogramType::ConstIterator histogramItr = histogram->Begin(); const HistogramType::ConstIterator histogramEnd = histogram->End(); - constexpr unsigned int expectedFrequency1 = 1; + constexpr unsigned int expectedFrequency1{ 1 }; while (histogramItr != histogramEnd) { if (histogramItr.GetFrequency() != expectedFrequency1) diff --git a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest5.cxx b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest5.cxx index 86b84751dbf..c39d028cca0 100644 --- a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest5.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest5.cxx @@ -26,7 +26,7 @@ int itkSampleToHistogramFilterTest5(int argc, char * argv[]) { - constexpr unsigned int imageDimension = 2; + constexpr unsigned int imageDimension{ 2 }; if (argc < 2) { @@ -49,7 +49,7 @@ itkSampleToHistogramFilterTest5(int argc, char * argv[]) using PixelType = itk::RGBPixel; - constexpr unsigned int numberOfComponents = 3; + constexpr unsigned int numberOfComponents{ 3 }; using ImageType = itk::Image; diff --git a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest6.cxx b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest6.cxx index 3d836a4b904..3ae5fee777c 100644 --- a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest6.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest6.cxx @@ -24,7 +24,7 @@ int itkSampleToHistogramFilterTest6(int, char *[]) { - constexpr unsigned int numberOfComponents = 3; + constexpr unsigned int numberOfComponents{ 3 }; // // Note: @@ -139,7 +139,7 @@ itkSampleToHistogramFilterTest6(int, char *[]) HistogramType::ConstIterator histogramItr = histogram->Begin(); const HistogramType::ConstIterator histogramEnd = histogram->End(); - constexpr unsigned int expectedFrequency1 = 1; + constexpr unsigned int expectedFrequency1{ 1 }; while (histogramItr != histogramEnd) { if (histogramItr.GetFrequency() != expectedFrequency1) diff --git a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest7.cxx b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest7.cxx index 41a24b101db..c80cee00d87 100644 --- a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest7.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest7.cxx @@ -24,7 +24,7 @@ int itkSampleToHistogramFilterTest7(int, char *[]) { - constexpr unsigned int numberOfComponents = 3; + constexpr unsigned int numberOfComponents{ 3 }; using MeasurementType = int; // Exercise an integer type for the samples using MeasurementVectorType = itk::VariableLengthVector; @@ -130,7 +130,7 @@ itkSampleToHistogramFilterTest7(int, char *[]) HistogramType::ConstIterator histogramItr = histogram->Begin(); const HistogramType::ConstIterator histogramEnd = histogram->End(); - constexpr unsigned int expectedFrequency1 = 1; + constexpr unsigned int expectedFrequency1{ 1 }; while (histogramItr != histogramEnd) { if (histogramItr.GetFrequency() != expectedFrequency1) diff --git a/Modules/Numerics/Statistics/test/itkSampleToSubsampleFilterTest1.cxx b/Modules/Numerics/Statistics/test/itkSampleToSubsampleFilterTest1.cxx index e6af82bd32b..f2f70e8a20c 100644 --- a/Modules/Numerics/Statistics/test/itkSampleToSubsampleFilterTest1.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleToSubsampleFilterTest1.cxx @@ -63,7 +63,7 @@ int itkSampleToSubsampleFilterTest1(int, char *[]) { - constexpr unsigned int MeasurementVectorSize = 17; + constexpr unsigned int MeasurementVectorSize{ 17 }; using MeasurementVectorType = itk::FixedArray; diff --git a/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceListSampleFilterTest.cxx b/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceListSampleFilterTest.cxx index d5cf60665c2..b0797e55a6a 100644 --- a/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceListSampleFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceListSampleFilterTest.cxx @@ -23,9 +23,9 @@ int itkScalarImageToCooccurrenceListSampleFilterTest(int, char *[]) { // Data definitions - constexpr unsigned int IMGWIDTH = 5; - constexpr unsigned int IMGHEIGHT = 5; - constexpr unsigned int NDIMENSION = 2; + constexpr unsigned int IMGWIDTH{ 5 }; + constexpr unsigned int IMGHEIGHT{ 5 }; + constexpr unsigned int NDIMENSION{ 2 }; //------------------------------------------------------ @@ -38,7 +38,7 @@ itkScalarImageToCooccurrenceListSampleFilterTest(int, char *[]) auto image = InputImageType::New(); - constexpr InputImageType::SizeType inputImageSize = { { IMGWIDTH, IMGHEIGHT } }; + constexpr InputImageType::SizeType inputImageSize{ IMGWIDTH, IMGHEIGHT }; constexpr InputImageType::IndexType index{}; InputImageType::RegionType region{ index, inputImageSize }; @@ -104,7 +104,7 @@ itkScalarImageToCooccurrenceListSampleFilterTest(int, char *[]) filter->SetInput(image); - constexpr CooccurrenceListType::OffsetType offset = { { 1, 0 } }; + constexpr CooccurrenceListType::OffsetType offset{ 1, 0 }; filter->UseNeighbor(offset); diff --git a/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceMatrixFilterTest.cxx b/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceMatrixFilterTest.cxx index 5af189f9792..6cc1e55bd43 100644 --- a/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceMatrixFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceMatrixFilterTest.cxx @@ -27,9 +27,9 @@ itkScalarImageToCooccurrenceMatrixFilterTest(int, char *[]) { // Data definitions - constexpr unsigned int IMGWIDTH = 5; - constexpr unsigned int IMGHEIGHT = 5; - constexpr unsigned int NDIMENSION = 2; + constexpr unsigned int IMGWIDTH{ 5 }; + constexpr unsigned int IMGHEIGHT{ 5 }; + constexpr unsigned int NDIMENSION{ 2 }; //------------------------------------------------------ @@ -42,7 +42,7 @@ itkScalarImageToCooccurrenceMatrixFilterTest(int, char *[]) auto image = InputImageType::New(); - constexpr InputImageType::SizeType inputImageSize = { { IMGWIDTH, IMGHEIGHT } }; + constexpr InputImageType::SizeType inputImageSize{ IMGWIDTH, IMGHEIGHT }; constexpr InputImageType::IndexType index{}; InputImageType::RegionType region{ index, inputImageSize }; @@ -150,8 +150,8 @@ itkScalarImageToCooccurrenceMatrixFilterTest(int, char *[]) filter->SetInput(image); - constexpr InputImageType::OffsetType offset1 = { { 0, 1 } }; - constexpr InputImageType::OffsetType offset2 = { { 1, 0 } }; + constexpr InputImageType::OffsetType offset1{ 0, 1 }; + constexpr InputImageType::OffsetType offset2{ 1, 0 }; const FilterType::OffsetVectorPointer offsetV = FilterType::OffsetVector::New(); offsetV->push_back(offset1); offsetV->push_back(offset2); @@ -262,7 +262,7 @@ itkScalarImageToCooccurrenceMatrixFilterTest(int, char *[]) auto filter2 = FilterType::New(); filter2->SetInput(image); - constexpr InputImageType::OffsetType offset3 = { { 0, 1 } }; + constexpr InputImageType::OffsetType offset3{ 0, 1 }; filter2->SetOffset(offset3); filter2->SetNumberOfBinsPerAxis(2); @@ -296,7 +296,7 @@ itkScalarImageToCooccurrenceMatrixFilterTest(int, char *[]) auto filter3 = FilterType::New(); filter3->SetInput(image); - constexpr InputImageType::OffsetType offset4 = { { 1, 1 } }; + constexpr InputImageType::OffsetType offset4{ 1, 1 }; filter3->SetOffset(offset4); diff --git a/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceMatrixFilterTest2.cxx b/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceMatrixFilterTest2.cxx index e7835a25ce2..351086da177 100644 --- a/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceMatrixFilterTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceMatrixFilterTest2.cxx @@ -27,9 +27,9 @@ itkScalarImageToCooccurrenceMatrixFilterTest2(int, char *[]) { // Data definitions - constexpr unsigned int IMGWIDTH = 5; - constexpr unsigned int IMGHEIGHT = 5; - constexpr unsigned int NDIMENSION = 2; + constexpr unsigned int IMGWIDTH{ 5 }; + constexpr unsigned int IMGHEIGHT{ 5 }; + constexpr unsigned int NDIMENSION{ 2 }; //------------------------------------------------------ @@ -44,7 +44,7 @@ itkScalarImageToCooccurrenceMatrixFilterTest2(int, char *[]) auto mask = InputImageType::New(); - constexpr InputImageType::SizeType inputImageSize = { { IMGWIDTH, IMGHEIGHT } }; + constexpr InputImageType::SizeType inputImageSize{ IMGWIDTH, IMGHEIGHT }; constexpr InputImageType::IndexType index{}; InputImageType::RegionType region{ index, inputImageSize }; @@ -125,8 +125,8 @@ itkScalarImageToCooccurrenceMatrixFilterTest2(int, char *[]) filter->SetInput(image); - constexpr InputImageType::OffsetType offset1 = { { 0, 1 } }; - constexpr InputImageType::OffsetType offset2 = { { 1, 0 } }; + constexpr InputImageType::OffsetType offset1{ 0, 1 }; + constexpr InputImageType::OffsetType offset2{ 1, 0 }; const FilterType::OffsetVectorPointer offsetV = FilterType::OffsetVector::New(); offsetV->push_back(offset1); offsetV->push_back(offset2); diff --git a/Modules/Numerics/Statistics/test/itkScalarImageToHistogramGeneratorTest.cxx b/Modules/Numerics/Statistics/test/itkScalarImageToHistogramGeneratorTest.cxx index c52d5cb9f59..e8bc25dcda4 100644 --- a/Modules/Numerics/Statistics/test/itkScalarImageToHistogramGeneratorTest.cxx +++ b/Modules/Numerics/Statistics/test/itkScalarImageToHistogramGeneratorTest.cxx @@ -34,7 +34,7 @@ itkScalarImageToHistogramGeneratorTest(int argc, char * argv[]) } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelComponentType = unsigned char; using ScalarImageType = itk::Image; using ReaderType = itk::ImageFileReader; @@ -80,7 +80,7 @@ itkScalarImageToHistogramGeneratorTest(int argc, char * argv[]) const unsigned int histogramSize = histogram->Size(); outputFile << "Histogram size " << histogramSize << std::endl; - constexpr unsigned int channel = 0; // red channel + constexpr unsigned int channel{ 0 }; // red channel outputFile << "Histogram of the scalar component" << std::endl; for (unsigned int bin = 0; bin < histogramSize; ++bin) { diff --git a/Modules/Numerics/Statistics/test/itkScalarImageToRunLengthFeaturesFilterTest.cxx b/Modules/Numerics/Statistics/test/itkScalarImageToRunLengthFeaturesFilterTest.cxx index 9186d707419..286fdd94ebe 100644 --- a/Modules/Numerics/Statistics/test/itkScalarImageToRunLengthFeaturesFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkScalarImageToRunLengthFeaturesFilterTest.cxx @@ -26,9 +26,9 @@ itkScalarImageToRunLengthFeaturesFilterTest(int, char *[]) { // Data definitions - constexpr unsigned int IMGWIDTH = 5; - constexpr unsigned int IMGHEIGHT = 5; - constexpr unsigned int NDIMENSION = 2; + constexpr unsigned int IMGWIDTH{ 5 }; + constexpr unsigned int IMGHEIGHT{ 5 }; + constexpr unsigned int NDIMENSION{ 2 }; //------------------------------------------------------ @@ -41,7 +41,7 @@ itkScalarImageToRunLengthFeaturesFilterTest(int, char *[]) auto image = InputImageType::New(); - constexpr InputImageType::SizeType inputImageSize = { { IMGWIDTH, IMGHEIGHT } }; + constexpr InputImageType::SizeType inputImageSize{ IMGWIDTH, IMGHEIGHT }; constexpr InputImageType::IndexType index{}; InputImageType::RegionType region{ index, inputImageSize }; @@ -194,7 +194,7 @@ itkScalarImageToRunLengthFeaturesFilterTest(int, char *[]) RunLengthFilterType::FeatureValueVectorPointer means = texFilter->GetFeatureMeans(); RunLengthFilterType::FeatureValueVectorPointer stds = texFilter->GetFeatureStandardDeviations(); - constexpr double expectedMeans[10] = { 0.76, 7, 10.4, 20, 0.0826667, 15.4, 0.0628267, 11.704, 0.578667, 107.8 }; + constexpr double expectedMeans[10]{ 0.76, 7, 10.4, 20, 0.0826667, 15.4, 0.0628267, 11.704, 0.578667, 107.8 }; { RunLengthFilterType::FeatureValueVector::ConstIterator mIt = means->Begin(); @@ -209,8 +209,8 @@ itkScalarImageToRunLengthFeaturesFilterTest(int, char *[]) } } { - constexpr double expectedDeviations[10] = { 0.415692, 10.3923, 4.50333, 8.66025, 0, - 0, 0.0343639, 6.40166, 0.859097, 160.041494 }; + constexpr double expectedDeviations[10]{ 0.415692, 10.3923, 4.50333, 8.66025, 0, + 0, 0.0343639, 6.40166, 0.859097, 160.041494 }; RunLengthFilterType::FeatureValueVector::ConstIterator sIt = stds->Begin(); for (int counter = 0; sIt != stds->End(); ++sIt, counter++) { @@ -228,8 +228,8 @@ itkScalarImageToRunLengthFeaturesFilterTest(int, char *[]) means = texFilter->GetFeatureMeans(); stds = texFilter->GetFeatureStandardDeviations(); - constexpr double expectedMeans2[10] = { 1, 1, 13, 25, 0.0826667, 15.4, 0.0826667, 15.4, 0.0826667, 15.4 }; - constexpr double expectedDeviations2[10] = { 0 }; + constexpr double expectedMeans2[10]{ 1, 1, 13, 25, 0.0826667, 15.4, 0.0826667, 15.4, 0.0826667, 15.4 }; + constexpr double expectedDeviations2[10]{ 0 }; { RunLengthFilterType::FeatureValueVector::ConstIterator mIt = means->Begin(); @@ -292,8 +292,8 @@ itkScalarImageToRunLengthFeaturesFilterTest(int, char *[]) means = texFilter->GetFeatureMeans(); stds = texFilter->GetFeatureStandardDeviations(); - constexpr double expectedMeans3[10] = { 1, 1, 13, 25, 0.0826667, 15.4, 0.0826667, 15.4, 0.0826667, 15.4 }; - constexpr double expectedDeviations3[10] = { 0 }; + constexpr double expectedMeans3[10]{ 1, 1, 13, 25, 0.0826667, 15.4, 0.0826667, 15.4, 0.0826667, 15.4 }; + constexpr double expectedDeviations3[10]{ 0 }; { RunLengthFilterType::FeatureValueVector::ConstIterator mIt = means->Begin(); for (int counter = 0; mIt != means->End(); ++mIt, counter++) diff --git a/Modules/Numerics/Statistics/test/itkScalarImageToRunLengthMatrixFilterTest.cxx b/Modules/Numerics/Statistics/test/itkScalarImageToRunLengthMatrixFilterTest.cxx index f4a5133499f..0a6e409d25b 100644 --- a/Modules/Numerics/Statistics/test/itkScalarImageToRunLengthMatrixFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkScalarImageToRunLengthMatrixFilterTest.cxx @@ -28,9 +28,9 @@ itkScalarImageToRunLengthMatrixFilterTest(int, char *[]) { // Data definitions - constexpr unsigned int IMGWIDTH = 5; - constexpr unsigned int IMGHEIGHT = 5; - constexpr unsigned int NDIMENSION = 2; + constexpr unsigned int IMGWIDTH{ 5 }; + constexpr unsigned int IMGHEIGHT{ 5 }; + constexpr unsigned int NDIMENSION{ 2 }; //------------------------------------------------------ @@ -45,7 +45,7 @@ itkScalarImageToRunLengthMatrixFilterTest(int, char *[]) auto mask = InputImageType::New(); - constexpr InputImageType::SizeType inputImageSize = { { IMGWIDTH, IMGHEIGHT } }; + constexpr InputImageType::SizeType inputImageSize{ IMGWIDTH, IMGHEIGHT }; InputImageType::RegionType region; @@ -117,8 +117,8 @@ itkScalarImageToRunLengthMatrixFilterTest(int, char *[]) filter->SetInput(image); - constexpr InputImageType::OffsetType offset1 = { { 0, -1 } }; - constexpr InputImageType::OffsetType offset2 = { { -1, 0 } }; + constexpr InputImageType::OffsetType offset1{ 0, -1 }; + constexpr InputImageType::OffsetType offset2{ -1, 0 }; const FilterType::OffsetVectorPointer offsetV = FilterType::OffsetVector::New(); offsetV->push_back(offset1); offsetV->push_back(offset2); diff --git a/Modules/Numerics/Statistics/test/itkScalarImageToTextureFeaturesFilterTest.cxx b/Modules/Numerics/Statistics/test/itkScalarImageToTextureFeaturesFilterTest.cxx index aba50589699..42685aafc5a 100644 --- a/Modules/Numerics/Statistics/test/itkScalarImageToTextureFeaturesFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkScalarImageToTextureFeaturesFilterTest.cxx @@ -27,9 +27,9 @@ itkScalarImageToTextureFeaturesFilterTest(int, char *[]) { // Data definitions - constexpr unsigned int IMGWIDTH = 5; - constexpr unsigned int IMGHEIGHT = 5; - constexpr unsigned int NDIMENSION = 2; + constexpr unsigned int IMGWIDTH{ 5 }; + constexpr unsigned int IMGHEIGHT{ 5 }; + constexpr unsigned int NDIMENSION{ 2 }; //------------------------------------------------------ @@ -44,7 +44,7 @@ itkScalarImageToTextureFeaturesFilterTest(int, char *[]) auto image = InputImageType::New(); - constexpr InputImageType::SizeType inputImageSize = { { IMGWIDTH, IMGHEIGHT } }; + constexpr InputImageType::SizeType inputImageSize{ IMGWIDTH, IMGHEIGHT }; constexpr InputImageType::IndexType index{}; InputImageType::RegionType region{ index, inputImageSize }; @@ -193,8 +193,8 @@ itkScalarImageToTextureFeaturesFilterTest(int, char *[]) TextureFilterType::FeatureValueVectorPointer means = texFilter->GetFeatureMeans(); TextureFilterType::FeatureValueVectorPointer stds = texFilter->GetFeatureStandardDeviations(); - constexpr double expectedMeans[6] = { 0.505, 0.992738, 0.625, 0.75, 0.0959999, 0.2688 }; - constexpr double expectedDeviations[6] = { 0.00866027, 0.0125788, 0.216506351, 0.433012702, 0.166277, 0.465575 }; + constexpr double expectedMeans[6]{ 0.505, 0.992738, 0.625, 0.75, 0.0959999, 0.2688 }; + constexpr double expectedDeviations[6]{ 0.00866027, 0.0125788, 0.216506351, 0.433012702, 0.166277, 0.465575 }; { @@ -229,8 +229,8 @@ itkScalarImageToTextureFeaturesFilterTest(int, char *[]) means = texFilter->GetFeatureMeans(); stds = texFilter->GetFeatureStandardDeviations(); - constexpr double expectedMeans2[6] = { 0.5, 1.0, 0.5, 1.0, 0.0, 0.0 }; - constexpr double expectedDeviations2[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + constexpr double expectedMeans2[6]{ 0.5, 1.0, 0.5, 1.0, 0.0, 0.0 }; + constexpr double expectedDeviations2[6]{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; { TextureFilterType::FeatureValueVector::ConstIterator mIt = means->Begin(); @@ -288,8 +288,8 @@ itkScalarImageToTextureFeaturesFilterTest(int, char *[]) means = texFilter->GetFeatureMeans(); stds = texFilter->GetFeatureStandardDeviations(); - constexpr double expectedMeans3[6] = { 0.5, 1.0, 0.5, 1.0, 0.0, 0.0 }; - constexpr double expectedDeviations3[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + constexpr double expectedMeans3[6]{ 0.5, 1.0, 0.5, 1.0, 0.0, 0.0 }; + constexpr double expectedDeviations3[6]{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; { TextureFilterType::FeatureValueVector::ConstIterator mIt = means->Begin(); diff --git a/Modules/Numerics/Statistics/test/itkSparseFrequencyContainer2Test.cxx b/Modules/Numerics/Statistics/test/itkSparseFrequencyContainer2Test.cxx index fbd57016f96..7b60bfba00a 100644 --- a/Modules/Numerics/Statistics/test/itkSparseFrequencyContainer2Test.cxx +++ b/Modules/Numerics/Statistics/test/itkSparseFrequencyContainer2Test.cxx @@ -31,7 +31,7 @@ itkSparseFrequencyContainer2Test(int, char *[]) using AbsoluteFrequencyType = SparseFrequencyContainer2Type::AbsoluteFrequencyType; - constexpr unsigned int numberOfBins = 1250; + constexpr unsigned int numberOfBins{ 1250 }; container->Initialize(numberOfBins); diff --git a/Modules/Numerics/Statistics/test/itkStandardDeviationPerComponentSampleFilterTest.cxx b/Modules/Numerics/Statistics/test/itkStandardDeviationPerComponentSampleFilterTest.cxx index 2955ac52a02..5b7eded24ee 100644 --- a/Modules/Numerics/Statistics/test/itkStandardDeviationPerComponentSampleFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkStandardDeviationPerComponentSampleFilterTest.cxx @@ -123,7 +123,7 @@ itkStandardDeviationPerComponentSampleFilterTest(int, char *[]) standardDeviationFilter->Print(std::cout); - constexpr double epsilon = 1e-6; + constexpr double epsilon{ 1e-6 }; // CHECK THE RESULTS using MeasurementVectorRealType = StandardDeviationPerComponentSampleFilterType::MeasurementVectorRealType; diff --git a/Modules/Numerics/Statistics/test/itkStatisticsAlgorithmTest.cxx b/Modules/Numerics/Statistics/test/itkStatisticsAlgorithmTest.cxx index f999949eae7..1da33580094 100644 --- a/Modules/Numerics/Statistics/test/itkStatisticsAlgorithmTest.cxx +++ b/Modules/Numerics/Statistics/test/itkStatisticsAlgorithmTest.cxx @@ -25,7 +25,7 @@ itkStatisticsAlgorithmTest(int, char *[]) { std::cout << "StatisticsAlgorithm Test \n \n"; - constexpr unsigned int measurementVectorSize = 2; + constexpr unsigned int measurementVectorSize{ 2 }; using MeasurementVectorType = itk::Array; using SampleType = itk::Statistics::ListSample; @@ -56,7 +56,7 @@ itkStatisticsAlgorithmTest(int, char *[]) MeasurementVectorType realUpper(measurementVectorSize); MeasurementVectorType realLower(measurementVectorSize); - constexpr unsigned int numberOfSamples = 25; + constexpr unsigned int numberOfSamples{ 25 }; realLower.Fill(1000); realUpper.Fill(0); @@ -91,7 +91,7 @@ itkStatisticsAlgorithmTest(int, char *[]) ITK_TRY_EXPECT_NO_EXCEPTION( itk::Statistics::Algorithm::FindSampleBound(constSample, constSample->Begin(), constSample->End(), lower, upper)); - constexpr float epsilon = 1e-5; + constexpr float epsilon{ 1e-5 }; for (unsigned int j = 0; j < measurementVectorSize; ++j) { diff --git a/Modules/Numerics/Statistics/test/itkStatisticsAlgorithmTest2.cxx b/Modules/Numerics/Statistics/test/itkStatisticsAlgorithmTest2.cxx index 703e13b3fc7..2bb15cb5c43 100644 --- a/Modules/Numerics/Statistics/test/itkStatisticsAlgorithmTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkStatisticsAlgorithmTest2.cxx @@ -29,7 +29,7 @@ using ImageType = itk::Image; using SampleType = itk::Statistics::ImageToListSampleAdaptor; using SubsampleType = itk::Statistics::Subsample; -constexpr unsigned int testDimension = 1; +constexpr unsigned int testDimension{ 1 }; void resetData(itk::Image::Pointer image, std::vector & refVector) diff --git a/Modules/Numerics/Statistics/test/itkSubsampleTest.cxx b/Modules/Numerics/Statistics/test/itkSubsampleTest.cxx index d53363facdc..daed856ed27 100644 --- a/Modules/Numerics/Statistics/test/itkSubsampleTest.cxx +++ b/Modules/Numerics/Statistics/test/itkSubsampleTest.cxx @@ -39,8 +39,8 @@ itkSubsampleTest(int, char *[]) const itk::SizeValueType totalSize = size[0] * size[1] * size[2]; source->SetSize(size); - constexpr float minValue = -100.0; - constexpr float maxValue = 1000.0; + constexpr float minValue{ -100.0 }; + constexpr float maxValue{ 1000.0 }; source->SetMin(static_cast(minValue)); source->SetMax(static_cast(maxValue)); diff --git a/Modules/Numerics/Statistics/test/itkSubsampleTest2.cxx b/Modules/Numerics/Statistics/test/itkSubsampleTest2.cxx index b9bca761f9f..e87e7fffc59 100644 --- a/Modules/Numerics/Statistics/test/itkSubsampleTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkSubsampleTest2.cxx @@ -28,10 +28,10 @@ itkSubsampleTest2(int, char *[]) using SampleType = itk::Statistics::ListSample; - constexpr SampleType::MeasurementVectorSizeType measurementVectorSize = 3; + constexpr SampleType::MeasurementVectorSizeType measurementVectorSize{ 3 }; std::cerr << "Measurement vector size: " << measurementVectorSize << std::endl; - constexpr unsigned int sampleSize = 10; + constexpr unsigned int sampleSize{ 10 }; auto sample = SampleType::New(); @@ -218,7 +218,7 @@ itkSubsampleTest2(int, char *[]) } IteratorType iter6(subSample2); - constexpr unsigned int targetEntry = 2; + constexpr unsigned int targetEntry{ 2 }; for (unsigned int kk = 0; kk < targetEntry; ++kk) { std::cout << "GetInstanceIdentifier() = " << iter6.GetInstanceIdentifier() << std::endl; @@ -287,7 +287,7 @@ itkSubsampleTest2(int, char *[]) ConstIteratorType iter9(subSample2); - constexpr unsigned int targetEntry = 2; + constexpr unsigned int targetEntry{ 2 }; for (unsigned int kk = 0; kk < targetEntry; ++kk) { std::cout << "Instance identifier = " << iter9.GetInstanceIdentifier() << std::endl; diff --git a/Modules/Numerics/Statistics/test/itkSubsampleTest3.cxx b/Modules/Numerics/Statistics/test/itkSubsampleTest3.cxx index 0d50e3b6151..e627bc62ce3 100644 --- a/Modules/Numerics/Statistics/test/itkSubsampleTest3.cxx +++ b/Modules/Numerics/Statistics/test/itkSubsampleTest3.cxx @@ -25,8 +25,8 @@ itkSubsampleTest3(int, char *[]) { std::cout << "MeanSampleFilter test \n \n"; - constexpr unsigned int MeasurementVectorSize = 2; - constexpr unsigned int numberOfMeasurementVectors = 5; + constexpr unsigned int MeasurementVectorSize{ 2 }; + constexpr unsigned int numberOfMeasurementVectors{ 5 }; using MeasurementVectorType = itk::FixedArray; using SampleType = itk::Statistics::ListSample; @@ -84,7 +84,7 @@ itkSubsampleTest3(int, char *[]) std::cout << meanOutput[0] << ' ' << mean[0] << ' ' << meanOutput[1] << ' ' << mean[1] << ' ' << std::endl; - constexpr FilterType::MeasurementVectorType::ValueType epsilon = 1e-6; + constexpr FilterType::MeasurementVectorType::ValueType epsilon{ 1e-6 }; if ((itk::Math::abs(meanOutput[0] - mean[0]) > epsilon) || (itk::Math::abs(meanOutput[1] - mean[1]) > epsilon)) { diff --git a/Modules/Numerics/Statistics/test/itkTDistributionTest.cxx b/Modules/Numerics/Statistics/test/itkTDistributionTest.cxx index 9ac717d090a..ac775a74949 100644 --- a/Modules/Numerics/Statistics/test/itkTDistributionTest.cxx +++ b/Modules/Numerics/Statistics/test/itkTDistributionTest.cxx @@ -43,10 +43,10 @@ itkTDistributionTest(int, char *[]) // expected values for Student-t cdf with 1 degree of freedom at // values of -5:1:5 - constexpr double expected1[] = { 6.283295818900114e-002, 7.797913037736926e-002, 1.024163823495667e-001, - 1.475836176504333e-001, 2.500000000000000e-001, 5.000000000000000e-001, - 7.500000000000000e-001, 8.524163823495667e-001, 8.975836176504333e-001, - 9.220208696226308e-001, 9.371670418109989e-001 }; + constexpr double expected1[]{ 6.283295818900114e-002, 7.797913037736926e-002, 1.024163823495667e-001, + 1.475836176504333e-001, 2.500000000000000e-001, 5.000000000000000e-001, + 7.500000000000000e-001, 8.524163823495667e-001, 8.975836176504333e-001, + 9.220208696226308e-001, 9.371670418109989e-001 }; std::cout << "Testing distribution with 1 degree of freedom" << std::endl; @@ -130,10 +130,10 @@ itkTDistributionTest(int, char *[]) // expected values for Student-t cdf with 11 degrees of freedom at // values of -5:1:5 - constexpr double expected11[] = { 2.012649090622596e-004, 1.043096783487477e-003, 6.039919735960683e-003, - 3.540197753401686e-002, 1.694003480981013e-001, 5.000000000000000e-001, - 8.305996519018988e-001, 9.645980224659831e-001, 9.939600802640394e-001, - 9.989569032165125e-001, 9.997987350909378e-001 }; + constexpr double expected11[]{ 2.012649090622596e-004, 1.043096783487477e-003, 6.039919735960683e-003, + 3.540197753401686e-002, 1.694003480981013e-001, 5.000000000000000e-001, + 8.305996519018988e-001, 9.645980224659831e-001, 9.939600802640394e-001, + 9.989569032165125e-001, 9.997987350909378e-001 }; std::cout << "-----------------------------------------------" << std::endl << std::endl; std::cout << "Testing distribution with 11 degrees of freedom" << std::endl; @@ -383,7 +383,7 @@ itkTDistributionTest(int, char *[]) parameters[0] = 5.0; distributionFunction->SetParameters(parameters); - constexpr unsigned long dof = 5; + constexpr unsigned long dof{ 5 }; std::cout << "Variance() = " << distributionFunction->GetVariance() << std::endl; std::cout << "PDF(x,p) = " << distributionFunction->PDF(x, parameters) << std::endl; @@ -448,7 +448,7 @@ itkTDistributionTest(int, char *[]) std::cout << "Exercise negative argument " << std::endl; std::cout << "InverseCDF(x,p) = " << distributionFunction->InverseCDF(-1.0, dof) << std::endl; - constexpr unsigned long newdof = 17; + constexpr unsigned long newdof{ 17 }; distributionFunction->SetDegreesOfFreedom(newdof); ITK_TEST_SET_GET_VALUE(newdof, distributionFunction->GetDegreesOfFreedom()); diff --git a/Modules/Numerics/Statistics/test/itkUniformRandomSpatialNeighborSubsamplerTest.cxx b/Modules/Numerics/Statistics/test/itkUniformRandomSpatialNeighborSubsamplerTest.cxx index 1859293b03f..ed0ee1a7608 100644 --- a/Modules/Numerics/Statistics/test/itkUniformRandomSpatialNeighborSubsamplerTest.cxx +++ b/Modules/Numerics/Statistics/test/itkUniformRandomSpatialNeighborSubsamplerTest.cxx @@ -38,7 +38,7 @@ itkUniformRandomSpatialNeighborSubsamplerTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using FloatImage = itk::Image; using RegionType = FloatImage::RegionType; diff --git a/Modules/Numerics/Statistics/test/itkVectorContainerToListSampleAdaptorTest.cxx b/Modules/Numerics/Statistics/test/itkVectorContainerToListSampleAdaptorTest.cxx index 6a8c7200ac4..29398c097a3 100644 --- a/Modules/Numerics/Statistics/test/itkVectorContainerToListSampleAdaptorTest.cxx +++ b/Modules/Numerics/Statistics/test/itkVectorContainerToListSampleAdaptorTest.cxx @@ -44,7 +44,7 @@ itkVectorContainerToListSampleAdaptorTest(int, char *[]) ITK_TRY_EXPECT_EXCEPTION(adaptor->GetTotalFrequency()); // Set the vector container - constexpr unsigned int containerSize = 3; + constexpr unsigned int containerSize{ 3 }; auto container = ContainerType::New(); container->Reserve(containerSize); for (unsigned int i = 0; i < container->Size(); ++i) diff --git a/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest1.cxx b/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest1.cxx index 759ca3be760..e964cf1566b 100644 --- a/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest1.cxx +++ b/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest1.cxx @@ -42,7 +42,7 @@ itkWeightedCentroidKdTreeGeneratorTest1(int argc, char * argv[]) using MeasurementVectorType = itk::Array; using SampleType = itk::Statistics::ListSample; - constexpr SampleType::MeasurementVectorSizeType measurementVectorSize = 2; + constexpr SampleType::MeasurementVectorSizeType measurementVectorSize{ 2 }; auto sample = SampleType::New(); sample->SetMeasurementVectorSize(measurementVectorSize); @@ -77,7 +77,7 @@ itkWeightedCentroidKdTreeGeneratorTest1(int argc, char * argv[]) MeasurementVectorType queryPoint(measurementVectorSize); MeasurementVectorType origin(measurementVectorSize); - constexpr unsigned int numberOfNeighbors = 1; + constexpr unsigned int numberOfNeighbors{ 1 }; TreeType::InstanceIdentifierVectorType neighbors; MeasurementVectorType result(measurementVectorSize); diff --git a/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest8.cxx b/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest8.cxx index 53f3013e466..b8dd86dccc9 100644 --- a/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest8.cxx +++ b/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest8.cxx @@ -40,7 +40,7 @@ itkWeightedCentroidKdTreeGeneratorTest8(int argc, char * argv[]) const NumberGeneratorType::Pointer randomNumberGenerator = NumberGeneratorType::GetInstance(); randomNumberGenerator->SetSeed(); - constexpr unsigned int measurementVectorSize = 2; + constexpr unsigned int measurementVectorSize{ 2 }; using MeasurementVectorType = itk::FixedArray; @@ -77,7 +77,7 @@ itkWeightedCentroidKdTreeGeneratorTest8(int argc, char * argv[]) MeasurementVectorType queryPoint; - constexpr unsigned int numberOfNeighbors = 1; + constexpr unsigned int numberOfNeighbors{ 1 }; TreeType::InstanceIdentifierVectorType neighbors; MeasurementVectorType result; diff --git a/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest9.cxx b/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest9.cxx index 22c47564b0c..af4c9e79b66 100644 --- a/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest9.cxx +++ b/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest9.cxx @@ -44,7 +44,7 @@ itkWeightedCentroidKdTreeGeneratorTest9(int argc, char * argv[]) using MeasurementVectorType = itk::VariableLengthVector; using SampleType = itk::Statistics::ListSample; - constexpr SampleType::MeasurementVectorSizeType measurementVectorSize = 2; + constexpr SampleType::MeasurementVectorSizeType measurementVectorSize{ 2 }; auto sample = SampleType::New(); sample->SetMeasurementVectorSize(measurementVectorSize); @@ -78,7 +78,7 @@ itkWeightedCentroidKdTreeGeneratorTest9(int argc, char * argv[]) MeasurementVectorType queryPoint(measurementVectorSize); - constexpr unsigned int numberOfNeighbors = 1; + constexpr unsigned int numberOfNeighbors{ 1 }; TreeType::InstanceIdentifierVectorType neighbors; MeasurementVectorType result(measurementVectorSize); diff --git a/Modules/Numerics/Statistics/test/itkWeightedCovarianceSampleFilterTest.cxx b/Modules/Numerics/Statistics/test/itkWeightedCovarianceSampleFilterTest.cxx index a3f5a0f1269..a4eee2b2b70 100644 --- a/Modules/Numerics/Statistics/test/itkWeightedCovarianceSampleFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkWeightedCovarianceSampleFilterTest.cxx @@ -19,7 +19,7 @@ #include "itkWeightedCovarianceSampleFilter.h" #include "itkListSample.h" -constexpr unsigned int MeasurementVectorSize = 3; +constexpr unsigned int MeasurementVectorSize{ 3 }; using MeasurementVectorType = itk::FixedArray; @@ -45,7 +45,7 @@ class MyWeightedCovarianceSampleFilter : public WeightedCovarianceSampleFilter::SetLength(meanExpected33, MeasurementVectorSize); diff --git a/Modules/Numerics/Statistics/test/itkWeightedCovarianceSampleFilterTest2.cxx b/Modules/Numerics/Statistics/test/itkWeightedCovarianceSampleFilterTest2.cxx index 7dcb9bd751e..af08ded54b1 100644 --- a/Modules/Numerics/Statistics/test/itkWeightedCovarianceSampleFilterTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkWeightedCovarianceSampleFilterTest2.cxx @@ -19,7 +19,7 @@ #include "itkWeightedCovarianceSampleFilter.h" #include "itkListSample.h" -constexpr unsigned int MeasurementVectorSize2 = 3; +constexpr unsigned int MeasurementVectorSize2{ 3 }; using MeasurementVectorType2 = itk::Array; @@ -45,7 +45,7 @@ class MyWeightedCovarianceSampleFilter : public WeightedCovarianceSampleFilter; @@ -72,7 +72,7 @@ itkWeightedMeanSampleFilterTest(int, char *[]) { std::cout << "WeightedMeanSampleFilter test \n \n"; - constexpr unsigned int numberOfMeasurementVectors = 5; + constexpr unsigned int numberOfMeasurementVectors{ 5 }; using SampleType = itk::Statistics::ListSample; @@ -142,7 +142,7 @@ itkWeightedMeanSampleFilterTest(int, char *[]) mean[0] = 2.0; mean[1] = 2.0; - constexpr FilterType::MeasurementVectorType::ValueType epsilon = 1e-6; + constexpr FilterType::MeasurementVectorType::ValueType epsilon{ 1e-6 }; if ((itk::Math::abs(meanOutput[0] - mean[0]) > epsilon) || (itk::Math::abs(meanOutput[1] - mean[1]) > epsilon)) { diff --git a/Modules/Registration/Common/include/itkMattesMutualInformationImageToImageMetric.hxx b/Modules/Registration/Common/include/itkMattesMutualInformationImageToImageMetric.hxx index 0ccf98f335c..7d0bda3acab 100644 --- a/Modules/Registration/Common/include/itkMattesMutualInformationImageToImageMetric.hxx +++ b/Modules/Registration/Common/include/itkMattesMutualInformationImageToImageMetric.hxx @@ -186,7 +186,7 @@ MattesMutualInformationImageToImageMetric::Initialize * window. * */ - constexpr int padding = 2; // this will pad by 2 bins + constexpr int padding{ 2 }; // this will pad by 2 bins this->m_FixedImageBinSize = (this->m_FixedImageTrueMax - this->m_FixedImageTrueMin) / static_cast(this->m_NumberOfHistogramBins - 2 * padding); diff --git a/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration10.cxx b/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration10.cxx index 5145935f6a7..fa74bcc28b1 100644 --- a/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration10.cxx +++ b/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration10.cxx @@ -33,7 +33,7 @@ #include "itkCastImageFilter.h" #include "itkLinearInterpolateImageFunction.h" -constexpr unsigned int Dimension = 3; +constexpr unsigned int Dimension{ 3 }; // The following section of code implements a Command observer // that will monitor the evolution of the registration process. diff --git a/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration12.cxx b/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration12.cxx index 2ea6e16db18..f355789c7b1 100644 --- a/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration12.cxx +++ b/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration12.cxx @@ -122,7 +122,7 @@ main(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; using FixedImageType = itk::Image; @@ -138,8 +138,8 @@ main(int argc, char * argv[]) // \index{BSplineTransform!Instantiation} // - constexpr unsigned int SpaceDimension = ImageDimension; - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int SpaceDimension{ ImageDimension }; + constexpr unsigned int SplineOrder{ 3 }; using CoordinateRepType = double; using TransformType = itk::BSplineTransform; @@ -195,7 +195,7 @@ main(int argc, char * argv[]) registration->SetFixedImageRegion(fixedRegion); - constexpr unsigned int numberOfGridNodesInOneDimension = 7; + constexpr unsigned int numberOfGridNodesInOneDimension{ 7 }; TransformType::PhysicalDimensionsType fixedPhysicalDimensions; TransformType::MeshSizeType meshSize; diff --git a/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration4.cxx b/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration4.cxx index 72c646280ce..5a01a05bd70 100644 --- a/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration4.cxx +++ b/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration4.cxx @@ -85,7 +85,7 @@ main(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = float; using FixedImageType = itk::Image; @@ -101,8 +101,8 @@ main(int argc, char * argv[]) // \index{BSplineTransform!Instantiation} // - constexpr unsigned int SpaceDimension = ImageDimension; - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int SpaceDimension{ ImageDimension }; + constexpr unsigned int SplineOrder{ 3 }; using CoordinateRepType = double; using TransformType = itk::BSplineTransform; @@ -162,7 +162,7 @@ main(int argc, char * argv[]) TransformType::MeshSizeType meshSize; TransformType::OriginType fixedOrigin; - constexpr unsigned int numberOfGridNodesInOneDimension = 8; + constexpr unsigned int numberOfGridNodesInOneDimension{ 8 }; for (unsigned int i = 0; i < SpaceDimension; ++i) { diff --git a/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration6.cxx b/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration6.cxx index 75897ac2140..b8d7d04bdf4 100644 --- a/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration6.cxx +++ b/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration6.cxx @@ -76,7 +76,7 @@ main(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = float; using FixedImageType = itk::Image; @@ -92,8 +92,8 @@ main(int argc, char * argv[]) // \index{BSplineTransform!Instantiation} // - constexpr unsigned int SpaceDimension = ImageDimension; - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int SpaceDimension{ ImageDimension }; + constexpr unsigned int SplineOrder{ 3 }; using CoordinateRepType = double; using TransformType = itk::BSplineTransform; diff --git a/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration7.cxx b/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration7.cxx index d06b7eaf922..54108e8c8fa 100644 --- a/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration7.cxx +++ b/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration7.cxx @@ -123,7 +123,7 @@ main(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using PixelType = float; using FixedImageType = itk::Image; @@ -139,8 +139,8 @@ main(int argc, char * argv[]) // \index{BSplineTransform!Instantiation} // - constexpr unsigned int SpaceDimension = ImageDimension; - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int SpaceDimension{ ImageDimension }; + constexpr unsigned int SplineOrder{ 3 }; using CoordinateRepType = double; using TransformType = itk::BSplineTransform; @@ -195,7 +195,7 @@ main(int argc, char * argv[]) registration->SetFixedImageRegion(fixedRegion); - constexpr unsigned int numberOfGridNodes = 8; + constexpr unsigned int numberOfGridNodes{ 8 }; TransformType::PhysicalDimensionsType fixedPhysicalDimensions; TransformType::MeshSizeType meshSize; diff --git a/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration8.cxx b/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration8.cxx index b886aed39f6..bb202f45c24 100644 --- a/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration8.cxx +++ b/Modules/Registration/Common/test/RegistrationITKv3/DeformableRegistration8.cxx @@ -123,7 +123,7 @@ main(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using PixelType = short; using FixedImageType = itk::Image; @@ -139,8 +139,8 @@ main(int argc, char * argv[]) // \index{BSplineTransform!Instantiation} // - constexpr unsigned int SpaceDimension = ImageDimension; - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int SpaceDimension{ ImageDimension }; + constexpr unsigned int SplineOrder{ 3 }; using CoordinateRepType = double; using TransformType = itk::BSplineTransform; diff --git a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration1.cxx b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration1.cxx index 51b78bfc713..4335b3f2acb 100644 --- a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration1.cxx +++ b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration1.cxx @@ -115,7 +115,7 @@ main(int argc, char * argv[]) // dimension and the types to be used for representing image pixels. // - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; diff --git a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration11.cxx b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration11.cxx index c8b82df0284..278fbf1f37d 100644 --- a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration11.cxx +++ b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration11.cxx @@ -110,7 +110,7 @@ main(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned short; using FixedImageType = itk::Image; diff --git a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration12.cxx b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration12.cxx index 72fda730491..b4e18c3c157 100644 --- a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration12.cxx +++ b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration12.cxx @@ -102,7 +102,7 @@ main(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using FixedImageType = itk::Image; diff --git a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration13.cxx b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration13.cxx index 73c9a34d8bd..729d2d9e2fe 100644 --- a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration13.cxx +++ b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration13.cxx @@ -96,7 +96,7 @@ main(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using FixedImageType = itk::Image; @@ -205,9 +205,9 @@ main(int argc, char * argv[]) using OptimizerScalesType = OptimizerType::ScalesType; OptimizerScalesType optimizerScales(transform->GetNumberOfParameters()); - constexpr double translationScale = 1.0 / 128.0; - constexpr double centerScale = 1000.0; // prevents it from moving - // during the optimization + constexpr double translationScale{ 1.0 / 128.0 }; + constexpr double centerScale{ 1000.0 }; // prevents it from moving + // during the optimization optimizerScales[0] = 1.0; optimizerScales[1] = centerScale; optimizerScales[2] = centerScale; diff --git a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration14.cxx b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration14.cxx index 3d8f2e850b3..efb83ff9091 100644 --- a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration14.cxx +++ b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration14.cxx @@ -104,7 +104,7 @@ main(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using FixedImageType = itk::Image; diff --git a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration3.cxx b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration3.cxx index adb32974572..4b5839b1ccd 100644 --- a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration3.cxx +++ b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration3.cxx @@ -233,7 +233,7 @@ main(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned short; using FixedImageType = itk::Image; diff --git a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration4.cxx b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration4.cxx index a882d87f287..d3e2ce60bbb 100644 --- a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration4.cxx +++ b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration4.cxx @@ -119,7 +119,7 @@ main(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned short; using FixedImageType = itk::Image; diff --git a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration5.cxx b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration5.cxx index 31e94f7a8d1..2f966dee8f4 100644 --- a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration5.cxx +++ b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration5.cxx @@ -120,7 +120,7 @@ main(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using FixedImageType = itk::Image; @@ -276,7 +276,7 @@ main(int argc, char * argv[]) using OptimizerScalesType = OptimizerType::ScalesType; OptimizerScalesType optimizerScales(transform->GetNumberOfParameters()); - constexpr double translationScale = 1.0 / 1000.0; + constexpr double translationScale{ 1.0 / 1000.0 }; optimizerScales[0] = 1.0; optimizerScales[1] = translationScale; diff --git a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration6.cxx b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration6.cxx index 33106a91cb2..dab6c757522 100644 --- a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration6.cxx +++ b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration6.cxx @@ -142,7 +142,7 @@ main(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using FixedImageType = itk::Image; @@ -274,7 +274,7 @@ main(int argc, char * argv[]) using OptimizerScalesType = OptimizerType::ScalesType; OptimizerScalesType optimizerScales(transform->GetNumberOfParameters()); - constexpr double translationScale = 1.0 / 1000.0; + constexpr double translationScale{ 1.0 / 1000.0 }; optimizerScales[0] = 1.0; optimizerScales[1] = translationScale; diff --git a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration7.cxx b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration7.cxx index 82101f61912..5cfed6bcd7a 100644 --- a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration7.cxx +++ b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration7.cxx @@ -133,7 +133,7 @@ main(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using FixedImageType = itk::Image; @@ -266,7 +266,7 @@ main(int argc, char * argv[]) using OptimizerScalesType = OptimizerType::ScalesType; OptimizerScalesType optimizerScales(transform->GetNumberOfParameters()); - constexpr double translationScale = 1.0 / 100.0; + constexpr double translationScale{ 1.0 / 100.0 }; optimizerScales[0] = 10.0; optimizerScales[1] = 1.0; diff --git a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration8.cxx b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration8.cxx index e73e136fdff..685e1bb2840 100644 --- a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration8.cxx +++ b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration8.cxx @@ -137,7 +137,7 @@ main(int argc, char * argv[]) std::cerr << " [sliceAfterRegistration] " << std::endl; return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = float; using FixedImageType = itk::Image; using MovingImageType = itk::Image; @@ -246,7 +246,7 @@ main(int argc, char * argv[]) axis[0] = 0.0; axis[1] = 0.0; axis[2] = 1.0; - constexpr double angle = 0; + constexpr double angle{ 0 }; rotation.Set(axis, angle); transform->SetRotation(rotation); @@ -257,7 +257,7 @@ main(int argc, char * argv[]) registration->SetInitialTransformParameters(transform->GetParameters()); using OptimizerScalesType = OptimizerType::ScalesType; OptimizerScalesType optimizerScales(transform->GetNumberOfParameters()); - constexpr double translationScale = 1.0 / 1000.0; + constexpr double translationScale{ 1.0 / 1000.0 }; optimizerScales[0] = 1.0; optimizerScales[1] = 1.0; optimizerScales[2] = 1.0; diff --git a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration9.cxx b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration9.cxx index 7042b77e3ea..08d40baac01 100644 --- a/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration9.cxx +++ b/Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration9.cxx @@ -134,7 +134,7 @@ main(int argc, char * argv[]) // We then define the types of the images to be registered. // - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using FixedImageType = itk::Image; diff --git a/Modules/Registration/Common/test/RegistrationITKv3/MeanSquaresImageMetric1.cxx b/Modules/Registration/Common/test/RegistrationITKv3/MeanSquaresImageMetric1.cxx index 89ecdd3dc68..e59b38ca36d 100644 --- a/Modules/Registration/Common/test/RegistrationITKv3/MeanSquaresImageMetric1.cxx +++ b/Modules/Registration/Common/test/RegistrationITKv3/MeanSquaresImageMetric1.cxx @@ -61,7 +61,7 @@ main(int argc, char * argv[]) // evaluation of the Metric. // - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; @@ -152,8 +152,8 @@ main(int argc, char * argv[]) MetricType::TransformParametersType displacement(Dimension); - constexpr int rangex = 50; - constexpr int rangey = 50; + constexpr int rangex{ 50 }; + constexpr int rangey{ 50 }; for (int dx = -rangex; dx <= rangex; ++dx) { diff --git a/Modules/Registration/Common/test/RegistrationITKv3/MultiResImageRegistration1.cxx b/Modules/Registration/Common/test/RegistrationITKv3/MultiResImageRegistration1.cxx index 7f612dfb135..a97d53197a9 100644 --- a/Modules/Registration/Common/test/RegistrationITKv3/MultiResImageRegistration1.cxx +++ b/Modules/Registration/Common/test/RegistrationITKv3/MultiResImageRegistration1.cxx @@ -260,7 +260,7 @@ main(int argc, const char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned short; const std::string fixedImageFile = argv[1]; diff --git a/Modules/Registration/Common/test/itkBSplineExponentialDiffeomorphicTransformParametersAdaptorTest.cxx b/Modules/Registration/Common/test/itkBSplineExponentialDiffeomorphicTransformParametersAdaptorTest.cxx index 18bd5de1704..e9e4dbc948d 100644 --- a/Modules/Registration/Common/test/itkBSplineExponentialDiffeomorphicTransformParametersAdaptorTest.cxx +++ b/Modules/Registration/Common/test/itkBSplineExponentialDiffeomorphicTransformParametersAdaptorTest.cxx @@ -22,7 +22,7 @@ int itkBSplineExponentialDiffeomorphicTransformParametersAdaptorTest(int, char *[]) { - constexpr unsigned int SpaceDimension = 3; + constexpr unsigned int SpaceDimension{ 3 }; using CoordinateRepType = double; using TransformType = itk::BSplineExponentialDiffeomorphicTransform; diff --git a/Modules/Registration/Common/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx b/Modules/Registration/Common/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx index aac2ef7afad..2d9de838730 100644 --- a/Modules/Registration/Common/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx +++ b/Modules/Registration/Common/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx @@ -23,7 +23,7 @@ int itkBSplineSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest(int, char *[]) { - constexpr unsigned int SpaceDimension = 3; + constexpr unsigned int SpaceDimension{ 3 }; using CoordinateRepType = double; using TransformType = itk::BSplineSmoothingOnUpdateDisplacementFieldTransform; diff --git a/Modules/Registration/Common/test/itkBSplineTransformParametersAdaptorTest.cxx b/Modules/Registration/Common/test/itkBSplineTransformParametersAdaptorTest.cxx index a777d7ca330..6ec93c70245 100644 --- a/Modules/Registration/Common/test/itkBSplineTransformParametersAdaptorTest.cxx +++ b/Modules/Registration/Common/test/itkBSplineTransformParametersAdaptorTest.cxx @@ -22,8 +22,8 @@ int itkBSplineTransformParametersAdaptorTest(int, char *[]) { - constexpr unsigned int SpaceDimension = 3; - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int SpaceDimension{ 3 }; + constexpr unsigned int SplineOrder{ 3 }; using CoordinateRepType = double; using TransformType = itk::BSplineTransform; diff --git a/Modules/Registration/Common/test/itkBlockMatchingImageFilterTest.cxx b/Modules/Registration/Common/test/itkBlockMatchingImageFilterTest.cxx index f27fe6035ed..9c3e2e23928 100644 --- a/Modules/Registration/Common/test/itkBlockMatchingImageFilterTest.cxx +++ b/Modules/Registration/Common/test/itkBlockMatchingImageFilterTest.cxx @@ -46,7 +46,7 @@ itkBlockMatchingImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr double selectFraction = 0.01; + constexpr double selectFraction{ 0.01 }; using InputPixelType = unsigned char; using OutputPixelType = itk::RGBPixel; diff --git a/Modules/Registration/Common/test/itkCenteredTransformInitializerTest.cxx b/Modules/Registration/Common/test/itkCenteredTransformInitializerTest.cxx index 705dbb74288..e012f2aef70 100644 --- a/Modules/Registration/Common/test/itkCenteredTransformInitializerTest.cxx +++ b/Modules/Registration/Common/test/itkCenteredTransformInitializerTest.cxx @@ -23,7 +23,7 @@ namespace { -constexpr unsigned int Dimension = 3; +constexpr unsigned int Dimension{ 3 }; // This function assumes that the center of mass of both images is the // geometrical center. @@ -91,7 +91,7 @@ RunTest(itk::SmartPointer fixedImage, itk::SmartPointerGetCenter(); const TransformType::OutputVectorType & translation1 = transform->GetTranslation(); const TransformType::OffsetType & offset1 = transform->GetOffset(); - constexpr double tolerance = 1e-3; + constexpr double tolerance{ 1e-3 }; // Verifications for the Geometry Mode for (unsigned int k = 0; k < Dimension; ++k) @@ -184,7 +184,7 @@ PopulateImage(itk::SmartPointer image) const IndexType & index = region.GetIndex(); - constexpr unsigned int border = 20; + constexpr unsigned int border{ 20 }; assert(2 * border < size[0]); assert(2 * border < size[1]); diff --git a/Modules/Registration/Common/test/itkCenteredVersorTransformInitializerTest.cxx b/Modules/Registration/Common/test/itkCenteredVersorTransformInitializerTest.cxx index 1aa7342c216..e63e03b8fc3 100644 --- a/Modules/Registration/Common/test/itkCenteredVersorTransformInitializerTest.cxx +++ b/Modules/Registration/Common/test/itkCenteredVersorTransformInitializerTest.cxx @@ -34,7 +34,7 @@ itkCenteredVersorTransformInitializerTest(int, char *[]) bool pass = true; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Fixed Image Type using FixedImageType = itk::Image; @@ -158,7 +158,7 @@ itkCenteredVersorTransformInitializerTest(int, char *[]) TransformType::InputVectorType relativeCenter = movingCenter - fixedCenter; - constexpr double tolerance = 1e-3; + constexpr double tolerance{ 1e-3 }; for (unsigned int k = 0; k < Dimension; ++k) { diff --git a/Modules/Registration/Common/test/itkCompareHistogramImageToImageMetricTest.cxx b/Modules/Registration/Common/test/itkCompareHistogramImageToImageMetricTest.cxx index 29d0d39a98e..90defadd850 100644 --- a/Modules/Registration/Common/test/itkCompareHistogramImageToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkCompareHistogramImageToImageMetricTest.cxx @@ -30,7 +30,7 @@ itkCompareHistogramImageToImageMetricTest(int, char *[]) { // Create two simple images. - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = double; using CoordinateRepresentationType = double; @@ -49,8 +49,8 @@ itkCompareHistogramImageToImageMetricTest(int, char *[]) FixedImageType::SpacingValueType fixedImageSpacing[] = { 1.0f, 1.0f }; MovingImageType::SpacingValueType movingImageSpacing[] = { 1.0f, 1.0f }; - constexpr FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; - constexpr MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; + constexpr FixedImageType::PointValueType fixedImageOrigin[]{ 0.0f, 0.0f }; + constexpr MovingImageType::PointValueType movingImageOrigin[]{ 0.0f, 0.0f }; auto movingImageSource = MovingImageSourceType::New(); auto fixedImageSource = FixedImageSourceType::New(); @@ -89,7 +89,7 @@ itkCompareHistogramImageToImageMetricTest(int, char *[]) metric->SetEpsilon(epsilon); ITK_TEST_SET_GET_VALUE(epsilon, metric->GetEpsilon()); - constexpr unsigned int nBins = 256; + constexpr unsigned int nBins{ 256 }; MetricType::HistogramType::SizeType histSize; histSize.SetSize(2); diff --git a/Modules/Registration/Common/test/itkCorrelationCoefficientHistogramImageToImageMetricTest.cxx b/Modules/Registration/Common/test/itkCorrelationCoefficientHistogramImageToImageMetricTest.cxx index d707967a56b..2bfdc0257aa 100644 --- a/Modules/Registration/Common/test/itkCorrelationCoefficientHistogramImageToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkCorrelationCoefficientHistogramImageToImageMetricTest.cxx @@ -30,7 +30,7 @@ itkCorrelationCoefficientHistogramImageToImageMetricTest(int, char *[]) try { // Create two simple images. - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = double; using CoordinateRepresentationType = double; @@ -49,8 +49,8 @@ itkCorrelationCoefficientHistogramImageToImageMetricTest(int, char *[]) FixedImageType::SpacingValueType fixedImageSpacing[] = { 1.0f, 1.0f }; MovingImageType::SpacingValueType movingImageSpacing[] = { 1.0f, 1.0f }; - constexpr FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; - constexpr MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; + constexpr FixedImageType::PointValueType fixedImageOrigin[]{ 0.0f, 0.0f }; + constexpr MovingImageType::PointValueType movingImageOrigin[]{ 0.0f, 0.0f }; auto movingImageSource = MovingImageSourceType::New(); auto fixedImageSource = FixedImageSourceType::New(); @@ -81,7 +81,7 @@ itkCorrelationCoefficientHistogramImageToImageMetricTest(int, char *[]) auto metric = MetricType::New(); - constexpr unsigned int nBins = 256; + constexpr unsigned int nBins{ 256 }; MetricType::HistogramType::SizeType histSize; histSize.SetSize(2); histSize[0] = nBins; diff --git a/Modules/Registration/Common/test/itkDisplacementFieldTransformParametersAdaptorTest.cxx b/Modules/Registration/Common/test/itkDisplacementFieldTransformParametersAdaptorTest.cxx index 0bdc0504ee9..e0712400457 100644 --- a/Modules/Registration/Common/test/itkDisplacementFieldTransformParametersAdaptorTest.cxx +++ b/Modules/Registration/Common/test/itkDisplacementFieldTransformParametersAdaptorTest.cxx @@ -22,7 +22,7 @@ int itkDisplacementFieldTransformParametersAdaptorTest(int, char *[]) { - constexpr unsigned int SpaceDimension = 3; + constexpr unsigned int SpaceDimension{ 3 }; using CoordinateRepType = double; using TransformType = itk::DisplacementFieldTransform; diff --git a/Modules/Registration/Common/test/itkEuclideanDistancePointMetricTest.cxx b/Modules/Registration/Common/test/itkEuclideanDistancePointMetricTest.cxx index cfbebec02fb..5e4f74534ca 100644 --- a/Modules/Registration/Common/test/itkEuclideanDistancePointMetricTest.cxx +++ b/Modules/Registration/Common/test/itkEuclideanDistancePointMetricTest.cxx @@ -83,9 +83,9 @@ itkEuclideanDistancePointMetricTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using ScalarType = double; - constexpr double Epsilon = 10e-6; + constexpr double Epsilon{ 10e-6 }; using MeshType = itk::Mesh; using QuadEdgeMeshType = itk::QuadEdgeMesh; diff --git a/Modules/Registration/Common/test/itkGaussianExponentialDiffeomorphicTransformParametersAdaptorTest.cxx b/Modules/Registration/Common/test/itkGaussianExponentialDiffeomorphicTransformParametersAdaptorTest.cxx index dbcffc9a84f..a84bcbf067c 100644 --- a/Modules/Registration/Common/test/itkGaussianExponentialDiffeomorphicTransformParametersAdaptorTest.cxx +++ b/Modules/Registration/Common/test/itkGaussianExponentialDiffeomorphicTransformParametersAdaptorTest.cxx @@ -23,7 +23,7 @@ int itkGaussianExponentialDiffeomorphicTransformParametersAdaptorTest(int, char *[]) { - constexpr unsigned int SpaceDimension = 3; + constexpr unsigned int SpaceDimension{ 3 }; using CoordinateRepType = double; using TransformType = itk::GaussianExponentialDiffeomorphicTransform; @@ -98,8 +98,8 @@ itkGaussianExponentialDiffeomorphicTransformParametersAdaptorTest(int, char *[]) adaptor->SetRequiredOrigin(displacementField->GetOrigin()); adaptor->SetRequiredDirection(displacementField->GetDirection()); - constexpr float updateSmoothingVariance = 3.0; - constexpr float velocitySmoothingVariance = 0; + constexpr float updateSmoothingVariance{ 3.0 }; + constexpr float velocitySmoothingVariance{ 0 }; adaptor->SetGaussianSmoothingVarianceForTheUpdateField(updateSmoothingVariance); adaptor->SetGaussianSmoothingVarianceForTheConstantVelocityField(velocitySmoothingVariance); diff --git a/Modules/Registration/Common/test/itkGaussianSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx b/Modules/Registration/Common/test/itkGaussianSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx index ffd96dad00f..9f00d34742f 100644 --- a/Modules/Registration/Common/test/itkGaussianSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx +++ b/Modules/Registration/Common/test/itkGaussianSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx @@ -23,7 +23,7 @@ int itkGaussianSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest(int, char *[]) { - constexpr unsigned int SpaceDimension = 3; + constexpr unsigned int SpaceDimension{ 3 }; using CoordinateRepType = double; using TransformType = itk::GaussianSmoothingOnUpdateDisplacementFieldTransform; diff --git a/Modules/Registration/Common/test/itkGradientDifferenceImageToImageMetricTest.cxx b/Modules/Registration/Common/test/itkGradientDifferenceImageToImageMetricTest.cxx index b25cc119e5d..e0d29a773ce 100644 --- a/Modules/Registration/Common/test/itkGradientDifferenceImageToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkGradientDifferenceImageToImageMetricTest.cxx @@ -26,7 +26,7 @@ int itkGradientDifferenceImageToImageMetricTest(int, char *[]) { // Create two simple images. - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = double; using CoordinateRepresentationType = double; @@ -45,8 +45,8 @@ itkGradientDifferenceImageToImageMetricTest(int, char *[]) FixedImageType::SpacingValueType fixedImageSpacing[] = { 1.0f, 1.0f }; MovingImageType::SpacingValueType movingImageSpacing[] = { 1.0f, 1.0f }; - constexpr FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; - constexpr MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; + constexpr FixedImageType::PointValueType fixedImageOrigin[]{ 0.0f, 0.0f }; + constexpr MovingImageType::PointValueType movingImageOrigin[]{ 0.0f, 0.0f }; auto movingImageSource = MovingImageSourceType::New(); auto fixedImageSource = FixedImageSourceType::New(); @@ -81,7 +81,7 @@ itkGradientDifferenceImageToImageMetricTest(int, char *[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(metric, GradientDifferenceImageToImageMetric, ImageToImageMetric); - constexpr double derivativeDelta = 0.001; + constexpr double derivativeDelta{ 0.001 }; metric->SetDerivativeDelta(derivativeDelta); ITK_TEST_SET_GET_VALUE(derivativeDelta, metric->GetDerivativeDelta()); diff --git a/Modules/Registration/Common/test/itkHistogramImageToImageMetricTest.cxx b/Modules/Registration/Common/test/itkHistogramImageToImageMetricTest.cxx index fb1f82eef97..1b47fdb0043 100644 --- a/Modules/Registration/Common/test/itkHistogramImageToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkHistogramImageToImageMetricTest.cxx @@ -26,7 +26,7 @@ int itkHistogramImageToImageMetricTest(int, char *[]) { // Create two simple images. - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = double; using CoordinateRepresentationType = double; @@ -45,8 +45,8 @@ itkHistogramImageToImageMetricTest(int, char *[]) FixedImageType::SpacingValueType fixedImageSpacing[] = { 1.0f, 1.0f }; MovingImageType::SpacingValueType movingImageSpacing[] = { 1.0f, 1.0f }; - constexpr FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; - constexpr MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; + constexpr FixedImageType::PointValueType fixedImageOrigin[]{ 0.0f, 0.0f }; + constexpr MovingImageType::PointValueType movingImageOrigin[]{ 0.0f, 0.0f }; auto movingImageSource = MovingImageSourceType::New(); auto fixedImageSource = FixedImageSourceType::New(); @@ -78,7 +78,7 @@ itkHistogramImageToImageMetricTest(int, char *[]) auto metric = MetricType::New(); - constexpr unsigned int nBins = 256; + constexpr unsigned int nBins{ 256 }; MetricType::HistogramType::SizeType histSize; histSize.SetSize(2); histSize[0] = nBins; @@ -121,7 +121,7 @@ itkHistogramImageToImageMetricTest(int, char *[]) scales[k] = 1; } - constexpr double STEP_LENGTH = 0.001; + constexpr double STEP_LENGTH{ 0.001 }; metric->SetDerivativeStepLength(STEP_LENGTH); metric->SetDerivativeStepLengthScales(scales); diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest.cxx index 018098d0c09..b40c6e42cdf 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest.cxx @@ -36,7 +36,7 @@ itkImageRegistrationMethodTest(int, char *[]) itk::OutputWindow::SetInstance(itk::TextOutput::New().GetPointer()); - constexpr unsigned int dimension = 3; + constexpr unsigned int dimension{ 3 }; // Fixed Image Type using FixedImageType = itk::Image; diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_1.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_1.cxx index 47690889611..22b60e82a4e 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_1.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_1.cxx @@ -36,7 +36,7 @@ itkImageRegistrationMethodTest_1(int argc, char * argv[]) bool pass = true; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; // Fixed Image Type @@ -171,7 +171,7 @@ itkImageRegistrationMethodTest_1(int argc, char * argv[]) // the end of the list of parameters. const unsigned int offsetOrder = finalParameters.Size() - actualParameters.Size(); - constexpr double tolerance = 1.0; // equivalent to 1 pixel. + constexpr double tolerance{ 1.0 }; // equivalent to 1 pixel. for (unsigned int i = 0; i < numbeOfParameters; ++i) { diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_10.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_10.cxx index 9a1382ddd7f..3498409fee1 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_10.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_10.cxx @@ -35,7 +35,7 @@ itkImageRegistrationMethodTest_10(int argc, char * argv[]) bool pass = true; - constexpr unsigned int dimension = 2; + constexpr unsigned int dimension{ 2 }; // Fixed Image Type using FixedImageType = itk::Image; @@ -179,7 +179,7 @@ itkImageRegistrationMethodTest_10(int argc, char * argv[]) // We know that for the Affine transform the Translation parameters are at // the end of the list of parameters. const unsigned int offsetOrder = finalParameters.Size() - actualParameters.Size(); - constexpr double tolerance = 1.0; // equivalent to 1 pixel. + constexpr double tolerance{ 1.0 }; // equivalent to 1 pixel. for (unsigned int i = 0; i < numbeOfParameters; ++i) { diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_11.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_11.cxx index c96bcf8427c..7f2e56f9ed6 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_11.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_11.cxx @@ -33,7 +33,7 @@ int itkImageRegistrationMethodTest_11(int, char *[]) { - constexpr unsigned int dimension = 3; + constexpr unsigned int dimension{ 3 }; // Fixed Image Type using FixedImageType = itk::Image; diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_12.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_12.cxx index 37920859ab8..0c61c2337ce 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_12.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_12.cxx @@ -36,7 +36,7 @@ itkImageRegistrationMethodTest_12(int argc, char * argv[]) bool pass = true; - constexpr unsigned int dimension = 2; + constexpr unsigned int dimension{ 2 }; // Fixed Image Type using FixedImageType = itk::Image; @@ -178,7 +178,7 @@ itkImageRegistrationMethodTest_12(int argc, char * argv[]) const unsigned int numbeOfParameters = actualParameters.Size(); - constexpr double tolerance = 1.0; // equivalent to 1 pixel. + constexpr double tolerance{ 1.0 }; // equivalent to 1 pixel. for (unsigned int i = 0; i < numbeOfParameters; ++i) { diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_13.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_13.cxx index 2eee73fff57..487021578e4 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_13.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_13.cxx @@ -98,7 +98,7 @@ itkImageRegistrationMethodTest_13(int, char *[]) bool pass = true; - constexpr unsigned int dimension = 3; + constexpr unsigned int dimension{ 3 }; using PixelType = float; @@ -136,11 +136,11 @@ itkImageRegistrationMethodTest_13(int, char *[]) * Set up the two input images. * One image scaled and shifted with respect to the other. **********************************************************/ - constexpr double displacement[dimension] = { 7, 3, 2 }; - constexpr double scale[dimension] = { 0.80, 1.0, 1.0 }; + constexpr double displacement[dimension]{ 7, 3, 2 }; + constexpr double scale[dimension]{ 0.80, 1.0, 1.0 }; FixedImageType::SizeType size = { { 100, 100, 40 } }; - constexpr FixedImageType::IndexType index = { { 0, 0, 0 } }; + constexpr FixedImageType::IndexType index{ 0, 0, 0 }; const FixedImageType::RegionType region{ index, size }; fixedImage->SetRegions(region); @@ -251,8 +251,8 @@ itkImageRegistrationMethodTest_13(int, char *[]) /*********************************************************** * Run the registration - reducing learning rate as we go ************************************************************/ - constexpr unsigned int numberOfLoops = 3; - constexpr unsigned int iter[numberOfLoops] = { 300, 300, 350 }; + constexpr unsigned int numberOfLoops{ 3 }; + constexpr unsigned int iter[numberOfLoops]{ 300, 300, 350 }; constexpr double rates[numberOfLoops] = { 1e-3, 5e-4, 1e-4 }; for (unsigned int j = 0; j < numberOfLoops; ++j) @@ -391,7 +391,7 @@ F(itk::Vector & v) double x = v[0]; double y = v[1]; double z = v[2]; - constexpr double s = 50; + constexpr double s{ 50 }; double value = 200.0 * std::exp(-(x * x + y * y + z * z) / (s * s)); x -= 8; y += 3; diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_14.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_14.cxx index 48eb9411edb..95aebc3e99d 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_14.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_14.cxx @@ -105,7 +105,7 @@ itkImageRegistrationMethodTest_14(int, char *[]) bool pass = true; - constexpr unsigned int dimension = 3; + constexpr unsigned int dimension{ 3 }; using PixelType = float; @@ -143,11 +143,11 @@ itkImageRegistrationMethodTest_14(int, char *[]) * Set up the two input images. * One image rotated (xy plane) and shifted with respect to the other. **********************************************************/ - constexpr double displacement[dimension] = { 7, 3, 2 }; - constexpr double angle = 10.0 / 180.0 * itk::Math::pi; + constexpr double displacement[dimension]{ 7, 3, 2 }; + constexpr double angle{ 10.0 / 180.0 * itk::Math::pi }; FixedImageType::SizeType size = { { 100, 100, 40 } }; - constexpr FixedImageType::IndexType index = { { 0, 0, 0 } }; + constexpr FixedImageType::IndexType index{ 0, 0, 0 }; const FixedImageType::RegionType region{ index, size }; fixedImage->SetRegions(region); @@ -261,8 +261,8 @@ itkImageRegistrationMethodTest_14(int, char *[]) /*********************************************************** * Run the registration - reducing learning rate as we go ************************************************************/ - constexpr unsigned int numberOfLoops = 3; - constexpr unsigned int iter[numberOfLoops] = { 300, 300, 350 }; + constexpr unsigned int numberOfLoops{ 3 }; + constexpr unsigned int iter[numberOfLoops]{ 300, 300, 350 }; constexpr double rates[numberOfLoops] = { 1e-3, 5e-4, 1e-4 }; for (unsigned int j = 0; j < numberOfLoops; ++j) @@ -400,7 +400,7 @@ F(itk::Vector & v) double x = v[0]; double y = v[1]; double z = v[2]; - constexpr double s = 50; + constexpr double s{ 50 }; double value = 200.0 * std::exp(-(x * x + y * y + z * z) / (s * s)); x -= 8; y += 3; diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_15.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_15.cxx index 22c46a71d59..c562550ce59 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_15.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_15.cxx @@ -82,7 +82,7 @@ itkImageRegistrationMethodTest_15(int, char *[]) bool pass = true; - constexpr unsigned int dimension = 3; + constexpr unsigned int dimension{ 3 }; using PixelType = float; @@ -120,8 +120,8 @@ itkImageRegistrationMethodTest_15(int, char *[]) * Set up the two input images. * One image scaled and shifted with respect to the other. **********************************************************/ - constexpr double displacement[dimension] = { 3, 1, 1 }; - constexpr double scale[dimension] = { 0.90, 1.0, 1.0 }; + constexpr double displacement[dimension]{ 3, 1, 1 }; + constexpr double scale[dimension]{ 0.90, 1.0, 1.0 }; FixedImageType::SizeType size = { { 100, 100, 40 } }; FixedImageType::IndexType index = { { 0, 0, 0 } }; @@ -249,8 +249,8 @@ itkImageRegistrationMethodTest_15(int, char *[]) /*********************************************************** * Run the registration ************************************************************/ - constexpr unsigned int numberOfLoops = 2; - constexpr unsigned int iter[numberOfLoops] = { 50, 0 }; + constexpr unsigned int numberOfLoops{ 2 }; + constexpr unsigned int iter[numberOfLoops]{ 50, 0 }; constexpr double rates[numberOfLoops] = { 1e-3, 5e-4 }; @@ -334,7 +334,7 @@ F(itk::Vector & v) double x = v[0]; double y = v[1]; double z = v[2]; - constexpr double s = 50; + constexpr double s{ 50 }; double value = 200.0 * std::exp(-(x * x + y * y + z * z) / (s * s)); x -= 8; y += 3; diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_16.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_16.cxx index 0f198410c66..83ea4532583 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_16.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_16.cxx @@ -37,7 +37,7 @@ DoRegistration() bool pass = true; - constexpr unsigned int dimension = 2; + constexpr unsigned int dimension{ 2 }; // Fixed Image Type using FixedImageType = itk::Image; @@ -118,9 +118,9 @@ DoRegistration() scales.Fill(1.0); - constexpr unsigned long numberOfIterations = 100; - constexpr double translationScale = 1e-6; - constexpr double learningRate = 1e-8; + constexpr unsigned long numberOfIterations{ 100 }; + constexpr double translationScale{ 1e-6 }; + constexpr double learningRate{ 1e-8 }; for (unsigned int i = 0; i < dimension; ++i) { @@ -157,7 +157,7 @@ DoRegistration() // We know that for the Affine transform the Translation parameters are at // the end of the list of parameters. const unsigned int offsetOrder = finalParameters.Size() - actualParameters.Size(); - constexpr double tolerance = 1.0; // equivalent to 1 pixel. + constexpr double tolerance{ 1.0 }; // equivalent to 1 pixel. for (unsigned int i = 0; i < numbeOfParameters; ++i) { diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_17.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_17.cxx index 00da0c4de36..b4b4b833122 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_17.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_17.cxx @@ -88,7 +88,7 @@ itkImageRegistrationMethodTest_17(int, char *[]) bool pass = true; - constexpr unsigned int dimension = 3; + constexpr unsigned int dimension{ 3 }; using PixelType = float; @@ -126,8 +126,8 @@ itkImageRegistrationMethodTest_17(int, char *[]) * Set up the two input images. * One image scaled and shifted with respect to the other. **********************************************************/ - constexpr double displacement[dimension] = { 3, 1, 1 }; - constexpr double scale[dimension] = { 0.90, 1.0, 1.0 }; + constexpr double displacement[dimension]{ 3, 1, 1 }; + constexpr double scale[dimension]{ 0.90, 1.0, 1.0 }; FixedImageType::SizeType size = { { 100, 100, 40 } }; FixedImageType::IndexType index = { { 0, 0, 0 } }; @@ -257,8 +257,8 @@ itkImageRegistrationMethodTest_17(int, char *[]) /*********************************************************** * Run the registration ************************************************************/ - constexpr unsigned int numberOfLoops = 2; - constexpr unsigned int iter[numberOfLoops] = { 50, 0 }; + constexpr unsigned int numberOfLoops{ 2 }; + constexpr unsigned int iter[numberOfLoops]{ 50, 0 }; constexpr double rates[numberOfLoops] = { 1e-3, 5e-4 }; @@ -342,7 +342,7 @@ F(itk::Vector & v) double x = v[0]; double y = v[1]; double z = v[2]; - constexpr double s = 50; + constexpr double s{ 50 }; double value = 200.0 * std::exp(-(x * x + y * y + z * z) / (s * s)); x -= 8; y += 3; diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_2.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_2.cxx index 33f3f724465..b0cd25fd20c 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_2.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_2.cxx @@ -35,7 +35,7 @@ itkImageRegistrationMethodTest_2(int argc, char * argv[]) bool pass = true; - constexpr unsigned int dimension = 2; + constexpr unsigned int dimension{ 2 }; // Fixed Image Type using FixedImageType = itk::Image; @@ -179,7 +179,7 @@ itkImageRegistrationMethodTest_2(int argc, char * argv[]) // We know that for the Affine transform the Translation parameters are at // the end of the list of parameters. const unsigned int offsetOrder = finalParameters.Size() - actualParameters.Size(); - constexpr double tolerance = 1.0; // equivalent to 1 pixel. + constexpr double tolerance{ 1.0 }; // equivalent to 1 pixel. for (unsigned int i = 0; i < numbeOfParameters; ++i) { diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_3.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_3.cxx index 6e350cd09a8..9c123ebdfd8 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_3.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_3.cxx @@ -36,7 +36,7 @@ itkImageRegistrationMethodTest_3(int argc, char * argv[]) bool pass = true; - constexpr unsigned int dimension = 2; + constexpr unsigned int dimension{ 2 }; // Fixed Image Type using FixedImageType = itk::Image; @@ -167,7 +167,7 @@ itkImageRegistrationMethodTest_3(int argc, char * argv[]) const unsigned int numbeOfParameters = actualParameters.Size(); - constexpr double tolerance = 1.0; // equivalent to 1 pixel. + constexpr double tolerance{ 1.0 }; // equivalent to 1 pixel. for (unsigned int i = 0; i < numbeOfParameters; ++i) { diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_4.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_4.cxx index 06581504ea1..e20dbbe8eab 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_4.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_4.cxx @@ -36,7 +36,7 @@ itkImageRegistrationMethodTest_4(int argc, char * argv[]) bool pass = true; - constexpr unsigned int dimension = 2; + constexpr unsigned int dimension{ 2 }; // Fixed Image Type using FixedImageType = itk::Image; @@ -178,7 +178,7 @@ itkImageRegistrationMethodTest_4(int argc, char * argv[]) const unsigned int numbeOfParameters = actualParameters.Size(); - constexpr double tolerance = 1.0; // equivalent to 1 pixel. + constexpr double tolerance{ 1.0 }; // equivalent to 1 pixel. for (unsigned int i = 0; i < numbeOfParameters; ++i) { diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_5.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_5.cxx index 9a21eac8f0d..e0249148397 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_5.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_5.cxx @@ -35,7 +35,7 @@ itkImageRegistrationMethodTest_5_Func(int argc, char * argv[], bool subtractMean bool pass = true; - constexpr unsigned int dimension = 2; + constexpr unsigned int dimension{ 2 }; // Fixed Image Type using FixedImageType = itk::Image; @@ -175,7 +175,7 @@ itkImageRegistrationMethodTest_5_Func(int argc, char * argv[], bool subtractMean // We know that for the Affine transform the Translation parameters are at // the end of the list of parameters. const unsigned int offsetOrder = finalParameters.Size() - actualParameters.Size(); - constexpr double tolerance = 1.0; // equivalent to 1 pixel. + constexpr double tolerance{ 1.0 }; // equivalent to 1 pixel. for (unsigned int i = 0; i < numbeOfParameters; ++i) { diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_6.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_6.cxx index 99750c47fda..0bebe5930bf 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_6.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_6.cxx @@ -35,7 +35,7 @@ itkImageRegistrationMethodTest_6(int argc, char * argv[]) bool pass = true; - constexpr unsigned int dimension = 2; + constexpr unsigned int dimension{ 2 }; // Fixed Image Type using FixedImageType = itk::Image; @@ -178,7 +178,7 @@ itkImageRegistrationMethodTest_6(int argc, char * argv[]) // We know that for the Affine transform the Translation parameters are at // the end of the list of parameters. const unsigned int offsetOrder = finalParameters.Size() - actualParameters.Size(); - constexpr double tolerance = 1.0; // equivalent to 1 pixel. + constexpr double tolerance{ 1.0 }; // equivalent to 1 pixel. for (unsigned int i = 0; i < numbeOfParameters; ++i) { diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_7.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_7.cxx index 15d5a2c5188..f00a49ba3a6 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_7.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_7.cxx @@ -36,7 +36,7 @@ itkImageRegistrationMethodTest_7(int argc, char * argv[]) bool pass = true; - constexpr unsigned int dimension = 2; + constexpr unsigned int dimension{ 2 }; // Fixed Image Type using FixedImageType = itk::Image; @@ -163,7 +163,7 @@ itkImageRegistrationMethodTest_7(int argc, char * argv[]) const unsigned int numbeOfParameters = actualParameters.Size(); - constexpr double tolerance = 1.0; // equivalent to 1 pixel. + constexpr double tolerance{ 1.0 }; // equivalent to 1 pixel. for (unsigned int i = 0; i < numbeOfParameters; ++i) { diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_8.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_8.cxx index dc426efac27..ad0ea67343a 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_8.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_8.cxx @@ -36,7 +36,7 @@ itkImageRegistrationMethodTest_8(int argc, char * argv[]) bool pass = true; - constexpr unsigned int dimension = 2; + constexpr unsigned int dimension{ 2 }; // Fixed Image Type using FixedImageType = itk::Image; @@ -177,7 +177,7 @@ itkImageRegistrationMethodTest_8(int argc, char * argv[]) const unsigned int numbeOfParameters = actualParameters.Size(); - constexpr double tolerance = 1.0; // equivalent to 1 pixel. + constexpr double tolerance{ 1.0 }; // equivalent to 1 pixel. for (unsigned int i = 0; i < numbeOfParameters; ++i) { diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_9.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_9.cxx index 72c8159321b..b71f3b3a1ad 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_9.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_9.cxx @@ -37,7 +37,7 @@ itkImageRegistrationMethodTest_9(int argc, char * argv[]) bool pass = true; - constexpr unsigned int dimension = 2; + constexpr unsigned int dimension{ 2 }; // Fixed Image Type using FixedImageType = itk::Image; @@ -150,11 +150,11 @@ itkImageRegistrationMethodTest_9(int argc, char * argv[]) // because the vnl_optimizer is instantiated there. vnl_conjugate_gradient * vnlOptimizer = optimizer->GetOptimizer(); - constexpr double F_Tolerance = 1e-3; // Function value tolerance - constexpr double G_Tolerance = 1e-4; // Gradient magnitude tolerance - constexpr double X_Tolerance = 1e-8; // Search space tolerance - constexpr double Epsilon_Function = 1e-10; // Step - constexpr int Max_Iterations = 100; // Maximum number of iterations + constexpr double F_Tolerance{ 1e-3 }; // Function value tolerance + constexpr double G_Tolerance{ 1e-4 }; // Gradient magnitude tolerance + constexpr double X_Tolerance{ 1e-8 }; // Search space tolerance + constexpr double Epsilon_Function{ 1e-10 }; // Step + constexpr int Max_Iterations{ 100 }; // Maximum number of iterations vnlOptimizer->set_f_tolerance(F_Tolerance); vnlOptimizer->set_g_tolerance(G_Tolerance); @@ -182,7 +182,7 @@ itkImageRegistrationMethodTest_9(int argc, char * argv[]) const unsigned int numbeOfParameters = actualParameters.Size(); - constexpr double tolerance = 1.0; // equivalent to 1 pixel. + constexpr double tolerance{ 1.0 }; // equivalent to 1 pixel. for (unsigned int i = 0; i < numbeOfParameters; ++i) { diff --git a/Modules/Registration/Common/test/itkImageToSpatialObjectRegistrationTest.cxx b/Modules/Registration/Common/test/itkImageToSpatialObjectRegistrationTest.cxx index 97100664151..3e0ba205d14 100644 --- a/Modules/Registration/Common/test/itkImageToSpatialObjectRegistrationTest.cxx +++ b/Modules/Registration/Common/test/itkImageToSpatialObjectRegistrationTest.cxx @@ -263,7 +263,7 @@ itkImageToSpatialObjectRegistrationTest(int, char *[]) auto gaussianFilter = GaussianFilterType::New(); gaussianFilter->SetInput(image); - constexpr double variance = 20; + constexpr double variance{ 20 }; gaussianFilter->SetVariance(variance); gaussianFilter->Update(); image = gaussianFilter->GetOutput(); diff --git a/Modules/Registration/Common/test/itkKappaStatisticImageToImageMetricTest.cxx b/Modules/Registration/Common/test/itkKappaStatisticImageToImageMetricTest.cxx index e78b2565c81..3a3772ff8a6 100644 --- a/Modules/Registration/Common/test/itkKappaStatisticImageToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkKappaStatisticImageToImageMetricTest.cxx @@ -34,7 +34,7 @@ int itkKappaStatisticImageToImageMetricTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using FixedImagePixelType = unsigned char; using MovingImagePixelType = unsigned char; @@ -56,7 +56,7 @@ itkKappaStatisticImageToImageMetricTest(int, char *[]) using InterpolatorType = itk::NearestNeighborInterpolateImageFunction; - constexpr double epsilon = 0.000001; + constexpr double epsilon{ 0.000001 }; auto transform = TransformType::New(); auto interpolator = InterpolatorType::New(); @@ -101,7 +101,7 @@ itkKappaStatisticImageToImageMetricTest(int, char *[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(metric, KappaStatisticImageToImageMetric, ImageToImageMetric); - constexpr MetricType::RealType foregroundValue = 255; + constexpr MetricType::RealType foregroundValue{ 255 }; metric->SetForegroundValue(foregroundValue); ITK_TEST_SET_GET_VALUE(foregroundValue, metric->GetForegroundValue()); @@ -230,7 +230,7 @@ itkKappaStatisticImageToImageMetricTest(int, char *[]) metric->GetDerivative(parameters, derivative); // The value 0.0477502 was computed by hand - constexpr double expectedDerivativeMeasure = -0.0477502; + constexpr double expectedDerivativeMeasure{ -0.0477502 }; for (unsigned int i = 0; i < derivative.size(); ++i) { if (!itk::Math::FloatAlmostEqual(static_cast(derivative[i]), expectedDerivativeMeasure, 10, epsilon)) diff --git a/Modules/Registration/Common/test/itkKullbackLeiblerCompareHistogramImageToImageMetricTest.cxx b/Modules/Registration/Common/test/itkKullbackLeiblerCompareHistogramImageToImageMetricTest.cxx index 7de2094a4ca..230a96b3617 100644 --- a/Modules/Registration/Common/test/itkKullbackLeiblerCompareHistogramImageToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkKullbackLeiblerCompareHistogramImageToImageMetricTest.cxx @@ -52,8 +52,8 @@ itkKullbackLeiblerCompareHistogramImageToImageMetricTest(int, char *[]) ImageDimension = MovingImageType::ImageDimension }; - constexpr MovingImageType::SizeType size = { { 16, 16 } }; - constexpr MovingImageType::IndexType index = { { 0, 0 } }; + constexpr MovingImageType::SizeType size{ 16, 16 }; + constexpr MovingImageType::IndexType index{ 0, 0 }; const MovingImageType::RegionType region{ index, size }; auto imgMoving = MovingImageType::New(); @@ -83,8 +83,8 @@ itkKullbackLeiblerCompareHistogramImageToImageMetricTest(int, char *[]) center[1] = static_cast(region.GetSize()[1]) / 2.0; const double s = static_cast(region.GetSize()[0]) / 2.0; - constexpr double mag = 200.0; - constexpr double noisemag = 0.0; // ended up yielding best results + constexpr double mag{ 200.0 }; + constexpr double noisemag{ 0.0 }; // ended up yielding best results itk::Point p; itk::Vector d; @@ -196,7 +196,7 @@ itkKullbackLeiblerCompareHistogramImageToImageMetricTest(int, char *[]) // set the number of samples to use // metric->SetNumberOfSpatialSamples( 100 ); - constexpr unsigned int nBins = 64; + constexpr unsigned int nBins{ 64 }; MetricType::HistogramType::SizeType histSize; histSize.SetSize(2); histSize[0] = nBins; diff --git a/Modules/Registration/Common/test/itkLandmarkBasedTransformInitializerTest.cxx b/Modules/Registration/Common/test/itkLandmarkBasedTransformInitializerTest.cxx index 8502edc92d4..8bb05b94554 100644 --- a/Modules/Registration/Common/test/itkLandmarkBasedTransformInitializerTest.cxx +++ b/Modules/Registration/Common/test/itkLandmarkBasedTransformInitializerTest.cxx @@ -202,7 +202,7 @@ test1(int scaleFactor) std::cout << "Testing Landmark alignment with " << transform->GetNameOfClass() << std::endl; using PixelType = unsigned char; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using FixedImageType = itk::Image; using MovingImageType = itk::Image; @@ -241,7 +241,7 @@ itkLandmarkBasedTransformInitializerTest(int, char *[]) { // Test landmark alignment using Rigid 2D transform in 2 dimensions std::cout << "Testing Landmark alignment with Rigid2DTransform" << std::endl; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using FixedImageType = itk::Image; using MovingImageType = itk::Image; @@ -327,7 +327,7 @@ itkLandmarkBasedTransformInitializerTest(int, char *[]) } { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using ImageType = itk::Image; const ImageType::Pointer fixedImage = CreateTestImage(); const ImageType::Pointer movingImage = CreateTestImage(); @@ -344,7 +344,7 @@ itkLandmarkBasedTransformInitializerTest(int, char *[]) // Test that an exception is thrown if there aren't enough points ITK_TRY_EXPECT_EXCEPTION(initializer->InitializeTransform()); - constexpr unsigned int numLandmarks(8); + constexpr unsigned int numLandmarks{ 8 }; constexpr double fixedLandMarkInit[numLandmarks][3] = { { -1.33671, -279.739, 176.001 }, { 28.0989, -346.692, 183.367 }, @@ -366,11 +366,11 @@ itkLandmarkBasedTransformInitializerTest(int, char *[]) { -300, 100, 1000 } // dummy }; - constexpr double weights[numLandmarks] = { 10, 1, 10, 1, 1, 1, 0.001, 0.001 }; + constexpr double weights[numLandmarks]{ 10, 1, 10, 1, 1, 1, 0.001, 0.001 }; { // First Test with working Landmarks // These landmark should match properly - constexpr unsigned int numWorkingLandmark = 6; + constexpr unsigned int numWorkingLandmark{ 6 }; TransformInitializerType::LandmarkPointContainer fixedLandmarks; fixedLandmarks.reserve(numWorkingLandmark); TransformInitializerType::LandmarkPointContainer movingLandmarks; @@ -402,7 +402,7 @@ itkLandmarkBasedTransformInitializerTest(int, char *[]) { // Test with dummy points // dummy points should not matched based on given weights - constexpr unsigned int numDummyLandmark = 8; + constexpr unsigned int numDummyLandmark{ 8 }; TransformInitializerType::LandmarkPointContainer fixedLandmarks; fixedLandmarks.reserve(numDummyLandmark); TransformInitializerType::LandmarkPointContainer movingLandmarks; @@ -435,7 +435,7 @@ itkLandmarkBasedTransformInitializerTest(int, char *[]) { std::cout << "\nTesting Landmark alignment with BSplineTransform..." << std::endl; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using FixedImageType = itk::Image; using MovingImageType = itk::Image; @@ -446,7 +446,7 @@ itkLandmarkBasedTransformInitializerTest(int, char *[]) fixedImage->SetOrigin(origin); // Set the transform type - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int SplineOrder{ 3 }; using TransformType = itk::BSplineTransform; auto transform = TransformType::New(); @@ -460,8 +460,8 @@ itkLandmarkBasedTransformInitializerTest(int, char *[]) TransformInitializerType::LandmarkPointContainer movingLandmarks; Init3DPoints(fixedLandmarks, movingLandmarks, 1); - constexpr unsigned int numLandmarks = 4; - constexpr double weights[numLandmarks] = { 1, 3, 0.01, 0.5 }; + constexpr unsigned int numLandmarks{ 4 }; + constexpr double weights[numLandmarks]{ 1, 3, 0.01, 0.5 }; TransformInitializerType::LandmarkWeightType landmarkWeights; for (const double weight : weights) diff --git a/Modules/Registration/Common/test/itkMatchCardinalityImageToImageMetricTest.cxx b/Modules/Registration/Common/test/itkMatchCardinalityImageToImageMetricTest.cxx index c6b6aed04fb..c57e92f8352 100644 --- a/Modules/Registration/Common/test/itkMatchCardinalityImageToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkMatchCardinalityImageToImageMetricTest.cxx @@ -84,7 +84,7 @@ itkMatchCardinalityImageToImageMetricTest(int argc, char * argv[]) } std::cout << "Now measure mismatches..." << std::endl; - constexpr bool measureMatches = false; + constexpr bool measureMatches{ false }; ITK_TEST_SET_GET_BOOLEAN(metric, MeasureMatches, measureMatches); for (float x = -200.0; x <= 200.0; x += 50.0) diff --git a/Modules/Registration/Common/test/itkMattesMutualInformationImageToImageMetricTest.cxx b/Modules/Registration/Common/test/itkMattesMutualInformationImageToImageMetricTest.cxx index ee124884133..1955bdc32c0 100644 --- a/Modules/Registration/Common/test/itkMattesMutualInformationImageToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkMattesMutualInformationImageToImageMetricTest.cxx @@ -210,7 +210,7 @@ TestMattesMetricWithAffineTransform(TInterpolator * interpolator, metric->SetMovingImage(imgMoving); // set the number of histogram bins - constexpr itk::SizeValueType numberOfHistogramBins = 50; + constexpr itk::SizeValueType numberOfHistogramBins{ 50 }; metric->SetNumberOfHistogramBins(numberOfHistogramBins); ITK_TEST_SET_GET_VALUE(numberOfHistogramBins, metric->GetNumberOfHistogramBins()); @@ -359,7 +359,7 @@ TestMattesMetricWithAffineTransform(TInterpolator * interpolator, typename MetricType::MeasureType measurePlus; typename MetricType::MeasureType measureMinus; - constexpr double delta = 0.001; + constexpr double delta{ 0.001 }; bool testFailed = false; diff --git a/Modules/Registration/Common/test/itkMeanReciprocalSquareDifferenceImageMetricTest.cxx b/Modules/Registration/Common/test/itkMeanReciprocalSquareDifferenceImageMetricTest.cxx index 3c3313c3e2d..5eef3b5673a 100644 --- a/Modules/Registration/Common/test/itkMeanReciprocalSquareDifferenceImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkMeanReciprocalSquareDifferenceImageMetricTest.cxx @@ -46,7 +46,7 @@ itkMeanReciprocalSquareDifferenceImageMetricTest(int, char *[]) // Create two simple images //------------------------------------------------------------ - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; @@ -67,8 +67,8 @@ itkMeanReciprocalSquareDifferenceImageMetricTest(int, char *[]) FixedImageType::SpacingValueType fixedImageSpacing[] = { 1.0f, 1.0f }; MovingImageType::SpacingValueType movingImageSpacing[] = { 1.0f, 1.0f }; - constexpr FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; - constexpr MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; + constexpr FixedImageType::PointValueType fixedImageOrigin[]{ 0.0f, 0.0f }; + constexpr MovingImageType::PointValueType movingImageOrigin[]{ 0.0f, 0.0f }; auto movingImageSource = MovingImageSourceType::New(); auto fixedImageSource = FixedImageSourceType::New(); @@ -146,11 +146,11 @@ itkMeanReciprocalSquareDifferenceImageMetricTest(int, char *[]) // The lambda value is the intensity difference that should // make the metric drop by 50% //------------------------------------------------------------ - constexpr double lambda = 10.0; + constexpr double lambda{ 10.0 }; metric->SetLambda(lambda); ITK_TEST_SET_GET_VALUE(lambda, metric->GetLambda()); - constexpr double delta = 0.00011; + constexpr double delta{ 0.00011 }; metric->SetDelta(delta); ITK_TEST_SET_GET_VALUE(delta, metric->GetDelta()); diff --git a/Modules/Registration/Common/test/itkMeanReciprocalSquareDifferencePointSetToImageMetricTest.cxx b/Modules/Registration/Common/test/itkMeanReciprocalSquareDifferencePointSetToImageMetricTest.cxx index 14a11d66390..b714b8b8cd4 100644 --- a/Modules/Registration/Common/test/itkMeanReciprocalSquareDifferencePointSetToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkMeanReciprocalSquareDifferencePointSetToImageMetricTest.cxx @@ -47,7 +47,7 @@ itkMeanReciprocalSquareDifferencePointSetToImageMetricTest(int, char *[]) // Create two simple images //------------------------------------------------------------ - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = double; @@ -68,8 +68,8 @@ itkMeanReciprocalSquareDifferencePointSetToImageMetricTest(int, char *[]) FixedImageType::SpacingValueType fixedImageSpacing[] = { 1.0f, 1.0f }; MovingImageType::SpacingValueType movingImageSpacing[] = { 1.0f, 1.0f }; - constexpr FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; - constexpr MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; + constexpr FixedImageType::PointValueType fixedImageOrigin[]{ 0.0f, 0.0f }; + constexpr MovingImageType::PointValueType movingImageOrigin[]{ 0.0f, 0.0f }; auto movingImageSource = MovingImageSourceType::New(); auto fixedImageSource = FixedImageSourceType::New(); @@ -99,7 +99,7 @@ itkMeanReciprocalSquareDifferencePointSetToImageMetricTest(int, char *[]) using FixedPointSetType = itk::PointSet; auto fixedPointSet = FixedPointSetType::New(); - constexpr unsigned int numberOfPoints = 100; + constexpr unsigned int numberOfPoints{ 100 }; fixedPointSet->SetPointData(FixedPointSetType::PointDataContainer::New()); @@ -157,7 +157,7 @@ itkMeanReciprocalSquareDifferencePointSetToImageMetricTest(int, char *[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(metric, MeanReciprocalSquareDifferencePointSetToImageMetric, PointSetToImageMetric); - constexpr double lambda = 1.0; + constexpr double lambda{ 1.0 }; metric->SetLambda(lambda); ITK_TEST_SET_GET_VALUE(lambda, metric->GetLambda()); diff --git a/Modules/Registration/Common/test/itkMeanSquaresHistogramImageToImageMetricTest.cxx b/Modules/Registration/Common/test/itkMeanSquaresHistogramImageToImageMetricTest.cxx index 156d74e5a2d..6a1797946d8 100644 --- a/Modules/Registration/Common/test/itkMeanSquaresHistogramImageToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkMeanSquaresHistogramImageToImageMetricTest.cxx @@ -31,7 +31,7 @@ itkMeanSquaresHistogramImageToImageMetricTest(int, char *[]) try { // Create two simple images. - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = double; using CoordinateRepresentationType = double; @@ -50,8 +50,8 @@ itkMeanSquaresHistogramImageToImageMetricTest(int, char *[]) FixedImageType::SpacingValueType fixedImageSpacing[] = { 1.0f, 1.0f }; MovingImageType::SpacingValueType movingImageSpacing[] = { 1.0f, 1.0f }; - constexpr FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; - constexpr MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; + constexpr FixedImageType::PointValueType fixedImageOrigin[]{ 0.0f, 0.0f }; + constexpr MovingImageType::PointValueType movingImageOrigin[]{ 0.0f, 0.0f }; auto movingImageSource = MovingImageSourceType::New(); auto fixedImageSource = FixedImageSourceType::New(); @@ -82,7 +82,7 @@ itkMeanSquaresHistogramImageToImageMetricTest(int, char *[]) auto metric = MetricType::New(); - constexpr unsigned int nBins = 256; + constexpr unsigned int nBins{ 256 }; MetricType::HistogramType::SizeType histSize; histSize.SetSize(2); histSize[0] = nBins; diff --git a/Modules/Registration/Common/test/itkMeanSquaresImageMetricTest.cxx b/Modules/Registration/Common/test/itkMeanSquaresImageMetricTest.cxx index cc29702266a..3647321a455 100644 --- a/Modules/Registration/Common/test/itkMeanSquaresImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkMeanSquaresImageMetricTest.cxx @@ -50,7 +50,7 @@ itkMeanSquaresImageMetricTest(int, char *[]) // Create two simple images //------------------------------------------------------------ - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = double; @@ -71,8 +71,8 @@ itkMeanSquaresImageMetricTest(int, char *[]) FixedImageType::SpacingValueType fixedImageSpacing[] = { 1.0f, 1.0f }; MovingImageType::SpacingValueType movingImageSpacing[] = { 1.0f, 1.0f }; - constexpr FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; - constexpr MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; + constexpr FixedImageType::PointValueType fixedImageOrigin[]{ 0.0f, 0.0f }; + constexpr MovingImageType::PointValueType movingImageOrigin[]{ 0.0f, 0.0f }; auto movingImageSource = MovingImageSourceType::New(); auto fixedImageSource = FixedImageSourceType::New(); @@ -268,7 +268,7 @@ itkMeanSquaresImageMetricTest(int, char *[]) // used to verify the correctness of the metric under a particular // usage scenario. metric->SetNumberOfWorkUnits(8); - constexpr int numThreads = 2; + constexpr int numThreads{ 2 }; itk::MultiThreaderBase::SetGlobalMaximumNumberOfThreads(numThreads); metric->Initialize(); @@ -300,8 +300,8 @@ itkMeanSquaresImageMetricTest(int, char *[]) metric->Print(std::cout); // Check consistency between BSplineTransform derivatives computed with vs omitting weights caching. - constexpr unsigned int splineOrder = 3; - constexpr unsigned int nodesPerDimension = 8; + constexpr unsigned int splineOrder{ 3 }; + constexpr unsigned int nodesPerDimension{ 8 }; using BSplineTransformType = itk::BSplineTransform; using InitializerType = itk::BSplineTransformInitializer; using GeneratorType = itk::Statistics::MersenneTwisterRandomVariateGenerator; diff --git a/Modules/Registration/Common/test/itkMeanSquaresPointSetToImageMetricTest.cxx b/Modules/Registration/Common/test/itkMeanSquaresPointSetToImageMetricTest.cxx index 22c1f43b2fd..361ea0cacfb 100644 --- a/Modules/Registration/Common/test/itkMeanSquaresPointSetToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkMeanSquaresPointSetToImageMetricTest.cxx @@ -46,7 +46,7 @@ itkMeanSquaresPointSetToImageMetricTest(int, char *[]) // Create two simple images //------------------------------------------------------------ - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = double; @@ -67,8 +67,8 @@ itkMeanSquaresPointSetToImageMetricTest(int, char *[]) FixedImageType::SpacingValueType fixedImageSpacing[] = { 1.0f, 1.0f }; MovingImageType::SpacingValueType movingImageSpacing[] = { 1.0f, 1.0f }; - constexpr FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; - constexpr MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; + constexpr FixedImageType::PointValueType fixedImageOrigin[]{ 0.0f, 0.0f }; + constexpr MovingImageType::PointValueType movingImageOrigin[]{ 0.0f, 0.0f }; auto movingImageSource = MovingImageSourceType::New(); auto fixedImageSource = FixedImageSourceType::New(); @@ -98,7 +98,7 @@ itkMeanSquaresPointSetToImageMetricTest(int, char *[]) using FixedPointSetType = itk::PointSet; auto fixedPointSet = FixedPointSetType::New(); - constexpr unsigned int numberOfPoints = 100; + constexpr unsigned int numberOfPoints{ 100 }; fixedPointSet->SetPointData(FixedPointSetType::PointDataContainer::New()); diff --git a/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest.cxx b/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest.cxx index d5f2726ba23..267cda59bf8 100644 --- a/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest.cxx +++ b/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest.cxx @@ -38,7 +38,7 @@ itkMultiResolutionImageRegistrationMethodTest(int, char *[]) itk::OutputWindow::SetInstance(itk::TextOutput::New().GetPointer()); - constexpr unsigned int dimension = 3; + constexpr unsigned int dimension{ 3 }; // Fixed Image Type using FixedImageType = itk::Image; @@ -122,7 +122,7 @@ itkMultiResolutionImageRegistrationMethodTest(int, char *[]) registration->SetFixedImageRegion(fixedImage->GetBufferedRegion()); ITK_TEST_SET_GET_VALUE(fixedImage->GetBufferedRegion(), registration->GetFixedImageRegion()); - constexpr itk::SizeValueType numberOfLevels = 2; + constexpr itk::SizeValueType numberOfLevels{ 2 }; registration->SetNumberOfLevels(numberOfLevels); ITK_TEST_SET_GET_VALUE(numberOfLevels, registration->GetNumberOfLevels()); diff --git a/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest_1.cxx b/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest_1.cxx index 30960d66310..2408bd1dbf2 100644 --- a/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest_1.cxx +++ b/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest_1.cxx @@ -80,7 +80,7 @@ itkMultiResolutionImageRegistrationMethodTest_1(int, char *[]) bool pass = true; - constexpr unsigned int dimension = 3; + constexpr unsigned int dimension{ 3 }; using PixelType = float; @@ -118,11 +118,11 @@ itkMultiResolutionImageRegistrationMethodTest_1(int, char *[]) auto fixedImage = FixedImageType::New(); auto movingImage = MovingImageType::New(); - constexpr double displacement[dimension] = { 7, 3, 2 }; - constexpr double scale[dimension] = { 0.80, 1.0, 1.0 }; + constexpr double displacement[dimension]{ 7, 3, 2 }; + constexpr double scale[dimension]{ 0.80, 1.0, 1.0 }; FixedImageType::SizeType size = { { 100, 100, 40 } }; - constexpr FixedImageType::IndexType index = { { 0, 0, 0 } }; + constexpr FixedImageType::IndexType index{ 0, 0, 0 }; const FixedImageType::RegionType region{ index, size }; fixedImage->SetRegions(region); @@ -249,7 +249,7 @@ itkMultiResolutionImageRegistrationMethodTest_1(int, char *[]) ******************************************************************/ SimpleMultiResolutionImageRegistrationUI2 simpleUI(registration); - constexpr unsigned short numberOfLevels = 3; + constexpr unsigned short numberOfLevels{ 3 }; itk::Array niter(numberOfLevels); itk::Array rates(numberOfLevels); @@ -473,7 +473,7 @@ itkMultiResolutionImageRegistrationMethodTest_1(int, char *[]) ******************************************************************/ SimpleMultiResolutionImageRegistrationUI2 simpleUI(registration); - constexpr unsigned short numberOfLevels = 3; + constexpr unsigned short numberOfLevels{ 3 }; itk::Array niter(numberOfLevels); itk::Array rates(numberOfLevels); @@ -566,7 +566,7 @@ F(itk::Vector & v) double x = v[0]; double y = v[1]; double z = v[2]; - constexpr double s = 50; + constexpr double s{ 50 }; double value = 200.0 * std::exp(-(x * x + y * y + z * z) / (s * s)); x -= 8; y += 3; diff --git a/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest_2.cxx b/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest_2.cxx index 8ef798490b9..0285eb5e44e 100644 --- a/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest_2.cxx +++ b/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest_2.cxx @@ -69,7 +69,7 @@ itkMultiResolutionImageRegistrationMethodTest_2(int, char *[]) bool pass = true; - constexpr unsigned int dimension = 3; + constexpr unsigned int dimension{ 3 }; using PixelType = float; @@ -115,11 +115,11 @@ itkMultiResolutionImageRegistrationMethodTest_2(int, char *[]) * Set up the two input images. * One image rotated (xy plane) and shifted with respect to the other. **********************************************************/ - constexpr double displacement[dimension] = { 7, 3, 2 }; - constexpr double angle = 10.0 / 180.0 * itk::Math::pi; + constexpr double displacement[dimension]{ 7, 3, 2 }; + constexpr double angle{ 10.0 / 180.0 * itk::Math::pi }; FixedImageType::SizeType size = { { 100, 100, 40 } }; - constexpr FixedImageType::IndexType index = { { 0, 0, 0 } }; + constexpr FixedImageType::IndexType index{ 0, 0, 0 }; const FixedImageType::RegionType region{ index, size }; fixedImage->SetRegions(region); @@ -240,7 +240,7 @@ itkMultiResolutionImageRegistrationMethodTest_2(int, char *[]) ******************************************************************/ SimpleMultiResolutionImageRegistrationUI2 simpleUI(registration); - constexpr unsigned short numberOfLevels = 3; + constexpr unsigned short numberOfLevels{ 3 }; itk::Array niter(numberOfLevels); niter[0] = 300; @@ -381,7 +381,7 @@ F(itk::Vector & v) double x = v[0]; double y = v[1]; double z = v[2]; - constexpr double s = 50; + constexpr double s{ 50 }; double value = 200.0 * std::exp(-(x * x + y * y + z * z) / (s * s)); x -= 8; y += 3; diff --git a/Modules/Registration/Common/test/itkMultiResolutionPyramidImageFilterTest.cxx b/Modules/Registration/Common/test/itkMultiResolutionPyramidImageFilterTest.cxx index 6bc0eb336e9..49f46de9c5c 100644 --- a/Modules/Registration/Common/test/itkMultiResolutionPyramidImageFilterTest.cxx +++ b/Modules/Registration/Common/test/itkMultiResolutionPyramidImageFilterTest.cxx @@ -32,7 +32,7 @@ namespace double F(double x, double y, double z) { - constexpr double s = 50; + constexpr double s{ 50 }; double value = 200.0 * std::exp(-(x * x + y * y + z * z) / (s * s)); x -= 8; y += 3; @@ -336,7 +336,7 @@ itkMultiResolutionPyramidImageFilterTest(int argc, char * argv[]) // if( OutputCenterOfMass != InputCenterOfMass ) { const OutputImageType::PointType::VectorType ErrorCenterOfMass = OutputCenterOfMass - InputCenterOfMass; - constexpr double CenterOfMassEpsilonAllowed = 0.001; + constexpr double CenterOfMassEpsilonAllowed{ 0.001 }; const double ErrorPercentage = (ErrorCenterOfMass.GetNorm() / pyramid->GetOutput(testLevel)->GetSpacing().GetNorm()); if (ErrorPercentage > CenterOfMassEpsilonAllowed) diff --git a/Modules/Registration/Common/test/itkMutualInformationHistogramImageToImageMetricTest.cxx b/Modules/Registration/Common/test/itkMutualInformationHistogramImageToImageMetricTest.cxx index 262dbfd3aca..6c02f4ad3fb 100644 --- a/Modules/Registration/Common/test/itkMutualInformationHistogramImageToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkMutualInformationHistogramImageToImageMetricTest.cxx @@ -30,7 +30,7 @@ itkMutualInformationHistogramImageToImageMetricTest(int, char *[]) try { // Create two simple images. - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = double; using CoordinateRepresentationType = double; @@ -49,8 +49,8 @@ itkMutualInformationHistogramImageToImageMetricTest(int, char *[]) FixedImageType::SpacingValueType fixedImageSpacing[] = { 1.0f, 1.0f }; MovingImageType::SpacingValueType movingImageSpacing[] = { 1.0f, 1.0f }; - constexpr FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; - constexpr MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; + constexpr FixedImageType::PointValueType fixedImageOrigin[]{ 0.0f, 0.0f }; + constexpr MovingImageType::PointValueType movingImageOrigin[]{ 0.0f, 0.0f }; auto movingImageSource = MovingImageSourceType::New(); auto fixedImageSource = FixedImageSourceType::New(); @@ -81,7 +81,7 @@ itkMutualInformationHistogramImageToImageMetricTest(int, char *[]) auto metric = MetricType::New(); - constexpr unsigned int nBins = 256; + constexpr unsigned int nBins{ 256 }; MetricType::HistogramType::SizeType histSize; histSize.SetSize(2); histSize[0] = nBins; diff --git a/Modules/Registration/Common/test/itkMutualInformationMetricTest.cxx b/Modules/Registration/Common/test/itkMutualInformationMetricTest.cxx index ace98258573..8600f1868e5 100644 --- a/Modules/Registration/Common/test/itkMutualInformationMetricTest.cxx +++ b/Modules/Registration/Common/test/itkMutualInformationMetricTest.cxx @@ -48,8 +48,8 @@ itkMutualInformationMetricTest(int, char *[]) ImageDimension = MovingImageType::ImageDimension }; - constexpr MovingImageType::SizeType size = { { 100, 100 } }; - constexpr MovingImageType::IndexType index = { { 0, 0 } }; + constexpr MovingImageType::SizeType size{ 100, 100 }; + constexpr MovingImageType::IndexType index{ 0, 0 }; const MovingImageType::RegionType region{ index, size }; auto imgMoving = MovingImageType::New(); diff --git a/Modules/Registration/Common/test/itkNormalizedCorrelationImageMetricTest.cxx b/Modules/Registration/Common/test/itkNormalizedCorrelationImageMetricTest.cxx index abceca3107d..0b404946209 100644 --- a/Modules/Registration/Common/test/itkNormalizedCorrelationImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkNormalizedCorrelationImageMetricTest.cxx @@ -46,7 +46,7 @@ itkNormalizedCorrelationImageMetricTest(int, char *[]) // Create two simple images //------------------------------------------------------------ - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = double; @@ -67,8 +67,8 @@ itkNormalizedCorrelationImageMetricTest(int, char *[]) FixedImageType::SpacingValueType fixedImageSpacing[] = { 1.0f, 1.0f }; MovingImageType::SpacingValueType movingImageSpacing[] = { 1.0f, 1.0f }; - constexpr FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; - constexpr MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; + constexpr FixedImageType::PointValueType fixedImageOrigin[]{ 0.0f, 0.0f }; + constexpr MovingImageType::PointValueType movingImageOrigin[]{ 0.0f, 0.0f }; auto movingImageSource = MovingImageSourceType::New(); auto fixedImageSource = FixedImageSourceType::New(); @@ -182,7 +182,7 @@ itkNormalizedCorrelationImageMetricTest(int, char *[]) std::cout << "param[1] Metric d(Metric)/d(param[1] " << std::endl; - constexpr bool subtractMean = true; + constexpr bool subtractMean{ true }; ITK_TEST_SET_GET_BOOLEAN(metric, SubtractMean, subtractMean); for (double trans = -10; trans <= 5; trans += 0.2) diff --git a/Modules/Registration/Common/test/itkNormalizedCorrelationPointSetToImageMetricTest.cxx b/Modules/Registration/Common/test/itkNormalizedCorrelationPointSetToImageMetricTest.cxx index 968c81ff74b..56996c0c825 100644 --- a/Modules/Registration/Common/test/itkNormalizedCorrelationPointSetToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkNormalizedCorrelationPointSetToImageMetricTest.cxx @@ -47,7 +47,7 @@ itkNormalizedCorrelationPointSetToImageMetricTest(int, char *[]) // Create two simple images //------------------------------------------------------------ - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = double; @@ -65,11 +65,11 @@ itkNormalizedCorrelationPointSetToImageMetricTest(int, char *[]) FixedImageType::SizeValueType fixedImageSize[] = { 100, 100 }; MovingImageType::SizeValueType movingImageSize[] = { 100, 100 }; - constexpr FixedImageType::SpacingValueType fixedImageSpacing[] = { 1.0f, 1.0f }; - constexpr MovingImageType::SpacingValueType movingImageSpacing[] = { 1.0f, 1.0f }; + constexpr FixedImageType::SpacingValueType fixedImageSpacing[]{ 1.0f, 1.0f }; + constexpr MovingImageType::SpacingValueType movingImageSpacing[]{ 1.0f, 1.0f }; - constexpr FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; - constexpr MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; + constexpr FixedImageType::PointValueType fixedImageOrigin[]{ 0.0f, 0.0f }; + constexpr MovingImageType::PointValueType movingImageOrigin[]{ 0.0f, 0.0f }; auto movingImageSource = MovingImageSourceType::New(); auto fixedImageSource = FixedImageSourceType::New(); @@ -99,7 +99,7 @@ itkNormalizedCorrelationPointSetToImageMetricTest(int, char *[]) using FixedPointSetType = itk::PointSet; auto fixedPointSet = FixedPointSetType::New(); - constexpr unsigned int numberOfPoints = 100; + constexpr unsigned int numberOfPoints{ 100 }; fixedPointSet->SetPointData(FixedPointSetType::PointDataContainer::New()); @@ -219,7 +219,7 @@ itkNormalizedCorrelationPointSetToImageMetricTest(int, char *[]) std::cout << "param[1] Metric d(Metric)/d(param[1] " << std::endl; - constexpr bool subtractMean = true; + constexpr bool subtractMean{ true }; ITK_TEST_SET_GET_BOOLEAN(metric, SubtractMean, subtractMean); parameters[1] = -10.2; diff --git a/Modules/Registration/Common/test/itkNormalizedMutualInformationHistogramImageToImageMetricTest.cxx b/Modules/Registration/Common/test/itkNormalizedMutualInformationHistogramImageToImageMetricTest.cxx index 25fd2a7e12b..a264d85078d 100644 --- a/Modules/Registration/Common/test/itkNormalizedMutualInformationHistogramImageToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkNormalizedMutualInformationHistogramImageToImageMetricTest.cxx @@ -31,7 +31,7 @@ itkNormalizedMutualInformationHistogramImageToImageMetricTest(int, char *[]) try { // Create two simple images. - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = double; using CoordinateRepresentationType = double; @@ -50,8 +50,8 @@ itkNormalizedMutualInformationHistogramImageToImageMetricTest(int, char *[]) FixedImageType::SpacingValueType fixedImageSpacing[] = { 1.0f, 1.0f }; MovingImageType::SpacingValueType movingImageSpacing[] = { 1.0f, 1.0f }; - constexpr FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; - constexpr MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; + constexpr FixedImageType::PointValueType fixedImageOrigin[]{ 0.0f, 0.0f }; + constexpr MovingImageType::PointValueType movingImageOrigin[]{ 0.0f, 0.0f }; auto movingImageSource = MovingImageSourceType::New(); auto fixedImageSource = FixedImageSourceType::New(); @@ -82,7 +82,7 @@ itkNormalizedMutualInformationHistogramImageToImageMetricTest(int, char *[]) auto metric = MetricType::New(); - constexpr unsigned int nBins = 256; + constexpr unsigned int nBins{ 256 }; MetricType::HistogramType::SizeType histSize; histSize.SetSize(2); histSize[0] = nBins; diff --git a/Modules/Registration/Common/test/itkPointSetToImageRegistrationTest.cxx b/Modules/Registration/Common/test/itkPointSetToImageRegistrationTest.cxx index cc25edf903c..62bddefc1a0 100644 --- a/Modules/Registration/Common/test/itkPointSetToImageRegistrationTest.cxx +++ b/Modules/Registration/Common/test/itkPointSetToImageRegistrationTest.cxx @@ -39,7 +39,7 @@ int itkPointSetToImageRegistrationTest(int, char *[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = double; @@ -68,7 +68,7 @@ itkPointSetToImageRegistrationTest(int, char *[]) using FixedPointSetType = itk::PointSet; auto fixedPointSet = FixedPointSetType::New(); - constexpr unsigned int numberOfPoints = 10000; + constexpr unsigned int numberOfPoints{ 10000 }; fixedPointSet->SetPointData(FixedPointSetType::PointDataContainer::New()); @@ -142,10 +142,10 @@ itkPointSetToImageRegistrationTest(int, char *[]) OptimizerType::ScalesType scales(transform->GetNumberOfParameters()); scales.Fill(1.0); - constexpr unsigned long numberOfIterations = 50; - constexpr double maximumStepLength = 1.0; // no step will be larger than this - constexpr double minimumStepLength = 0.01; - constexpr double gradientTolerance = 1e-6; // convergence criterion + constexpr unsigned long numberOfIterations{ 50 }; + constexpr double maximumStepLength{ 1.0 }; // no step will be larger than this + constexpr double minimumStepLength{ 0.01 }; + constexpr double gradientTolerance{ 1e-6 }; // convergence criterion optimizer->SetScales(scales); optimizer->SetNumberOfIterations(numberOfIterations); diff --git a/Modules/Registration/Common/test/itkPointSetToPointSetRegistrationTest.cxx b/Modules/Registration/Common/test/itkPointSetToPointSetRegistrationTest.cxx index 96d95211774..6d5d4d95635 100644 --- a/Modules/Registration/Common/test/itkPointSetToPointSetRegistrationTest.cxx +++ b/Modules/Registration/Common/test/itkPointSetToPointSetRegistrationTest.cxx @@ -35,7 +35,7 @@ int itkPointSetToPointSetRegistrationTest(int, char *[]) { - constexpr unsigned int PointSetDimension = 2; + constexpr unsigned int PointSetDimension{ 2 }; using PointSetPointType = float; @@ -43,7 +43,7 @@ itkPointSetToPointSetRegistrationTest(int, char *[]) using FixedPointSetType = itk::PointSet; auto fixedPointSet = FixedPointSetType::New(); - constexpr unsigned int numberOfPoints = 500; + constexpr unsigned int numberOfPoints{ 500 }; fixedPointSet->SetPointData(FixedPointSetType::PointDataContainer::New()); @@ -117,10 +117,10 @@ itkPointSetToPointSetRegistrationTest(int, char *[]) OptimizerType::ScalesType scales(transform->GetNumberOfParameters()); scales.Fill(1.0); - constexpr unsigned long numberOfIterations = 100; - constexpr double gradientTolerance = 1e-1; // convergence criterion - constexpr double valueTolerance = 1e-1; // convergence criterion - constexpr double epsilonFunction = 1e-9; // convergence criterion + constexpr unsigned long numberOfIterations{ 100 }; + constexpr double gradientTolerance{ 1e-1 }; // convergence criterion + constexpr double valueTolerance{ 1e-1 }; // convergence criterion + constexpr double epsilonFunction{ 1e-9 }; // convergence criterion optimizer->SetScales(scales); optimizer->SetNumberOfIterations(numberOfIterations); @@ -183,7 +183,7 @@ itkPointSetToPointSetRegistrationTest(int, char *[]) // Test with the Danielsson distance map. // - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using BinaryImageType = itk::Image; using ImageType = itk::Image; diff --git a/Modules/Registration/Common/test/itkPointSetToSpatialObjectDemonsRegistrationTest.cxx b/Modules/Registration/Common/test/itkPointSetToSpatialObjectDemonsRegistrationTest.cxx index ff03b83cc63..98f2f002703 100644 --- a/Modules/Registration/Common/test/itkPointSetToSpatialObjectDemonsRegistrationTest.cxx +++ b/Modules/Registration/Common/test/itkPointSetToSpatialObjectDemonsRegistrationTest.cxx @@ -26,7 +26,7 @@ int itkPointSetToSpatialObjectDemonsRegistrationTest(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using EllipseType = itk::EllipseSpatialObject; diff --git a/Modules/Registration/Common/test/itkPointsLocatorTest.cxx b/Modules/Registration/Common/test/itkPointsLocatorTest.cxx index 7b825f14df1..9c25ebab864 100644 --- a/Modules/Registration/Common/test/itkPointsLocatorTest.cxx +++ b/Modules/Registration/Common/test/itkPointsLocatorTest.cxx @@ -27,7 +27,7 @@ testPointsLocatorTest() /** * Create the point set through its object factory. */ - constexpr unsigned int PointDimension = 3; + constexpr unsigned int PointDimension{ 3 }; using PointType = itk::Point; @@ -134,7 +134,7 @@ testPointsLocatorTest() int itkPointsLocatorTest(int, char *[]) { - constexpr unsigned int PointDimension = 3; + constexpr unsigned int PointDimension{ 3 }; using PointType = itk::Point; using VectorContainerType = itk::VectorContainer; diff --git a/Modules/Registration/Common/test/itkRecursiveMultiResolutionPyramidImageFilterTest.cxx b/Modules/Registration/Common/test/itkRecursiveMultiResolutionPyramidImageFilterTest.cxx index 2c9740cc960..edae2620ee5 100644 --- a/Modules/Registration/Common/test/itkRecursiveMultiResolutionPyramidImageFilterTest.cxx +++ b/Modules/Registration/Common/test/itkRecursiveMultiResolutionPyramidImageFilterTest.cxx @@ -32,7 +32,7 @@ namespace double F(double x, double y, double z) { - constexpr double s = 50; + constexpr double s{ 50 }; double value = 200.0 * std::exp(-(x * x + y * y + z * z) / (s * s)); x -= 8; y += 3; @@ -96,7 +96,7 @@ itkRecursiveMultiResolutionPyramidImageFilterTest(int argc, char * argv[]) } InputImageType::SizeType size = { { 100, 100, 40 } }; - constexpr InputImageType::IndexType index = { { 0, 0, 0 } }; + constexpr InputImageType::IndexType index{ 0, 0, 0 }; const InputImageType::RegionType region{ index, size }; auto imgTarget = InputImageType::New(); diff --git a/Modules/Registration/FEM/include/itkFEMRegistrationFilter.hxx b/Modules/Registration/FEM/include/itkFEMRegistrationFilter.hxx index 2914609a781..a81752c2b40 100644 --- a/Modules/Registration/FEM/include/itkFEMRegistrationFilter.hxx +++ b/Modules/Registration/FEM/include/itkFEMRegistrationFilter.hxx @@ -528,7 +528,7 @@ FEMRegistrationFilter::IterativeSolve(Sol if (DLS == 2 && deltE < 0.0) { itkDebugMacro(" Line search "); - constexpr float tol = 1.0; // ((0.01 < LastE) ? 0.01 : LastE/10.); + constexpr float tol{ 1.0 }; // ((0.01 < LastE) ? 0.01 : LastE/10.); LastE = this->GoldenSection(solver, tol, m_LineSearchMaximumIterations); deltE = (m_MinE - LastE); itkDebugMacro(" Line search done "); @@ -1181,8 +1181,8 @@ FEMRegistrationFilter::FindBracketingTrip { // See Numerical Recipes - constexpr Float Gold = 1.618034; - constexpr Float Glimit = 100.0; + constexpr Float Gold{ 1.618034 }; + constexpr Float Glimit{ 100.0 }; const Float Tiny = 1.e-20; Float ax = 0.0; Float bx = 1.0; @@ -1293,7 +1293,7 @@ FEMRegistrationFilter::GoldenSection(Solv this->FindBracketingTriplet(solver, &ax, &bx, &cx); - constexpr Float R = 0.6180339; + constexpr Float R{ 0.6180339 }; const Float C = (1.0 - R); Float x0 = ax; diff --git a/Modules/Registration/FEM/test/itkFEMFiniteDifferenceFunctionLoadTest.cxx b/Modules/Registration/FEM/test/itkFEMFiniteDifferenceFunctionLoadTest.cxx index 7cf59d55c96..2ec71f97af3 100644 --- a/Modules/Registration/FEM/test/itkFEMFiniteDifferenceFunctionLoadTest.cxx +++ b/Modules/Registration/FEM/test/itkFEMFiniteDifferenceFunctionLoadTest.cxx @@ -28,8 +28,8 @@ // Typedefs used for registration -constexpr unsigned int ImageDimension = 3; -constexpr unsigned int ImageWidth = 16; +constexpr unsigned int ImageDimension{ 3 }; +constexpr unsigned int ImageWidth{ 16 }; using InputImagePixelType = unsigned char; using DeformationFieldPixelType = float; @@ -38,7 +38,7 @@ using InputImageType = itk::Image; using DeformationFieldVectorType = itk::Vector; using DeformationFieldImageType = itk::Image; -constexpr unsigned int PixelsPerElement = 1; +constexpr unsigned int PixelsPerElement{ 1 }; using Element2DType = itk::fem::Element2DC0LinearQuadrilateralMembrane; using Element3DType = itk::fem::Element3DC0LinearHexahedronMembrane; using FEMObjectType = itk::fem::FEMObject; diff --git a/Modules/Registration/FEM/test/itkFEMRegistrationFilter2DTest.cxx b/Modules/Registration/FEM/test/itkFEMRegistrationFilter2DTest.cxx index 0c131070137..003b3f35d7f 100644 --- a/Modules/Registration/FEM/test/itkFEMRegistrationFilter2DTest.cxx +++ b/Modules/Registration/FEM/test/itkFEMRegistrationFilter2DTest.cxx @@ -24,7 +24,7 @@ // Typedefs used for registration -constexpr unsigned int ImageDimension = 2; +constexpr unsigned int ImageDimension{ 2 }; using InputImagePixelType = unsigned char; using DeformationFieldPixelType = float; diff --git a/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest.cxx b/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest.cxx index b411aed2d0c..0f5f093f25c 100644 --- a/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest.cxx +++ b/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest.cxx @@ -24,7 +24,7 @@ // Typedefs used for registration -constexpr unsigned int ImageDimension = 3; +constexpr unsigned int ImageDimension{ 3 }; using InputImagePixelType = unsigned char; using DeformationFieldPixelType = float; diff --git a/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest2.cxx b/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest2.cxx index d5c046dd2ea..dc8eed48624 100644 --- a/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest2.cxx +++ b/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest2.cxx @@ -27,7 +27,7 @@ // itkFEMRegistrationFilter2DTest.cxx tests the itk::FEMRegistrationFilter // class on 2D images -constexpr unsigned int ImageDimension = 3; +constexpr unsigned int ImageDimension{ 3 }; using InputImagePixelType = unsigned char; using DeformationFieldPixelType = float; diff --git a/Modules/Registration/FEM/test/itkMIRegistrationFunctionTest.cxx b/Modules/Registration/FEM/test/itkMIRegistrationFunctionTest.cxx index cbc61e33449..add574e6585 100644 --- a/Modules/Registration/FEM/test/itkMIRegistrationFunctionTest.cxx +++ b/Modules/Registration/FEM/test/itkMIRegistrationFunctionTest.cxx @@ -34,7 +34,7 @@ int itkMIRegistrationFunctionTest(int, char *[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = double; using DeformationPixelType = itk::Vector; diff --git a/Modules/Registration/FEM/test/itkPhysicsBasedNonRigidRegistrationMethodTest.cxx b/Modules/Registration/FEM/test/itkPhysicsBasedNonRigidRegistrationMethodTest.cxx index b50cbeb557d..4b817b823ff 100644 --- a/Modules/Registration/FEM/test/itkPhysicsBasedNonRigidRegistrationMethodTest.cxx +++ b/Modules/Registration/FEM/test/itkPhysicsBasedNonRigidRegistrationMethodTest.cxx @@ -54,7 +54,7 @@ itkPhysicsBasedNonRigidRegistrationMethodTest(int argc, char * argv[]) // Legacy compat with older MetaImages itk::MetaImageIO::SetDefaultDoublePrecision(6); - constexpr unsigned int ImageDimension = 3; + constexpr unsigned int ImageDimension{ 3 }; using InputPixelType = short; using InputImageType = itk::Image; diff --git a/Modules/Registration/FEM/test/itkVTKTetrahedralMeshReader.hxx b/Modules/Registration/FEM/test/itkVTKTetrahedralMeshReader.hxx index f36f48f92a2..9f2fbd4931d 100644 --- a/Modules/Registration/FEM/test/itkVTKTetrahedralMeshReader.hxx +++ b/Modules/Registration/FEM/test/itkVTKTetrahedralMeshReader.hxx @@ -347,7 +347,7 @@ VTKTetrahedralMeshReader::GenerateData() } - constexpr int tetrahedralCellTypeID = 10; + constexpr int tetrahedralCellTypeID{ 10 }; if (cellTypeID != tetrahedralCellTypeID) { diff --git a/Modules/Registration/GPUPDEDeformable/test/itkGPUDemonsRegistrationFilterTest.cxx b/Modules/Registration/GPUPDEDeformable/test/itkGPUDemonsRegistrationFilterTest.cxx index a3a27470918..b22a4cb770a 100644 --- a/Modules/Registration/GPUPDEDeformable/test/itkGPUDemonsRegistrationFilterTest.cxx +++ b/Modules/Registration/GPUPDEDeformable/test/itkGPUDemonsRegistrationFilterTest.cxx @@ -71,10 +71,10 @@ class ShowProgressObject : public itk::Object typename TRegistration::Pointer m_Process; }; -constexpr unsigned int numberOfRepeatedTests = 1; -constexpr float displacementFieldSmoothingSigma = 1.0; -constexpr float updateFieldSmoothingSigma = 1.0; -constexpr float maximumRMSError = 0.01; +constexpr unsigned int numberOfRepeatedTests{ 1 }; +constexpr float displacementFieldSmoothingSigma{ 1.0 }; +constexpr float updateFieldSmoothingSigma{ 1.0 }; +constexpr float maximumRMSError{ 0.01 }; const bool smoothUpdateField = true; itk::TimeProbe m_GPUTime; @@ -142,7 +142,7 @@ template int GPUDemonsRegistrationFilterTestTemplate(int argc, char * argv[]) { - constexpr unsigned int ImageDimension = VDimension; + constexpr unsigned int ImageDimension{ VDimension }; bool passed; unsigned int size1 = 0, size2 = 0; diff --git a/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationGetValueAndDerivativeThreader.hxx b/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationGetValueAndDerivativeThreader.hxx index 8c00a486b65..b8d3633a24d 100644 --- a/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationGetValueAndDerivativeThreader.hxx +++ b/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationGetValueAndDerivativeThreader.hxx @@ -141,7 +141,7 @@ JointHistogramMutualInformationGetValueAndDerivativeThreader< this->m_JointHistogramMIPerThreadVariables[threadId].MovingImageMarginalPDFInterpolator->Evaluate(mind); const InternalComputationValueType dMmPDF = this->ComputeMovingImageMarginalPDFDerivative(mind, threadId); - constexpr InternalComputationValueType eps = 1.e-16; + constexpr InternalComputationValueType eps{ 1.e-16 }; if (jointPDFValue > eps && movingImagePDFValue > eps) { const InternalComputationValueType pRatio = std::log(jointPDFValue) - std::log(movingImagePDFValue); diff --git a/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationImageToImageMetricv4.hxx b/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationImageToImageMetricv4.hxx index fdc7ca11c58..83646a85aab 100644 --- a/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationImageToImageMetricv4.hxx +++ b/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationImageToImageMetricv4.hxx @@ -346,7 +346,7 @@ JointHistogramMutualInformationImageToImageMetricv4::epsilon(); + constexpr TInternalComputationValueType eps{ NumericTraits::epsilon() }; CompensatedSummation total_mi; for (SizeValueType ii = 0; ii < m_NumberOfHistogramBins; ++ii) { diff --git a/Modules/Registration/Metricsv4/include/itkMattesMutualInformationImageToImageMetricv4.hxx b/Modules/Registration/Metricsv4/include/itkMattesMutualInformationImageToImageMetricv4.hxx index c57749f6c31..d25b9e376b7 100644 --- a/Modules/Registration/Metricsv4/include/itkMattesMutualInformationImageToImageMetricv4.hxx +++ b/Modules/Registration/Metricsv4/include/itkMattesMutualInformationImageToImageMetricv4.hxx @@ -247,7 +247,7 @@ MattesMutualInformationImageToImageMetricv4m_FixedImageBinSize = (this->m_FixedImageTrueMax - this->m_FixedImageTrueMin) / static_cast(this->m_NumberOfHistogramBins - 2 * padding); diff --git a/Modules/Registration/Metricsv4/test/itkANTSNeighborhoodCorrelationImageToImageMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkANTSNeighborhoodCorrelationImageToImageMetricv4Test.cxx index 5f98f892b37..3dce6fd6b15 100644 --- a/Modules/Registration/Metricsv4/test/itkANTSNeighborhoodCorrelationImageToImageMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkANTSNeighborhoodCorrelationImageToImageMetricv4Test.cxx @@ -123,7 +123,7 @@ ANTSNeighborhoodCorrelationImageToImageMetricv4Test_PrintImage(const ImagePointe int itkANTSNeighborhoodCorrelationImageToImageMetricv4Test(int, char ** const) { - constexpr itk::SizeValueType ImageDimension = 2; + constexpr itk::SizeValueType ImageDimension{ 2 }; using ImageType = itk::Image; using VectorType = itk::Vector; @@ -149,7 +149,7 @@ itkANTSNeighborhoodCorrelationImageToImageMetricv4Test(int, char ** const) auto transformFComp = CompositeTransformType::New(); - constexpr itk::SizeValueType imageSize = 6; + constexpr itk::SizeValueType imageSize{ 6 }; auto size = ImageType::SizeType::Filled(imageSize); constexpr ImageType::IndexType index{}; @@ -185,7 +185,7 @@ itkANTSNeighborhoodCorrelationImageToImageMetricv4Test(int, char ** const) } VectorType zero; - constexpr float def_value = -0.5; + constexpr float def_value{ -0.5 }; zero.Fill(def_value); auto field = FieldType::New(); @@ -342,7 +342,7 @@ itkANTSNeighborhoodCorrelationImageToImageMetricv4Test(int, char ** const) std::cout << std::endl << "derivative of moving transform as a field (sparse threader):" << std::endl; ANTSNeighborhoodCorrelationImageToImageMetricv4Test_PrintDerivativeAsVectorImage( fixedImage, derivativeReturnSparse, ImageDimension); - constexpr double tolerance = 1e-7; + constexpr double tolerance{ 1e-7 }; if (!derivativeReturn.is_equal(derivativeReturnSparse, tolerance)) { std::cerr << "Results for derivative don't match using dense and sparse threaders: " @@ -356,7 +356,7 @@ itkANTSNeighborhoodCorrelationImageToImageMetricv4Test(int, char ** const) DisplacementTransformType::ParametersType parameters(transformMdisplacement->GetNumberOfParameters()); parameters.Fill(static_cast(1000.0)); transformMdisplacement->SetParameters(parameters); - constexpr MetricType::MeasureType expectedMetricMax = itk::NumericTraits::max(); + constexpr MetricType::MeasureType expectedMetricMax{ itk::NumericTraits::max() }; std::cout << "Testing non-overlapping images. Expect a warning:" << std::endl; MetricType::MeasureType valueReturn = NAN; metric->GetValueAndDerivative(valueReturn, derivativeReturn); diff --git a/Modules/Registration/Metricsv4/test/itkANTSNeighborhoodCorrelationImageToImageRegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkANTSNeighborhoodCorrelationImageToImageRegistrationTest.cxx index e0db4a4485c..1170a00ef5e 100644 --- a/Modules/Registration/Metricsv4/test/itkANTSNeighborhoodCorrelationImageToImageRegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkANTSNeighborhoodCorrelationImageToImageRegistrationTest.cxx @@ -97,7 +97,7 @@ itkANTSNeighborhoodCorrelationImageToImageRegistrationTest(int argc, char * argv } std::cout << " iterations " << numberOfIterations << " learningRate " << learningRate << std::endl; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = double; // I assume png is unsigned short using FixedImageType = itk::Image; @@ -173,7 +173,7 @@ itkANTSNeighborhoodCorrelationImageToImageRegistrationTest(int argc, char * argv metric->SetMovingImage(movingImage); metric->SetFixedTransform(identityTransform); metric->SetMovingTransform(affineTransform); - constexpr bool gaussian = false; + constexpr bool gaussian{ false }; metric->SetUseMovingImageGradientFilter(gaussian); metric->SetUseFixedImageGradientFilter(gaussian); metric->Initialize(); diff --git a/Modules/Registration/Metricsv4/test/itkCorrelationImageToImageMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkCorrelationImageToImageMetricv4Test.cxx index c01164e69c4..dee35c3f45b 100644 --- a/Modules/Registration/Metricsv4/test/itkCorrelationImageToImageMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkCorrelationImageToImageMetricv4Test.cxx @@ -124,8 +124,8 @@ int itkCorrelationImageToImageMetricv4Test(int, char ** const) { - constexpr unsigned int imageSize = 20; - constexpr unsigned int imageDimensionality = 3; + constexpr unsigned int imageSize{ 20 }; + constexpr unsigned int imageDimensionality{ 3 }; using ImageType = itk::Image; auto size = ImageType::SizeType::Filled(imageSize); @@ -225,7 +225,7 @@ itkCorrelationImageToImageMetricv4Test(int, char ** const) result = EXIT_FAILURE; } - constexpr double myeps = 1e-8; + constexpr double myeps{ 1e-8 }; if (itk::Math::abs(value1 - value2) > 1e-8) { std::cerr << "value1: " << value1 << std::endl; @@ -248,7 +248,7 @@ itkCorrelationImageToImageMetricv4Test(int, char ** const) MovingTransformType::ParametersType parameters(imageDimensionality); parameters.Fill(static_cast(1000)); movingTransform->SetParameters(parameters); - constexpr MetricType::MeasureType expectedMetricMax = itk::NumericTraits::max(); + constexpr MetricType::MeasureType expectedMetricMax{ itk::NumericTraits::max() }; std::cout << "Testing non-overlapping images. Expect a warning:" << std::endl; MetricType::MeasureType valueReturn = NAN; MetricType::DerivativeType derivativeReturn; diff --git a/Modules/Registration/Metricsv4/test/itkDemonsImageToImageMetricv4RegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkDemonsImageToImageMetricv4RegistrationTest.cxx index c815d3024d8..a0f162f942b 100644 --- a/Modules/Registration/Metricsv4/test/itkDemonsImageToImageMetricv4RegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkDemonsImageToImageMetricv4RegistrationTest.cxx @@ -113,7 +113,7 @@ itkDemonsImageToImageMetricv4RegistrationTest(int argc, char * argv[]) std::cout << " iterations " << numberOfIterations << std::endl; std::cout << " useImageGradientFilter " << useImageGradientFilter << std::endl; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = double; // I assume png is unsigned short using FixedImageType = itk::Image; diff --git a/Modules/Registration/Metricsv4/test/itkDemonsImageToImageMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkDemonsImageToImageMetricv4Test.cxx index 4299aa4e812..d876366b8a0 100644 --- a/Modules/Registration/Metricsv4/test/itkDemonsImageToImageMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkDemonsImageToImageMetricv4Test.cxx @@ -32,8 +32,8 @@ int itkDemonsImageToImageMetricv4Test(int, char ** const) { - constexpr unsigned int imageSize = 5; - constexpr unsigned int imageDimensionality = 3; + constexpr unsigned int imageSize{ 5 }; + constexpr unsigned int imageDimensionality{ 3 }; using ImageType = itk::Image; auto size = ImageType::SizeType::Filled(imageSize); diff --git a/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricRegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricRegistrationTest.cxx index 9f0411db290..2d0566c4167 100644 --- a/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricRegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricRegistrationTest.cxx @@ -83,7 +83,7 @@ itkEuclideanDistancePointSetMetricRegistrationTestRun(unsigned int // Create a few points and apply a small rotation to make the moving point set - constexpr float theta = itk::Math::pi / static_cast(180.0) * static_cast(1.0); + constexpr float theta{ itk::Math::pi / static_cast(180.0) * static_cast(1.0) }; PointType fixedPoint; fixedPoint[0] = static_cast(0.0); fixedPoint[1] = static_cast(0.0); @@ -200,7 +200,7 @@ itkEuclideanDistancePointSetMetricRegistrationTestRun(unsigned int int itkEuclideanDistancePointSetMetricRegistrationTest(int argc, char * argv[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; int finalResult = EXIT_SUCCESS; diff --git a/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest3.cxx b/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest3.cxx index 6c9bc9975d8..92673fb4860 100644 --- a/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest3.cxx +++ b/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest3.cxx @@ -205,12 +205,12 @@ itkEuclideanDistancePointSetMetricTest3(int, char *[]) { int result = EXIT_SUCCESS; - constexpr double distanceThresholdPositive = 0.5; - constexpr double distanceThresholdZero = 0.0; - constexpr double distanceThresholdNegative = -8.0; + constexpr double distanceThresholdPositive{ 0.5 }; + constexpr double distanceThresholdZero{ 0.0 }; + constexpr double distanceThresholdNegative{ -8.0 }; - constexpr unsigned int dimension2D = 2; - constexpr unsigned int dimension3D = 3; + constexpr unsigned int dimension2D{ 2 }; + constexpr unsigned int dimension3D{ 3 }; // Test for positive distance threshold if (itkEuclideanDistancePointSetMetricTest3Run(distanceThresholdPositive) == EXIT_FAILURE) diff --git a/Modules/Registration/Metricsv4/test/itkExpectationBasedPointSetMetricRegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkExpectationBasedPointSetMetricRegistrationTest.cxx index bf1dbb6c3ea..81b737dfc3e 100644 --- a/Modules/Registration/Metricsv4/test/itkExpectationBasedPointSetMetricRegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkExpectationBasedPointSetMetricRegistrationTest.cxx @@ -62,7 +62,7 @@ class itkExpectationBasedPointSetMetricRegistrationTestCommandIterationUpdate : int itkExpectationBasedPointSetMetricRegistrationTest(int argc, char * argv[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; unsigned int numberOfIterations = 10; if (argc > 1) @@ -110,7 +110,7 @@ itkExpectationBasedPointSetMetricRegistrationTest(int argc, char * argv[]) for (float theta = 0; theta < 2.0 * itk::Math::pi; theta += 0.1) { PointType fixedPoint; - constexpr float radius = 100.0; + constexpr float radius{ 100.0 }; fixedPoint[0] = radius * std::cos(theta); fixedPoint[1] = radius * std::sin(theta); if constexpr (Dimension > 2) @@ -179,7 +179,7 @@ itkExpectationBasedPointSetMetricRegistrationTest(int argc, char * argv[]) // applying the resultant transform to moving points and verify result std::cout << "Fixed\tMoving\tMovingTransformed\tFixedTransformed\tDiff" << std::endl; bool passed = true; - constexpr PointType::ValueType tolerance = 1e-4; + constexpr PointType::ValueType tolerance{ 1e-4 }; const AffineTransformType::InverseTransformBasePointer movingInverse = metric->GetMovingTransform()->GetInverseTransform(); const AffineTransformType::InverseTransformBasePointer fixedInverse = diff --git a/Modules/Registration/Metricsv4/test/itkExpectationBasedPointSetMetricTest.cxx b/Modules/Registration/Metricsv4/test/itkExpectationBasedPointSetMetricTest.cxx index 13ef6b26c80..89959958417 100644 --- a/Modules/Registration/Metricsv4/test/itkExpectationBasedPointSetMetricTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkExpectationBasedPointSetMetricTest.cxx @@ -45,7 +45,7 @@ itkExpectationBasedPointSetMetricTestRun() for (float theta = 0; theta < 2.0 * itk::Math::pi; theta += 0.1) { PointType fixedPoint; - constexpr float radius = 100.0; + constexpr float radius{ 100.0 }; fixedPoint[0] = radius * std::cos(theta); fixedPoint[1] = radius * std::sin(theta); if constexpr (Dimension > 2) @@ -81,7 +81,7 @@ itkExpectationBasedPointSetMetricTestRun() metric->SetPointSetSigma(pointSetSigma); ITK_TEST_SET_GET_VALUE(pointSetSigma, metric->GetPointSetSigma()); - constexpr unsigned int evaluationKNeighborhood = 50; + constexpr unsigned int evaluationKNeighborhood{ 50 }; metric->SetEvaluationKNeighborhood(evaluationKNeighborhood); ITK_TEST_SET_GET_VALUE(evaluationKNeighborhood, metric->GetEvaluationKNeighborhood()); diff --git a/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4RegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4RegistrationTest.cxx index ac449376a6c..09492e11e10 100644 --- a/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4RegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4RegistrationTest.cxx @@ -185,7 +185,7 @@ ImageToImageMetricv4RegistrationTestRun(typename TMetric::Pointer metric, std::cout << "metric value: initial: " << initialValue << ", final: " << finalValue << std::endl; // test that the final position is close to the truth - constexpr double tolerance = 0.11; + constexpr double tolerance{ 0.11 }; for (itk::SizeValueType n = 0; n < Dimension; ++n) { if (itk::Math::abs(1.0 - (static_cast(imageShift[n]) / translationTransform->GetParameters()[n])) > diff --git a/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4Test.cxx index 779d0a50d33..82ee0b34ff5 100644 --- a/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4Test.cxx @@ -173,7 +173,7 @@ ImageToImageMetricv4TestTestArray(const TVector & v1, const TVector & v2) bool pass = true; for (unsigned int i = 0; i < v1.Size(); ++i) { - constexpr double epsilon = 1e-10; + constexpr double epsilon{ 1e-10 }; if (itk::Math::abs(v1[i] - v2[i]) > epsilon) { pass = false; @@ -184,7 +184,7 @@ ImageToImageMetricv4TestTestArray(const TVector & v1, const TVector & v2) // Global types -constexpr unsigned int ImageToImageMetricv4TestImageDimensionality = 2; +constexpr unsigned int ImageToImageMetricv4TestImageDimensionality{ 2 }; using ImageToImageMetricv4TestImageType = itk::Image; using ImageToImageMetricv4TestMetricType = ImageToImageMetricv4TestMetric epsilon) { std::cerr << "-FAILED- truthValue does not equal value: " << std::endl @@ -383,10 +383,10 @@ itkImageToImageMetricv4Test(int, char ** const) itk::Object::SetGlobalWarningDisplay(true); using DimensionSizeType = unsigned int; - constexpr DimensionSizeType imageSize = 4; + constexpr DimensionSizeType imageSize{ 4 }; - constexpr ImageToImageMetricv4TestImageType::SizeType size = { { imageSize, imageSize } }; - constexpr ImageToImageMetricv4TestImageType::IndexType index = { { 0, 0 } }; + constexpr ImageToImageMetricv4TestImageType::SizeType size{ imageSize, imageSize }; + constexpr ImageToImageMetricv4TestImageType::IndexType index{ 0, 0 }; const ImageToImageMetricv4TestImageType::RegionType region{ index, size }; @@ -568,10 +568,10 @@ itkImageToImageMetricv4Test(int, char ** const) bool useMovingImageGradientFilter = true; ITK_TEST_SET_GET_BOOLEAN(metric, UseMovingImageGradientFilter, useMovingImageGradientFilter); - constexpr bool useVirtualSampledPointSet = false; + constexpr bool useVirtualSampledPointSet{ false }; ITK_TEST_SET_GET_BOOLEAN(metric, UseVirtualSampledPointSet, useVirtualSampledPointSet); - constexpr bool useFloatingPointCorrection = false; + constexpr bool useFloatingPointCorrection{ false }; ITK_TEST_SET_GET_BOOLEAN(metric, UseFloatingPointCorrection, useFloatingPointCorrection); // Tell the metric to compute image gradients for both fixed and moving. @@ -633,7 +633,7 @@ itkImageToImageMetricv4Test(int, char ** const) metric->SetFixedSampledPointSet(pset); ITK_TEST_SET_GET_VALUE(pset, metric->GetFixedSampledPointSet()); - constexpr bool useSampledPointSet = true; + constexpr bool useSampledPointSet{ true }; ITK_TEST_SET_GET_BOOLEAN(metric, UseSampledPointSet, useSampledPointSet); #if !defined(ITK_LEGACY_REMOVE) @@ -680,7 +680,7 @@ itkImageToImageMetricv4Test(int, char ** const) ITK_TEST_SET_GET_VALUE(floatingPointCorrectionResolution, metric->GetFloatingPointCorrectionResolution()); // Empty method body by default; called for coverage purposes - constexpr itk::ThreadIdType thread = 0; + constexpr itk::ThreadIdType thread{ 0 }; metric->FinalizeThread(thread); diff --git a/Modules/Registration/Metricsv4/test/itkJensenHavrdaCharvatTsallisPointSetMetricRegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkJensenHavrdaCharvatTsallisPointSetMetricRegistrationTest.cxx index 8e87e6a08d3..556ec10b219 100644 --- a/Modules/Registration/Metricsv4/test/itkJensenHavrdaCharvatTsallisPointSetMetricRegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkJensenHavrdaCharvatTsallisPointSetMetricRegistrationTest.cxx @@ -66,7 +66,7 @@ class itkJensenHavrdaCharvatTsallisPointSetMetricRegistrationTestCommandIteratio int itkJensenHavrdaCharvatTsallisPointSetMetricRegistrationTest(int argc, char * argv[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; unsigned int numberOfIterations = 10; if (argc > 1) @@ -114,7 +114,7 @@ itkJensenHavrdaCharvatTsallisPointSetMetricRegistrationTest(int argc, char * arg for (float theta = 0; theta < 2.0 * itk::Math::pi; theta += 0.1) { PointType fixedPoint; - constexpr float radius = 100.0; + constexpr float radius{ 100.0 }; fixedPoint[0] = radius * std::cos(theta); fixedPoint[1] = radius * std::sin(theta); if constexpr (Dimension > 2) @@ -187,7 +187,7 @@ itkJensenHavrdaCharvatTsallisPointSetMetricRegistrationTest(int argc, char * arg // applying the resultant transform to moving points and verify result std::cout << "Fixed\tMoving\tMovingTransformed\tFixedTransformed\tDiff" << std::endl; bool passed = true; - constexpr PointType::ValueType tolerance = 1e-2; + constexpr PointType::ValueType tolerance{ 1e-2 }; const AffineTransformType::InverseTransformBasePointer movingInverse = metric->GetMovingTransform()->GetInverseTransform(); const AffineTransformType::InverseTransformBasePointer fixedInverse = diff --git a/Modules/Registration/Metricsv4/test/itkJensenHavrdaCharvatTsallisPointSetMetricTest.cxx b/Modules/Registration/Metricsv4/test/itkJensenHavrdaCharvatTsallisPointSetMetricTest.cxx index 83d98136b7f..37d14d2d76d 100644 --- a/Modules/Registration/Metricsv4/test/itkJensenHavrdaCharvatTsallisPointSetMetricTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkJensenHavrdaCharvatTsallisPointSetMetricTest.cxx @@ -50,7 +50,7 @@ itkJensenHavrdaCharvatTsallisPointSetMetricTestRun() unsigned long count = 0; for (float theta = 0; theta < 2.0 * itk::Math::pi; theta += 0.1) { - constexpr float radius = 100.0; + constexpr float radius{ 100.0 }; PointType fixedPoint; fixedPoint[0] = radius * std::cos(theta); fixedPoint[1] = radius * std::sin(theta); @@ -83,12 +83,12 @@ itkJensenHavrdaCharvatTsallisPointSetMetricTestRun() // check various alpha values between accepted values of [1.0, 2.0] - constexpr unsigned int numberOfAlphaValues = 6; - constexpr float alphaValues[] = { 1.0f, 1.2f, 1.4f, 1.6f, 1.8f, 2.0f }; + constexpr unsigned int numberOfAlphaValues{ 6 }; + constexpr float alphaValues[]{ 1.0f, 1.2f, 1.4f, 1.6f, 1.8f, 2.0f }; - constexpr unsigned int evaluationKNeighborhood = 50; + constexpr unsigned int evaluationKNeighborhood{ 50 }; auto useAnisotropicCovariances = false; - constexpr unsigned int covarianceKNeighborhood = 5; + constexpr unsigned int covarianceKNeighborhood{ 5 }; for (unsigned int i = 0; i < numberOfAlphaValues; ++i) { diff --git a/Modules/Registration/Metricsv4/test/itkJointHistogramMutualInformationImageToImageMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkJointHistogramMutualInformationImageToImageMetricv4Test.cxx index 2b1fbf39b91..cf7b3e82d5a 100644 --- a/Modules/Registration/Metricsv4/test/itkJointHistogramMutualInformationImageToImageMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkJointHistogramMutualInformationImageToImageMetricv4Test.cxx @@ -31,8 +31,8 @@ int itkJointHistogramMutualInformationImageToImageMetricv4Test(int, char *[]) { - constexpr unsigned int imageSize = 10; - constexpr unsigned int imageDimensionality = 3; + constexpr unsigned int imageSize{ 10 }; + constexpr unsigned int imageDimensionality{ 3 }; using ImageType = itk::Image; auto size = ImageType::SizeType::Filled(imageSize); @@ -82,11 +82,11 @@ itkJointHistogramMutualInformationImageToImageMetricv4Test(int, char *[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(metric, JointHistogramMutualInformationImageToImageMetricv4, ImageToImageMetricv4); - constexpr itk::SizeValueType numberOfHistogramBins = 6; + constexpr itk::SizeValueType numberOfHistogramBins{ 6 }; metric->SetNumberOfHistogramBins(numberOfHistogramBins); ITK_TEST_SET_GET_VALUE(numberOfHistogramBins, metric->GetNumberOfHistogramBins()); - constexpr double varianceForJointPDFSmoothing = 1.5; + constexpr double varianceForJointPDFSmoothing{ 1.5 }; metric->SetVarianceForJointPDFSmoothing(varianceForJointPDFSmoothing); ITK_TEST_SET_GET_VALUE(varianceForJointPDFSmoothing, metric->GetVarianceForJointPDFSmoothing()); @@ -120,7 +120,7 @@ itkJointHistogramMutualInformationImageToImageMetricv4Test(int, char *[]) MovingTransformType::ParametersType parameters(movingTransform->GetNumberOfParameters()); parameters.Fill(static_cast(1000)); movingTransform->SetParameters(parameters); - constexpr MetricType::MeasureType expectedMetricMax = itk::NumericTraits::max(); + constexpr MetricType::MeasureType expectedMetricMax{ itk::NumericTraits::max() }; std::cout << "Testing non-overlapping images. Expect a warning:" << std::endl; metric->GetValueAndDerivative(valueReturn2, derivativeReturn); if (metric->GetNumberOfValidPoints() != 0 || itk::Math::NotAlmostEquals(valueReturn2, expectedMetricMax)) diff --git a/Modules/Registration/Metricsv4/test/itkJointHistogramMutualInformationImageToImageRegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkJointHistogramMutualInformationImageToImageRegistrationTest.cxx index 026eaf50b9b..2561be5de19 100644 --- a/Modules/Registration/Metricsv4/test/itkJointHistogramMutualInformationImageToImageRegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkJointHistogramMutualInformationImageToImageRegistrationTest.cxx @@ -170,7 +170,7 @@ itkJointHistogramMutualInformationImageToImageRegistrationTest(int argc, char * std::cout << " iterations " << numberOfIterations << " displacementIterations " << numberOfDisplacementIterations << std::endl; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = double; // I assume png is unsigned short using FixedImageType = itk::Image; @@ -275,7 +275,7 @@ itkJointHistogramMutualInformationImageToImageRegistrationTest(int argc, char * metric->SetMovingImage(movingImage); metric->SetFixedTransform(identityTransform); metric->SetMovingTransform(affineTransform); - constexpr bool gaussian = false; + constexpr bool gaussian{ false }; metric->SetUseMovingImageGradientFilter(gaussian); metric->SetUseFixedImageGradientFilter(gaussian); metric->Initialize(); diff --git a/Modules/Registration/Metricsv4/test/itkLabeledPointSetMetricRegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkLabeledPointSetMetricRegistrationTest.cxx index f901809a0bb..71225fbd926 100644 --- a/Modules/Registration/Metricsv4/test/itkLabeledPointSetMetricRegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkLabeledPointSetMetricRegistrationTest.cxx @@ -85,7 +85,7 @@ itkLabeledPointSetMetricRegistrationTestPerMetric(unsigned int numberOfIteration auto label = static_cast(1.5 + count / 35); PointType fixedPoint; - constexpr float radius = 100.0; + constexpr float radius{ 100.0 }; fixedPoint[0] = radius * std::cos(theta); fixedPoint[1] = radius * std::sin(theta); if (PointSetType::PointDimension > 2) @@ -192,7 +192,7 @@ itkLabeledPointSetMetricRegistrationTest(int argc, char * argv[]) numberOfIterations = std::stoi(argv[1]); } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PointSetType = itk::PointSet; int allSuccess = EXIT_SUCCESS; diff --git a/Modules/Registration/Metricsv4/test/itkMattesMutualInformationImageToImageMetricv4RegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkMattesMutualInformationImageToImageMetricv4RegistrationTest.cxx index 2bda3e6166c..91080190557 100644 --- a/Modules/Registration/Metricsv4/test/itkMattesMutualInformationImageToImageMetricv4RegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkMattesMutualInformationImageToImageMetricv4RegistrationTest.cxx @@ -76,7 +76,7 @@ itkMattesMutualInformationImageToImageMetricv4RegistrationTest(int argc, char * std::cout << " iterations " << numberOfIterations << " displacementIterations " << numberOfDisplacementIterations << std::endl; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = double; // I assume png is unsigned short using FixedImageType = itk::Image; @@ -184,7 +184,7 @@ itkMattesMutualInformationImageToImageMetricv4RegistrationTest(int argc, char * metric->SetMovingImage(movingImage); metric->SetFixedTransform(identityTransform); metric->SetMovingTransform(affineTransform); - constexpr bool gaussian = false; + constexpr bool gaussian{ false }; metric->SetUseMovingImageGradientFilter(gaussian); metric->SetUseFixedImageGradientFilter(gaussian); metric->Initialize(); diff --git a/Modules/Registration/Metricsv4/test/itkMattesMutualInformationImageToImageMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkMattesMutualInformationImageToImageMetricv4Test.cxx index 5957da110f8..9ac1fca1d13 100644 --- a/Modules/Registration/Metricsv4/test/itkMattesMutualInformationImageToImageMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkMattesMutualInformationImageToImageMetricv4Test.cxx @@ -220,7 +220,7 @@ TestMattesMetricWithAffineTransform(TInterpolator * const interpolator, const bo metric->SetMovingImage(imgMoving); // set the number of histogram bins - constexpr itk::SizeValueType numberOfHistogramBins = 50; + constexpr itk::SizeValueType numberOfHistogramBins{ 50 }; metric->SetNumberOfHistogramBins(numberOfHistogramBins); ITK_TEST_SET_GET_VALUE(numberOfHistogramBins, metric->GetNumberOfHistogramBins()); @@ -346,7 +346,7 @@ TestMattesMetricWithAffineTransform(TInterpolator * const interpolator, const bo ParametersType parameters1Minus(numberOfParameters); ParametersType parameters2Minus(numberOfParameters); - constexpr double delta = 0.00001; + constexpr double delta{ 0.00001 }; const double tolerance = (useSampling) ? 0.075 : 0.014; for (unsigned int perturbParamIndex = 0; perturbParamIndex < numberOfParameters; ++perturbParamIndex) @@ -391,7 +391,7 @@ TestMattesMetricWithAffineTransform(TInterpolator * const interpolator, const bo for (size_t v = 0; v < 4; ++v) { - constexpr double max_percent_diff_in_metric = 0.05; + constexpr double max_percent_diff_in_metric{ 0.05 }; if (itk::Math::abs(itk::Math::abs(new_values[v] / known_values[v]) - 1.0) > max_percent_diff_in_metric) { std::cout << "\t[FAILED] known values for metric values not computed correctly." << std::setprecision(16) @@ -440,7 +440,7 @@ int itkMattesMutualInformationImageToImageMetricv4Test(int, char *[]) { - constexpr size_t imageSize = 100; // NOTE 100 is very small + constexpr size_t imageSize{ 100 }; // NOTE 100 is very small // using ImageType = itk::Image; using ImageType = itk::Image; diff --git a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest.cxx b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest.cxx index 8f04d2bdbcb..63137633aff 100644 --- a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest.cxx @@ -31,9 +31,9 @@ int itkMeanSquaresImageToImageMetricv4OnVectorTest(int, char ** const) { - constexpr unsigned int imageSize = 5; - constexpr unsigned int imageDimensionality = 3; - constexpr unsigned int vectorLength = 2; + constexpr unsigned int imageSize{ 5 }; + constexpr unsigned int imageDimensionality{ 3 }; + constexpr unsigned int vectorLength{ 2 }; using VectorType = itk::Vector; using ImageType = itk::Image; diff --git a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest2.cxx b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest2.cxx index abcd4f5c047..4aedf57b6be 100644 --- a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest2.cxx +++ b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest2.cxx @@ -29,8 +29,8 @@ int itkMeanSquaresImageToImageMetricv4OnVectorTest2Run(typename TMetric::MeasureType & measureReturn, typename TMetric::DerivativeType & derivativeReturn) { - constexpr unsigned int imageSize = 5; - constexpr unsigned int imageDimensionality = 3; + constexpr unsigned int imageSize{ 5 }; + constexpr unsigned int imageDimensionality{ 3 }; using ImageType = typename TMetric::FixedImageType; @@ -126,8 +126,8 @@ itkMeanSquaresImageToImageMetricv4OnVectorTest2Run(typename TMetric::MeasureType int itkMeanSquaresImageToImageMetricv4OnVectorTest2(int, char ** const) { - constexpr unsigned int imageDimensionality = 3; - constexpr unsigned int vectorLength = 3; + constexpr unsigned int imageDimensionality{ 3 }; + constexpr unsigned int vectorLength{ 3 }; /* The vector metric */ using VectorType = itk::Vector; @@ -155,7 +155,7 @@ itkMeanSquaresImageToImageMetricv4OnVectorTest2(int, char ** const) std::cout << "scalarMeasure: " << scalarMeasure << " scalarDerivative: " << scalarDerivative << std::endl; /* Compare */ - constexpr double tolerance = 1e-8; + constexpr double tolerance{ 1e-8 }; if (itk::Math::abs(scalarMeasure - (vectorMeasure / vectorLength)) > tolerance) { std::cerr << "Measures do not match within tolerance. scalarMeasure, vectorMeasure: " << scalarMeasure << ", " diff --git a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4RegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4RegistrationTest.cxx index 982048dc95f..d22e7af50ff 100644 --- a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4RegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4RegistrationTest.cxx @@ -73,7 +73,7 @@ itkMeanSquaresImageToImageMetricv4RegistrationTest(int argc, char * argv[]) std::cout << " iterations " << numberOfIterations << " displacementIterations " << numberOfDisplacementIterations << std::endl; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = double; // I assume png is unsigned short using FixedImageType = itk::Image; @@ -173,7 +173,7 @@ itkMeanSquaresImageToImageMetricv4RegistrationTest(int argc, char * argv[]) metric->SetMovingImage(movingImage); metric->SetFixedTransform(identityTransform); metric->SetMovingTransform(affineTransform); - constexpr bool gaussian = false; + constexpr bool gaussian{ false }; metric->SetUseMovingImageGradientFilter(gaussian); metric->SetUseFixedImageGradientFilter(gaussian); metric->Initialize(); diff --git a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4RegistrationTest2.cxx b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4RegistrationTest2.cxx index 41e6c936db6..7e68f13a8d5 100644 --- a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4RegistrationTest2.cxx +++ b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4RegistrationTest2.cxx @@ -88,7 +88,7 @@ itkMeanSquaresImageToImageMetricv4RegistrationTest2(int argc, char * argv[]) /** load the images **/ - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = double; using FixedImageType = itk::Image; @@ -162,7 +162,7 @@ itkMeanSquaresImageToImageMetricv4RegistrationTest2(int argc, char * argv[]) metric->SetMovingImage(movingImage); metric->SetFixedTransform(identityTransform); metric->SetMovingTransform(affineTransform); - constexpr bool gaussian = false; + constexpr bool gaussian{ false }; metric->SetUseMovingImageGradientFilter(gaussian); metric->SetUseFixedImageGradientFilter(gaussian); metric->Initialize(); diff --git a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4SpeedTest.cxx b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4SpeedTest.cxx index 4f9b312123b..755d29b5351 100644 --- a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4SpeedTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4SpeedTest.cxx @@ -36,7 +36,7 @@ itkMeanSquaresImageToImageMetricv4SpeedTest(int argc, char * argv[]) std::cout << "image dim: " << imageSize << ", reps: " << numberOfReps << std::endl; - constexpr unsigned int imageDimensionality = 3; + constexpr unsigned int imageDimensionality{ 3 }; using ImageType = itk::Image; auto size = ImageType::SizeType::Filled(imageSize); diff --git a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4Test.cxx index 0de95fd57ba..b8388aeebd7 100644 --- a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4Test.cxx @@ -30,8 +30,8 @@ int itkMeanSquaresImageToImageMetricv4Test(int, char ** const) { - constexpr unsigned int imageSize = 5; - constexpr unsigned int imageDimensionality = 3; + constexpr unsigned int imageSize{ 5 }; + constexpr unsigned int imageDimensionality{ 3 }; using ImageType = itk::Image; auto size = ImageType::SizeType::Filled(imageSize); diff --git a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4VectorRegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4VectorRegistrationTest.cxx index 93ed7218034..fa4154363f1 100644 --- a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4VectorRegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4VectorRegistrationTest.cxx @@ -75,7 +75,7 @@ itkMeanSquaresImageToImageMetricv4VectorRegistrationTest(int argc, char * argv[] std::cout << " affine iterations " << numberOfAffineIterations << " displacementIterations " << numberOfDisplacementIterations << std::endl; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; // RGBPixel type is not supported by GradientRecursiveGaussianFilter at this point. // using PixelType = itk::RGBPixel; @@ -181,7 +181,7 @@ itkMeanSquaresImageToImageMetricv4VectorRegistrationTest(int argc, char * argv[] metric->SetMovingImage(movingImage); metric->SetFixedTransform(identityTransform); metric->SetMovingTransform(affineTransform); - constexpr bool gaussian = false; + constexpr bool gaussian{ false }; metric->SetUseMovingImageGradientFilter(gaussian); metric->SetUseFixedImageGradientFilter(gaussian); metric->Initialize(); diff --git a/Modules/Registration/Metricsv4/test/itkMetricImageGradientTest.cxx b/Modules/Registration/Metricsv4/test/itkMetricImageGradientTest.cxx index 7dba32ce005..74bb960eb1b 100644 --- a/Modules/Registration/Metricsv4/test/itkMetricImageGradientTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkMetricImageGradientTest.cxx @@ -224,7 +224,7 @@ itkMetricImageGradientTestRunTest(unsigned int imageSize, // Fill images, with a border itk::ImageRegionIteratorWithIndex it(image, region); it.GoToBegin(); - constexpr unsigned int imageBorder = 20; + constexpr unsigned int imageBorder{ 20 }; while (!it.IsAtEnd()) { it.Set(0); @@ -263,7 +263,7 @@ itkMetricImageGradientTestRunTest(unsigned int imageSize, const typename TTransform::Pointer movingTransform = transform->GetInverseTransform().GetPointer(); // Write out the images if requested, for debugging only - constexpr bool writeImages = false; + constexpr bool writeImages{ false }; if constexpr (writeImages) { using OutputPixelType = double; @@ -367,12 +367,12 @@ int itkMetricImageGradientTest(int argc, char * argv[]) { using DimensionSizeType = unsigned int; - constexpr DimensionSizeType imageSize = 60; + constexpr DimensionSizeType imageSize{ 60 }; unsigned int dimensionality = 3; double minimumAverage = itk::NumericTraits::max(); double rotationDegrees = 0.0; // (3.0); - constexpr double maxDegrees = 359.0; - constexpr double degreeStep = 15.0; //(3.0); + constexpr double maxDegrees{ 359.0 }; + constexpr double degreeStep{ 15.0 }; //(3.0); std::string outputPath(""); if (argc >= 2) @@ -455,7 +455,7 @@ itkMetricImageGradientTest(int argc, char * argv[]) } std::cout << "minimumAverage: " << minimumAverage << std::endl; - constexpr double threshold = 0.96; + constexpr double threshold{ 0.96 }; if (minimumAverage < threshold) { std::cerr << "Minimum average of all runs is below threshold of " << threshold << std::endl; diff --git a/Modules/Registration/Metricsv4/test/itkMultiGradientImageToImageMetricv4RegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkMultiGradientImageToImageMetricv4RegistrationTest.cxx index 6a2cda343f1..abb6217d3cc 100644 --- a/Modules/Registration/Metricsv4/test/itkMultiGradientImageToImageMetricv4RegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkMultiGradientImageToImageMetricv4RegistrationTest.cxx @@ -68,7 +68,7 @@ itkMultiGradientImageToImageMetricv4RegistrationTest(int argc, char * argv[]) } std::cout << " iterations " << numberOfIterations << std::endl; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = double; // I assume png is unsigned short using FixedImageType = itk::Image; diff --git a/Modules/Registration/Metricsv4/test/itkMultiStartImageToImageMetricv4RegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkMultiStartImageToImageMetricv4RegistrationTest.cxx index d054701f2c9..f8bea2bf005 100644 --- a/Modules/Registration/Metricsv4/test/itkMultiStartImageToImageMetricv4RegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkMultiStartImageToImageMetricv4RegistrationTest.cxx @@ -70,7 +70,7 @@ itkMultiStartImageToImageMetricv4RegistrationTest(int argc, char * argv[]) { rotateinput = true; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned short; // I assume png is unsigned short using InternalPixelType = double; @@ -178,7 +178,7 @@ itkMultiStartImageToImageMetricv4RegistrationTest(int argc, char * argv[]) } metric->SetFixedTransform(identityTransform); metric->SetMovingTransform(affineTransform); - constexpr bool gaussian = false; + constexpr bool gaussian{ false }; metric->SetUseMovingImageGradientFilter(gaussian); metric->SetUseFixedImageGradientFilter(gaussian); metric->Initialize(); @@ -200,7 +200,7 @@ itkMultiStartImageToImageMetricv4RegistrationTest(int argc, char * argv[]) using MOptimizerType = itk::MultiStartOptimizerv4; auto MOptimizer = MOptimizerType::New(); MOptimizerType::ParametersListType parametersList = MOptimizer->GetParametersList(); - constexpr float rotplus = 10; + constexpr float rotplus{ 10 }; // for ( float i = 180; i <= 180; i+=rotplus ) for (float i = 0; i < 360; i += rotplus) { diff --git a/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4RegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4RegistrationTest.cxx index 721a4feb782..5f808375f76 100644 --- a/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4RegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4RegistrationTest.cxx @@ -83,8 +83,8 @@ ObjectToObjectMultiMetricv4RegistrationTestCreateImages(typename TImage::Pointer using CoordinateRepresentationType = PixelType; // Create two simple images - constexpr itk::SizeValueType ImageSize = 100; - constexpr itk::OffsetValueType boundary = 6; + constexpr itk::SizeValueType ImageSize{ 100 }; + constexpr itk::OffsetValueType boundary{ 6 }; // Declare Gaussian Sources using GaussianImageSourceType = itk::GaussianImageSource; @@ -195,7 +195,7 @@ ObjectToObjectMultiMetricv4RegistrationTestRun(typename TMetric::Pointer & int itkObjectToObjectMultiMetricv4RegistrationTest(int argc, char * argv[]) { - constexpr int Dimension = 2; + constexpr int Dimension{ 2 }; using ImageType = itk::Image; int numberOfIterations = 30; diff --git a/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4Test.cxx index 1754fd4d8f4..c671300716f 100644 --- a/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4Test.cxx @@ -37,7 +37,7 @@ takes N metrics and assigns a weight to each metric's result. */ -constexpr unsigned int ObjectToObjectMultiMetricv4TestDimension = 2; +constexpr unsigned int ObjectToObjectMultiMetricv4TestDimension{ 2 }; using ObjectToObjectMultiMetricv4TestMultiMetricType = itk::ObjectToObjectMultiMetricv4; @@ -201,7 +201,7 @@ int itkObjectToObjectMultiMetricv4TestRun(bool useDisplacementTransform) { // Create two simple images - constexpr unsigned int Dimension = ObjectToObjectMultiMetricv4TestDimension; + constexpr unsigned int Dimension{ ObjectToObjectMultiMetricv4TestDimension }; using PixelType = double; using CoordinateRepresentationType = double; @@ -215,7 +215,7 @@ itkObjectToObjectMultiMetricv4TestRun(bool useDisplacementTransform) // Note: the following declarations are classical arrays FixedImageType::SizeValueType fixedImageSize[] = { 100, 100 }; FixedImageType::SpacingValueType fixedImageSpacing[] = { 1.0f, 1.0f }; - constexpr FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; + constexpr FixedImageType::PointValueType fixedImageOrigin[]{ 0.0f, 0.0f }; auto fixedImageSource = FixedImageSourceType::New(); fixedImageSource->SetSize(fixedImageSize); diff --git a/Modules/Registration/PDEDeformable/test/itkDemonsRegistrationFilterTest.cxx b/Modules/Registration/PDEDeformable/test/itkDemonsRegistrationFilterTest.cxx index ced6faf9d0f..54d106ff41e 100644 --- a/Modules/Registration/PDEDeformable/test/itkDemonsRegistrationFilterTest.cxx +++ b/Modules/Registration/PDEDeformable/test/itkDemonsRegistrationFilterTest.cxx @@ -147,8 +147,8 @@ itkDemonsRegistrationFilterTest(int, char *[]) initField->Allocate(); double center[ImageDimension]; - constexpr PixelType fgnd = 250; - constexpr PixelType bgnd = 15; + constexpr PixelType fgnd{ 250 }; + constexpr PixelType bgnd{ 15 }; // fill moving with circle center[0] = 64; @@ -192,7 +192,7 @@ itkDemonsRegistrationFilterTest(int, char *[]) registrator->SetNumberOfIterations(numberOfIterations); ITK_TEST_SET_GET_VALUE(numberOfIterations, registrator->GetNumberOfIterations()); - constexpr double standardDeviationsVal = 1.0; + constexpr double standardDeviationsVal{ 1.0 }; const RegistrationType::StandardDeviationsType standardDeviations{ standardDeviationsVal }; registrator->SetStandardDeviations(standardDeviationsVal); ITK_TEST_SET_GET_VALUE(standardDeviations, registrator->GetStandardDeviations()); @@ -204,7 +204,7 @@ itkDemonsRegistrationFilterTest(int, char *[]) registrator->SetMaximumError(maximumError); ITK_TEST_SET_GET_VALUE(maximumError, registrator->GetMaximumError()); - constexpr unsigned int maximumKernelWidth = 10; + constexpr unsigned int maximumKernelWidth{ 10 }; registrator->SetMaximumKernelWidth(maximumKernelWidth); ITK_TEST_SET_GET_VALUE(maximumKernelWidth, registrator->GetMaximumKernelWidth()); @@ -218,7 +218,7 @@ itkDemonsRegistrationFilterTest(int, char *[]) auto smoothUpdateField = false; ITK_TEST_SET_GET_BOOLEAN(registrator, SmoothUpdateField, smoothUpdateField); - constexpr double updateFieldStandardDeviationsVal = 1.0; + constexpr double updateFieldStandardDeviationsVal{ 1.0 }; const RegistrationType::StandardDeviationsType updateFieldStandardDeviations{ updateFieldStandardDeviationsVal }; registrator->SetUpdateFieldStandardDeviations(updateFieldStandardDeviationsVal); ITK_TEST_SET_GET_VALUE(updateFieldStandardDeviations, registrator->GetUpdateFieldStandardDeviations()); diff --git a/Modules/Registration/PDEDeformable/test/itkDiffeomorphicDemonsRegistrationFilterTest.cxx b/Modules/Registration/PDEDeformable/test/itkDiffeomorphicDemonsRegistrationFilterTest.cxx index 4499d4cc16e..80e1a62855a 100644 --- a/Modules/Registration/PDEDeformable/test/itkDiffeomorphicDemonsRegistrationFilterTest.cxx +++ b/Modules/Registration/PDEDeformable/test/itkDiffeomorphicDemonsRegistrationFilterTest.cxx @@ -166,8 +166,8 @@ itkDiffeomorphicDemonsRegistrationFilterTest(int argc, char * argv[]) initField->SetDirection(direction); double center[ImageDimension]; - constexpr PixelType fgnd = 250; - constexpr PixelType bgnd = 15; + constexpr PixelType fgnd{ 250 }; + constexpr PixelType bgnd{ 15 }; // fill moving with circle center[0] = 64; diff --git a/Modules/Registration/PDEDeformable/test/itkDiffeomorphicDemonsRegistrationFilterTest2.cxx b/Modules/Registration/PDEDeformable/test/itkDiffeomorphicDemonsRegistrationFilterTest2.cxx index 7bb9a994568..f89e1ebb045 100644 --- a/Modules/Registration/PDEDeformable/test/itkDiffeomorphicDemonsRegistrationFilterTest2.cxx +++ b/Modules/Registration/PDEDeformable/test/itkDiffeomorphicDemonsRegistrationFilterTest2.cxx @@ -69,7 +69,7 @@ itkDiffeomorphicDemonsRegistrationFilterTest2(int argc, char * argv[]) } using PixelType = float; - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using ImageType = itk::Image; using VectorType = itk::Vector; diff --git a/Modules/Registration/PDEDeformable/test/itkFastSymmetricForcesDemonsRegistrationFilterTest.cxx b/Modules/Registration/PDEDeformable/test/itkFastSymmetricForcesDemonsRegistrationFilterTest.cxx index 15b3381edc6..cda6a0d6953 100644 --- a/Modules/Registration/PDEDeformable/test/itkFastSymmetricForcesDemonsRegistrationFilterTest.cxx +++ b/Modules/Registration/PDEDeformable/test/itkFastSymmetricForcesDemonsRegistrationFilterTest.cxx @@ -146,8 +146,8 @@ itkFastSymmetricForcesDemonsRegistrationFilterTest(int, char *[]) initField->Allocate(); double center[ImageDimension]; - constexpr PixelType fgnd = 250; - constexpr PixelType bgnd = 15; + constexpr PixelType fgnd{ 250 }; + constexpr PixelType bgnd{ 15 }; // fill moving with circle center[0] = 64; @@ -192,7 +192,7 @@ itkFastSymmetricForcesDemonsRegistrationFilterTest(int, char *[]) registrator->SetNumberOfIterations(numberOfIterations); ITK_TEST_SET_GET_VALUE(numberOfIterations, registrator->GetNumberOfIterations()); - constexpr double standardDeviationsVal = 1.0; + constexpr double standardDeviationsVal{ 1.0 }; const RegistrationType::StandardDeviationsType standardDeviations{ standardDeviationsVal }; registrator->SetStandardDeviations(standardDeviationsVal); ITK_TEST_SET_GET_VALUE(standardDeviations, registrator->GetStandardDeviations()); @@ -204,7 +204,7 @@ itkFastSymmetricForcesDemonsRegistrationFilterTest(int, char *[]) registrator->SetMaximumError(maximumError); ITK_TEST_SET_GET_VALUE(maximumError, registrator->GetMaximumError()); - constexpr unsigned int maximumKernelWidth = 10; + constexpr unsigned int maximumKernelWidth{ 10 }; registrator->SetMaximumKernelWidth(maximumKernelWidth); ITK_TEST_SET_GET_VALUE(maximumKernelWidth, registrator->GetMaximumKernelWidth()); @@ -218,7 +218,7 @@ itkFastSymmetricForcesDemonsRegistrationFilterTest(int, char *[]) auto smoothUpdateField = false; ITK_TEST_SET_GET_BOOLEAN(registrator, SmoothUpdateField, smoothUpdateField); - constexpr double updateFieldStandardDeviationsVal = 1.0; + constexpr double updateFieldStandardDeviationsVal{ 1.0 }; const RegistrationType::StandardDeviationsType updateFieldStandardDeviations{ updateFieldStandardDeviationsVal }; registrator->SetUpdateFieldStandardDeviations(updateFieldStandardDeviationsVal); ITK_TEST_SET_GET_VALUE(updateFieldStandardDeviations, registrator->GetUpdateFieldStandardDeviations()); diff --git a/Modules/Registration/PDEDeformable/test/itkLevelSetMotionRegistrationFilterTest.cxx b/Modules/Registration/PDEDeformable/test/itkLevelSetMotionRegistrationFilterTest.cxx index 2e108c1465d..e4792d1b956 100644 --- a/Modules/Registration/PDEDeformable/test/itkLevelSetMotionRegistrationFilterTest.cxx +++ b/Modules/Registration/PDEDeformable/test/itkLevelSetMotionRegistrationFilterTest.cxx @@ -162,8 +162,8 @@ itkLevelSetMotionRegistrationFilterTest(int argc, char * argv[]) initField->Allocate(); double center[ImageDimension]; - constexpr PixelType fgnd = 250; - constexpr PixelType bgnd = 15; + constexpr PixelType fgnd{ 250 }; + constexpr PixelType bgnd{ 15 }; // fill moving with circle center[0] = 64; @@ -203,15 +203,15 @@ itkLevelSetMotionRegistrationFilterTest(int argc, char * argv[]) registrator->SetMaximumError(0.08); registrator->SetMaximumKernelWidth(10); - constexpr double intensityDifferenceThreshold = 0.001; + constexpr double intensityDifferenceThreshold{ 0.001 }; registrator->SetIntensityDifferenceThreshold(intensityDifferenceThreshold); ITK_TEST_SET_GET_VALUE(intensityDifferenceThreshold, registrator->GetIntensityDifferenceThreshold()); - constexpr double gradientMagnitudeThreshold = 1e-9; + constexpr double gradientMagnitudeThreshold{ 1e-9 }; registrator->SetGradientMagnitudeThreshold(gradientMagnitudeThreshold); ITK_TEST_SET_GET_VALUE(gradientMagnitudeThreshold, registrator->GetGradientMagnitudeThreshold()); - constexpr double alpha = 0.1; + constexpr double alpha{ 0.1 }; registrator->SetAlpha(alpha); ITK_TEST_SET_GET_VALUE(alpha, registrator->GetAlpha()); @@ -313,7 +313,7 @@ itkLevelSetMotionRegistrationFilterTest(int argc, char * argv[]) std::cout << "Number of pixels different: " << numPixelsDifferent << std::endl; - constexpr unsigned int maximumNumberOfPixelsDifferent = 4600; + constexpr unsigned int maximumNumberOfPixelsDifferent{ 4600 }; if (numPixelsDifferent > maximumNumberOfPixelsDifferent) { std::cout << "Test failed - too many pixels different." << std::endl; diff --git a/Modules/Registration/PDEDeformable/test/itkMultiResolutionPDEDeformableRegistrationTest.cxx b/Modules/Registration/PDEDeformable/test/itkMultiResolutionPDEDeformableRegistrationTest.cxx index bc8a9205d16..cf5944c6b03 100644 --- a/Modules/Registration/PDEDeformable/test/itkMultiResolutionPDEDeformableRegistrationTest.cxx +++ b/Modules/Registration/PDEDeformable/test/itkMultiResolutionPDEDeformableRegistrationTest.cxx @@ -154,7 +154,7 @@ itkMultiResolutionPDEDeformableRegistrationTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; @@ -205,8 +205,8 @@ itkMultiResolutionPDEDeformableRegistrationTest(int argc, char * argv[]) initField->SetSpacing(spacing); double center[ImageDimension]; - constexpr PixelType fgnd = 250; - constexpr PixelType bgnd = 15; + constexpr PixelType fgnd{ 250 }; + constexpr PixelType bgnd{ 15 }; // fill moving with circle center[0] = 128; @@ -243,7 +243,7 @@ itkMultiResolutionPDEDeformableRegistrationTest(int argc, char * argv[]) registrator->GetModifiableFixedImagePyramid()->UseShrinkImageFilterOn(); registrator->GetModifiableMovingImagePyramid()->UseShrinkImageFilterOn(); - constexpr unsigned int numLevel = 3; + constexpr unsigned int numLevel{ 3 }; unsigned int numIterations[numLevel]; itk::Array numIterationsArray; diff --git a/Modules/Registration/PDEDeformable/test/itkSymmetricForcesDemonsRegistrationFilterTest.cxx b/Modules/Registration/PDEDeformable/test/itkSymmetricForcesDemonsRegistrationFilterTest.cxx index 2770404cfc3..96223482db1 100644 --- a/Modules/Registration/PDEDeformable/test/itkSymmetricForcesDemonsRegistrationFilterTest.cxx +++ b/Modules/Registration/PDEDeformable/test/itkSymmetricForcesDemonsRegistrationFilterTest.cxx @@ -137,8 +137,8 @@ itkSymmetricForcesDemonsRegistrationFilterTest(int, char *[]) initField->Allocate(); double center[ImageDimension]; - constexpr PixelType fgnd = 250; - constexpr PixelType bgnd = 15; + constexpr PixelType fgnd{ 250 }; + constexpr PixelType bgnd{ 15 }; // fill moving with circle center[0] = 64; @@ -171,7 +171,7 @@ itkSymmetricForcesDemonsRegistrationFilterTest(int, char *[]) registrator->SetStandardDeviations(2.0); registrator->SetStandardDeviations(1.0); - constexpr double intensityDifferenceThreshold = 0.001; + constexpr double intensityDifferenceThreshold{ 0.001 }; registrator->SetIntensityDifferenceThreshold(intensityDifferenceThreshold); ITK_TEST_SET_GET_VALUE(intensityDifferenceThreshold, registrator->GetIntensityDifferenceThreshold()); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkBSplineImageRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkBSplineImageRegistrationTest.cxx index a7cfd9440e2..44fb2bca184 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkBSplineImageRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkBSplineImageRegistrationTest.cxx @@ -222,8 +222,8 @@ PerformBSplineImageRegistration(int argc, char * argv[]) auto compositeTransform = CompositeTransformType::New(); compositeTransform->AddTransform(affineSimple->GetModifiableTransform()); - constexpr unsigned int numberOfLevels = 3; - constexpr unsigned int SplineOrder = 3; + constexpr unsigned int numberOfLevels{ 3 }; + constexpr unsigned int SplineOrder{ 3 }; using BSplineTransformType = itk::BSplineTransform; using BSplineRegistrationType = itk::ImageRegistrationMethodv4; diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkBSplineSyNImageRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkBSplineSyNImageRegistrationTest.cxx index 1eb24613875..9600d3aa143 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkBSplineSyNImageRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkBSplineSyNImageRegistrationTest.cxx @@ -211,7 +211,7 @@ PerformBSplineSyNImageRegistration(int argc, char * argv[]) // if the user wishes to add that option, they can use the class // GaussianSmoothingOnUpdateDisplacementFieldTransformAdaptor - constexpr unsigned int numberOfLevels = 3; + constexpr unsigned int numberOfLevels{ 3 }; typename DisplacementFieldRegistrationType::NumberOfIterationsArrayType numberOfIterationsPerLevel; numberOfIterationsPerLevel.SetSize(3); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkBSplineSyNPointSetRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkBSplineSyNPointSetRegistrationTest.cxx index 140dd340c3d..6b58531fe09 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkBSplineSyNPointSetRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkBSplineSyNPointSetRegistrationTest.cxx @@ -24,7 +24,7 @@ int itkBSplineSyNPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PointSetType = itk::PointSet; @@ -55,7 +55,7 @@ itkBSplineSyNPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(ar auto label = static_cast(1.5 + count / 100); PointType fixedPoint; - constexpr float radius = 100.0; + constexpr float radius{ 100.0 }; fixedPoint[0] = radius * std::cos(theta); fixedPoint[1] = radius * std::sin(theta); if constexpr (PointSetType::PointDimension > 2) @@ -154,7 +154,7 @@ itkBSplineSyNPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(ar // if the user wishes to add that option, they can use the class // GaussianSmoothingOnUpdateDisplacementFieldTransformAdaptor - constexpr unsigned int numberOfLevels = 3; + constexpr unsigned int numberOfLevels{ 3 }; DisplacementFieldRegistrationType::NumberOfIterationsArrayType numberOfIterationsPerLevel; numberOfIterationsPerLevel.SetSize(3); @@ -232,7 +232,7 @@ itkBSplineSyNPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(ar // applying the resultant transform to moving points and verify result std::cout << "Fixed\tMoving\tMovingTransformed\tFixedTransformed\tDiff" << std::endl; - constexpr PointType::ValueType tolerance = 0.01; + constexpr PointType::ValueType tolerance{ 0.01 }; float averageError = 0.0; for (unsigned int n = 0; n < movingPoints->GetNumberOfPoints(); ++n) diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkImageRegistrationSamplingTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkImageRegistrationSamplingTest.cxx index aba6321f8cb..4268a35f09b 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkImageRegistrationSamplingTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkImageRegistrationSamplingTest.cxx @@ -37,7 +37,7 @@ itkImageRegistrationSamplingTest(int, char *[]) ITK_TRY_EXPECT_NO_EXCEPTION(registrationMethod->SetMetricSamplingPercentage(0.1)); - constexpr unsigned int NUM_ERRORS = 3; + constexpr unsigned int NUM_ERRORS{ 3 }; constexpr RegistrationType::RealType errorValues[NUM_ERRORS] = { -0.1, 0.0, 1.1 }; for (const double errorValue : errorValues) { diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkQuasiNewtonOptimizerv4RegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkQuasiNewtonOptimizerv4RegistrationTest.cxx index 16bb3164492..aba7a701f2f 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkQuasiNewtonOptimizerv4RegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkQuasiNewtonOptimizerv4RegistrationTest.cxx @@ -198,7 +198,7 @@ itkQuasiNewtonOptimizerv4RegistrationTestMain(int argc, char * argv[]) metric->SetMovingImage(movingImage); metric->SetFixedTransform(identityTransform); metric->SetMovingTransform(affineTransform); - constexpr bool gaussian = false; + constexpr bool gaussian{ false }; metric->SetUseMovingImageGradientFilter(gaussian); metric->SetUseFixedImageGradientFilter(gaussian); metric->Initialize(); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest2.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest2.cxx index 1b13c3d75ff..96e5a73aa41 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest2.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest2.cxx @@ -206,7 +206,7 @@ PerformSimpleImageRegistration2(int argc, char * argv[]) const typename RegistrationType::MetricSamplingStrategyEnum rigidSamplingStrategy = RegistrationType::MetricSamplingStrategyEnum::RANDOM; - constexpr double rigidSamplingPercentage = 0.20; + constexpr double rigidSamplingPercentage{ 0.20 }; rigidRegistration->SetMetricSamplingStrategy(rigidSamplingStrategy); ITK_TEST_SET_GET_VALUE(rigidSamplingStrategy, rigidRegistration->GetMetricSamplingStrategy()); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkSimplePointSetRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkSimplePointSetRegistrationTest.cxx index 76d6e52149e..3543cfa6eeb 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkSimplePointSetRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkSimplePointSetRegistrationTest.cxx @@ -104,8 +104,8 @@ class CommandIterationUpdate : public itk::Command int itkSimplePointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) { - constexpr unsigned int Dimension = 2; - constexpr unsigned int numberOfIterations = 20; + constexpr unsigned int Dimension{ 2 }; + constexpr unsigned int numberOfIterations{ 20 }; using PointSetType = itk::PointSet; @@ -136,7 +136,7 @@ itkSimplePointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[ auto label = static_cast(1.5 + count / 100); PointType fixedPoint; - constexpr float radius = 100.0; + constexpr float radius{ 100.0 }; fixedPoint[0] = radius * std::cos(theta); fixedPoint[1] = radius * std::sin(theta); if constexpr (PointSetType::PointDimension > 2) @@ -232,7 +232,7 @@ itkSimplePointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[ // applying the resultant transform to moving points and verify result std::cout << "Fixed\tMoving\tMovingTransformed\tFixedTransformed\tDiff" << std::endl; bool passed = true; - constexpr PointType::ValueType tolerance = 1e-2; + constexpr PointType::ValueType tolerance{ 1e-2 }; const AffineTransformType::InverseTransformBasePointer affineInverseTransform = affineSimple->GetModifiableTransform()->GetInverseTransform(); for (unsigned int n = 0; n < movingPoints->GetNumberOfPoints(); ++n) diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkSyNImageRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkSyNImageRegistrationTest.cxx index 32cf0ce1ae1..43a9857d5a5 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkSyNImageRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkSyNImageRegistrationTest.cxx @@ -261,7 +261,7 @@ PerformDisplacementFieldImageRegistration(int argc, char * argv[]) // if the user wishes to add that option, they can use the class // GaussianSmoothingOnUpdateDisplacementFieldTransformAdaptor - constexpr unsigned int numberOfLevels = 3; + constexpr unsigned int numberOfLevels{ 3 }; typename DisplacementFieldRegistrationType::NumberOfIterationsArrayType numberOfIterationsPerLevel; numberOfIterationsPerLevel.SetSize(3); @@ -274,8 +274,8 @@ PerformDisplacementFieldImageRegistration(int argc, char * argv[]) numberOfIterationsPerLevel[1] = 1; numberOfIterationsPerLevel[2] = 1; #endif - constexpr RealType varianceForUpdateField = 1.75; - constexpr RealType varianceForTotalField = 0.5; + constexpr RealType varianceForUpdateField{ 1.75 }; + constexpr RealType varianceForTotalField{ 0.5 }; typename DisplacementFieldRegistrationType::ShrinkFactorsArrayType shrinkFactorsPerLevel; shrinkFactorsPerLevel.SetSize(3); @@ -398,7 +398,7 @@ PerformDisplacementFieldImageRegistration(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int convergenceWindowSize = 10; + constexpr unsigned int convergenceWindowSize{ 10 }; displacementFieldRegistration->SetConvergenceWindowSize(convergenceWindowSize); ITK_TEST_SET_GET_VALUE(convergenceWindowSize, displacementFieldRegistration->GetConvergenceWindowSize()); @@ -474,7 +474,7 @@ itkSyNImageRegistrationTest(int argc, char * argv[]) // Exercise the objet's basic methods outside the templated test helper to // avoid the Superclass name not being found. - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = double; using FixedImageType = itk::Image; diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkSyNPointSetRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkSyNPointSetRegistrationTest.cxx index 014a73fc4f5..7d77c5c0fdb 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkSyNPointSetRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkSyNPointSetRegistrationTest.cxx @@ -25,7 +25,7 @@ int itkSyNPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PointSetType = itk::PointSet; @@ -56,7 +56,7 @@ itkSyNPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) auto label = static_cast(1.5 + count / 100); PointType fixedPoint; - constexpr float radius = 100.0; + constexpr float radius{ 100.0 }; fixedPoint[0] = radius * std::cos(theta); fixedPoint[1] = radius * std::sin(theta); if (PointSetType::PointDimension > 2) @@ -146,7 +146,7 @@ itkSyNPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) // if the user wishes to add that option, they can use the class // GaussianSmoothingOnUpdateDisplacementFieldTransformAdaptor - constexpr unsigned int numberOfLevels = 3; + constexpr unsigned int numberOfLevels{ 3 }; DisplacementFieldRegistrationType::NumberOfIterationsArrayType numberOfIterationsPerLevel; numberOfIterationsPerLevel.SetSize(3); @@ -154,8 +154,8 @@ itkSyNPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) numberOfIterationsPerLevel[1] = 1; numberOfIterationsPerLevel[2] = 50; - constexpr double varianceForUpdateField = 5; - constexpr double varianceForTotalField = 0.0; + constexpr double varianceForUpdateField{ 5 }; + constexpr double varianceForTotalField{ 0.0 }; displacementFieldRegistration->SetGaussianSmoothingVarianceForTheUpdateField(varianceForUpdateField); displacementFieldRegistration->SetGaussianSmoothingVarianceForTheTotalField(varianceForTotalField); @@ -203,7 +203,7 @@ itkSyNPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) // applying the resultant transform to moving points and verify result std::cout << "Fixed\tMoving\tMovingTransformed\tFixedTransformed\tDiff" << std::endl; - constexpr PointType::ValueType tolerance = 0.1; + constexpr PointType::ValueType tolerance{ 0.1 }; float averageError = 0.0; for (unsigned int n = 0; n < movingPoints->GetNumberOfPoints(); ++n) diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingBSplineVelocityFieldPointSetRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingBSplineVelocityFieldPointSetRegistrationTest.cxx index 0b889f57005..f63192d5e94 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingBSplineVelocityFieldPointSetRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingBSplineVelocityFieldPointSetRegistrationTest.cxx @@ -26,7 +26,7 @@ int itkTimeVaryingBSplineVelocityFieldPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PointSetType = itk::PointSet; @@ -55,7 +55,7 @@ itkTimeVaryingBSplineVelocityFieldPointSetRegistrationTest(int itkNotUsed(argc), for (float theta = 0; theta < 2.0 * itk::Math::pi; theta += 0.1) { PointType fixedPoint; - constexpr float radius = 100.0; + constexpr float radius{ 100.0 }; fixedPoint[0] = radius * std::cos(theta); fixedPoint[1] = radius * std::sin(theta); if constexpr (PointSetType::PointDimension > 2) @@ -285,7 +285,7 @@ itkTimeVaryingBSplineVelocityFieldPointSetRegistrationTest(int itkNotUsed(argc), // applying the resultant transform to moving points and verify result std::cout << "Fixed\tMoving\tMovingTransformed\tFixedTransformed\tDiff" << std::endl; - constexpr PointType::ValueType tolerance = 0.55; + constexpr PointType::ValueType tolerance{ 0.55 }; float averageError = 0.0; for (unsigned int n = 0; n < movingPoints->GetNumberOfPoints(); ++n) diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingVelocityFieldImageRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingVelocityFieldImageRegistrationTest.cxx index 22706f37288..8a180e5aacf 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingVelocityFieldImageRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingVelocityFieldImageRegistrationTest.cxx @@ -294,7 +294,7 @@ PerformTimeVaryingVelocityFieldImageRegistration(int argc, char * argv[]) velocityFieldRegistration->SetConvergenceThreshold(convergenceThreshold); ITK_TEST_SET_GET_VALUE(convergenceThreshold, velocityFieldRegistration->GetConvergenceThreshold()); - constexpr unsigned int convergenceWindowSize = 10; + constexpr unsigned int convergenceWindowSize{ 10 }; velocityFieldRegistration->SetConvergenceWindowSize(convergenceWindowSize); ITK_TEST_SET_GET_VALUE(convergenceWindowSize, velocityFieldRegistration->GetConvergenceWindowSize()); diff --git a/Modules/Segmentation/Classifiers/include/itkImageKmeansModelEstimator.h b/Modules/Segmentation/Classifiers/include/itkImageKmeansModelEstimator.h index bf5383e0910..4411e67c0c2 100644 --- a/Modules/Segmentation/Classifiers/include/itkImageKmeansModelEstimator.h +++ b/Modules/Segmentation/Classifiers/include/itkImageKmeansModelEstimator.h @@ -32,10 +32,10 @@ #include "itkImageModelEstimatorBase.h" -constexpr int8_t ONEBAND = 1; -constexpr int8_t GLA_CONVERGED = 1; -constexpr int8_t GLA_NOT_CONVERGED = 2; -constexpr int8_t LBG_COMPLETED = 3; +constexpr int8_t ONEBAND{ 1 }; +constexpr int8_t GLA_CONVERGED{ 1 }; +constexpr int8_t GLA_NOT_CONVERGED{ 2 }; +constexpr int8_t LBG_COMPLETED{ 3 }; namespace itk { diff --git a/Modules/Segmentation/Classifiers/test/itkBayesianClassifierImageFilterTest.cxx b/Modules/Segmentation/Classifiers/test/itkBayesianClassifierImageFilterTest.cxx index 9daf4cb5ff3..a8b036eff77 100644 --- a/Modules/Segmentation/Classifiers/test/itkBayesianClassifierImageFilterTest.cxx +++ b/Modules/Segmentation/Classifiers/test/itkBayesianClassifierImageFilterTest.cxx @@ -178,7 +178,7 @@ itkBayesianClassifierImageFilterTest(int argc, char * argv[]) } // Set up reader - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned char; using InputImageType = itk::Image; using ReaderType = itk::ImageFileReader; @@ -254,7 +254,7 @@ itkBayesianClassifierImageFilterTest(int argc, char * argv[]) // The hypothesis is that the vector element type for // TestInitialLabelImageType must be the same as for TestPriorType { - constexpr unsigned int TestDimension = 2; + constexpr unsigned int TestDimension{ 2 }; using TestLabelType = unsigned char; using TestPosteriorType = float; @@ -274,7 +274,7 @@ itkBayesianClassifierImageFilterTest(int argc, char * argv[]) } { - constexpr unsigned int TestDimension = 2; + constexpr unsigned int TestDimension{ 2 }; using TestLabelType = unsigned char; using TestPosteriorType = float; @@ -293,7 +293,7 @@ itkBayesianClassifierImageFilterTest(int argc, char * argv[]) } { - constexpr unsigned int TestDimension = 2; + constexpr unsigned int TestDimension{ 2 }; using TestLabelType = unsigned char; using TestPosteriorType = float; diff --git a/Modules/Segmentation/Classifiers/test/itkImageClassifierFilterTest.cxx b/Modules/Segmentation/Classifiers/test/itkImageClassifierFilterTest.cxx index e7e3f277d58..68a6309b802 100644 --- a/Modules/Segmentation/Classifiers/test/itkImageClassifierFilterTest.cxx +++ b/Modules/Segmentation/Classifiers/test/itkImageClassifierFilterTest.cxx @@ -37,12 +37,12 @@ itkImageClassifierFilterTest(int argc, char * argv[]) << "ClassifiedOutputImage name" << std::endl; return EXIT_FAILURE; } - constexpr unsigned int MeasurementVectorSize = 1; + constexpr unsigned int MeasurementVectorSize{ 1 }; using MeasurementComponentType = double; - constexpr unsigned int numberOfClasses = 2; + constexpr unsigned int numberOfClasses{ 2 }; using InputPixelType = itk::FixedArray; - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using InputImageType = itk::Image; using OutputPixelType = unsigned char; @@ -69,8 +69,8 @@ itkImageClassifierFilterTest(int argc, char * argv[]) // Fill the first half of the input image with pixel intensities // generated from a normal distribution defined by the following parameters - constexpr double mean = 10.5; - constexpr double standardDeviation = 5.0; + constexpr double mean{ 10.5 }; + constexpr double standardDeviation{ 5.0 }; InputImageType::IndexType index; const unsigned int halfSize = size[1] / 2; @@ -89,8 +89,8 @@ itkImageClassifierFilterTest(int argc, char * argv[]) } // Pixel intensities generated from the second normal distribution - constexpr double mean2 = 200.5; - constexpr double standardDeviation2 = 20.0; + constexpr double mean2{ 200.5 }; + constexpr double standardDeviation2{ 20.0 }; for (unsigned int y = halfSize; y < size[1]; ++y) { @@ -141,7 +141,7 @@ itkImageClassifierFilterTest(int argc, char * argv[]) auto estimator = EstimatorType::New(); estimator->SetSample(sample); - constexpr int maximumIteration = 200; + constexpr int maximumIteration{ 200 }; estimator->SetMaximumIteration(maximumIteration); itk::Array initialProportions(numberOfClasses); @@ -181,10 +181,10 @@ itkImageClassifierFilterTest(int argc, char * argv[]) using ClassLabelType = ImageClassifierFilterType::ClassLabelType; - constexpr ClassLabelType class1 = 0; + constexpr ClassLabelType class1{ 0 }; classLabelVector.push_back(class1); - constexpr ClassLabelType class2 = 255; + constexpr ClassLabelType class2{ 255 }; classLabelVector.push_back(class2); // Set a decision rule type diff --git a/Modules/Segmentation/Classifiers/test/itkKmeansModelEstimatorTest.cxx b/Modules/Segmentation/Classifiers/test/itkKmeansModelEstimatorTest.cxx index ce3c8f41a38..ee11eb43a74 100644 --- a/Modules/Segmentation/Classifiers/test/itkKmeansModelEstimatorTest.cxx +++ b/Modules/Segmentation/Classifiers/test/itkKmeansModelEstimatorTest.cxx @@ -22,18 +22,18 @@ #include "itkDistanceToCentroidMembershipFunction.h" // Data definitions -constexpr uint8_t IMGWIDTH = 16; -constexpr uint8_t IMGHEIGHT = 1; +constexpr uint8_t IMGWIDTH{ 16 }; +constexpr uint8_t IMGHEIGHT{ 1 }; // constexpr uint8_t NFRAMES =1; // constexpr uint8_t NUMBANDS =2; // constexpr uint8_t NDIMENSION =3; -constexpr uint8_t CDBKWIDTH = 4; -constexpr uint8_t CDBKHEIGHT = 1; -constexpr uint8_t NFRAMES = 1; -constexpr uint8_t NCODEWORDS = CDBKWIDTH * CDBKHEIGHT * NFRAMES; -constexpr uint8_t NUMBANDS = 2; -constexpr uint8_t NDIMENSION = 3; +constexpr uint8_t CDBKWIDTH{ 4 }; +constexpr uint8_t CDBKHEIGHT{ 1 }; +constexpr uint8_t NFRAMES{ 1 }; +constexpr uint8_t NCODEWORDS{ CDBKWIDTH * CDBKHEIGHT * NFRAMES }; +constexpr uint8_t NUMBANDS{ 2 }; +constexpr uint8_t NDIMENSION{ 3 }; // constexpr uint8_t STARTFRAME = 0; // constexpr uint8_t NUM_BYTES_PER_PIXEL = 1; @@ -62,7 +62,7 @@ itkKmeansModelEstimatorTest(int, char *[]) auto vecImage = VecImageType::New(); - constexpr VecImageType::SizeType vecImgSize = { { IMGWIDTH, IMGHEIGHT, NFRAMES } }; + constexpr VecImageType::SizeType vecImgSize{ IMGWIDTH, IMGHEIGHT, NFRAMES }; constexpr VecImageType::IndexType index{}; VecImageType::RegionType region{ index, vecImgSize }; diff --git a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest1.cxx b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest1.cxx index d81dcf677ee..d95cf4b7a60 100644 --- a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest1.cxx +++ b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest1.cxx @@ -32,10 +32,10 @@ int itkSampleClassifierFilterTest1(int, char *[]) { - constexpr unsigned int numberOfComponents = 3; + constexpr unsigned int numberOfComponents{ 3 }; using MeasurementType = float; - constexpr unsigned int numberOfClasses = 3; + constexpr unsigned int numberOfClasses{ 3 }; using MeasurementVectorType = itk::Array; using SampleType = itk::Statistics::ListSample; @@ -172,13 +172,13 @@ itkSampleClassifierFilterTest1(int, char *[]) using ClassLabelType = FilterType::ClassLabelType; - constexpr ClassLabelType class1 = 0; + constexpr ClassLabelType class1{ 0 }; classLabelVector.push_back(class1); - constexpr ClassLabelType class2 = 1; + constexpr ClassLabelType class2{ 1 }; classLabelVector.push_back(class2); - constexpr ClassLabelType class3 = 2; + constexpr ClassLabelType class3{ 2 }; classLabelVector.push_back(class3); diff --git a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest2.cxx b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest2.cxx index 3b08b245f38..3dca131f9cb 100644 --- a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest2.cxx +++ b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest2.cxx @@ -28,10 +28,10 @@ int itkSampleClassifierFilterTest2(int, char *[]) { - constexpr unsigned int numberOfComponents = 1; + constexpr unsigned int numberOfComponents{ 1 }; using MeasurementType = float; - constexpr unsigned int numberOfClasses = 2; + constexpr unsigned int numberOfClasses{ 2 }; using MeasurementVectorType = itk::Array; using SampleType = itk::Statistics::ListSample; @@ -103,10 +103,10 @@ itkSampleClassifierFilterTest2(int, char *[]) using ClassLabelType = FilterType::ClassLabelType; - constexpr ClassLabelType class1 = 0; + constexpr ClassLabelType class1{ 0 }; classLabelVector.push_back(class1); - constexpr ClassLabelType class2 = 1; + constexpr ClassLabelType class2{ 1 }; classLabelVector.push_back(class2); // Set a decision rule type @@ -129,7 +129,7 @@ itkSampleClassifierFilterTest2(int, char *[]) itk::NumericTraits::SetLength(mv, numberOfComponents); double mean = mean1[0]; double standardDeviation = std::sqrt(covariance1[0][0]); - constexpr unsigned int numberOfSampleEachClass = 10; + constexpr unsigned int numberOfSampleEachClass{ 10 }; for (unsigned int i = 0; i < numberOfSampleEachClass; ++i) { mv[0] = (normalGenerator->GetVariate() * standardDeviation) + mean; diff --git a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest3.cxx b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest3.cxx index 98fc675fe94..3f34b733a69 100644 --- a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest3.cxx +++ b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest3.cxx @@ -29,10 +29,10 @@ int itkSampleClassifierFilterTest3(int, char *[]) { - constexpr unsigned int numberOfComponents = 1; + constexpr unsigned int numberOfComponents{ 1 }; using MeasurementType = float; - constexpr unsigned int numberOfClasses = 2; + constexpr unsigned int numberOfClasses{ 2 }; using MeasurementVectorType = itk::Array; using SampleType = itk::Statistics::ListSample; @@ -67,7 +67,7 @@ itkSampleClassifierFilterTest3(int, char *[]) itk::NumericTraits::SetLength(mv, numberOfComponents); double mean = mean1[0]; double standardDeviation = 0.1; - constexpr unsigned int numberOfSampleEachClass = 10; + constexpr unsigned int numberOfSampleEachClass{ 10 }; // Add sample from the first gaussian for (unsigned int i = 0; i < numberOfSampleEachClass; ++i) @@ -94,7 +94,7 @@ itkSampleClassifierFilterTest3(int, char *[]) /* Creating k-d tree */ auto generator = GeneratorType::New(); generator->SetSample(sample); - constexpr unsigned int bucketSize = 1; + constexpr unsigned int bucketSize{ 1 }; generator->SetBucketSize(bucketSize); generator->GenerateData(); @@ -105,7 +105,7 @@ itkSampleClassifierFilterTest3(int, char *[]) initialMeans[0] = 5; initialMeans[1] = 70; estimator->SetParameters(initialMeans); - constexpr unsigned int maximumIteration = 100; + constexpr unsigned int maximumIteration{ 100 }; estimator->SetMaximumIteration(maximumIteration); estimator->SetKdTree(generator->GetOutput()); estimator->SetCentroidPositionChangesThreshold(0.0); @@ -117,10 +117,10 @@ itkSampleClassifierFilterTest3(int, char *[]) using ClassLabelType = FilterType::ClassLabelType; - constexpr ClassLabelType class1 = 0; + constexpr ClassLabelType class1{ 0 }; classLabelVector.push_back(class1); - constexpr ClassLabelType class2 = 1; + constexpr ClassLabelType class2{ 1 }; classLabelVector.push_back(class2); // Set a decision rule type @@ -160,7 +160,7 @@ itkSampleClassifierFilterTest3(int, char *[]) FilterType::MembershipFunctionsWeightsArrayType weightsArray; // set array size different from the number of classes - constexpr unsigned int numberOfClasses2 = 3; + constexpr unsigned int numberOfClasses2{ 3 }; weightsArray.SetSize(numberOfClasses2); weightArrayObjects->Set(weightsArray); diff --git a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest4.cxx b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest4.cxx index ad835dc9e29..522013da68a 100644 --- a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest4.cxx +++ b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest4.cxx @@ -29,10 +29,10 @@ int itkSampleClassifierFilterTest4(int, char *[]) { - constexpr unsigned int numberOfComponents = 1; + constexpr unsigned int numberOfComponents{ 1 }; using MeasurementType = float; - constexpr unsigned int numberOfClasses = 2; + constexpr unsigned int numberOfClasses{ 2 }; using MeasurementVectorType = itk::FixedArray; using SampleType = itk::Statistics::ListSample; @@ -64,7 +64,7 @@ itkSampleClassifierFilterTest4(int, char *[]) MeasurementVectorType mv; double mean = mean1[0]; double standardDeviation = 0.1; - constexpr unsigned int numberOfSampleEachClass = 10; + constexpr unsigned int numberOfSampleEachClass{ 10 }; // Add sample from the first gaussian for (unsigned int i = 0; i < numberOfSampleEachClass; ++i) @@ -91,7 +91,7 @@ itkSampleClassifierFilterTest4(int, char *[]) /* Creating k-d tree */ auto generator = GeneratorType::New(); generator->SetSample(sample); - constexpr unsigned int bucketSize = 1; + constexpr unsigned int bucketSize{ 1 }; generator->SetBucketSize(bucketSize); generator->GenerateData(); @@ -102,7 +102,7 @@ itkSampleClassifierFilterTest4(int, char *[]) initialMeans[0] = 5; initialMeans[1] = 70; estimator->SetParameters(initialMeans); - constexpr unsigned int maximumIteration = 100; + constexpr unsigned int maximumIteration{ 100 }; estimator->SetMaximumIteration(maximumIteration); estimator->SetKdTree(generator->GetOutput()); estimator->SetCentroidPositionChangesThreshold(0.0); @@ -114,10 +114,10 @@ itkSampleClassifierFilterTest4(int, char *[]) using ClassLabelType = FilterType::ClassLabelType; - constexpr ClassLabelType class1 = 0; + constexpr ClassLabelType class1{ 0 }; classLabelVector.push_back(class1); - constexpr ClassLabelType class2 = 1; + constexpr ClassLabelType class2{ 1 }; classLabelVector.push_back(class2); // Set a decision rule type diff --git a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest5.cxx b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest5.cxx index 4bb6b773723..4ab295dc0a9 100644 --- a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest5.cxx +++ b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest5.cxx @@ -29,10 +29,10 @@ int itkSampleClassifierFilterTest5(int, char *[]) { - constexpr unsigned int numberOfComponents = 1; + constexpr unsigned int numberOfComponents{ 1 }; using MeasurementType = float; - constexpr unsigned int numberOfClasses = 2; + constexpr unsigned int numberOfClasses{ 2 }; using MeasurementVectorType = itk::VariableLengthVector; using SampleType = itk::Statistics::ListSample; @@ -67,7 +67,7 @@ itkSampleClassifierFilterTest5(int, char *[]) itk::NumericTraits::SetLength(mv, numberOfComponents); double mean = mean1[0]; double standardDeviation = 0.1; - constexpr unsigned int numberOfSampleEachClass = 10; + constexpr unsigned int numberOfSampleEachClass{ 10 }; // Add sample from the first gaussian for (unsigned int i = 0; i < numberOfSampleEachClass; ++i) @@ -94,7 +94,7 @@ itkSampleClassifierFilterTest5(int, char *[]) /* Creating k-d tree */ auto generator = GeneratorType::New(); generator->SetSample(sample); - constexpr unsigned int bucketSize = 1; + constexpr unsigned int bucketSize{ 1 }; generator->SetBucketSize(bucketSize); generator->GenerateData(); @@ -105,7 +105,7 @@ itkSampleClassifierFilterTest5(int, char *[]) initialMeans[0] = 5; initialMeans[1] = 70; estimator->SetParameters(initialMeans); - constexpr unsigned int maximumIteration = 100; + constexpr unsigned int maximumIteration{ 100 }; estimator->SetMaximumIteration(maximumIteration); estimator->SetKdTree(generator->GetOutput()); estimator->SetCentroidPositionChangesThreshold(0.0); @@ -117,10 +117,10 @@ itkSampleClassifierFilterTest5(int, char *[]) using ClassLabelType = FilterType::ClassLabelType; - constexpr ClassLabelType class1 = 0; + constexpr ClassLabelType class1{ 0 }; classLabelVector.push_back(class1); - constexpr ClassLabelType class2 = 1; + constexpr ClassLabelType class2{ 1 }; classLabelVector.push_back(class2); // Set a decision rule type diff --git a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest6.cxx b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest6.cxx index 05b8bf3743a..0d065ee9627 100644 --- a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest6.cxx +++ b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest6.cxx @@ -29,10 +29,10 @@ int itkSampleClassifierFilterTest6(int, char *[]) { - constexpr unsigned int numberOfComponents = 1; + constexpr unsigned int numberOfComponents{ 1 }; using MeasurementType = float; - constexpr unsigned int numberOfClasses = 2; + constexpr unsigned int numberOfClasses{ 2 }; using MeasurementVectorType = std::vector; using SampleType = itk::Statistics::ListSample; @@ -66,7 +66,7 @@ itkSampleClassifierFilterTest6(int, char *[]) itk::NumericTraits::SetLength(mv, numberOfComponents); double mean = mean1[0]; double standardDeviation = 0.1; - constexpr unsigned int numberOfSampleEachClass = 10; + constexpr unsigned int numberOfSampleEachClass{ 10 }; // Add sample from the first gaussian for (unsigned int i = 0; i < numberOfSampleEachClass; ++i) @@ -93,7 +93,7 @@ itkSampleClassifierFilterTest6(int, char *[]) /* Creating k-d tree */ auto generator = GeneratorType::New(); generator->SetSample(sample); - constexpr unsigned int bucketSize = 1; + constexpr unsigned int bucketSize{ 1 }; generator->SetBucketSize(bucketSize); generator->GenerateData(); @@ -104,7 +104,7 @@ itkSampleClassifierFilterTest6(int, char *[]) initialMeans[0] = 5; initialMeans[1] = 70; estimator->SetParameters(initialMeans); - constexpr unsigned int maximumIteration = 100; + constexpr unsigned int maximumIteration{ 100 }; estimator->SetMaximumIteration(maximumIteration); estimator->SetKdTree(generator->GetOutput()); estimator->SetCentroidPositionChangesThreshold(0.0); @@ -116,10 +116,10 @@ itkSampleClassifierFilterTest6(int, char *[]) using ClassLabelType = FilterType::ClassLabelType; - constexpr ClassLabelType class1 = 0; + constexpr ClassLabelType class1{ 0 }; classLabelVector.push_back(class1); - constexpr ClassLabelType class2 = 1; + constexpr ClassLabelType class2{ 1 }; classLabelVector.push_back(class2); // Set a decision rule type diff --git a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest7.cxx b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest7.cxx index 9e0545e53f5..acc146f1c1d 100644 --- a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest7.cxx +++ b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest7.cxx @@ -43,9 +43,9 @@ itkSampleClassifierFilterTest7(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int maximumIteration = 200; - constexpr double minStandardDeviation = 28.54746; - constexpr unsigned int numberOfClasses = 2; + constexpr int maximumIteration{ 200 }; + constexpr double minStandardDeviation{ 28.54746 }; + constexpr unsigned int numberOfClasses{ 2 }; using ParametersType = itk::Array; std::vector trueParameters(numberOfClasses); ParametersType params(6); @@ -94,7 +94,7 @@ itkSampleClassifierFilterTest7(int argc, char * argv[]) /* Loading point data */ auto pointSet = PointSetType::New(); const PointSetType::PointsContainerPointer pointsContainer = PointSetType::PointsContainer::New(); - constexpr int dataSizeBig = 2000; + constexpr int dataSizeBig{ 2000 }; pointsContainer->Reserve(dataSizeBig); pointSet->SetPoints(pointsContainer); @@ -191,10 +191,10 @@ itkSampleClassifierFilterTest7(int argc, char * argv[]) using ClassLabelType = FilterType::ClassLabelType; - constexpr ClassLabelType class1 = 0; + constexpr ClassLabelType class1{ 0 }; classLabelVector.push_back(class1); - constexpr ClassLabelType class2 = 1; + constexpr ClassLabelType class2{ 1 }; classLabelVector.push_back(class2); // Set a decision rule type @@ -251,7 +251,7 @@ itkSampleClassifierFilterTest7(int argc, char * argv[]) auto pointSet2 = PointSetType::New(); const PointSetType::PointsContainerPointer pointsContainer2 = PointSetType::PointsContainer::New(); - constexpr int dataSizeSmall = 200; + constexpr int dataSizeSmall{ 200 }; pointsContainer2->Reserve(dataSizeSmall); pointSet2->SetPoints(pointsContainer2); @@ -291,7 +291,7 @@ itkSampleClassifierFilterTest7(int argc, char * argv[]) unsigned int sampleCounter = 0; - constexpr unsigned int numberOfSamplesPerClass = 100; + constexpr unsigned int numberOfSamplesPerClass{ 100 }; if (sampleCounter > numberOfSamplesPerClass) { if (iter.GetClassLabel() != class1) diff --git a/Modules/Segmentation/Classifiers/test/itkScalarImageKmeansImageFilter3DTest.cxx b/Modules/Segmentation/Classifiers/test/itkScalarImageKmeansImageFilter3DTest.cxx index ef36b420aff..a0321ab654d 100644 --- a/Modules/Segmentation/Classifiers/test/itkScalarImageKmeansImageFilter3DTest.cxx +++ b/Modules/Segmentation/Classifiers/test/itkScalarImageKmeansImageFilter3DTest.cxx @@ -42,7 +42,7 @@ itkScalarImageKmeansImageFilter3DTest(int argc, char * argv[]) const std::string inputVolume(argv[1]); const std::string input3DSkullStripVolume(argv[2]); const std::string outputLabelMapVolume(argv[3]); - constexpr float numberOfStdDeviations = 10.0; + constexpr float numberOfStdDeviations{ 10.0 }; const bool debug = true; @@ -76,7 +76,7 @@ itkScalarImageKmeansImageFilter3DTest(int argc, char * argv[]) } using PixelType = short; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; @@ -87,8 +87,8 @@ itkScalarImageKmeansImageFilter3DTest(int argc, char * argv[]) auto maskReader = ReaderType::New(); maskReader->SetFileName(input3DSkullStripVolume); - constexpr PixelType imageExclusion = -32000; - constexpr PixelType maskThresholdBelow = 5; // someday with more generality? + constexpr PixelType imageExclusion{ -32000 }; + constexpr PixelType maskThresholdBelow{ 5 }; // someday with more generality? /* The Threshold Image Filter is used to produce the brain clipping mask from a 3DSkullStrip result image. */ using ThresholdFilterType = itk::ThresholdImageFilter; @@ -185,7 +185,7 @@ itkScalarImageKmeansImageFilter3DTest(int argc, char * argv[]) auto kmeansFilter = KMeansFilterType::New(); kmeansFilter->SetInput(clippedBrainT1Pointer); - constexpr bool useNonContiguousLabels = true; + constexpr bool useNonContiguousLabels{ true }; RealPixelType backgroundInitialMean = imageExclusion; // RealPixelType bloodInitialMean = imageMax; // ARTERIAL blood. diff --git a/Modules/Segmentation/Classifiers/test/itkScalarImageKmeansImageFilterTest.cxx b/Modules/Segmentation/Classifiers/test/itkScalarImageKmeansImageFilterTest.cxx index 5e91483f24b..d0c0402a7f3 100644 --- a/Modules/Segmentation/Classifiers/test/itkScalarImageKmeansImageFilterTest.cxx +++ b/Modules/Segmentation/Classifiers/test/itkScalarImageKmeansImageFilterTest.cxx @@ -37,7 +37,7 @@ itkScalarImageKmeansImageFilterTest(int argc, char * argv[]) } using PixelType = unsigned char; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ImageType = itk::Image; @@ -68,7 +68,7 @@ itkScalarImageKmeansImageFilterTest(int argc, char * argv[]) const unsigned int numberOfInitialClasses = std::stoi(argv[4]); - constexpr unsigned int numberOfArgumentsBeforeMeans = 5; + constexpr unsigned int numberOfArgumentsBeforeMeans{ 5 }; if (static_cast(argc) < numberOfInitialClasses + numberOfArgumentsBeforeMeans) { std::cerr << "Error: " << std::endl; diff --git a/Modules/Segmentation/Classifiers/test/itkSupervisedImageClassifierTest.cxx b/Modules/Segmentation/Classifiers/test/itkSupervisedImageClassifierTest.cxx index 0a9fb44398f..4ead9948da7 100644 --- a/Modules/Segmentation/Classifiers/test/itkSupervisedImageClassifierTest.cxx +++ b/Modules/Segmentation/Classifiers/test/itkSupervisedImageClassifierTest.cxx @@ -53,12 +53,12 @@ class ShowProgressObject int itkSupervisedImageClassifierTest(int, char *[]) { - constexpr unsigned int IMGWIDTH = 2; - constexpr unsigned int IMGHEIGHT = 2; - constexpr unsigned int NFRAMES = 4; - constexpr unsigned int NUMBANDS = 2; - constexpr unsigned int NDIMENSION = 3; - constexpr unsigned int NUM_CLASSES = 3; + constexpr unsigned int IMGWIDTH{ 2 }; + constexpr unsigned int IMGHEIGHT{ 2 }; + constexpr unsigned int NFRAMES{ 4 }; + constexpr unsigned int NUMBANDS{ 2 }; + constexpr unsigned int NDIMENSION{ 3 }; + constexpr unsigned int NUM_CLASSES{ 3 }; //------------------------------------------------------ // Create a simple test image with width, height, and @@ -69,7 +69,7 @@ itkSupervisedImageClassifierTest(int, char *[]) auto vecImage = VecImageType::New(); - constexpr VecImageType::SizeType vecImgSize = { { IMGWIDTH, IMGHEIGHT, NFRAMES } }; + constexpr VecImageType::SizeType vecImgSize{ IMGWIDTH, IMGHEIGHT, NFRAMES }; constexpr VecImageType::IndexType index{}; VecImageType::RegionType region{ index, vecImgSize }; @@ -169,7 +169,7 @@ itkSupervisedImageClassifierTest(int, char *[]) using ClassImageType = itk::Image; auto classImage = ClassImageType::New(); - constexpr ClassImageType::SizeType classImgSize = { { IMGWIDTH, IMGHEIGHT, NFRAMES } }; + constexpr ClassImageType::SizeType classImgSize{ IMGWIDTH, IMGHEIGHT, NFRAMES }; constexpr ClassImageType::IndexType classindex{}; diff --git a/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentFunctorImageFilter.hxx b/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentFunctorImageFilter.hxx index 7a4dc934d09..e7023c9997e 100644 --- a/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentFunctorImageFilter.hxx +++ b/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentFunctorImageFilter.hxx @@ -33,7 +33,7 @@ ConnectedComponentFunctorImageFilterAllocateOutputs(); - constexpr OutputPixelType maxPossibleLabel = NumericTraits::max(); + constexpr OutputPixelType maxPossibleLabel{ NumericTraits::max() }; const typename TOutputImage::Pointer output = this->GetOutput(); output->FillBuffer(maxPossibleLabel); diff --git a/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterBackgroundTest.cxx b/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterBackgroundTest.cxx index 22ae1417ffc..ddaf4ffaf0c 100644 --- a/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterBackgroundTest.cxx +++ b/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterBackgroundTest.cxx @@ -32,7 +32,7 @@ itkConnectedComponentImageFilterBackgroundTest(int argc, char * argv[]) } using PixelType = int; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ImageType = itk::Image; auto background = static_cast(std::stoi(argv[1])); diff --git a/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTest.cxx b/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTest.cxx index 4cb4afb5fc8..004eff423b8 100644 --- a/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTest.cxx +++ b/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTest.cxx @@ -38,7 +38,7 @@ itkConnectedComponentImageFilterTest(int argc, char * argv[]) } using InternalPixelType = unsigned short; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InternalImageType = itk::Image; using OutputImageType = itk::Image; diff --git a/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTestRGB.cxx b/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTestRGB.cxx index de03f536ba6..f8d953f0456 100644 --- a/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTestRGB.cxx +++ b/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTestRGB.cxx @@ -38,7 +38,7 @@ itkConnectedComponentImageFilterTestRGB(int argc, char * argv[]) } using InternalPixelType = unsigned short; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InternalImageType = itk::Image; using OutputImageType = itk::Image; diff --git a/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTooManyObjectsTest.cxx b/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTooManyObjectsTest.cxx index ba50cfde6a5..3cecdfb246b 100644 --- a/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTooManyObjectsTest.cxx +++ b/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTooManyObjectsTest.cxx @@ -24,7 +24,7 @@ itkConnectedComponentImageFilterTooManyObjectsTest(int itkNotUsed(argc), char *[ { using PixelType = unsigned char; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ImageType = itk::Image; // create a test input image with more objects in it than what the output type diff --git a/Modules/Segmentation/ConnectedComponents/test/itkHardConnectedComponentImageFilterTest.cxx b/Modules/Segmentation/ConnectedComponents/test/itkHardConnectedComponentImageFilterTest.cxx index 53720086821..912e0b736f4 100644 --- a/Modules/Segmentation/ConnectedComponents/test/itkHardConnectedComponentImageFilterTest.cxx +++ b/Modules/Segmentation/ConnectedComponents/test/itkHardConnectedComponentImageFilterTest.cxx @@ -32,7 +32,7 @@ DoIt(int argc, char * argv[], const std::string & pixelType) } const char * outputImageFileName = argv[1]; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = TPixel; using InputImageType = itk::Image; @@ -41,8 +41,8 @@ DoIt(int argc, char * argv[], const std::string & pixelType) auto inputimg = InputImageType::New(); constexpr IndexType index{}; - constexpr int height = 20; - constexpr int width = 20; + constexpr int height{ 20 }; + constexpr int width{ 20 }; constexpr InputImageType::SizeType size{ width, height }; typename InputImageType::RegionType region{ index, size }; diff --git a/Modules/Segmentation/ConnectedComponents/test/itkMaskConnectedComponentImageFilterTest.cxx b/Modules/Segmentation/ConnectedComponents/test/itkMaskConnectedComponentImageFilterTest.cxx index 9d3738827a3..e8160c7cbbb 100644 --- a/Modules/Segmentation/ConnectedComponents/test/itkMaskConnectedComponentImageFilterTest.cxx +++ b/Modules/Segmentation/ConnectedComponents/test/itkMaskConnectedComponentImageFilterTest.cxx @@ -39,7 +39,7 @@ itkMaskConnectedComponentImageFilterTest(int argc, char * argv[]) using InternalPixelType = unsigned short; using MaskPixelType = bool; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InternalImageType = itk::Image; using MaskImageType = itk::Image; diff --git a/Modules/Segmentation/ConnectedComponents/test/itkRelabelComponentImageFilterTest.cxx b/Modules/Segmentation/ConnectedComponents/test/itkRelabelComponentImageFilterTest.cxx index 1df25209dc4..4804c2ecb12 100644 --- a/Modules/Segmentation/ConnectedComponents/test/itkRelabelComponentImageFilterTest.cxx +++ b/Modules/Segmentation/ConnectedComponents/test/itkRelabelComponentImageFilterTest.cxx @@ -48,7 +48,7 @@ itkRelabelComponentImageFilterTest(int argc, char * argv[]) using InternalPixelType = unsigned short; using LabelPixelType = unsigned long; using WritePixelType = unsigned char; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InternalImageType = itk::Image; using LabelImageType = itk::Image; @@ -69,9 +69,9 @@ itkRelabelComponentImageFilterTest(int argc, char * argv[]) using HistogramType = itk::Statistics::Histogram; - constexpr int NumBins = 13; - constexpr RealType LowerBound = 51.0; - constexpr RealType UpperBound = 252.0; + constexpr int NumBins{ 13 }; + constexpr RealType LowerBound{ 51.0 }; + constexpr RealType UpperBound{ 252.0 }; auto reader = ReaderType::New(); auto writer = WriterType::New(); @@ -116,7 +116,7 @@ itkRelabelComponentImageFilterTest(int argc, char * argv[]) connected->SetInput(threshold->GetOutput()); relabel->SetInput(connected->GetOutput()); - constexpr itk::SizeValueType numberOfObjectsToPrint = 5; + constexpr itk::SizeValueType numberOfObjectsToPrint{ 5 }; relabel->SetNumberOfObjectsToPrint(numberOfObjectsToPrint); ITK_TEST_SET_GET_VALUE(numberOfObjectsToPrint, relabel->GetNumberOfObjectsToPrint()); @@ -124,7 +124,7 @@ itkRelabelComponentImageFilterTest(int argc, char * argv[]) relabel->SetMinimumObjectSize(minimumObjectSize); ITK_TEST_SET_GET_VALUE(minimumObjectSize, relabel->GetMinimumObjectSize()); - constexpr bool sortByObjectSize = true; + constexpr bool sortByObjectSize{ true }; ITK_TEST_SET_GET_BOOLEAN(relabel, SortByObjectSize, sortByObjectSize); std::cout << "Modified time of relabel's output = " << relabel->GetOutput()->GetMTime() << std::endl; diff --git a/Modules/Segmentation/ConnectedComponents/test/itkScalarConnectedComponentImageFilterTest.cxx b/Modules/Segmentation/ConnectedComponents/test/itkScalarConnectedComponentImageFilterTest.cxx index e55bbff272e..9aa70ef08e4 100644 --- a/Modules/Segmentation/ConnectedComponents/test/itkScalarConnectedComponentImageFilterTest.cxx +++ b/Modules/Segmentation/ConnectedComponents/test/itkScalarConnectedComponentImageFilterTest.cxx @@ -37,7 +37,7 @@ itkScalarConnectedComponentImageFilterTest(int argc, char * argv[]) using InternalPixelType = unsigned short; using MaskPixelType = bool; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InternalImageType = itk::Image; using MaskImageType = itk::Image; diff --git a/Modules/Segmentation/ConnectedComponents/test/itkThresholdMaximumConnectedComponentsImageFilterTest.cxx b/Modules/Segmentation/ConnectedComponents/test/itkThresholdMaximumConnectedComponentsImageFilterTest.cxx index cd088e39d03..61bea49d9df 100644 --- a/Modules/Segmentation/ConnectedComponents/test/itkThresholdMaximumConnectedComponentsImageFilterTest.cxx +++ b/Modules/Segmentation/ConnectedComponents/test/itkThresholdMaximumConnectedComponentsImageFilterTest.cxx @@ -49,13 +49,13 @@ itkThresholdMaximumConnectedComponentsImageFilterTest(int argc, char * argv[]) using InputPixelType = unsigned char; using OutputPixelType = unsigned char; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputImageType = itk::Image; using OutputImageType = itk::Image; - constexpr InputPixelType maxLabel = itk::NumericTraits::max(); - constexpr InputPixelType minLabel = itk::NumericTraits::NonpositiveMin(); + constexpr InputPixelType maxLabel{ itk::NumericTraits::max() }; + constexpr InputPixelType minLabel{ itk::NumericTraits::NonpositiveMin() }; const unsigned int minimumPixelArea = std::stoi(argv[3]); diff --git a/Modules/Segmentation/ConnectedComponents/test/itkVectorConnectedComponentImageFilterTest.cxx b/Modules/Segmentation/ConnectedComponents/test/itkVectorConnectedComponentImageFilterTest.cxx index a7539a4d2d4..9f8d8761a71 100644 --- a/Modules/Segmentation/ConnectedComponents/test/itkVectorConnectedComponentImageFilterTest.cxx +++ b/Modules/Segmentation/ConnectedComponents/test/itkVectorConnectedComponentImageFilterTest.cxx @@ -38,7 +38,7 @@ itkVectorConnectedComponentImageFilterTest(int argc, char * argv[]) // Comment the following if you want to use the itk text output window itk::OutputWindow::SetInstance(itk::TextOutput::New()); - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = itk::Vector; using OutputPixelType = unsigned long; using LabelPixelType = unsigned char; diff --git a/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DFilterTest.cxx b/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DFilterTest.cxx index d6c666f4664..e4a734d5495 100644 --- a/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DFilterTest.cxx +++ b/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DFilterTest.cxx @@ -159,16 +159,16 @@ itkDeformableSimplexMesh3DFilterTest(int, char *[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(deformFilter, DeformableSimplexMesh3DFilter, MeshToMeshFilter); - constexpr unsigned int numberOfCycles = 100; + constexpr unsigned int numberOfCycles{ 100 }; for (unsigned int i = 0; i < numberOfCycles; ++i) { - constexpr double alpha = 0.1; - constexpr double beta = -0.1; - constexpr double gamma = 0.05; - constexpr double damping = 0.65; - constexpr int iterations = 5; - constexpr unsigned int rigidity = 1; + constexpr double alpha{ 0.1 }; + constexpr double beta{ -0.1 }; + constexpr double gamma{ 0.05 }; + constexpr double damping{ 0.65 }; + constexpr int iterations{ 5 }; + constexpr unsigned int rigidity{ 1 }; // must disconnect the pipeline simplexMesh->DisconnectPipeline(); deformFilter->SetInput(simplexMesh); diff --git a/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DGradientConstraintForceFilterTest.cxx b/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DGradientConstraintForceFilterTest.cxx index d6691dd9e77..c0e29fcb8dc 100644 --- a/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DGradientConstraintForceFilterTest.cxx +++ b/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DGradientConstraintForceFilterTest.cxx @@ -31,7 +31,7 @@ int itkDeformableSimplexMesh3DGradientConstraintForceFilterTest(int, char *[]) { - constexpr unsigned int PointDimension = 3; + constexpr unsigned int PointDimension{ 3 }; // Declare the type of the input and output mesh using TriangleMeshTraits = itk::DefaultDynamicMeshTraits; @@ -130,7 +130,7 @@ itkDeformableSimplexMesh3DGradientConstraintForceFilterTest(int, char *[]) deformFilter->SetAlpha(0.2); deformFilter->SetBeta(0.1); - constexpr int range = 1; + constexpr int range{ 1 }; deformFilter->SetRange(range); ITK_TEST_SET_GET_VALUE(range, deformFilter->GetRange()); diff --git a/Modules/Segmentation/DeformableMesh/test/itkSimplexMeshWithFloatCoordRepTest.cxx b/Modules/Segmentation/DeformableMesh/test/itkSimplexMeshWithFloatCoordRepTest.cxx index 73b5b772cf2..f3179ef9c47 100644 --- a/Modules/Segmentation/DeformableMesh/test/itkSimplexMeshWithFloatCoordRepTest.cxx +++ b/Modules/Segmentation/DeformableMesh/test/itkSimplexMeshWithFloatCoordRepTest.cxx @@ -21,7 +21,7 @@ int itkSimplexMeshWithFloatCoordRepTest(int, char *[]) { - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = float; using CoordinateType = float; diff --git a/Modules/Segmentation/KLMRegionGrowing/test/itkRegionGrow2DTest.cxx b/Modules/Segmentation/KLMRegionGrowing/test/itkRegionGrow2DTest.cxx index f58e4e740a6..8bec3c8721c 100644 --- a/Modules/Segmentation/KLMRegionGrowing/test/itkRegionGrow2DTest.cxx +++ b/Modules/Segmentation/KLMRegionGrowing/test/itkRegionGrow2DTest.cxx @@ -119,7 +119,7 @@ test_RegionGrowKLMExceptionHandling() // Generate the image data - constexpr int sizeLen = 3; + constexpr int sizeLen{ 3 }; using ImageType5D = itk::Image, NUMDIM5D>; auto image5D = ImageType5D::New(); @@ -151,7 +151,7 @@ test_RegionGrowKLMExceptionHandling() exceptionTestingFilter5D->SetGridSize(gridSize5D); exceptionTestingFilter5D->SetMaximumNumberOfRegions(2); - constexpr double maximumLambda = 1000.0; + constexpr double maximumLambda{ 1000.0 }; exceptionTestingFilter5D->SetMaximumLambda(maximumLambda); ITK_TEST_SET_GET_VALUE(maximumLambda, exceptionTestingFilter5D->GetMaximumLambda()); @@ -235,8 +235,8 @@ test_regiongrowKLM1D() auto image = ImageType::New(); - constexpr unsigned int numPixels = 100; - constexpr unsigned int numPixelsHalf = 50; + constexpr unsigned int numPixels{ 100 }; + constexpr unsigned int numPixelsHalf{ 50 }; auto imageSize = ImageType::SizeType::Filled(numPixels); constexpr ImageType::IndexType index{}; @@ -308,7 +308,7 @@ test_regiongrowKLM1D() KLMFilter->SetMaximumLambda(maximumLambda); ITK_TEST_SET_GET_VALUE(maximumLambda, KLMFilter->GetMaximumLambda()); - constexpr unsigned int numberOfRegions = 0; + constexpr unsigned int numberOfRegions{ 0 }; KLMFilter->SetNumberOfRegions(numberOfRegions); ITK_TEST_SET_GET_VALUE(numberOfRegions, KLMFilter->GetNumberOfRegions()); @@ -446,8 +446,8 @@ test_regiongrowKLM1D() pixelOut2b[1] = pixelOut2a[0]; pixelOut2b[2] = 247; - constexpr LabelType ma = 1; - constexpr LabelType mb = 2; + constexpr LabelType ma{ 1 }; + constexpr LabelType mb{ 2 }; k = 0; while (!outIt2.IsAtEnd()) @@ -585,8 +585,8 @@ test_regiongrowKLM1D() pixelOut3d[1] = pixelOut3a[0]; pixelOut3d[2] = 227; - constexpr LabelType mc = 3; - constexpr LabelType md = 4; + constexpr LabelType mc{ 3 }; + constexpr LabelType md{ 4 }; k = 0; while (!outIt3.IsAtEnd()) @@ -709,7 +709,7 @@ test_regiongrowKLM1D() // FIFTH TEST: // large gridsize no merging - constexpr int gridWidth = 5; + constexpr int gridWidth{ 5 }; gridSize.Fill(gridWidth); std::cout << std::endl << "Fifth test, gridSize = " << gridWidth << " no merging" << std::endl; @@ -816,7 +816,7 @@ test_regiongrowKLM2D() ImageType::SizeType imageSize; imageSize[0] = 10; imageSize[1] = 20; - constexpr unsigned int numPixels = 200; + constexpr unsigned int numPixels{ 200 }; constexpr ImageType::IndexType index{}; @@ -880,7 +880,7 @@ test_regiongrowKLM2D() 6, 6, 6, 2, 1, 1, 2, 6, 6, 6, 6, 6, 6, 2, 1, 1, 2, 6, 6, 8, 8, 6, 6, 2, 1, 1, 2, 6, 6, 6, 6, 6, 6, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; - constexpr double outImageVals[] = { + constexpr double outImageVals[]{ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 1.0, 1.0, 9.0, 6.5, 6.5, 6.5, 6.5, 6.5, 6.5, 9.0, 1.0, 1.0, 9.0, 6.5, 6.5, 6.5, 6.5, 6.5, 6.5, 9.0, 1.0, 1.0, 9.0, 6.5, 6.5, 3.0, 3.0, 6.5, 6.5, 9.0, 1.0, 1.0, 9.0, 6.5, 6.5, 6.5, 6.5, 6.5, 6.5, 9.0, 1.0, 1.0, 9.0, 6.5, 6.5, 3.0, 3.0, 6.5, 6.5, 9.0, @@ -1020,7 +1020,7 @@ test_regiongrowKLM2D() std::cout << std::endl << "Second test, key merging test containing duplicate borders" << std::endl; KLMFilter->SetMaximumLambda(1e45); - constexpr unsigned int nregions = 8; + constexpr unsigned int nregions{ 8 }; KLMFilter->SetMaximumNumberOfRegions(nregions); // Kick off the Region grow function @@ -1128,11 +1128,11 @@ test_regiongrowKLM2D() KLMFilter->SetMaximumNumberOfRegions(25); KLMFilter->SetGridSize(gridSize); - constexpr double maximumLambda = 1e45; + constexpr double maximumLambda{ 1e45 }; KLMFilter->SetMaximumLambda(maximumLambda); ITK_TEST_SET_GET_VALUE(maximumLambda, KLMFilter->GetMaximumLambda()); - constexpr unsigned int numberOfRegions = 0; + constexpr unsigned int numberOfRegions{ 0 }; KLMFilter->SetNumberOfRegions(numberOfRegions); ITK_TEST_SET_GET_VALUE(numberOfRegions, KLMFilter->GetNumberOfRegions()); @@ -1416,7 +1416,7 @@ test_regiongrowKLM3D() KLMFilter->SetMaximumLambda(-1); - constexpr unsigned int numberOfRegions = 0; + constexpr unsigned int numberOfRegions{ 0 }; KLMFilter->SetNumberOfRegions(numberOfRegions); ITK_TEST_SET_GET_VALUE(numberOfRegions, KLMFilter->GetNumberOfRegions()); @@ -1527,7 +1527,7 @@ test_regiongrowKLM3D() std::cout << std::endl << "Second test, key merging test containing duplicate borders" << std::endl; KLMFilter->SetMaximumLambda(1e45); - constexpr unsigned int nregions = 8; + constexpr unsigned int nregions{ 8 }; KLMFilter->SetMaximumNumberOfRegions(nregions); // Kick off the Region grow function @@ -1761,7 +1761,7 @@ test_regiongrowKLM4D() auto image = ImageType::New(); ImageType::SizeType imageSize; - constexpr int multVal = 2; + constexpr int multVal{ 2 }; imageSize[0] = 2 * multVal; imageSize[1] = 3 * multVal; imageSize[2] = 5 * multVal; diff --git a/Modules/Segmentation/LabelVoting/test/itkBinaryMedianImageFilterTest.cxx b/Modules/Segmentation/LabelVoting/test/itkBinaryMedianImageFilterTest.cxx index 5b5aeb935e4..9b984ce1d0d 100644 --- a/Modules/Segmentation/LabelVoting/test/itkBinaryMedianImageFilterTest.cxx +++ b/Modules/Segmentation/LabelVoting/test/itkBinaryMedianImageFilterTest.cxx @@ -46,8 +46,8 @@ itkBinaryMedianImageFilterTest(int, char *[]) ImageType::PointValueType origin[2] = { 15, 400 }; random->SetOrigin(origin); - constexpr ImageType::PixelType foreground = 97; // prime numbers are good testers - constexpr ImageType::PixelType background = 29; + constexpr ImageType::PixelType foreground{ 97 }; // prime numbers are good testers + constexpr ImageType::PixelType background{ 29 }; itk::BinaryThresholdImageFilter::Pointer thresholder; thresholder = itk::BinaryThresholdImageFilter::New(); diff --git a/Modules/Segmentation/LabelVoting/test/itkLabelVotingImageFilterTest.cxx b/Modules/Segmentation/LabelVoting/test/itkLabelVotingImageFilterTest.cxx index cf9c3d34c25..68d5a9ec87f 100644 --- a/Modules/Segmentation/LabelVoting/test/itkLabelVotingImageFilterTest.cxx +++ b/Modules/Segmentation/LabelVoting/test/itkLabelVotingImageFilterTest.cxx @@ -25,7 +25,7 @@ itkLabelVotingImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; // Declare the pixel types of the images using PixelType = unsigned int; diff --git a/Modules/Segmentation/LabelVoting/test/itkMultiLabelSTAPLEImageFilterTest.cxx b/Modules/Segmentation/LabelVoting/test/itkMultiLabelSTAPLEImageFilterTest.cxx index 3bd9877bec6..3dc70069c56 100644 --- a/Modules/Segmentation/LabelVoting/test/itkMultiLabelSTAPLEImageFilterTest.cxx +++ b/Modules/Segmentation/LabelVoting/test/itkMultiLabelSTAPLEImageFilterTest.cxx @@ -23,9 +23,9 @@ itkMultiLabelSTAPLEImageFilterTest(int, char *[]) { // Define the dimension of the images - constexpr unsigned int Dimension = 3; - constexpr unsigned int imageSizePerDimension = 2; - constexpr unsigned int imageSize = 8; // std::pow(imageSizePerDimension, Dimension); + constexpr unsigned int Dimension{ 3 }; + constexpr unsigned int imageSizePerDimension{ 2 }; + constexpr unsigned int imageSize{ 8 }; // std::pow(imageSizePerDimension, Dimension); // Declare the types of the images using ImageType = itk::Image; @@ -116,7 +116,7 @@ itkMultiLabelSTAPLEImageFilterTest(int, char *[]) ITK_TEST_EXPECT_TRUE(!filter->GetHasMaximumNumberOfIterations()); - constexpr unsigned int maximumNumberOfIterations = 100; + constexpr unsigned int maximumNumberOfIterations{ 100 }; filter->SetMaximumNumberOfIterations(maximumNumberOfIterations); ITK_TEST_SET_GET_VALUE(maximumNumberOfIterations, filter->GetMaximumNumberOfIterations()); diff --git a/Modules/Segmentation/LabelVoting/test/itkVotingBinaryHoleFillingImageFilterTest.cxx b/Modules/Segmentation/LabelVoting/test/itkVotingBinaryHoleFillingImageFilterTest.cxx index 93b15e75976..162fd5903fe 100644 --- a/Modules/Segmentation/LabelVoting/test/itkVotingBinaryHoleFillingImageFilterTest.cxx +++ b/Modules/Segmentation/LabelVoting/test/itkVotingBinaryHoleFillingImageFilterTest.cxx @@ -37,7 +37,7 @@ itkVotingBinaryHoleFillingImageFilterTest(int argc, char * argv[]) } // Define the dimension of the images - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; // Declare the pixel types of the images using InputPixelType = unsigned short; @@ -52,8 +52,8 @@ itkVotingBinaryHoleFillingImageFilterTest(int argc, char * argv[]) ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); - constexpr InputImageType::PixelType foreground = 97; // Prime numbers are good testers - constexpr InputImageType::PixelType background = 29; + constexpr InputImageType::PixelType foreground{ 97 }; // Prime numbers are good testers + constexpr InputImageType::PixelType background{ 29 }; const itk::BinaryThresholdImageFilter::Pointer thresholder = itk::BinaryThresholdImageFilter::New(); @@ -80,7 +80,7 @@ itkVotingBinaryHoleFillingImageFilterTest(int argc, char * argv[]) // Set the number of pixels over 50% that will tip the decision about // switching a pixel - constexpr unsigned int majorityThreshold = 1; + constexpr unsigned int majorityThreshold{ 1 }; voting->SetMajorityThreshold(majorityThreshold); ITK_TEST_SET_GET_VALUE(majorityThreshold, voting->GetMajorityThreshold()); diff --git a/Modules/Segmentation/LabelVoting/test/itkVotingBinaryIterativeHoleFillingImageFilterTest.cxx b/Modules/Segmentation/LabelVoting/test/itkVotingBinaryIterativeHoleFillingImageFilterTest.cxx index 650093320f4..35f476acadb 100644 --- a/Modules/Segmentation/LabelVoting/test/itkVotingBinaryIterativeHoleFillingImageFilterTest.cxx +++ b/Modules/Segmentation/LabelVoting/test/itkVotingBinaryIterativeHoleFillingImageFilterTest.cxx @@ -47,8 +47,8 @@ itkVotingBinaryIterativeHoleFillingImageFilterTest(int, char *[]) ImageType::PointValueType origin[2] = { 15, 400 }; random->SetOrigin(origin); - constexpr ImageType::PixelType foreground = 97; // prime numbers are good testers - constexpr ImageType::PixelType background = 29; + constexpr ImageType::PixelType foreground{ 97 }; // prime numbers are good testers + constexpr ImageType::PixelType background{ 29 }; itk::BinaryThresholdImageFilter::Pointer thresholder; thresholder = itk::BinaryThresholdImageFilter::New(); @@ -80,17 +80,17 @@ itkVotingBinaryIterativeHoleFillingImageFilterTest(int, char *[]) // Set the maximum number of times the filter should perform passes filling // the border of holes and cavities. - constexpr unsigned int maximumNumberOfIterations = 10; + constexpr unsigned int maximumNumberOfIterations{ 10 }; voting->SetMaximumNumberOfIterations(maximumNumberOfIterations); ITK_TEST_SET_GET_VALUE(maximumNumberOfIterations, voting->GetMaximumNumberOfIterations()); - constexpr unsigned int currentNumberOfIterations = 0; + constexpr unsigned int currentNumberOfIterations{ 0 }; voting->SetCurrentNumberOfIterations(currentNumberOfIterations); ITK_TEST_SET_GET_VALUE(currentNumberOfIterations, voting->GetCurrentNumberOfIterations()); // Set the number of pixels over 50% that will tip the decision about // switching a pixel. - constexpr unsigned int majorityThreshold = 1; + constexpr unsigned int majorityThreshold{ 1 }; voting->SetMajorityThreshold(majorityThreshold); ITK_TEST_SET_GET_VALUE(majorityThreshold, voting->GetMajorityThreshold()); diff --git a/Modules/Segmentation/LevelSets/include/itkLevelSetFunction.hxx b/Modules/Segmentation/LevelSets/include/itkLevelSetFunction.hxx index d48e31bcd5e..f3fbcd66b88 100644 --- a/Modules/Segmentation/LevelSets/include/itkLevelSetFunction.hxx +++ b/Modules/Segmentation/LevelSets/include/itkLevelSetFunction.hxx @@ -97,7 +97,7 @@ LevelSetFunction::ComputeMinimalCurvature(const NeighborhoodType & i // Eigensystem const vnl_symmetric_eigensystem eig{ Curve.as_matrix() }; - constexpr ScalarValueType MIN_EIG = NumericTraits::min(); + constexpr ScalarValueType MIN_EIG{ NumericTraits::min() }; ScalarValueType mincurve = itk::Math::abs(eig.get_eigenvalue(ImageDimension - 1)); for (unsigned int i = 0; i < ImageDimension; ++i) { @@ -120,9 +120,9 @@ LevelSetFunction::Compute3DMinimalCurvature(const NeighborhoodType & { const ScalarValueType mean_curve = this->ComputeMeanCurvature(neighborhood, offset, gd); - constexpr int i0 = 0; - constexpr int i1 = 1; - constexpr int i2 = 2; + constexpr int i0{ 0 }; + constexpr int i1{ 1 }; + constexpr int i2{ 2 }; const ScalarValueType gauss_curve = (2 * (gd->m_dx[i0] * gd->m_dx[i1] * (gd->m_dxy[i2][i0] * gd->m_dxy[i1][i2] - gd->m_dxy[i0][i1] * gd->m_dxy[i2][i2]) + diff --git a/Modules/Segmentation/LevelSets/include/itkLevelSetFunctionWithRefitTerm.hxx b/Modules/Segmentation/LevelSets/include/itkLevelSetFunctionWithRefitTerm.hxx index ac9bb026a6e..f83adeeef5f 100644 --- a/Modules/Segmentation/LevelSets/include/itkLevelSetFunctionWithRefitTerm.hxx +++ b/Modules/Segmentation/LevelSets/include/itkLevelSetFunctionWithRefitTerm.hxx @@ -67,7 +67,7 @@ auto LevelSetFunctionWithRefitTerm::ComputeCurvature( const NeighborhoodType & neighborhood) const -> ScalarValueType { - constexpr NeighborhoodSizeValueType one = 1; + constexpr NeighborhoodSizeValueType one{ 1 }; const NeighborhoodSizeValueType center = neighborhood.Size() / 2; const NeighborhoodScalesType neighborhoodScales = this->ComputeNeighborhoodScales(); diff --git a/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx b/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx index 0f127343ca1..35fd090055d 100644 --- a/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx +++ b/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx @@ -1030,7 +1030,7 @@ ParallelSparseFieldLevelSetImageFilter::Iterate() // Controls how often we check for balance of the load among the threads and // perform load balancing (if needed) by redistributing the load. - constexpr unsigned int LOAD_BALANCE_ITERATION_FREQUENCY = 30; + constexpr unsigned int LOAD_BALANCE_ITERATION_FREQUENCY{ 30 }; if (!this->m_IsInitialized) { @@ -2035,7 +2035,7 @@ ParallelSparseFieldLevelSetImageFilter::CheckLoadBala { // This parameter defines a degree of unbalancedness of the load among // threads. - constexpr float MAX_PIXEL_DIFFERENCE_PERCENT = 0.025; + constexpr float MAX_PIXEL_DIFFERENCE_PERCENT{ 0.025 }; m_BoundaryChanged = false; diff --git a/Modules/Segmentation/LevelSets/include/itkSparseFieldFourthOrderLevelSetImageFilter.hxx b/Modules/Segmentation/LevelSets/include/itkSparseFieldFourthOrderLevelSetImageFilter.hxx index bae68615e5a..50b3504a1c1 100644 --- a/Modules/Segmentation/LevelSets/include/itkSparseFieldFourthOrderLevelSetImageFilter.hxx +++ b/Modules/Segmentation/LevelSets/include/itkSparseFieldFourthOrderLevelSetImageFilter.hxx @@ -79,7 +79,7 @@ auto SparseFieldFourthOrderLevelSetImageFilter::ComputeCurvatureFromSparseImageNeighborhood( SparseImageIteratorType & it) const -> ValueType { - constexpr SizeValueType one = 1; + constexpr SizeValueType one{ 1 }; const SizeValueType center = it.Size() / 2; bool flag = false; const NeighborhoodScalesType neighborhoodScales = this->GetDifferenceFunction()->ComputeNeighborhoodScales(); diff --git a/Modules/Segmentation/LevelSets/test/itkAnisotropicFourthOrderLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkAnisotropicFourthOrderLevelSetImageFilterTest.cxx index de491a6c6f8..caf0503df94 100644 --- a/Modules/Segmentation/LevelSets/test/itkAnisotropicFourthOrderLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkAnisotropicFourthOrderLevelSetImageFilterTest.cxx @@ -27,8 +27,8 @@ itkAnisotropicFourthOrderLevelSetImageFilterTest(int, char *[]) auto im_init = ImageType::New(); - constexpr ImageType::SizeType sz = { { 128, 128 } }; - constexpr ImageType::IndexType idx = { { 0, 0 } }; + constexpr ImageType::SizeType sz{ 128, 128 }; + constexpr ImageType::IndexType idx{ 0, 0 }; ImageType::RegionType r = { idx, sz }; im_init->SetRegions(r); diff --git a/Modules/Segmentation/LevelSets/test/itkBinaryMaskToNarrowBandPointSetFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkBinaryMaskToNarrowBandPointSetFilterTest.cxx index 59831d2645a..f8f2fd0f060 100644 --- a/Modules/Segmentation/LevelSets/test/itkBinaryMaskToNarrowBandPointSetFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkBinaryMaskToNarrowBandPointSetFilterTest.cxx @@ -32,7 +32,7 @@ itkBinaryMaskToNarrowBandPointSetFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using BinaryMaskPixelType = unsigned char; diff --git a/Modules/Segmentation/LevelSets/test/itkCannySegmentationLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkCannySegmentationLevelSetImageFilterTest.cxx index b407a3ea939..73ffc36c93b 100644 --- a/Modules/Segmentation/LevelSets/test/itkCannySegmentationLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkCannySegmentationLevelSetImageFilterTest.cxx @@ -25,9 +25,9 @@ namespace CSIFTN using ImageType = itk::Image; using SeedImageType = itk::Image; -constexpr int V_WIDTH = 64; -constexpr int V_HEIGHT = 64; -constexpr int V_DEPTH = 64; +constexpr int V_WIDTH{ 64 }; +constexpr int V_HEIGHT{ 64 }; +constexpr int V_DEPTH{ 64 }; float sphere(float x, float y, float z) diff --git a/Modules/Segmentation/LevelSets/test/itkCollidingFrontsImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkCollidingFrontsImageFilterTest.cxx index 9caaf62f351..735d8d25999 100644 --- a/Modules/Segmentation/LevelSets/test/itkCollidingFrontsImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkCollidingFrontsImageFilterTest.cxx @@ -34,7 +34,7 @@ itkCollidingFrontsImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; using InternalPixelType = float; @@ -50,7 +50,7 @@ itkCollidingFrontsImageFilterTest(int argc, char * argv[]) ImageType::RegionType imageRegion; imageRegion.SetSize(imageSize); - constexpr PixelType background = 64; + constexpr PixelType background{ 64 }; auto inputImage = ImageType::New(); inputImage->SetRegions(imageRegion); diff --git a/Modules/Segmentation/LevelSets/test/itkCurvesLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkCurvesLevelSetImageFilterTest.cxx index ed68e266d49..53022f98459 100644 --- a/Modules/Segmentation/LevelSets/test/itkCurvesLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkCurvesLevelSetImageFilterTest.cxx @@ -36,7 +36,7 @@ int itkCurvesLevelSetImageFilterTest(int, char *[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; using InternalPixelType = float; @@ -54,8 +54,8 @@ itkCurvesLevelSetImageFilterTest(int, char *[]) * Create an input image. * A light square on a dark background. */ - constexpr PixelType background = 0; - constexpr PixelType foreground = 190; + constexpr PixelType background{ 0 }; + constexpr PixelType foreground{ 190 }; auto inputImage = ImageType::New(); inputImage->SetRegions(imageRegion); diff --git a/Modules/Segmentation/LevelSets/test/itkCurvesLevelSetImageFilterZeroSigmaTest.cxx b/Modules/Segmentation/LevelSets/test/itkCurvesLevelSetImageFilterZeroSigmaTest.cxx index 5e18597c8c9..2ec9c309674 100644 --- a/Modules/Segmentation/LevelSets/test/itkCurvesLevelSetImageFilterZeroSigmaTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkCurvesLevelSetImageFilterZeroSigmaTest.cxx @@ -33,7 +33,7 @@ int itkCurvesLevelSetImageFilterZeroSigmaTest(int, char *[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; using InternalPixelType = float; @@ -51,8 +51,8 @@ itkCurvesLevelSetImageFilterZeroSigmaTest(int, char *[]) * Create an input image. * A light square on a dark background. */ - constexpr PixelType background = 0; - constexpr PixelType foreground = 190; + constexpr PixelType background{ 0 }; + constexpr PixelType foreground{ 190 }; auto inputImage = ImageType::New(); inputImage->SetRegions(imageRegion); diff --git a/Modules/Segmentation/LevelSets/test/itkExtensionVelocitiesImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkExtensionVelocitiesImageFilterTest.cxx index 48db09c788c..bf20686221b 100644 --- a/Modules/Segmentation/LevelSets/test/itkExtensionVelocitiesImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkExtensionVelocitiesImageFilterTest.cxx @@ -48,7 +48,7 @@ double SimpleSignedDistance(const TPoint & p) { auto center = itk::MakeFilled(50); - constexpr double radius = 19.5; + constexpr double radius{ 19.5 }; double accum = 0.0; for (unsigned int j = 0; j < TPoint::PointDimension; ++j) @@ -115,7 +115,7 @@ int itkExtensionVelocitiesImageFilterTest(int, char *[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = float; using ImageType = itk::Image; @@ -181,7 +181,7 @@ itkExtensionVelocitiesImageFilterTest(int, char *[]) */ // Set up reinitialize level set image filter - constexpr unsigned int AuxDimension = 2; + constexpr unsigned int AuxDimension{ 2 }; using ReinitializerType = itk::ExtensionVelocitiesImageFilter; auto reinitializer = ReinitializerType::New(); reinitializer->SetInput(multiplier->GetOutput()); diff --git a/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourLevelSetImageFilterTest.cxx index 3792c5eb10e..cade4f29c8c 100644 --- a/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourLevelSetImageFilterTest.cxx @@ -31,7 +31,7 @@ int itkGeodesicActiveContourLevelSetImageFilterTest(int, char *[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; using InternalPixelType = float; @@ -46,8 +46,8 @@ itkGeodesicActiveContourLevelSetImageFilterTest(int, char *[]) imageRegion.SetSize(imageSize); // Create an input image: a light square on a dark background - constexpr PixelType background = 0; - constexpr PixelType foreground = 190; + constexpr PixelType background{ 0 }; + constexpr PixelType foreground{ 190 }; auto inputImage = ImageType::New(); inputImage->SetRegions(imageRegion); diff --git a/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourLevelSetImageFilterZeroSigmaTest.cxx b/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourLevelSetImageFilterZeroSigmaTest.cxx index ddefd9cbb64..9353902d905 100644 --- a/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourLevelSetImageFilterZeroSigmaTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourLevelSetImageFilterZeroSigmaTest.cxx @@ -31,7 +31,7 @@ int itkGeodesicActiveContourLevelSetImageFilterZeroSigmaTest(int, char *[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; using InternalPixelType = float; @@ -48,8 +48,8 @@ itkGeodesicActiveContourLevelSetImageFilterZeroSigmaTest(int, char *[]) // // Create an input image: a light square on a dark background. // - constexpr PixelType background = 0; - constexpr PixelType foreground = 190; + constexpr PixelType background{ 0 }; + constexpr PixelType foreground{ 190 }; auto inputImage = ImageType::New(); inputImage->SetRegions(imageRegion); diff --git a/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest.cxx index 4e054e1e5fc..22adfc49078 100644 --- a/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest.cxx @@ -59,7 +59,7 @@ int itkGeodesicActiveContourShapePriorLevelSetImageFilterTest(int, char *[]) { // Typedefs of components - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; using InternalPixelType = float; @@ -98,8 +98,8 @@ itkGeodesicActiveContourShapePriorLevelSetImageFilterTest(int, char *[]) // // The true shape is just the circle. // - constexpr PixelType background = 0; - constexpr PixelType foreground = 190; + constexpr PixelType background{ 0 }; + constexpr PixelType foreground{ 190 }; // Fill in the background auto inputImage = ImageType::New(); diff --git a/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2.cxx b/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2.cxx index f59f2c77225..05fa05ec20f 100644 --- a/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2.cxx +++ b/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2.cxx @@ -60,7 +60,7 @@ int itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2(int, char *[]) { // Typedefs of components - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; using InternalPixelType = float; @@ -102,8 +102,8 @@ itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2(int, char *[]) // The true shape is just the circle. // - constexpr PixelType background = 0; - constexpr PixelType foreground = 190; + constexpr PixelType background{ 0 }; + constexpr PixelType foreground{ 190 }; // Fill in the background auto inputImage = ImageType::New(); @@ -258,7 +258,7 @@ itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2(int, char *[]) using ImageVectorType = ShapeFunctionType::ImagePointerVector; ImageVectorType pca; - constexpr unsigned int numberOfPCA = 1; + constexpr unsigned int numberOfPCA{ 1 }; pca.resize(numberOfPCA); pca[0] = ComponentImageType::New(); diff --git a/Modules/Segmentation/LevelSets/test/itkImplicitManifoldNormalVectorFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkImplicitManifoldNormalVectorFilterTest.cxx index 7912c3e45aa..34e2f814fab 100644 --- a/Modules/Segmentation/LevelSets/test/itkImplicitManifoldNormalVectorFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkImplicitManifoldNormalVectorFilterTest.cxx @@ -31,8 +31,8 @@ itkImplicitManifoldNormalVectorFilterTest(int, char *[]) using FunctionType = itk::NormalVectorDiffusionFunction; auto im_init = InputImageType::New(); - constexpr InputImageType::SizeType sz = { { 50, 50 } }; - constexpr InputImageType::IndexType idx = { { 0, 0 } }; + constexpr InputImageType::SizeType sz{ 50, 50 }; + constexpr InputImageType::IndexType idx{ 0, 0 }; InputImageType::RegionType r = { idx, sz }; im_init->SetRegions(r); im_init->Allocate(); diff --git a/Modules/Segmentation/LevelSets/test/itkIsotropicFourthOrderLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkIsotropicFourthOrderLevelSetImageFilterTest.cxx index af42154fd4f..402c61f313b 100644 --- a/Modules/Segmentation/LevelSets/test/itkIsotropicFourthOrderLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkIsotropicFourthOrderLevelSetImageFilterTest.cxx @@ -27,8 +27,8 @@ itkIsotropicFourthOrderLevelSetImageFilterTest(int, char *[]) auto im_init = ImageType::New(); - constexpr ImageType::SizeType sz = { { 128, 128 } }; - constexpr ImageType::IndexType idx = { { 0, 0 } }; + constexpr ImageType::SizeType sz{ 128, 128 }; + constexpr ImageType::IndexType idx{ 0, 0 }; ImageType::RegionType r = { idx, sz }; im_init->SetRegions(r); diff --git a/Modules/Segmentation/LevelSets/test/itkLaplacianSegmentationLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkLaplacianSegmentationLevelSetImageFilterTest.cxx index 522c0939562..835ec1fc25a 100644 --- a/Modules/Segmentation/LevelSets/test/itkLaplacianSegmentationLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkLaplacianSegmentationLevelSetImageFilterTest.cxx @@ -26,9 +26,9 @@ namespace LSIFTN using ImageType = itk::Image; using SeedImageType = itk::Image; -constexpr int V_WIDTH = 64; -constexpr int V_HEIGHT = 64; -constexpr int V_DEPTH = 64; +constexpr int V_WIDTH{ 64 }; +constexpr int V_HEIGHT{ 64 }; +constexpr int V_DEPTH{ 64 }; float sphere(float x, float y, float z) diff --git a/Modules/Segmentation/LevelSets/test/itkLevelSetFunctionTest.cxx b/Modules/Segmentation/LevelSets/test/itkLevelSetFunctionTest.cxx index 22dd840231d..f315d5463fa 100644 --- a/Modules/Segmentation/LevelSets/test/itkLevelSetFunctionTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkLevelSetFunctionTest.cxx @@ -213,13 +213,13 @@ itkLevelSetFunctionTest(int, char *[]) { using ImageType = itk::Image; - constexpr int n = 100; // Number of iterations + constexpr int n{ 100 }; // Number of iterations auto im_init = ImageType::New(); auto im_target = ImageType::New(); - constexpr ImageType::SizeType sz = { { LSFT::HEIGHT, LSFT::WIDTH } }; - constexpr ImageType::IndexType idx = { { 0, 0 } }; + constexpr ImageType::SizeType sz{ LSFT::HEIGHT, LSFT::WIDTH }; + constexpr ImageType::IndexType idx{ 0, 0 }; ImageType::RegionType r = { idx, sz }; im_init->SetRegions(r); diff --git a/Modules/Segmentation/LevelSets/test/itkLevelSetNeighborhoodExtractorTest.cxx b/Modules/Segmentation/LevelSets/test/itkLevelSetNeighborhoodExtractorTest.cxx index f1acd050d16..9a194747479 100644 --- a/Modules/Segmentation/LevelSets/test/itkLevelSetNeighborhoodExtractorTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkLevelSetNeighborhoodExtractorTest.cxx @@ -22,7 +22,7 @@ int itkLevelSetNeighborhoodExtractorTest(int, char *[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = float; using ImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSets/test/itkLevelSetVelocityNeighborhoodExtractorTest.cxx b/Modules/Segmentation/LevelSets/test/itkLevelSetVelocityNeighborhoodExtractorTest.cxx index a8c4b581990..6bae907feb6 100644 --- a/Modules/Segmentation/LevelSets/test/itkLevelSetVelocityNeighborhoodExtractorTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkLevelSetVelocityNeighborhoodExtractorTest.cxx @@ -22,7 +22,7 @@ int itkLevelSetVelocityNeighborhoodExtractorTest(int, char *[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = float; using ImageType = itk::Image; using AuxValueType = double; diff --git a/Modules/Segmentation/LevelSets/test/itkNarrowBandCurvesLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkNarrowBandCurvesLevelSetImageFilterTest.cxx index 4b74c4a4137..a44e6c97eab 100644 --- a/Modules/Segmentation/LevelSets/test/itkNarrowBandCurvesLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkNarrowBandCurvesLevelSetImageFilterTest.cxx @@ -40,7 +40,7 @@ itkNarrowBandCurvesLevelSetImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; using InternalPixelType = float; @@ -56,8 +56,8 @@ itkNarrowBandCurvesLevelSetImageFilterTest(int argc, char * argv[]) // Create an input image. // A light square on a dark background. - constexpr PixelType background = 0; - constexpr PixelType foreground = 190; + constexpr PixelType background{ 0 }; + constexpr PixelType foreground{ 190 }; auto inputImage = ImageType::New(); inputImage->SetRegions(imageRegion); @@ -133,7 +133,7 @@ itkNarrowBandCurvesLevelSetImageFilterTest(int argc, char * argv[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(curvesFilter, NarrowBandCurvesLevelSetImageFilter, NarrowBandLevelSetImageFilter); - constexpr bool reverseExpansionDirection = false; + constexpr bool reverseExpansionDirection{ false }; ITK_TEST_SET_GET_BOOLEAN(curvesFilter, ReverseExpansionDirection, reverseExpansionDirection); // Set the initial level set diff --git a/Modules/Segmentation/LevelSets/test/itkNarrowBandThresholdSegmentationLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkNarrowBandThresholdSegmentationLevelSetImageFilterTest.cxx index a1093e3d62c..ac16e4ae1ed 100644 --- a/Modules/Segmentation/LevelSets/test/itkNarrowBandThresholdSegmentationLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkNarrowBandThresholdSegmentationLevelSetImageFilterTest.cxx @@ -25,9 +25,9 @@ namespace NBTS using ImageType = itk::Image; using SeedImageType = itk::Image; -constexpr int V_WIDTH = 64; -constexpr int V_HEIGHT = 64; -constexpr int V_DEPTH = 64; +constexpr int V_WIDTH{ 64 }; +constexpr int V_HEIGHT{ 64 }; +constexpr int V_DEPTH{ 64 }; float sphere(float x, float y, float z) @@ -171,7 +171,7 @@ itkNarrowBandThresholdSegmentationLevelSetImageFilterTest(int, char *[]) filter->SetEdgeWeight(edgeWeight); ITK_TEST_SET_GET_VALUE(edgeWeight, filter->GetEdgeWeight()); - constexpr int smoothingIterations = 5; + constexpr int smoothingIterations{ 5 }; filter->SetSmoothingIterations(smoothingIterations); ITK_TEST_SET_GET_VALUE(smoothingIterations, filter->GetSmoothingIterations()); diff --git a/Modules/Segmentation/LevelSets/test/itkParallelSparseFieldLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkParallelSparseFieldLevelSetImageFilterTest.cxx index 4e569561248..22ced610c21 100644 --- a/Modules/Segmentation/LevelSets/test/itkParallelSparseFieldLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkParallelSparseFieldLevelSetImageFilterTest.cxx @@ -42,7 +42,7 @@ constexpr unsigned int HEIGHT = (64); constexpr unsigned int WIDTH = (64); constexpr unsigned int DEPTH = (64); -constexpr int RADIUS = (std::min(std::min(HEIGHT, WIDTH), DEPTH) / 4); +constexpr int RADIUS{ (std::min(std::min(HEIGHT, WIDTH), DEPTH) / 4) }; // Distance transform function for a sphere float @@ -222,19 +222,19 @@ itkParallelSparseFieldLevelSetImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using PixelType = float; using ImageType = itk::Image; - constexpr int n = 100; // Number of iterations - constexpr int numberOfWorkUnits = 11; // Number of work units to be used + constexpr int n{ 100 }; // Number of iterations + constexpr int numberOfWorkUnits{ 11 }; // Number of work units to be used auto im_init = ImageType::New(); auto im_target = ImageType::New(); - constexpr ImageType::SizeType sz = { { PSFLSIFT::HEIGHT, PSFLSIFT::WIDTH, PSFLSIFT::DEPTH } }; - constexpr ImageType::IndexType idx = { { 0, 0, 0 } }; + constexpr ImageType::SizeType sz{ PSFLSIFT::HEIGHT, PSFLSIFT::WIDTH, PSFLSIFT::DEPTH }; + constexpr ImageType::IndexType idx{ 0, 0, 0 }; ImageType::RegionType r = { idx, sz }; ImageType::PointType origin; diff --git a/Modules/Segmentation/LevelSets/test/itkReinitializeLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkReinitializeLevelSetImageFilterTest.cxx index 96e81c711ae..37e06b827cf 100644 --- a/Modules/Segmentation/LevelSets/test/itkReinitializeLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkReinitializeLevelSetImageFilterTest.cxx @@ -49,7 +49,7 @@ double SimpleSignedDistance(const TPoint & p) { auto center = itk::MakeFilled(50); - constexpr double radius = 19.5; + constexpr double radius{ 19.5 }; double accum = 0.0; for (unsigned int j = 0; j < TPoint::PointDimension; ++j) @@ -67,7 +67,7 @@ int itkReinitializeLevelSetImageFilterTest(int, char *[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = float; using ImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSets/test/itkShapeDetectionLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkShapeDetectionLevelSetImageFilterTest.cxx index fda7a0ec827..14e6632ad11 100644 --- a/Modules/Segmentation/LevelSets/test/itkShapeDetectionLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkShapeDetectionLevelSetImageFilterTest.cxx @@ -34,7 +34,7 @@ int itkShapeDetectionLevelSetImageFilterTest(int, char *[]) { - constexpr unsigned int ImageDimension = 2; + constexpr unsigned int ImageDimension{ 2 }; using PixelType = unsigned char; using InternalPixelType = float; @@ -52,8 +52,8 @@ itkShapeDetectionLevelSetImageFilterTest(int, char *[]) * Create an input image. * A light square on a dark background. */ - constexpr PixelType background = 0; - constexpr PixelType foreground = 190; + constexpr PixelType background{ 0 }; + constexpr PixelType foreground{ 190 }; auto inputImage = ImageType::New(); inputImage->SetRegions(imageRegion); diff --git a/Modules/Segmentation/LevelSets/test/itkShapePriorMAPCostFunctionTest.cxx b/Modules/Segmentation/LevelSets/test/itkShapePriorMAPCostFunctionTest.cxx index c7a506e7878..2823242cc50 100644 --- a/Modules/Segmentation/LevelSets/test/itkShapePriorMAPCostFunctionTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkShapePriorMAPCostFunctionTest.cxx @@ -41,7 +41,7 @@ itkShapePriorMAPCostFunctionTest(int, char *[]) { using PixelType = float; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ImageType = itk::Image; /** @@ -97,7 +97,7 @@ itkShapePriorMAPCostFunctionTest(int, char *[]) iter.GoToBegin(); unsigned int counter = 0; - constexpr PixelType activeRegionThreshold = 3.0; + constexpr PixelType activeRegionThreshold{ 3.0 }; while (!iter.IsAtEnd()) { diff --git a/Modules/Segmentation/LevelSets/test/itkShapePriorSegmentationLevelSetFunctionTest.cxx b/Modules/Segmentation/LevelSets/test/itkShapePriorSegmentationLevelSetFunctionTest.cxx index a82afb9d02a..9d4614ea1ad 100644 --- a/Modules/Segmentation/LevelSets/test/itkShapePriorSegmentationLevelSetFunctionTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkShapePriorSegmentationLevelSetFunctionTest.cxx @@ -112,7 +112,7 @@ itkShapePriorSegmentationLevelSetFunctionTest(int, char *[]) { using PixelType = float; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ImageType = itk::Image; // create an input level set using the sphere signed distance function diff --git a/Modules/Segmentation/LevelSets/test/itkSparseFieldFourthOrderLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkSparseFieldFourthOrderLevelSetImageFilterTest.cxx index a117e54e2b8..e47f0c867bb 100644 --- a/Modules/Segmentation/LevelSets/test/itkSparseFieldFourthOrderLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkSparseFieldFourthOrderLevelSetImageFilterTest.cxx @@ -140,8 +140,8 @@ itkSparseFieldFourthOrderLevelSetImageFilterTest(int, char *[]) auto image = ImageType::New(); - constexpr ImageType::SizeType sz = { { SFFOLSIFT::HEIGHT, SFFOLSIFT::WIDTH } }; - constexpr ImageType::IndexType idx = { { 0, 0 } }; + constexpr ImageType::SizeType sz{ SFFOLSIFT::HEIGHT, SFFOLSIFT::WIDTH }; + constexpr ImageType::IndexType idx{ 0, 0 }; ImageType::RegionType r = { idx, sz }; image->SetRegions(r); @@ -155,11 +155,11 @@ itkSparseFieldFourthOrderLevelSetImageFilterTest(int, char *[]) filter, IsotropicDiffusionLevelSetFilter, SparseFieldFourthOrderLevelSetImageFilter); - constexpr unsigned int maxRefitIteration = 0; + constexpr unsigned int maxRefitIteration{ 0 }; filter->SetMaxRefitIteration(maxRefitIteration); ITK_TEST_SET_GET_VALUE(maxRefitIteration, filter->GetMaxRefitIteration()); - constexpr unsigned int maxNormalIteration = 100; + constexpr unsigned int maxNormalIteration{ 100 }; filter->SetMaxNormalIteration(maxNormalIteration); ITK_TEST_SET_GET_VALUE(maxNormalIteration, filter->GetMaxNormalIteration()); @@ -171,7 +171,7 @@ itkSparseFieldFourthOrderLevelSetImageFilterTest(int, char *[]) filter->SetRMSChangeNormalProcessTrigger(rmsChangeNormalProcessTrigger); ITK_TEST_SET_GET_VALUE(rmsChangeNormalProcessTrigger, filter->GetRMSChangeNormalProcessTrigger()); - constexpr int normalProcessType = 0; + constexpr int normalProcessType{ 0 }; filter->SetNormalProcessType(normalProcessType); ITK_TEST_SET_GET_VALUE(normalProcessType, filter->GetNormalProcessType()); @@ -179,7 +179,7 @@ itkSparseFieldFourthOrderLevelSetImageFilterTest(int, char *[]) filter->SetNormalProcessConductance(normalProcessConductance); ITK_TEST_SET_GET_VALUE(normalProcessConductance, filter->GetNormalProcessConductance()); - constexpr bool normalProcessUnsharpFlag = false; + constexpr bool normalProcessUnsharpFlag{ false }; filter->SetNormalProcessUnsharpFlag(normalProcessUnsharpFlag); ITK_TEST_SET_GET_BOOLEAN(filter, NormalProcessUnsharpFlag, normalProcessUnsharpFlag); diff --git a/Modules/Segmentation/LevelSets/test/itkThresholdSegmentationLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkThresholdSegmentationLevelSetImageFilterTest.cxx index e5b1d20ff42..8aeb22e94f1 100644 --- a/Modules/Segmentation/LevelSets/test/itkThresholdSegmentationLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkThresholdSegmentationLevelSetImageFilterTest.cxx @@ -25,9 +25,9 @@ namespace TSIFTN using ImageType = itk::Image; using SeedImageType = itk::Image; -constexpr int V_WIDTH = 64; -constexpr int V_HEIGHT = 64; -constexpr int V_DEPTH = 64; +constexpr int V_WIDTH{ 64 }; +constexpr int V_HEIGHT{ 64 }; +constexpr int V_DEPTH{ 64 }; float sphere(float x, float y, float z) @@ -211,7 +211,7 @@ itkThresholdSegmentationLevelSetImageFilterTest(int, char *[]) filter->SetEdgeWeight(edgeWeight); ITK_TEST_SET_GET_VALUE(edgeWeight, filter->GetEdgeWeight()); - constexpr int smoothingIterations = 5; + constexpr int smoothingIterations{ 5 }; filter->SetSmoothingIterations(smoothingIterations); ITK_TEST_SET_GET_VALUE(smoothingIterations, filter->GetSmoothingIterations()); diff --git a/Modules/Segmentation/LevelSets/test/itkUnsharpMaskLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkUnsharpMaskLevelSetImageFilterTest.cxx index 2cf0b07a434..cab5bf458e3 100644 --- a/Modules/Segmentation/LevelSets/test/itkUnsharpMaskLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkUnsharpMaskLevelSetImageFilterTest.cxx @@ -62,8 +62,8 @@ itkUnsharpMaskLevelSetImageFilterTest(int, char *[]) auto im_init = ImageType::New(); - constexpr ImageType::SizeType sz = { { HEIGHT, WIDTH } }; - constexpr ImageType::IndexType idx = { { 0, 0 } }; + constexpr ImageType::SizeType sz{ HEIGHT, WIDTH }; + constexpr ImageType::IndexType idx{ 0, 0 }; ImageType::RegionType r = { idx, sz }; im_init->SetRegions(r); diff --git a/Modules/Segmentation/LevelSets/test/itkVectorThresholdSegmentationLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkVectorThresholdSegmentationLevelSetImageFilterTest.cxx index e6427a2d710..554a1e1c035 100644 --- a/Modules/Segmentation/LevelSets/test/itkVectorThresholdSegmentationLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkVectorThresholdSegmentationLevelSetImageFilterTest.cxx @@ -38,7 +38,7 @@ itkVectorThresholdSegmentationLevelSetImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelComponentType = unsigned char; using RGBPixelType = itk::RGBPixel; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToMalcolmSparseLevelSetAdaptorTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToMalcolmSparseLevelSetAdaptorTest.cxx index 7de9bb5bbe4..8f265e150c4 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToMalcolmSparseLevelSetAdaptorTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToMalcolmSparseLevelSetAdaptorTest.cxx @@ -32,7 +32,7 @@ itkBinaryImageToMalcolmSparseLevelSetAdaptorTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned char; bool debugPrint = false; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToShiSparseLevelSetAdaptorTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToShiSparseLevelSetAdaptorTest.cxx index 056b620abe6..b40e3abecae 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToShiSparseLevelSetAdaptorTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToShiSparseLevelSetAdaptorTest.cxx @@ -32,7 +32,7 @@ itkBinaryImageToShiSparseLevelSetAdaptorTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned char; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToWhitakerSparseLevelSetAdaptorTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToWhitakerSparseLevelSetAdaptorTest.cxx index 71e3af30433..9721d58aa92 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToWhitakerSparseLevelSetAdaptorTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToWhitakerSparseLevelSetAdaptorTest.cxx @@ -32,7 +32,7 @@ itkBinaryImageToWhitakerSparseLevelSetAdaptorTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned char; using OutputPixelType = double; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkDenseLevelSetContainerTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkDenseLevelSetContainerTest.cxx index 8a2ab8a0ef7..bb3fef53b30 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkDenseLevelSetContainerTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkDenseLevelSetContainerTest.cxx @@ -21,7 +21,7 @@ int itkDenseLevelSetContainerTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ImageType = itk::Image; using LevelSetType = itk::LevelSetDenseImage; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDenseImageTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDenseImageTest.cxx index d06d2a41700..5e701a32ba2 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDenseImageTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDenseImageTest.cxx @@ -72,7 +72,7 @@ class ToleranceChecker int itkLevelSetDenseImageTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; @@ -89,7 +89,7 @@ itkLevelSetDenseImageTest(int, char *[]) const ImageType::RegionType region{ index, size }; - constexpr PixelType zeroValue = 0.; + constexpr PixelType zeroValue{ 0. }; ImageType::SpacingType spacing; spacing[0] = 0.02 / size[0]; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainMapImageFilterTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainMapImageFilterTest.cxx index beb7c4bb50c..fc6a87a5eef 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainMapImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainMapImageFilterTest.cxx @@ -22,7 +22,7 @@ int itkLevelSetDomainMapImageFilterTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ListPixelType = std::list; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionBaseTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionBaseTest.cxx index d2aa095bc07..7f63adc0461 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionBaseTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionBaseTest.cxx @@ -52,13 +52,13 @@ class LevelSetDomainPartitionBaseHelper : public LevelSetDomainPartitionBase; using DomainPartitionBaseHelperType = itk::LevelSetDomainPartitionBaseHelper; - constexpr itk::IdentifierType count = 2; + constexpr itk::IdentifierType count{ 2 }; auto function = DomainPartitionBaseHelperType::New(); function->SetNumberOfLevelSetFunctions(count); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionImageTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionImageTest.cxx index 7ccdbc6d1fe..a68c6526e05 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionImageTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionImageTest.cxx @@ -23,7 +23,7 @@ int itkLevelSetDomainPartitionImageTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; @@ -59,7 +59,7 @@ itkLevelSetDomainPartitionImageTest(int, char *[]) binary->Allocate(); binary->FillBuffer(InputPixelType{}); - constexpr IdentifierType numberOfLevelSetFunctions = 2; + constexpr IdentifierType numberOfLevelSetFunctions{ 2 }; LevelSetDomainRegionVectorType regionVector; regionVector.resize(numberOfLevelSetFunctions); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionImageWithKdTreeTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionImageWithKdTreeTest.cxx index 9906b115396..87eeb0fefc5 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionImageWithKdTreeTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionImageWithKdTreeTest.cxx @@ -23,7 +23,7 @@ int itkLevelSetDomainPartitionImageWithKdTreeTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; @@ -65,7 +65,7 @@ itkLevelSetDomainPartitionImageWithKdTreeTest(int, char *[]) binary->Allocate(); binary->FillBuffer(InputPixelType{}); - constexpr IdentifierType numberOfLevelSetFunctions = 10; + constexpr IdentifierType numberOfLevelSetFunctions{ 10 }; LevelSetDomainRegionVectorType regionVector; regionVector.resize(numberOfLevelSetFunctions); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationBinaryMaskTermTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationBinaryMaskTermTest.cxx index ed71ec404aa..1a8c1c794ba 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationBinaryMaskTermTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationBinaryMaskTermTest.cxx @@ -27,7 +27,7 @@ int itkLevelSetEquationBinaryMaskTermTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationChanAndVeseExternalTermTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationChanAndVeseExternalTermTest.cxx index f86c4c5329a..5b3c3b19a2e 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationChanAndVeseExternalTermTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationChanAndVeseExternalTermTest.cxx @@ -35,7 +35,7 @@ itkLevelSetEquationChanAndVeseExternalTermTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationChanAndVeseInternalTermTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationChanAndVeseInternalTermTest.cxx index 99743f7e246..cd653c288ab 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationChanAndVeseInternalTermTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationChanAndVeseInternalTermTest.cxx @@ -35,7 +35,7 @@ itkLevelSetEquationChanAndVeseInternalTermTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationCurvatureTermTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationCurvatureTermTest.cxx index 388ebd018e8..3d0e0035b78 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationCurvatureTermTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationCurvatureTermTest.cxx @@ -34,7 +34,7 @@ itkLevelSetEquationCurvatureTermTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; @@ -187,7 +187,7 @@ itkLevelSetEquationCurvatureTermTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr bool useCurvatureImage = false; + constexpr bool useCurvatureImage{ false }; ITK_TEST_SET_GET_BOOLEAN(term, UseCurvatureImage, useCurvatureImage); if (itk::Math::NotAlmostEquals(term->Evaluate(index), value)) diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationLaplacianTermTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationLaplacianTermTest.cxx index 8ba6dff4a4a..cb256957ac6 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationLaplacianTermTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationLaplacianTermTest.cxx @@ -32,7 +32,7 @@ itkLevelSetEquationLaplacianTermTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationOverlapPenaltyTermTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationOverlapPenaltyTermTest.cxx index a180cf40ed1..6dcb29054b5 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationOverlapPenaltyTermTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationOverlapPenaltyTermTest.cxx @@ -27,7 +27,7 @@ int itkLevelSetEquationOverlapPenaltyTermTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationPropagationTermTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationPropagationTermTest.cxx index 8cd93a8cd02..1826ab5efa9 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationPropagationTermTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationPropagationTermTest.cxx @@ -32,7 +32,7 @@ itkLevelSetEquationPropagationTermTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationTermContainerTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationTermContainerTest.cxx index 7dc93c4c22f..33a405266b4 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationTermContainerTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationTermContainerTest.cxx @@ -34,7 +34,7 @@ itkLevelSetEquationTermContainerTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEvolutionNumberOfIterationsStoppingCriterionTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEvolutionNumberOfIterationsStoppingCriterionTest.cxx index 670e676fda7..9742e259e66 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEvolutionNumberOfIterationsStoppingCriterionTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEvolutionNumberOfIterationsStoppingCriterionTest.cxx @@ -25,7 +25,7 @@ int itkLevelSetEvolutionNumberOfIterationsStoppingCriterionTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ValueType = float; using LevelSetType = itk::WhitakerSparseLevelSetImage; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkMalcolmSparseLevelSetImageTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkMalcolmSparseLevelSetImageTest.cxx index 220cd75f6f7..cf742987d51 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkMalcolmSparseLevelSetImageTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkMalcolmSparseLevelSetImageTest.cxx @@ -22,7 +22,7 @@ int itkMalcolmSparseLevelSetImageTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using SparseLevelSetType = itk::MalcolmSparseLevelSetImage; using LabelMapType = SparseLevelSetType::LabelMapType; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetChanAndVeseInternalTermTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetChanAndVeseInternalTermTest.cxx index 7b71250b391..23cbcdf29d0 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetChanAndVeseInternalTermTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetChanAndVeseInternalTermTest.cxx @@ -24,7 +24,7 @@ int itkMultiLevelSetChanAndVeseInternalTermTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned char; using InputImageType = itk::Image; @@ -59,7 +59,7 @@ itkMultiLevelSetChanAndVeseInternalTermTest(int, char *[]) const ImageType::RegionType region{ index, size }; - constexpr PixelType value = 0.; + constexpr PixelType value{ 0. }; auto input = InputImageType::New(); input->SetRegions(region); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetDenseImageSubset2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetDenseImageSubset2DTest.cxx index 6bcbfb4a561..4a091709ae2 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetDenseImageSubset2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetDenseImageSubset2DTest.cxx @@ -32,7 +32,7 @@ int itkMultiLevelSetDenseImageSubset2DTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetDenseImageTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetDenseImageTest.cxx index ac930648ab3..0cb1fbbd080 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetDenseImageTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetDenseImageTest.cxx @@ -22,7 +22,7 @@ int itkMultiLevelSetDenseImageTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using ImageType = itk::Image; @@ -42,7 +42,7 @@ itkMultiLevelSetDenseImageTest(int, char *[]) const ImageType::RegionType region{ index, size }; - constexpr PixelType value = 0.; + constexpr PixelType value{ 0. }; auto input1 = ImageType::New(); input1->SetRegions(region); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetEvolutionTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetEvolutionTest.cxx index 221c64ee8fc..fb1b5107ace 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetEvolutionTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetEvolutionTest.cxx @@ -28,7 +28,7 @@ int itkMultiLevelSetEvolutionTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned char; using InputImageType = itk::Image; @@ -68,7 +68,7 @@ itkMultiLevelSetEvolutionTest(int, char *[]) const ImageType::RegionType region{ index, size }; - constexpr PixelType value = 0.; + constexpr PixelType value{ 0. }; auto input = InputImageType::New(); input->SetRegions(region); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetMalcolmImageSubset2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetMalcolmImageSubset2DTest.cxx index 8b220ed5a51..c775ca2fa77 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetMalcolmImageSubset2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetMalcolmImageSubset2DTest.cxx @@ -33,7 +33,7 @@ int itkMultiLevelSetMalcolmImageSubset2DTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetShiImageSubset2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetShiImageSubset2DTest.cxx index 5333ecc828c..b29f82a1707 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetShiImageSubset2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetShiImageSubset2DTest.cxx @@ -33,7 +33,7 @@ int itkMultiLevelSetShiImageSubset2DTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetWhitakerImageSubset2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetWhitakerImageSubset2DTest.cxx index db3c502ce53..86fabda1d7a 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetWhitakerImageSubset2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetWhitakerImageSubset2DTest.cxx @@ -33,7 +33,7 @@ int itkMultiLevelSetWhitakerImageSubset2DTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkShiSparseLevelSetImageTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkShiSparseLevelSetImageTest.cxx index e38df78b163..091524d899b 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkShiSparseLevelSetImageTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkShiSparseLevelSetImageTest.cxx @@ -22,7 +22,7 @@ int itkShiSparseLevelSetImageTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using SparseLevelSetType = itk::ShiSparseLevelSetImage; using LabelMapType = SparseLevelSetType::LabelMapType; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetDenseAdvectionImage2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetDenseAdvectionImage2DTest.cxx index ea6f4fc3e9a..df0282d140f 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetDenseAdvectionImage2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetDenseAdvectionImage2DTest.cxx @@ -41,7 +41,7 @@ itkSingleLevelSetDenseAdvectionImage2DTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetDenseImage2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetDenseImage2DTest.cxx index 132aa2fd15a..1a150f65506 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetDenseImage2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetDenseImage2DTest.cxx @@ -40,7 +40,7 @@ itkSingleLevelSetDenseImage2DTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetMalcolmImage2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetMalcolmImage2DTest.cxx index ff2a80ba573..ac50ad9a681 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetMalcolmImage2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetMalcolmImage2DTest.cxx @@ -39,7 +39,7 @@ itkSingleLevelSetMalcolmImage2DTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetShiImage2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetShiImage2DTest.cxx index 65e3ee3f212..fc221589568 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetShiImage2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetShiImage2DTest.cxx @@ -39,7 +39,7 @@ itkSingleLevelSetShiImage2DTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DTest.cxx index 4b23b959a1b..184719e0704 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DTest.cxx @@ -39,7 +39,7 @@ itkSingleLevelSetWhitakerImage2DTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; @@ -168,7 +168,7 @@ itkSingleLevelSetWhitakerImage2DTest(int argc, char * argv[]) evolution->SetLevelSetContainer(lscontainer); - constexpr itk::ThreadIdType numberOfWorkUnits = 1; + constexpr itk::ThreadIdType numberOfWorkUnits{ 1 }; evolution->SetNumberOfWorkUnits(numberOfWorkUnits); ITK_TEST_SET_GET_VALUE(numberOfWorkUnits, evolution->GetNumberOfWorkUnits()); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithCurvatureTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithCurvatureTest.cxx index 25e7d46600f..82a5b0d6302 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithCurvatureTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithCurvatureTest.cxx @@ -37,7 +37,7 @@ itkSingleLevelSetWhitakerImage2DWithCurvatureTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithLaplacianTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithLaplacianTest.cxx index 5b9f35fd196..3a7873425cb 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithLaplacianTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithLaplacianTest.cxx @@ -38,7 +38,7 @@ itkSingleLevelSetWhitakerImage2DWithLaplacianTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithPropagationTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithPropagationTest.cxx index 1a85a6fd1fb..745d4e850de 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithPropagationTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithPropagationTest.cxx @@ -37,7 +37,7 @@ itkSingleLevelSetWhitakerImage2DWithPropagationTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkSparseLevelSetContainerTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkSparseLevelSetContainerTest.cxx index 817ec221bfe..2e363c8a091 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkSparseLevelSetContainerTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkSparseLevelSetContainerTest.cxx @@ -22,7 +22,7 @@ int itkSparseLevelSetContainerTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using LevelSetType = itk::WhitakerSparseLevelSetImage; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetDenseImage2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetDenseImage2DTest.cxx index 0a77183c1f5..aba3e04bdba 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetDenseImage2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetDenseImage2DTest.cxx @@ -39,7 +39,7 @@ itkTwoLevelSetDenseImage2DTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetMalcolmImage2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetMalcolmImage2DTest.cxx index 966923c96bc..c78b01626af 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetMalcolmImage2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetMalcolmImage2DTest.cxx @@ -39,7 +39,7 @@ itkTwoLevelSetMalcolmImage2DTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetShiImage2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetShiImage2DTest.cxx index 8d220cc0daf..c889cb93a82 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetShiImage2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetShiImage2DTest.cxx @@ -39,7 +39,7 @@ itkTwoLevelSetShiImage2DTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetWhitakerImage2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetWhitakerImage2DTest.cxx index 21fc5e8c698..de8d4eea0c5 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetWhitakerImage2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetWhitakerImage2DTest.cxx @@ -39,7 +39,7 @@ itkTwoLevelSetWhitakerImage2DTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned short; using InputImageType = itk::Image; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkWhitakerSparseLevelSetImageTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkWhitakerSparseLevelSetImageTest.cxx index f12674b4c47..ba2128df837 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkWhitakerSparseLevelSetImageTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkWhitakerSparseLevelSetImageTest.cxx @@ -24,7 +24,7 @@ int itkWhitakerSparseLevelSetImageTest(int, char *[]) { using OutputType = double; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using SparseLevelSetType = itk::WhitakerSparseLevelSetImage; using LabelMapType = SparseLevelSetType::LabelMapType; diff --git a/Modules/Segmentation/MarkovRandomFieldsClassifiers/include/itkMRFImageFilter.hxx b/Modules/Segmentation/MarkovRandomFieldsClassifiers/include/itkMRFImageFilter.hxx index 08f7f89e4f6..52e9adf18e7 100644 --- a/Modules/Segmentation/MarkovRandomFieldsClassifiers/include/itkMRFImageFilter.hxx +++ b/Modules/Segmentation/MarkovRandomFieldsClassifiers/include/itkMRFImageFilter.hxx @@ -231,7 +231,7 @@ MRFImageFilter::SetDefaultMRFNeighborhoodWeight() // Determine the default neighborhood size m_NeighborhoodSize = 1; - constexpr int neighborhoodRadius = 1; // Default assumes a radius of 1 + constexpr int neighborhoodRadius{ 1 }; // Default assumes a radius of 1 for (unsigned int i = 0; i < InputImageDimension; ++i) { m_NeighborhoodSize *= (2 * neighborhoodRadius + 1); diff --git a/Modules/Segmentation/MarkovRandomFieldsClassifiers/test/itkMRFImageFilterTest.cxx b/Modules/Segmentation/MarkovRandomFieldsClassifiers/test/itkMRFImageFilterTest.cxx index 83850b341e2..cb52d02f1ef 100644 --- a/Modules/Segmentation/MarkovRandomFieldsClassifiers/test/itkMRFImageFilterTest.cxx +++ b/Modules/Segmentation/MarkovRandomFieldsClassifiers/test/itkMRFImageFilterTest.cxx @@ -25,14 +25,14 @@ // Data definitions -constexpr uint8_t IMGWIDTH = 6; -constexpr uint8_t IMGHEIGHT = 6; -constexpr uint8_t NFRAMES = 3; -constexpr uint8_t NUMBANDS = 2; -constexpr uint8_t NDIMENSION = 3; -constexpr uint8_t NUM_CLASSES = 3; -constexpr uint8_t MAX_NUM_ITER = 5; -constexpr uint8_t NEIGHBORHOOD_RAD = 1; +constexpr uint8_t IMGWIDTH{ 6 }; +constexpr uint8_t IMGHEIGHT{ 6 }; +constexpr uint8_t NFRAMES{ 3 }; +constexpr uint8_t NUMBANDS{ 2 }; +constexpr uint8_t NDIMENSION{ 3 }; +constexpr uint8_t NUM_CLASSES{ 3 }; +constexpr uint8_t MAX_NUM_ITER{ 5 }; +constexpr uint8_t NEIGHBORHOOD_RAD{ 1 }; int @@ -212,7 +212,7 @@ itkMRFImageFilterTest(int, char *[]) using ClassImageType = itk::Image; auto classImage = ClassImageType::New(); - constexpr ClassImageType::SizeType classImgSize = { { IMGWIDTH, IMGHEIGHT, NFRAMES } }; + constexpr ClassImageType::SizeType classImgSize{ IMGWIDTH, IMGHEIGHT, NFRAMES }; constexpr ClassImageType::IndexType classindex{}; diff --git a/Modules/Segmentation/MarkovRandomFieldsClassifiers/test/itkRGBGibbsPriorFilterTest.cxx b/Modules/Segmentation/MarkovRandomFieldsClassifiers/test/itkRGBGibbsPriorFilterTest.cxx index 8ebcb70910d..bbe291a42c4 100644 --- a/Modules/Segmentation/MarkovRandomFieldsClassifiers/test/itkRGBGibbsPriorFilterTest.cxx +++ b/Modules/Segmentation/MarkovRandomFieldsClassifiers/test/itkRGBGibbsPriorFilterTest.cxx @@ -30,13 +30,13 @@ int itkRGBGibbsPriorFilterTest(int, char *[]) { - constexpr unsigned int ImageWidth = 20; - constexpr unsigned int ImageHeight = 20; - constexpr unsigned int NumFrames = 1; - constexpr unsigned int NumberOfBands = 1; - constexpr unsigned int ImageDimension = 3; - constexpr unsigned int NumClasses = 3; - constexpr unsigned int MaxNumIter = 1; + constexpr unsigned int ImageWidth{ 20 }; + constexpr unsigned int ImageHeight{ 20 }; + constexpr unsigned int NumFrames{ 1 }; + constexpr unsigned int NumberOfBands{ 1 }; + constexpr unsigned int ImageDimension{ 3 }; + constexpr unsigned int NumClasses{ 3 }; + constexpr unsigned int MaxNumIter{ 1 }; const unsigned short TestingImage[400] = { 297, 277, 317, 289, 300, 312, 306, 283, 282, 308, 308, 342, 335, 325, 315, 300, 304, 318, 307, 308, @@ -87,7 +87,7 @@ itkRGBGibbsPriorFilterTest(int, char *[]) using VecImagePixelType = VecImageType::PixelType; - constexpr VecImageType::SizeType vecImgSize = { { ImageWidth, ImageHeight, NumFrames } }; + constexpr VecImageType::SizeType vecImgSize{ ImageWidth, ImageHeight, NumFrames }; constexpr VecImageType::IndexType index{}; @@ -132,7 +132,7 @@ itkRGBGibbsPriorFilterTest(int, char *[]) using ClassImageType = itk::Image; auto classImage = ClassImageType::New(); - constexpr ClassImageType::SizeType classImgSize = { { ImageWidth, ImageHeight, NumFrames } }; + constexpr ClassImageType::SizeType classImgSize{ ImageWidth, ImageHeight, NumFrames }; constexpr ClassImageType::IndexType classindex{}; @@ -262,15 +262,15 @@ itkRGBGibbsPriorFilterTest(int, char *[]) // applyGibbsImageFilter->SetErrorTolerance(0.00); - constexpr unsigned int clusterSize = 10; + constexpr unsigned int clusterSize{ 10 }; applyGibbsImageFilter->SetClusterSize(clusterSize); ITK_TEST_SET_GET_VALUE(clusterSize, applyGibbsImageFilter->GetClusterSize()); - constexpr unsigned int boundaryGradient = 6; + constexpr unsigned int boundaryGradient{ 6 }; applyGibbsImageFilter->SetBoundaryGradient(boundaryGradient); ITK_TEST_SET_GET_VALUE(boundaryGradient, applyGibbsImageFilter->GetBoundaryGradient()); - constexpr unsigned int objectLabel = 1; + constexpr unsigned int objectLabel{ 1 }; applyGibbsImageFilter->SetObjectLabel(objectLabel); ITK_TEST_SET_GET_VALUE(objectLabel, applyGibbsImageFilter->GetObjectLabel()); @@ -280,27 +280,27 @@ itkRGBGibbsPriorFilterTest(int, char *[]) // applyGibbsImageFilter->SetRecursiveNumber(1); - constexpr double cliqueWeight1 = 5.0; + constexpr double cliqueWeight1{ 5.0 }; applyGibbsImageFilter->SetCliqueWeight_1(cliqueWeight1); ITK_TEST_SET_GET_VALUE(cliqueWeight1, applyGibbsImageFilter->GetCliqueWeight_1()); - constexpr double cliqueWeight2 = 5.0; + constexpr double cliqueWeight2{ 5.0 }; applyGibbsImageFilter->SetCliqueWeight_2(cliqueWeight2); ITK_TEST_SET_GET_VALUE(cliqueWeight2, applyGibbsImageFilter->GetCliqueWeight_2()); - constexpr double cliqueWeight3 = 5.0; + constexpr double cliqueWeight3{ 5.0 }; applyGibbsImageFilter->SetCliqueWeight_3(cliqueWeight3); ITK_TEST_SET_GET_VALUE(cliqueWeight3, applyGibbsImageFilter->GetCliqueWeight_3()); - constexpr double cliqueWeight4 = 5.0; + constexpr double cliqueWeight4{ 5.0 }; applyGibbsImageFilter->SetCliqueWeight_4(cliqueWeight4); ITK_TEST_SET_GET_VALUE(cliqueWeight4, applyGibbsImageFilter->GetCliqueWeight_4()); - constexpr double cliqueWeight5 = 5.0; + constexpr double cliqueWeight5{ 5.0 }; applyGibbsImageFilter->SetCliqueWeight_5(cliqueWeight5); ITK_TEST_SET_GET_VALUE(cliqueWeight5, applyGibbsImageFilter->GetCliqueWeight_5()); - constexpr double cliqueWeight6 = 0.0; + constexpr double cliqueWeight6{ 0.0 }; applyGibbsImageFilter->SetCliqueWeight_6(cliqueWeight6); ITK_TEST_SET_GET_VALUE(cliqueWeight6, applyGibbsImageFilter->GetCliqueWeight_6()); diff --git a/Modules/Segmentation/RegionGrowing/test/itkConnectedThresholdImageFilterTest.cxx b/Modules/Segmentation/RegionGrowing/test/itkConnectedThresholdImageFilterTest.cxx index d5ea3570f43..cfdcd87c1cc 100644 --- a/Modules/Segmentation/RegionGrowing/test/itkConnectedThresholdImageFilterTest.cxx +++ b/Modules/Segmentation/RegionGrowing/test/itkConnectedThresholdImageFilterTest.cxx @@ -37,7 +37,7 @@ itkConnectedThresholdImageFilterTest(int argc, char * argv[]) // Define the dimension of the images - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; // Define the pixel types of the images using PixelType = unsigned char; @@ -101,7 +101,7 @@ itkConnectedThresholdImageFilterTest(int argc, char * argv[]) connectedThresholdFilter->SetUpper(upperThreshold); ITK_TEST_SET_GET_VALUE(upperThreshold, connectedThresholdFilter->GetUpper()); - constexpr ConnectedThresholdImageFilterType::OutputImagePixelType replaceValue = 255; + constexpr ConnectedThresholdImageFilterType::OutputImagePixelType replaceValue{ 255 }; connectedThresholdFilter->SetReplaceValue(replaceValue); ITK_TEST_SET_GET_VALUE(replaceValue, connectedThresholdFilter->GetReplaceValue()); diff --git a/Modules/Segmentation/RegionGrowing/test/itkIsolatedConnectedImageFilterTest.cxx b/Modules/Segmentation/RegionGrowing/test/itkIsolatedConnectedImageFilterTest.cxx index 1a36d4a0596..0643668801b 100644 --- a/Modules/Segmentation/RegionGrowing/test/itkIsolatedConnectedImageFilterTest.cxx +++ b/Modules/Segmentation/RegionGrowing/test/itkIsolatedConnectedImageFilterTest.cxx @@ -76,24 +76,24 @@ itkIsolatedConnectedImageFilterTest(int argc, char * argv[]) } // The min and max values for a .png image - constexpr FilterType::InputImagePixelType lower = 0; + constexpr FilterType::InputImagePixelType lower{ 0 }; filter->SetLower(lower); ITK_TEST_SET_GET_VALUE(lower, filter->GetLower()); #if !defined(ITK_LEGACY_REMOVE) - constexpr FilterType::InputImagePixelType upperValueLimit = 255; + constexpr FilterType::InputImagePixelType upperValueLimit{ 255 }; filter->SetUpperValueLimit(upperValueLimit); ITK_TEST_SET_GET_VALUE(upperValueLimit, filter->GetUpperValueLimit()); #endif - constexpr FilterType::InputImagePixelType upper = 255; + constexpr FilterType::InputImagePixelType upper{ 255 }; filter->SetUpper(upper); ITK_TEST_SET_GET_VALUE(upper, filter->GetUpper()); - constexpr FilterType::OutputImagePixelType replaceValue = 255; + constexpr FilterType::OutputImagePixelType replaceValue{ 255 }; filter->SetReplaceValue(replaceValue); ITK_TEST_SET_GET_VALUE(replaceValue, filter->GetReplaceValue()); - constexpr FilterType::InputImagePixelType isolatedValueTolerance = 1; + constexpr FilterType::InputImagePixelType isolatedValueTolerance{ 1 }; filter->SetIsolatedValueTolerance(isolatedValueTolerance); ITK_TEST_SET_GET_VALUE(isolatedValueTolerance, filter->GetIsolatedValueTolerance()); diff --git a/Modules/Segmentation/RegionGrowing/test/itkVectorConfidenceConnectedImageFilterTest.cxx b/Modules/Segmentation/RegionGrowing/test/itkVectorConfidenceConnectedImageFilterTest.cxx index 06ed5b0d974..9ad24b5af45 100644 --- a/Modules/Segmentation/RegionGrowing/test/itkVectorConfidenceConnectedImageFilterTest.cxx +++ b/Modules/Segmentation/RegionGrowing/test/itkVectorConfidenceConnectedImageFilterTest.cxx @@ -37,7 +37,7 @@ itkVectorConfidenceConnectedImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelComponentType = unsigned char; using PixelType = itk::RGBPixel; diff --git a/Modules/Segmentation/SignedDistanceFunction/test/itkPCAShapeSignedDistanceFunctionTest.cxx b/Modules/Segmentation/SignedDistanceFunction/test/itkPCAShapeSignedDistanceFunctionTest.cxx index 041103e8d98..e65b9337607 100644 --- a/Modules/Segmentation/SignedDistanceFunction/test/itkPCAShapeSignedDistanceFunctionTest.cxx +++ b/Modules/Segmentation/SignedDistanceFunction/test/itkPCAShapeSignedDistanceFunctionTest.cxx @@ -37,10 +37,10 @@ int itkPCAShapeSignedDistanceFunctionTest(int, char *[]) { using CoordRep = double; - constexpr unsigned int Dimension = 2; - constexpr unsigned int ImageWidth = 3; - constexpr unsigned int ImageHeight = 2; - constexpr unsigned int NumberOfPCs = 3; + constexpr unsigned int Dimension{ 2 }; + constexpr unsigned int ImageWidth{ 3 }; + constexpr unsigned int ImageHeight{ 2 }; + constexpr unsigned int NumberOfPCs{ 3 }; // define a pca shape function @@ -59,7 +59,7 @@ itkPCAShapeSignedDistanceFunctionTest(int, char *[]) // prepare for image creation using ImageType = ShapeFunction::ImageType; - constexpr ImageType::SizeType imageSize = { { ImageWidth, ImageHeight } }; + constexpr ImageType::SizeType imageSize{ ImageWidth, ImageHeight }; constexpr ImageType::IndexType startIndex{}; diff --git a/Modules/Segmentation/SignedDistanceFunction/test/itkSphereSignedDistanceFunctionTest.cxx b/Modules/Segmentation/SignedDistanceFunction/test/itkSphereSignedDistanceFunctionTest.cxx index 183867af1a6..03f195a9960 100644 --- a/Modules/Segmentation/SignedDistanceFunction/test/itkSphereSignedDistanceFunctionTest.cxx +++ b/Modules/Segmentation/SignedDistanceFunction/test/itkSphereSignedDistanceFunctionTest.cxx @@ -35,7 +35,7 @@ int itkSphereSignedDistanceFunctionTest(int, char *[]) { using CoordRep = double; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using FunctionType = itk::ShapeSignedDistanceFunction; using SphereFunctionType = itk::SphereSignedDistanceFunction; diff --git a/Modules/Segmentation/SuperPixel/test/itkSLICImageFilterTest.cxx b/Modules/Segmentation/SuperPixel/test/itkSLICImageFilterTest.cxx index dfadd5c5f15..9c3da84957a 100644 --- a/Modules/Segmentation/SuperPixel/test/itkSLICImageFilterTest.cxx +++ b/Modules/Segmentation/SuperPixel/test/itkSLICImageFilterTest.cxx @@ -106,7 +106,7 @@ itkSLICImageFilterTest(int argc, char * argv[]) const char * inFileName = argv[1]; const char * outFileName = argv[2]; - constexpr unsigned int VDimension = 2; + constexpr unsigned int VDimension{ 2 }; using InputImageType = itk::VectorImage; using ReaderType = itk::ImageFileReader; diff --git a/Modules/Segmentation/Voronoi/include/itkVoronoiDiagram2DGenerator.hxx b/Modules/Segmentation/Voronoi/include/itkVoronoiDiagram2DGenerator.hxx index 9172a8b048a..51530a8ca82 100644 --- a/Modules/Segmentation/Voronoi/include/itkVoronoiDiagram2DGenerator.hxx +++ b/Modules/Segmentation/Voronoi/include/itkVoronoiDiagram2DGenerator.hxx @@ -26,8 +26,8 @@ namespace itk { -constexpr double NUMERIC_TOLERENCE = 1.0e-10; -constexpr double DIFF_TOLERENCE = 0.001; +constexpr double NUMERIC_TOLERENCE{ 1.0e-10 }; +constexpr double DIFF_TOLERENCE{ 0.001 }; template VoronoiDiagram2DGenerator::VoronoiDiagram2DGenerator() diff --git a/Modules/Segmentation/Voronoi/test/itkVoronoiDiagram2DTest.cxx b/Modules/Segmentation/Voronoi/test/itkVoronoiDiagram2DTest.cxx index 56b7ddd3e2f..b13a10c07eb 100644 --- a/Modules/Segmentation/Voronoi/test/itkVoronoiDiagram2DTest.cxx +++ b/Modules/Segmentation/Voronoi/test/itkVoronoiDiagram2DTest.cxx @@ -33,9 +33,9 @@ itkVoronoiDiagram2DTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr double height = 400; - constexpr double width = 400; - constexpr unsigned int numberOfSeeds = 20; + constexpr double height{ 400 }; + constexpr double width{ 400 }; + constexpr unsigned int numberOfSeeds{ 20 }; using VoronoiDiagram = itk::VoronoiDiagram2D; using VoronoiDiagramGenerator = itk::VoronoiDiagram2DGenerator; diff --git a/Modules/Segmentation/Voronoi/test/itkVoronoiPartitioningImageFilterTest.cxx b/Modules/Segmentation/Voronoi/test/itkVoronoiPartitioningImageFilterTest.cxx index e37748aa8b4..166b9da646a 100644 --- a/Modules/Segmentation/Voronoi/test/itkVoronoiPartitioningImageFilterTest.cxx +++ b/Modules/Segmentation/Voronoi/test/itkVoronoiPartitioningImageFilterTest.cxx @@ -65,7 +65,7 @@ itkVoronoiPartitioningImageFilterTest(int argc, char * argv[]) voronoi->SetOutputBoundary(std::stoi(argv[3]) == 1); voronoi->SetSteps(7); - constexpr double sigmaThreshold = 4.0; + constexpr double sigmaThreshold{ 4.0 }; voronoi->SetSigmaThreshold(sigmaThreshold); ITK_TEST_SET_GET_VALUE(sigmaThreshold, voronoi->GetSigmaThreshold()); diff --git a/Modules/Segmentation/Voronoi/test/itkVoronoiSegmentationImageFilterTest.cxx b/Modules/Segmentation/Voronoi/test/itkVoronoiSegmentationImageFilterTest.cxx index c29a0593dc0..1240321e068 100644 --- a/Modules/Segmentation/Voronoi/test/itkVoronoiSegmentationImageFilterTest.cxx +++ b/Modules/Segmentation/Voronoi/test/itkVoronoiSegmentationImageFilterTest.cxx @@ -32,8 +32,8 @@ itkVoronoiSegmentationImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr int width = 256; - constexpr int height = 256; + constexpr int width{ 256 }; + constexpr int height{ 256 }; using UShortImage = itk::Image; using PriorImage = itk::Image; @@ -45,7 +45,7 @@ itkVoronoiSegmentationImageFilterTest(int argc, char * argv[]) voronoiSegmenter, VoronoiSegmentationImageFilter, VoronoiSegmentationImageFilterBase); auto inputImage = UShortImage::New(); - constexpr UShortImage::SizeType size = { { width, height } }; + constexpr UShortImage::SizeType size{ width, height }; UShortImage::IndexType index{}; UShortImage::RegionType region{ index, size }; diff --git a/Modules/Segmentation/Voronoi/test/itkVoronoiSegmentationRGBImageFilterTest.cxx b/Modules/Segmentation/Voronoi/test/itkVoronoiSegmentationRGBImageFilterTest.cxx index 5a9ff7f8215..c9a9a941232 100644 --- a/Modules/Segmentation/Voronoi/test/itkVoronoiSegmentationRGBImageFilterTest.cxx +++ b/Modules/Segmentation/Voronoi/test/itkVoronoiSegmentationRGBImageFilterTest.cxx @@ -36,21 +36,21 @@ namespace VoronoiSegRGBTest // // global constants // -constexpr unsigned int width = 256; -constexpr unsigned int height = 256; -constexpr unsigned char bgMean = 64; -constexpr unsigned char bgStd = 10; -constexpr unsigned char fgMean = 128; -constexpr unsigned char fgStd = 5; -constexpr unsigned int objAStartX = 30; -constexpr unsigned int objAEndX = 94; -constexpr unsigned int objAStartY = 30; -constexpr unsigned int objAEndY = 94; -constexpr unsigned int objBStartX = 150; -constexpr unsigned int objBEndX = 214; -constexpr unsigned int objBStartY = 150; -constexpr unsigned int objBEndY = 214; -constexpr double minCorrectRate = .875; // .875 is all classified as background +constexpr unsigned int width{ 256 }; +constexpr unsigned int height{ 256 }; +constexpr unsigned char bgMean{ 64 }; +constexpr unsigned char bgStd{ 10 }; +constexpr unsigned char fgMean{ 128 }; +constexpr unsigned char fgStd{ 5 }; +constexpr unsigned int objAStartX{ 30 }; +constexpr unsigned int objAEndX{ 94 }; +constexpr unsigned int objAStartY{ 30 }; +constexpr unsigned int objAEndY{ 94 }; +constexpr unsigned int objBStartX{ 150 }; +constexpr unsigned int objBEndX{ 214 }; +constexpr unsigned int objBStartY{ 150 }; +constexpr unsigned int objBEndY{ 214 }; +constexpr double minCorrectRate{ .875 }; // .875 is all classified as background // @@ -61,7 +61,7 @@ SetUpInputImage() { // initialize the test input image auto inputImage = ImageType::New(); - constexpr ImageType::SizeType size = { { width, height } }; + constexpr ImageType::SizeType size{ width, height }; ImageType::RegionType region; region.SetSize(size); inputImage->SetRegions(region); @@ -262,7 +262,7 @@ TestWithPrior(ImageType::Pointer inputImage) // set up the prior std::cout << "Setting up the prior image" << std::endl; auto prior = BinaryObjectImage::New(); - constexpr BinaryObjectImage::SizeType size = { { width, height } }; + constexpr BinaryObjectImage::SizeType size{ width, height }; BinaryObjectImage::RegionType region; region.SetSize(size); prior->SetRegions(region); diff --git a/Modules/Segmentation/Watersheds/test/itkIsolatedWatershedImageFilterTest.cxx b/Modules/Segmentation/Watersheds/test/itkIsolatedWatershedImageFilterTest.cxx index c726a165bac..26e4651e033 100644 --- a/Modules/Segmentation/Watersheds/test/itkIsolatedWatershedImageFilterTest.cxx +++ b/Modules/Segmentation/Watersheds/test/itkIsolatedWatershedImageFilterTest.cxx @@ -42,7 +42,7 @@ itkIsolatedWatershedImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using ImageType = itk::Image; @@ -100,15 +100,15 @@ itkIsolatedWatershedImageFilterTest(int argc, char * argv[]) filter->SetThreshold(threshold); ITK_TEST_SET_GET_VALUE(threshold, filter->GetThreshold()); - constexpr PixelType replaceValue1 = 255; + constexpr PixelType replaceValue1{ 255 }; filter->SetReplaceValue1(replaceValue1); ITK_TEST_SET_GET_VALUE(replaceValue1, filter->GetReplaceValue1()); - constexpr PixelType replaceValue2 = 127; + constexpr PixelType replaceValue2{ 127 }; filter->SetReplaceValue2(replaceValue2); ITK_TEST_SET_GET_VALUE(replaceValue2, filter->GetReplaceValue2()); - constexpr double upperValueLimit = 1.0; + constexpr double upperValueLimit{ 1.0 }; filter->SetUpperValueLimit(upperValueLimit); ITK_TEST_SET_GET_VALUE(upperValueLimit, filter->GetUpperValueLimit()); diff --git a/Modules/Segmentation/Watersheds/test/itkMorphologicalWatershedFromMarkersImageFilterTest.cxx b/Modules/Segmentation/Watersheds/test/itkMorphologicalWatershedFromMarkersImageFilterTest.cxx index 1d9494f4304..9ae7bdd5670 100644 --- a/Modules/Segmentation/Watersheds/test/itkMorphologicalWatershedFromMarkersImageFilterTest.cxx +++ b/Modules/Segmentation/Watersheds/test/itkMorphologicalWatershedFromMarkersImageFilterTest.cxx @@ -40,7 +40,7 @@ itkMorphologicalWatershedFromMarkersImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; diff --git a/Modules/Segmentation/Watersheds/test/itkMorphologicalWatershedImageFilterTest.cxx b/Modules/Segmentation/Watersheds/test/itkMorphologicalWatershedImageFilterTest.cxx index 94cddf3fc41..514bdeaa5d6 100644 --- a/Modules/Segmentation/Watersheds/test/itkMorphologicalWatershedImageFilterTest.cxx +++ b/Modules/Segmentation/Watersheds/test/itkMorphologicalWatershedImageFilterTest.cxx @@ -41,7 +41,7 @@ itkMorphologicalWatershedImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; diff --git a/Modules/Segmentation/Watersheds/test/itkTobogganImageFilterTest.cxx b/Modules/Segmentation/Watersheds/test/itkTobogganImageFilterTest.cxx index 29cd033d535..7cdaa05459c 100644 --- a/Modules/Segmentation/Watersheds/test/itkTobogganImageFilterTest.cxx +++ b/Modules/Segmentation/Watersheds/test/itkTobogganImageFilterTest.cxx @@ -35,7 +35,7 @@ itkTobogganImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using FloatPixelType = float; diff --git a/Modules/Segmentation/Watersheds/test/itkWatershedImageFilterBadValuesTest.cxx b/Modules/Segmentation/Watersheds/test/itkWatershedImageFilterBadValuesTest.cxx index 22053c825b9..764d4196996 100644 --- a/Modules/Segmentation/Watersheds/test/itkWatershedImageFilterBadValuesTest.cxx +++ b/Modules/Segmentation/Watersheds/test/itkWatershedImageFilterBadValuesTest.cxx @@ -31,7 +31,7 @@ int itkWatershedImageFilterBadValuesTest(int argc, char * argv[]) { - constexpr int result = 0; + constexpr int result{ 0 }; if (argc < 2) { diff --git a/Modules/Segmentation/Watersheds/test/itkWatershedImageFilterTest.cxx b/Modules/Segmentation/Watersheds/test/itkWatershedImageFilterTest.cxx index f14972e9cb3..942260b255f 100644 --- a/Modules/Segmentation/Watersheds/test/itkWatershedImageFilterTest.cxx +++ b/Modules/Segmentation/Watersheds/test/itkWatershedImageFilterTest.cxx @@ -27,7 +27,7 @@ int itkWatershedImageFilterTest(int, char *[]) { - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using PixelType = float; using ImageType2D = itk::Image; @@ -79,11 +79,11 @@ itkWatershedImageFilterTest(int, char *[]) ITK_EXERCISE_BASIC_OBJECT_METHODS(wmppc, WatershedMiniPipelineProgressCommand, Command); - constexpr double count = 2.0; + constexpr double count{ 2.0 }; wmppc->SetCount(count); ITK_TEST_SET_GET_VALUE(count, wmppc->GetCount()); - constexpr unsigned int numberOfFilters = 2; + constexpr unsigned int numberOfFilters{ 2 }; wmppc->SetNumberOfFilters(numberOfFilters); ITK_TEST_SET_GET_VALUE(numberOfFilters, wmppc->GetNumberOfFilters()); @@ -131,11 +131,11 @@ itkWatershedImageFilterTest(int, char *[]) const itk::SimpleFilterWatcher watchIt(watershedFilter, "WatershedImageFilter"); - constexpr double threshold = .05; + constexpr double threshold{ .05 }; watershedFilter->SetThreshold(threshold); ITK_TEST_SET_GET_VALUE(threshold, watershedFilter->GetThreshold()); - constexpr double level = 1.0; + constexpr double level{ 1.0 }; watershedFilter->SetLevel(level); ITK_TEST_SET_GET_VALUE(level, watershedFilter->GetLevel()); diff --git a/Modules/Video/BridgeOpenCV/test/itkOpenCVBasicTypeBridgeTest.cxx b/Modules/Video/BridgeOpenCV/test/itkOpenCVBasicTypeBridgeTest.cxx index 59e4541ef70..49d1e23e666 100644 --- a/Modules/Video/BridgeOpenCV/test/itkOpenCVBasicTypeBridgeTest.cxx +++ b/Modules/Video/BridgeOpenCV/test/itkOpenCVBasicTypeBridgeTest.cxx @@ -169,8 +169,8 @@ Size2ConversionTest() int MatrixConversionTest() { - constexpr unsigned int NumberOfRows = 2; - constexpr unsigned int NumberOfColumns = 3; + constexpr unsigned int NumberOfRows{ 2 }; + constexpr unsigned int NumberOfColumns{ 3 }; using ITKMatrixType = itk::Matrix; using CVMatrixType = cv::Matx; @@ -211,7 +211,7 @@ MatrixConversionTest() int VectorConversionTest() { - constexpr unsigned int Dimension = 10; + constexpr unsigned int Dimension{ 10 }; using ITKVectorType = itk::Vector; using CVVectorType = cv::Vec; @@ -442,8 +442,8 @@ Size2ConversionTest() int MatrixConversionTest() { - constexpr unsigned int NumberOfRows = 2; - constexpr unsigned int NumberOfColumns = 3; + constexpr unsigned int NumberOfRows{ 2 }; + constexpr unsigned int NumberOfColumns{ 3 }; using ITKMatrixType = itk::Matrix; using CVMatrixType = cv::Matx; @@ -484,7 +484,7 @@ MatrixConversionTest() int VectorConversionTest() { - constexpr unsigned int Dimension = 10; + constexpr unsigned int Dimension{ 10 }; using ITKVectorType = itk::Vector; using CVVectorType = cv::Vec; diff --git a/Modules/Video/BridgeOpenCV/test/itkOpenCVImageBridgeGrayScaleTest.cxx b/Modules/Video/BridgeOpenCV/test/itkOpenCVImageBridgeGrayScaleTest.cxx index 62eb7bfe36e..7edcb44d0ee 100644 --- a/Modules/Video/BridgeOpenCV/test/itkOpenCVImageBridgeGrayScaleTest.cxx +++ b/Modules/Video/BridgeOpenCV/test/itkOpenCVImageBridgeGrayScaleTest.cxx @@ -86,7 +86,7 @@ int itkOpenCVImageBridgeTestTemplatedScalar(char * argv) { // type alias - constexpr unsigned int Dimension = VDimension; + constexpr unsigned int Dimension{ VDimension }; using PixelType = TPixelType; using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; diff --git a/Modules/Video/BridgeOpenCV/test/itkOpenCVImageBridgeRGBTest.cxx b/Modules/Video/BridgeOpenCV/test/itkOpenCVImageBridgeRGBTest.cxx index f8f713f3db0..2c6f8eceaca 100644 --- a/Modules/Video/BridgeOpenCV/test/itkOpenCVImageBridgeRGBTest.cxx +++ b/Modules/Video/BridgeOpenCV/test/itkOpenCVImageBridgeRGBTest.cxx @@ -142,7 +142,7 @@ int itkOpenCVImageBridgeTestTemplatedRGB(char * argv0, char * argv1) { // type alias - constexpr unsigned int Dimension = VDimension; + constexpr unsigned int Dimension{ VDimension }; using ValueType = TValue; using PixelType = itk::RGBPixel; using ComponentType = typename PixelType::ComponentType; diff --git a/Modules/Video/Core/test/itkImageToVideoFilterTest.cxx b/Modules/Video/Core/test/itkImageToVideoFilterTest.cxx index 2d13ec9b5db..04d9d63a7d3 100644 --- a/Modules/Video/Core/test/itkImageToVideoFilterTest.cxx +++ b/Modules/Video/Core/test/itkImageToVideoFilterTest.cxx @@ -42,7 +42,7 @@ itkImageToVideoFilterTest(int argc, char * argv[]) } using PixelType = float; - constexpr unsigned int Dimension = 3; + constexpr unsigned int Dimension{ 3 }; using ImageType = itk::Image; @@ -68,7 +68,7 @@ itkImageToVideoFilterTest(int argc, char * argv[]) videoFilter->SetInput(inputImage); // Arbitrarily set 0th axis as temporal dimension to split frames - constexpr itk::IndexValueType frameAxis = 0; + constexpr itk::IndexValueType frameAxis{ 0 }; videoFilter->SetFrameAxis(frameAxis); ITK_TEST_SET_GET_VALUE(frameAxis, videoFilter->GetFrameAxis()); diff --git a/Modules/Video/Core/test/itkTemporalRegionTest.cxx b/Modules/Video/Core/test/itkTemporalRegionTest.cxx index e0d4d692c3a..154e38af922 100644 --- a/Modules/Video/Core/test/itkTemporalRegionTest.cxx +++ b/Modules/Video/Core/test/itkTemporalRegionTest.cxx @@ -35,8 +35,8 @@ itkTemporalRegionTest(int, char *[]) ITK_MACROEND_NOOP_STATEMENT // Test arrays for frame durations - constexpr itk::SizeValueType testFrameStart = 0; - constexpr itk::SizeValueType testFrameDuration = 20; + constexpr itk::SizeValueType testFrameStart{ 0 }; + constexpr itk::SizeValueType testFrameDuration{ 20 }; // Test time stamps and intervals const itk::RealTimeStamp stamp0; diff --git a/Modules/Video/Core/test/itkVectorImageToVideoTest.cxx b/Modules/Video/Core/test/itkVectorImageToVideoTest.cxx index 1d10b1645e1..16975c6a233 100644 --- a/Modules/Video/Core/test/itkVectorImageToVideoTest.cxx +++ b/Modules/Video/Core/test/itkVectorImageToVideoTest.cxx @@ -42,7 +42,7 @@ itkVectorImageToVideoTest(int argc, char * argv[]) } using PixelType = unsigned char; - constexpr unsigned int Dimension = 2; + constexpr unsigned int Dimension{ 2 }; using ImageType = itk::VectorImage; using FilterOutputType = itk::VideoStream>; @@ -54,7 +54,7 @@ itkVectorImageToVideoTest(int argc, char * argv[]) auto videoFilter = VideoFilterType::New(); videoFilter->SetInput(inputImage); // Arbitrarily set last axis as temporal dimension to split frames - constexpr itk::IndexValueType frameAxis = Dimension - 1; + constexpr itk::IndexValueType frameAxis{ Dimension - 1 }; videoFilter->SetFrameAxis(frameAxis); ITK_TEST_SET_GET_VALUE(frameAxis, videoFilter->GetFrameAxis()); diff --git a/Modules/Video/Core/test/itkVideoSourceTest.cxx b/Modules/Video/Core/test/itkVideoSourceTest.cxx index 73994b40c4a..1dc476e594b 100644 --- a/Modules/Video/Core/test/itkVideoSourceTest.cxx +++ b/Modules/Video/Core/test/itkVideoSourceTest.cxx @@ -21,7 +21,7 @@ #include // Set up type alias for test -constexpr unsigned int Dimension = 2; +constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using FrameType = itk::Image; using VideoType = itk::VideoStream; @@ -264,7 +264,7 @@ itkVideoSourceTest(int, char *[]) // Artificially set the output's largest possible temporal region duration itk::TemporalRegion largestTempRegion = videoSource->GetOutput()->GetLargestPossibleTemporalRegion(); - constexpr unsigned int newNumBuffers = 25; + constexpr unsigned int newNumBuffers{ 25 }; largestTempRegion.SetFrameDuration(newNumBuffers); videoSource->GetOutput()->SetLargestPossibleTemporalRegion(largestTempRegion); videoSource->GetOutput()->SetRequestedTemporalRegion(emptyRegion); diff --git a/Modules/Video/Core/test/itkVideoStreamTest.cxx b/Modules/Video/Core/test/itkVideoStreamTest.cxx index 439744289f4..f4ea2333230 100644 --- a/Modules/Video/Core/test/itkVideoStreamTest.cxx +++ b/Modules/Video/Core/test/itkVideoStreamTest.cxx @@ -162,8 +162,8 @@ itkVideoStreamTest(int, char *[]) // Set the buffered temporal region VideoType::TemporalRegionType temporalRegion; - constexpr SizeValueType startFrame = 0; - constexpr SizeValueType numFrames = 5; + constexpr SizeValueType startFrame{ 0 }; + constexpr SizeValueType numFrames{ 5 }; temporalRegion.SetFrameStart(startFrame); temporalRegion.SetFrameDuration(numFrames); video1->SetLargestPossibleTemporalRegion(temporalRegion); diff --git a/Modules/Video/Core/test/itkVideoToVideoFilterTest.cxx b/Modules/Video/Core/test/itkVideoToVideoFilterTest.cxx index a63ffb73c86..be13c360678 100644 --- a/Modules/Video/Core/test/itkVideoToVideoFilterTest.cxx +++ b/Modules/Video/Core/test/itkVideoToVideoFilterTest.cxx @@ -21,7 +21,7 @@ #include "itkTestingMacros.h" // type alias for test -constexpr unsigned int Dimension = 2; +constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned char; using InputFrameType = itk::Image; using InputVideoType = itk::VideoStream; @@ -171,8 +171,8 @@ itkVideoToVideoFilterTest(int, char *[]) // Set up an input video stream auto inputVideo = InputVideoType::New(); itk::TemporalRegion inputLargestTemporalRegion; - constexpr SizeValueType inputStart = 0; - constexpr SizeValueType inputDuration = 10; + constexpr SizeValueType inputStart{ 0 }; + constexpr SizeValueType inputDuration{ 10 }; inputLargestTemporalRegion.SetFrameStart(inputStart); inputLargestTemporalRegion.SetFrameDuration(inputDuration); inputVideo->SetLargestPossibleTemporalRegion(inputLargestTemporalRegion); @@ -227,7 +227,7 @@ itkVideoToVideoFilterTest(int, char *[]) itk::ImageRegionConstIterator iter(frame, frame->GetRequestedRegion()); const OutputPixelType expectedVal = ((OutputPixelType)(i)-1.0 + (OutputPixelType)(i)) / 2.0; - constexpr OutputPixelType epsilon = .00001; + constexpr OutputPixelType epsilon{ .00001 }; while (!iter.IsAtEnd()) { if (iter.Get() < expectedVal - epsilon || iter.Get() > expectedVal + epsilon) diff --git a/Modules/Video/Filtering/test/itkDecimateFramesVideoFilterTest.cxx b/Modules/Video/Filtering/test/itkDecimateFramesVideoFilterTest.cxx index bf737aafd7e..571abf24429 100644 --- a/Modules/Video/Filtering/test/itkDecimateFramesVideoFilterTest.cxx +++ b/Modules/Video/Filtering/test/itkDecimateFramesVideoFilterTest.cxx @@ -27,7 +27,7 @@ #include "itkTestingMacros.h" // type alias -constexpr unsigned int Dimension = 2; +constexpr unsigned int Dimension{ 2 }; using PixelType = unsigned char; using FrameType = itk::Image; using VideoType = itk::VideoStream; diff --git a/Modules/Video/Filtering/test/itkFrameAverageVideoFilterTest.cxx b/Modules/Video/Filtering/test/itkFrameAverageVideoFilterTest.cxx index 34c29456d69..818e6ee5189 100644 --- a/Modules/Video/Filtering/test/itkFrameAverageVideoFilterTest.cxx +++ b/Modules/Video/Filtering/test/itkFrameAverageVideoFilterTest.cxx @@ -25,7 +25,7 @@ // Set up type alias for test -constexpr unsigned int Dimension = 2; +constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned char; using InputFrameType = itk::Image; using InputVideoType = itk::VideoStream; @@ -96,7 +96,7 @@ itkFrameAverageVideoFilterTest(int argc, char * argv[]) // Set up an input VideoStream auto inputVideo = InputVideoType::New(); - constexpr SizeValueType numInputFrames = 50; + constexpr SizeValueType numInputFrames{ 50 }; inputVideo->SetNumberOfBuffers(numInputFrames); itk::TemporalRegion inputTempRegion; inputTempRegion.SetFrameStart(0); @@ -150,7 +150,7 @@ itkFrameAverageVideoFilterTest(int argc, char * argv[]) // Check the results const OutputPixelType expectedVal = static_cast(i + (i + 1)) / 2.0; const OutputPixelType actualVal = filter->GetOutput()->GetFrame(i)->GetPixel(checkPx); - constexpr double eps = 0.00001; + constexpr double eps{ 0.00001 }; if (expectedVal < actualVal - eps || expectedVal > actualVal + eps) { std::cerr << "Filter failed to compute frame " << i << " correctly over 2 frames." << std::endl; @@ -193,7 +193,7 @@ itkFrameAverageVideoFilterTest(int argc, char * argv[]) { const OutputPixelType expectedVal = static_cast(i + (i + 1) + (i + 2)) / 3.0; const OutputPixelType actualVal = filter->GetOutput()->GetFrame(i)->GetPixel(checkPx); - constexpr double eps = 0.00001; + constexpr double eps{ 0.00001 }; if (expectedVal < actualVal - eps || expectedVal > actualVal + eps) { std::cerr << "Filter failed to compute frame " << i << " correctly over 3 frames." << std::endl; diff --git a/Modules/Video/Filtering/test/itkFrameDifferenceVideoFilterTest.cxx b/Modules/Video/Filtering/test/itkFrameDifferenceVideoFilterTest.cxx index b1d8eac9211..2ab9fcd4190 100644 --- a/Modules/Video/Filtering/test/itkFrameDifferenceVideoFilterTest.cxx +++ b/Modules/Video/Filtering/test/itkFrameDifferenceVideoFilterTest.cxx @@ -25,7 +25,7 @@ // Set up type alias for test -constexpr unsigned int Dimension = 2; +constexpr unsigned int Dimension{ 2 }; using InputPixelType = unsigned char; using InputFrameType = itk::Image; using InputVideoType = itk::VideoStream; @@ -86,7 +86,7 @@ itkFrameDifferenceVideoFilterTest(int itkNotUsed(argc), char * itkNotUsed(argv)[ // Set up an input VideoStream auto inputVideo = InputVideoType::New(); - constexpr SizeValueType numInputFrames = 50; + constexpr SizeValueType numInputFrames{ 50 }; inputVideo->SetNumberOfBuffers(numInputFrames); itk::TemporalRegion inputTempRegion; inputTempRegion.SetFrameStart(0); @@ -137,7 +137,7 @@ itkFrameDifferenceVideoFilterTest(int itkNotUsed(argc), char * itkNotUsed(argv)[ filter->Update(); // Check the results - constexpr OutputPixelType expectedVal = 1; + constexpr OutputPixelType expectedVal{ 1 }; const OutputPixelType actualVal = filter->GetOutput()->GetFrame(i)->GetPixel(checkPx); if (expectedVal != actualVal) { @@ -179,7 +179,7 @@ itkFrameDifferenceVideoFilterTest(int itkNotUsed(argc), char * itkNotUsed(argv)[ filter->Update(); for (unsigned int i = outputStart; i < outputStart + outputDuration; ++i) { - constexpr OutputPixelType expectedVal = 4; // Difference of 2 squared + constexpr OutputPixelType expectedVal{ 4 }; // Difference of 2 squared const OutputPixelType actualVal = filter->GetOutput()->GetFrame(i)->GetPixel(checkPx); if (expectedVal != actualVal) { diff --git a/Modules/Video/IO/test/itkFileListVideoIOTest.cxx b/Modules/Video/IO/test/itkFileListVideoIOTest.cxx index 9ce8eda682a..eb0869e1a39 100644 --- a/Modules/Video/IO/test/itkFileListVideoIOTest.cxx +++ b/Modules/Video/IO/test/itkFileListVideoIOTest.cxx @@ -98,7 +98,7 @@ test_FileListVideoIO(const char * input, paramMessage << "Height mismatch: (expected) " << inHeight << " != (got) " << fileListIO->GetDimensions(1) << std::endl; } - constexpr double epsilon = 0.0001; + constexpr double epsilon{ 0.0001 }; if (!itk::Math::FloatAlmostEqual(fileListIO->GetFramesPerSecond(), inFpS, 10, epsilon)) { infoSet = false; diff --git a/Modules/Video/IO/test/itkVideoFileReaderWriterTest.cxx b/Modules/Video/IO/test/itkVideoFileReaderWriterTest.cxx index 497a41721ce..d4d4ffb02b8 100644 --- a/Modules/Video/IO/test/itkVideoFileReaderWriterTest.cxx +++ b/Modules/Video/IO/test/itkVideoFileReaderWriterTest.cxx @@ -37,7 +37,7 @@ itkVideoFileReaderWriterTest(int argc, char * argv[]) // Instantiate a new reader using PixelType = itk::RGBPixel; - constexpr unsigned int NumberOfDimensions = 2; + constexpr unsigned int NumberOfDimensions{ 2 }; using FrameType = itk::Image; using VideoType = itk::VideoStream; using VideoReaderType = itk::VideoFileReader;