Skip to content
Draft
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Modules/Core/Common/test/itkAdaptorComparisonTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,8 @@ itkAdaptorComparisonTest(int, char *[])
using VectorImageType = itk::Image<itk::Vector<float, 3>, 3>;

// Set up some images
constexpr itk::Size<3> size{ 100, 100, 100 };
constexpr itk::Index<3> index{ 0, 0, 0 };
itk::ImageRegion<3> region = { index, size };
constexpr itk::Size<3> size{ 100, 100, 100 };
itk::ImageRegion<3> region{ size };

auto scalar_image = ScalarImageType::New();
auto vector_image = VectorImageType::New();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ GetTestImage(int d1, int d2, int d3, int d4)
sizeND[2] = d3;
sizeND[3] = d4;

constexpr itk::Index<4> origND{};

const itk::ImageRegion<4> RegionND{ origND, sizeND };
const itk::ImageRegion<4> RegionND{ sizeND };

auto imageND = TestImageType::New();
imageND->SetRegions(RegionND);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ itkConstNeighborhoodIteratorWithOnlyIndexTestGetTestImage(int d1, int d2, int d3
sizeND[2] = d3;
sizeND[3] = d4;

constexpr itk::Index<4> origND{};

const itk::ImageRegion<4> RegionND{ origND, sizeND };
const itk::ImageRegion<4> RegionND{ sizeND };

auto imageND = TImage::New();
imageND->SetRegions(RegionND);
Expand Down
7 changes: 3 additions & 4 deletions Modules/Core/Common/test/itkConstantBoundaryConditionTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,9 @@ int
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 };
RegionType imageRegion{ imageIndex, imageSize };
auto image = ImageType::New();
constexpr SizeType imageSize{ 5, 5 };
RegionType imageRegion{ imageSize };
image->SetRegions(imageRegion);
image->Allocate();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ itkMinimumMaximumImageCalculatorTest(int, char *[])

// Set the region over which perform the computations
constexpr itk::Size<3> regionSize{ { 4, 4, 4 } };
constexpr itk::Index<3> idx{ { 0, 0, 0 } };
const MinMaxCalculatorType::RegionType computationRegion{ idx, regionSize };
const MinMaxCalculatorType::RegionType computationRegion{ regionSize };

calculator->SetRegion(computationRegion);

Expand Down
5 changes: 2 additions & 3 deletions Modules/Core/Common/test/itkPeriodicBoundaryConditionTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +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 };
const RegionType imageRegion(imageIndex, imageSize);
constexpr SizeType imageSize{ 5, 5 };
const RegionType imageRegion{ imageSize };
image->SetRegions(imageRegion);
image->Allocate();

Expand Down
7 changes: 3 additions & 4 deletions Modules/Core/Common/test/itkSliceIteratorTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,9 @@ itkSliceIteratorTest(int, char *[])
try
{

constexpr itk::Size<2> hoodRadius{ 2, 2 };
constexpr itk::Size<2> imgSize{ 20, 20 };
constexpr itk::Index<2> zeroIndex{};
itk::ImageRegion<2> reg = { zeroIndex, imgSize };
constexpr itk::Size<2> hoodRadius{ 2, 2 };
constexpr itk::Size<2> imgSize{ 20, 20 };
itk::ImageRegion<2> reg{ imgSize };

const std::slice hslice(10, 5, 1); // slice through the horizontal center
const std::slice vslice(2, 5, 5); // slice through the vertical center
Expand Down
5 changes: 2 additions & 3 deletions Modules/Core/Common/test/itkZeroFluxBoundaryConditionTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +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 };
const RegionType imageRegion{ imageIndex, imageSize };
constexpr SizeType imageSize{ 5, 5 };
const RegionType imageRegion{ imageSize };
image->SetRegions(imageRegion);
image->Allocate();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,8 @@ TestVectorImageCast1()
// Create a 1x3 image of 2D vectors
auto image = FloatVectorImageType::New();

constexpr itk::Size<2> size{ { 1, 3 } };
constexpr itk::Index<2> start{ { 0, 0 } };

const itk::ImageRegion<2> region(start, size);
constexpr itk::Size<2> size{ { 1, 3 } };
const itk::ImageRegion<2> region{ size };
image->SetNumberOfComponentsPerPixel(2);
image->SetRegions(region);
image->Allocate();
Expand Down Expand Up @@ -350,10 +348,8 @@ TestVectorImageCast2()
// Create a 1x3 image of 2D vectors
auto image = FloatVectorImageType::New();

constexpr itk::Size<2> size{ { 1, 3 } };
constexpr itk::Index<2> start{ { 0, 0 } };

