Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Modules/Bridge/NumPy/include/itkPyBuffer.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ PyBuffer<TImage>::_get_image_view_from_contiguous_array(PyObject * arr, PyObject
using InternalPixelType = typename TImage::InternalPixelType;
using ImporterType = ImportImageContainer<SizeValueType, InternalPixelType>;
auto importer = ImporterType::New();
constexpr bool importImageFilterWillOwnTheBuffer = false;
constexpr bool importImageFilterWillOwnTheBuffer{ false };
auto * const data = static_cast<InternalPixelType *>(buffer);
importer->SetImportPointer(data, numberOfPixels, importImageFilterWillOwnTheBuffer);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<PixelComponentType>;
using ImageType = itk::Image<PixelType, Dimension>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
int
itkImageToVTKImageFilterTest(int, char *[])
{
constexpr int dim = 3;
constexpr int dim{ 3 };
using ImageType = itk::Image<float, dim>;
using SourceType = itk::RandomImageSource<ImageType>;
using SpacingType = SourceType::SpacingType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
int
itkVTKImageToImageFilterTest(int, char *[])
{
constexpr int dim = 2;
constexpr int dim{ 2 };
using ImageType = itk::Image<double, dim>;
using VTKNoiseType = vtkSmartPointer<vtkImageNoiseSource>;
using ConnectorType = itk::VTKImageToImageFilter<ImageType>;
Expand Down
2 changes: 1 addition & 1 deletion Modules/Bridge/VtkGlue/test/runViewImage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<PixelType, dimension>;
using ReaderType = itk::ImageFileReader<ImageType>;
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkBresenhamLine.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ BresenhamLine<VDimension>::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)
{
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkDerivativeOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace itk
using DerivativeOperatorType = itk::DerivativeOperator<float, 2>;
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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ template <typename TPixel, unsigned int VDimension, typename TAllocator>
double
GaussianDerivativeOperator<TPixel, VDimension, TAllocator>::ModifiedBesselI(int n, double y)
{
constexpr double DIGITS = 10.0;
constexpr double DIGITS{ 10.0 };

if (n < 2)
{
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkGaussianOperator.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ template <typename TPixel, unsigned int VDimension, typename TAllocator>
double
GaussianOperator<TPixel, VDimension, TAllocator>::ModifiedBesselI(int n, double y)
{
constexpr double ACCURACY = 40.0;
constexpr double ACCURACY{ 40.0 };

if (n < 2)
{
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkHexahedronCell.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ HexahedronCell<TCellInterface>::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
Expand Down Expand Up @@ -475,7 +475,7 @@ HexahedronCell<TCellInterface>::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)
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkImageIORegion.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkImageRegion.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ class ITK_TEMPLATE_EXPORT ImageRegion final
[[nodiscard]] bool
IsInside(const ContinuousIndex<TCoordinate, VImageDimension> & 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.
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkIndexRange.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<Dimension> size = { {2, 3} };
const ZeroBasedIndexRange<Dimension> indexRange{ size };

Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkMacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkSobelOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkSobelOperator.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ auto
SobelOperator<TPixel, VDimension, TAllocator>::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)
{
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkSpatialOrientationAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkSymmetricEigenAnalysis.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ template <typename TMatrix, typename TVector, typename TEigenMatrix>
unsigned int
SymmetricEigenAnalysis<TMatrix, TVector, TEigenMatrix>::ComputeEigenValuesUsingQL(double * d, double * e) const
{
constexpr double c_b10 = 1.0;
constexpr double c_b10{ 1.0 };

// Local variables
unsigned int ierr = 0;
Expand Down Expand Up @@ -545,7 +545,7 @@ SymmetricEigenAnalysis<TMatrix, TVector, TEigenMatrix>::ComputeEigenValuesAndVec
double * e,
double * z) const
{
constexpr double c_b10 = 1.0;
constexpr double c_b10{ 1.0 };
if (m_Order == 1)
{
return 1;
Expand Down
14 changes: 7 additions & 7 deletions Modules/Core/Common/include/itkThreadSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkTriangleCell.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ TriangleCell<TCellInterface>::EvaluatePosition(CoordinateType * x,
// Test if the projected point is inside the cell.

// Zero with epsilon
constexpr double zwe = -NumericTraits<double>::min();
constexpr double zwe{ -NumericTraits<double>::min() };

// Since the three barycentric coordinates are interdependent
// only three tests should be necessary. That is, we only need
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkVersor.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Versor<T>::operator==(const Self & v) const

const typename itk::NumericTraits<T>::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)
{
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/src/itkIndent.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/src/itkMemoryUsageObserver.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<MemoryUsageObserverBase::MemoryLoadType>(resourceInfo.ru_ixrss);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/src/itkObjectFactoryBase.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions Modules/Core/Common/src/itkProcessObject.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/src/itkWin32OutputWindow.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/test/VNLSparseLUSolverTraitsTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions Modules/Core/Common/test/itkAbortProcessObjectTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);

Expand Down
Loading
Loading