const itk::ImageRegion<2> region(start, size);
constexpr itk::Size<2> size{ { 1, 3 } };
const itk::ImageRegion<2> region{ size };
image->SetNumberOfComponentsPerPixel(2);
image->SetRegions(region);
image->Allocate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ itkDivideImageFilterTest2(int, char *[])
// Declare appropriate Iterator types for each image
using OutputImageIteratorType = itk::ImageRegionIteratorWithIndex<OutputImageType>;


// Declare the type of the index to access images
using IndexType = itk::Index<Dimension>;

// Declare the type of the size
using SizeType = itk::Size<Dimension>;

Expand All @@ -55,9 +51,8 @@ itkDivideImageFilterTest2(int, char *[])
auto inputImageB = InputImageType2::New();

// Define their size, and start index
constexpr SizeType size{ 2, 2, 2 };
constexpr IndexType start{ 0, 0, 0 };
RegionType region{ start, size };
constexpr SizeType size{ 2, 2, 2 };
RegionType region{ size };

// Initialize Image A
inputImageA->SetRegions(region);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ itkOpeningByReconstructionImageFilterTest2(int argc, char * argv[])
using OutputImageType = itk::Image<PixelType, Dimension>;
using RegionType = InputImageType::RegionType;
using SizeType = InputImageType::SizeType;
using IndexType = InputImageType::IndexType;
using SpacingType = InputImageType::SpacingType;
using OriginType = InputImageType::PointType;

Expand All @@ -56,9 +55,8 @@ itkOpeningByReconstructionImageFilterTest2(int argc, char * argv[])
auto inputImage = InputImageType::New();

// Define regions of input image
auto size = SizeType::Filled(std::stoi(argv[2]));
constexpr IndexType index{};
RegionType region = { index, size };
auto size = SizeType::Filled(std::stoi(argv[2]));
RegionType region{ size };

// fill spacing and origin
OriginType origin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,7 @@ itkReadWriteSpatialObjectTest(int argc, char * argv[])
spacing[i] = i + 1;
}

RegionType region;
region.SetSize(size);
constexpr itk::Index<3> zeroIndex{};
region.SetIndex(zeroIndex);
RegionType region{ size };
itkImage->SetRegions(region);
itkImage->SetSpacing(spacing);
itkImage->Allocate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ itkGaussianRandomSpatialNeighborSubsamplerTest(int argc, char * argv[])
using SamplerType = itk::Statistics::GaussianRandomSpatialNeighborSubsampler<AdaptorType, RegionType>;
using WriterType = itk::ImageFileWriter<FloatImage>;

auto inImage = FloatImage::New();
auto sz = SizeType::Filled(35);
constexpr IndexType idx{};
const RegionType region{ idx, sz };
auto inImage = FloatImage::New();
auto sz = SizeType::Filled(35);
const RegionType region{ sz };

inImage->SetRegions(region);
inImage->AllocateInitialized();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,9 @@ itkSpatialNeighborSubsamplerTest(int, char *[])
using SamplerType = itk::Statistics::SpatialNeighborSubsampler<AdaptorType, RegionType>;
using IteratorType = itk::ImageRegionConstIteratorWithIndex<ImageType>;

auto inImage = ImageType::New();
constexpr auto sz = SizeType::Filled(25);
constexpr IndexType idx{};
const RegionType region{ idx, sz };
auto inImage = ImageType::New();
constexpr auto sz = SizeType::Filled(25);
const RegionType region{ sz };

inImage->SetRegions(region);
inImage->AllocateInitialized();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ itkUniformRandomSpatialNeighborSubsamplerTest(int argc, char * argv[])
auto inImage = FloatImage::New();
constexpr typename SizeType::value_type regionSizeVal = 35;
constexpr auto sz = SizeType::Filled(regionSizeVal);
constexpr IndexType idx{};
const RegionType region{ idx, sz };
const RegionType region{ sz };

inImage->SetRegions(region);
inImage->AllocateInitialized();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,11 @@ itkCenteredVersorTransformInitializerTest(int, char *[])
// Transform Type
using TransformType = itk::VersorRigid3DTransform<double>;

SizeType size{ { 100, 100, 150 } };
PointType fixedOrigin{};
PointType movingOrigin{ { 29.0, 17.0, 13.0 } };
SpacingType spacing{ { 1.5, 1.5, 1.0 } };
constexpr IndexType index{};

const RegionType region{ index, size };
SizeType size{ { 100, 100, 150 } };
PointType fixedOrigin{};
PointType movingOrigin{ { 29.0, 17.0, 13.0 } };
SpacingType spacing{ { 1.5, 1.5, 1.0 } };
const RegionType region{ size };


auto fixedImage = FixedImageType::New();
Expand All @@ -79,9 +77,9 @@ itkCenteredVersorTransformInitializerTest(int, char *[])
SizeType internalSize;
IndexType internalIndex;

internalIndex[0] = index[0] + 20;
internalIndex[1] = index[1] + 30;
internalIndex[2] = index[2] + 10;
internalIndex[0] = 20;
internalIndex[1] = 30;
internalIndex[2] = 10;

internalSize[0] = size[0] - 2 * 20;
internalSize[1] = size[1] - 2 * 30;
Expand All @@ -101,9 +99,9 @@ itkCenteredVersorTransformInitializerTest(int, char *[])
}


internalIndex[0] = index[0] + 10;
internalIndex[1] = index[1] + 20;
internalIndex[2] = index[2] + 30;
internalIndex[0] = 10;
internalIndex[1] = 20;
internalIndex[2] = 30;

internalSize[0] = size[0] - 2 * 10;
internalSize[1] = size[1] - 2 * 20;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ itkDemonsRegistrationFilterTest(int, char *[])
using ImageType = itk::Image<PixelType, ImageDimension>;
using VectorType = itk::Vector<float, ImageDimension>;
using FieldType = itk::Image<VectorType, ImageDimension>;
using IndexType = ImageType::IndexType;
using SizeType = ImageType::SizeType;
using RegionType = ImageType::RegionType;

Expand All @@ -126,9 +125,7 @@ itkDemonsRegistrationFilterTest(int, char *[])
SizeType size;
size.SetSize(sizeArray);

constexpr IndexType index{};

const RegionType region{ index, size };
const RegionType region{ size };

auto moving = ImageType::New();
auto fixed = ImageType::New();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ itkDiffeomorphicDemonsRegistrationFilterTest(int argc, char * argv[])
using ImageType = itk::Image<PixelType, ImageDimension>;
using VectorType = itk::Vector<float, ImageDimension>;
using FieldType = itk::Image<VectorType, ImageDimension>;
using IndexType = ImageType::IndexType;
using SizeType = ImageType::SizeType;
using RegionType = ImageType::RegionType;
using DirectionType = ImageType::DirectionType;
Expand All @@ -138,9 +137,7 @@ itkDiffeomorphicDemonsRegistrationFilterTest(int argc, char * argv[])
SizeType size;
size.SetSize(sizeArray);

constexpr IndexType index{};

const RegionType region{ index, size };
const RegionType region{ size };

DirectionType direction;
direction.SetIdentity();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ itkFastSymmetricForcesDemonsRegistrationFilterTest(int, char *[])
using ImageType = itk::Image<PixelType, ImageDimension>;
using VectorType = itk::Vector<float, ImageDimension>;
using FieldType = itk::Image<VectorType, ImageDimension>;
using IndexType = ImageType::IndexType;
using SizeType = ImageType::SizeType;
using RegionType = ImageType::RegionType;

Expand All @@ -125,9 +124,7 @@ itkFastSymmetricForcesDemonsRegistrationFilterTest(int, char *[])
SizeType size;
size.SetSize(sizeArray);

constexpr IndexType index{};

const RegionType region{ index, size };
const RegionType region{ size };

auto moving = ImageType::New();
auto fixed = ImageType::New();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ itkLevelSetMotionRegistrationFilterTest(int argc, char * argv[])
using ImageType = itk::Image<PixelType, ImageDimension>;
using VectorType = itk::Vector<float, ImageDimension>;
using FieldType = itk::Image<VectorType, ImageDimension>;
using IndexType = ImageType::IndexType;
using SizeType = ImageType::SizeType;
using RegionType = ImageType::RegionType;

Expand All @@ -141,9 +140,7 @@ itkLevelSetMotionRegistrationFilterTest(int argc, char * argv[])
SizeType size;
size.SetSize(sizeArray);

constexpr IndexType index{};

const RegionType region{ index, size };
const RegionType region{ size };

auto moving = ImageType::New();
auto fixed = ImageType::New();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ itkSymmetricForcesDemonsRegistrationFilterTest(int, char *[])
using VectorType = itk::Vector<float, ImageDimension>;
using FieldType = itk::Image<VectorType, ImageDimension>;
using FloatImageType = itk::Image<VectorType::ValueType, ImageDimension>;
using IndexType = ImageType::IndexType;
using SizeType = ImageType::SizeType;
using RegionType = ImageType::RegionType;

Expand All @@ -116,9 +115,7 @@ itkSymmetricForcesDemonsRegistrationFilterTest(int, char *[])
SizeType size;
size.SetSize(sizeArray);

constexpr IndexType index{};

const RegionType region{ index, size };
const RegionType region{ size };

auto moving = ImageType::New();
auto fixed = ImageType::New();
Expand Down
Loading