diff --git a/src/Core/Common/AddOffsetToIndex/Code.cxx b/src/Core/Common/AddOffsetToIndex/Code.cxx index 9040e2247..d9d8a8dfd 100644 --- a/src/Core/Common/AddOffsetToIndex/Code.cxx +++ b/src/Core/Common/AddOffsetToIndex/Code.cxx @@ -26,8 +26,7 @@ main() { constexpr unsigned int Dimension = 2; - itk::Index index; - index.Fill(5); + auto index = itk::Index::Filled(5); itk::Offset offset; offset.Fill(1); diff --git a/src/Core/Common/ApplyAFilterOnlyToASpecifiedRegionOfAnImage/Code.cxx b/src/Core/Common/ApplyAFilterOnlyToASpecifiedRegionOfAnImage/Code.cxx index fb5df521f..61874dbe7 100644 --- a/src/Core/Common/ApplyAFilterOnlyToASpecifiedRegionOfAnImage/Code.cxx +++ b/src/Core/Common/ApplyAFilterOnlyToASpecifiedRegionOfAnImage/Code.cxx @@ -28,15 +28,13 @@ main() using ImageType = itk::Image; - ImageType::SizeType smallSize; - smallSize.Fill(10); + auto smallSize = ImageType::SizeType::Filled(10); ImageType::IndexType index{}; ImageType::RegionType region(index, smallSize); - ImageType::SizeType bigSize; - bigSize.Fill(10000); + auto bigSize = ImageType::SizeType::Filled(10000); using RandomSourceType = itk::RandomImageSource; auto randomImageSource = RandomSourceType::New(); diff --git a/src/Core/Common/CreateABackwardDifferenceOperator/Code.cxx b/src/Core/Common/CreateABackwardDifferenceOperator/Code.cxx index 6302d271a..966bb68b1 100644 --- a/src/Core/Common/CreateABackwardDifferenceOperator/Code.cxx +++ b/src/Core/Common/CreateABackwardDifferenceOperator/Code.cxx @@ -30,8 +30,7 @@ main() // Create the operator for the X axis derivative backwardDifferenceOperator.SetDirection(0); - itk::Size radius; - radius.Fill(1); + auto radius = itk::Size::Filled(1); backwardDifferenceOperator.CreateToRadius(radius); diff --git a/src/Core/Common/CreateAnImageRegion/Code.cxx b/src/Core/Common/CreateAnImageRegion/Code.cxx index 4fbd7c42b..c249a28d8 100644 --- a/src/Core/Common/CreateAnImageRegion/Code.cxx +++ b/src/Core/Common/CreateAnImageRegion/Code.cxx @@ -24,11 +24,9 @@ main() constexpr unsigned int Dimension = 2; using RegionType = itk::ImageRegion; - RegionType::SizeType size; - size.Fill(3); + auto size = RegionType::SizeType::Filled(3); - RegionType::IndexType index; - index.Fill(1); + auto index = RegionType::IndexType::Filled(1); RegionType region(index, size); diff --git a/src/Core/Common/CreateAnotherInstanceOfAFilter/Code.cxx b/src/Core/Common/CreateAnotherInstanceOfAFilter/Code.cxx index 731a3d03a..e62225a80 100644 --- a/src/Core/Common/CreateAnotherInstanceOfAFilter/Code.cxx +++ b/src/Core/Common/CreateAnotherInstanceOfAFilter/Code.cxx @@ -26,8 +26,7 @@ CreateImage(typename TImage::Pointer image) using ImageType = TImage; typename ImageType::IndexType start{}; - typename ImageType::SizeType size; - size.Fill(2); + auto size = ImageType::SizeType::Filled(2); typename ImageType::RegionType region(start, size); diff --git a/src/Core/Common/CreateDerivativeKernel/Code.cxx b/src/Core/Common/CreateDerivativeKernel/Code.cxx index f10f8de66..ef8e8f63c 100644 --- a/src/Core/Common/CreateDerivativeKernel/Code.cxx +++ b/src/Core/Common/CreateDerivativeKernel/Code.cxx @@ -23,8 +23,7 @@ main() using DerivativeOperatorType = itk::DerivativeOperator; DerivativeOperatorType derivativeOperator; derivativeOperator.SetDirection(0); // Create the operator for the X axis derivative - itk::Size<2> radius; - radius.Fill(1); + auto radius = itk::Size<2>::Filled(1); derivativeOperator.CreateToRadius(radius); std::cout << "Size: " << derivativeOperator.GetSize() << std::endl; diff --git a/src/Core/Common/CreateForwardDifferenceKernel/Code.cxx b/src/Core/Common/CreateForwardDifferenceKernel/Code.cxx index d03d5a7f1..b93aee2ae 100644 --- a/src/Core/Common/CreateForwardDifferenceKernel/Code.cxx +++ b/src/Core/Common/CreateForwardDifferenceKernel/Code.cxx @@ -23,8 +23,7 @@ main() using ForwardDifferenceOperatorType = itk::ForwardDifferenceOperator; ForwardDifferenceOperatorType forwardDifferenceOperator; forwardDifferenceOperator.SetDirection(0); // Create the operator for the X axis derivative - itk::Size<2> radius; - radius.Fill(1); + auto radius = itk::Size<2>::Filled(1); forwardDifferenceOperator.CreateToRadius(radius); std::cout << "Size: " << forwardDifferenceOperator.GetSize() << std::endl; diff --git a/src/Core/Common/CreateGaussianDerivativeKernel/Code.cxx b/src/Core/Common/CreateGaussianDerivativeKernel/Code.cxx index cabdcfdc1..90b563137 100644 --- a/src/Core/Common/CreateGaussianDerivativeKernel/Code.cxx +++ b/src/Core/Common/CreateGaussianDerivativeKernel/Code.cxx @@ -23,8 +23,7 @@ main() using GaussianDerivativeOperatorType = itk::GaussianDerivativeOperator; GaussianDerivativeOperatorType gaussianDerivativeOperator; gaussianDerivativeOperator.SetDirection(0); // Create the operator for the X axis derivative - itk::Size<2> radius; - radius.Fill(1); + auto radius = itk::Size<2>::Filled(1); gaussianDerivativeOperator.CreateToRadius(radius); std::cout << "Size: " << gaussianDerivativeOperator.GetSize() << std::endl; diff --git a/src/Core/Common/CreateGaussianKernel/Code.cxx b/src/Core/Common/CreateGaussianKernel/Code.cxx index 869fa870d..076872975 100644 --- a/src/Core/Common/CreateGaussianKernel/Code.cxx +++ b/src/Core/Common/CreateGaussianKernel/Code.cxx @@ -23,8 +23,7 @@ main() using GaussianOperatorType = itk::GaussianOperator; GaussianOperatorType gaussianOperator; gaussianOperator.SetDirection(0); // Create the operator for the X axis derivative - itk::Size<2> radius; - radius.Fill(1); + auto radius = itk::Size<2>::Filled(1); gaussianOperator.CreateToRadius(radius); std::cout << "Size: " << gaussianOperator.GetSize() << std::endl; diff --git a/src/Core/Common/CreateLaplacianKernel/Code.cxx b/src/Core/Common/CreateLaplacianKernel/Code.cxx index 817b45f3a..e37179609 100644 --- a/src/Core/Common/CreateLaplacianKernel/Code.cxx +++ b/src/Core/Common/CreateLaplacianKernel/Code.cxx @@ -22,8 +22,7 @@ main() { using LaplacianOperatorType = itk::LaplacianOperator; LaplacianOperatorType laplacianOperator; - itk::Size<2> radius; - radius.Fill(1); + auto radius = itk::Size<2>::Filled(1); laplacianOperator.CreateToRadius(radius); std::cout << "Size: " << laplacianOperator.GetSize() << std::endl; diff --git a/src/Core/Common/CreateSobelKernel/Code.cxx b/src/Core/Common/CreateSobelKernel/Code.cxx index 843db7fc7..b263d4283 100644 --- a/src/Core/Common/CreateSobelKernel/Code.cxx +++ b/src/Core/Common/CreateSobelKernel/Code.cxx @@ -23,8 +23,7 @@ main() using SobelOperatorType = itk::SobelOperator; SobelOperatorType sobelOperator; sobelOperator.SetDirection(0); // Create the operator for the X axis derivative - itk::Size<2> radius; - radius.Fill(1); + auto radius = itk::Size<2>::Filled(1); sobelOperator.CreateToRadius(radius); std::cout << sobelOperator << std::endl; diff --git a/src/Core/Common/CreateVectorImage/Code.cxx b/src/Core/Common/CreateVectorImage/Code.cxx index c15d32b3e..4c0055b51 100644 --- a/src/Core/Common/CreateVectorImage/Code.cxx +++ b/src/Core/Common/CreateVectorImage/Code.cxx @@ -25,8 +25,7 @@ main() ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(2); + auto size = ImageType::SizeType::Filled(2); ImageType::RegionType region(start, size); diff --git a/src/Core/Common/CropImageBySpecifyingRegion/Code.cxx b/src/Core/Common/CropImageBySpecifyingRegion/Code.cxx index 897c573b9..ed8cf2654 100644 --- a/src/Core/Common/CropImageBySpecifyingRegion/Code.cxx +++ b/src/Core/Common/CropImageBySpecifyingRegion/Code.cxx @@ -27,8 +27,7 @@ main() ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(10); + auto size = ImageType::SizeType::Filled(10); ImageType::RegionType region(start, size); @@ -39,11 +38,9 @@ main() std::cout << "Image largest region: " << image->GetLargestPossibleRegion() << std::endl; - ImageType::IndexType desiredStart; - desiredStart.Fill(3); + auto desiredStart = ImageType::IndexType::Filled(3); - ImageType::SizeType desiredSize; - desiredSize.Fill(4); + auto desiredSize = ImageType::SizeType::Filled(4); ImageType::RegionType desiredRegion(desiredStart, desiredSize); @@ -62,8 +59,7 @@ main() output->DisconnectPipeline(); output->FillBuffer(2); - itk::Index<2> index; - index.Fill(5); + auto index = itk::Index<2>::Filled(5); std::cout << "new largest region: " << output->GetLargestPossibleRegion() << std::endl; std::cout << "new: " << (int)output->GetPixel(index) << std::endl; diff --git a/src/Core/Common/DemonstrateAllOperators/Code.cxx b/src/Core/Common/DemonstrateAllOperators/Code.cxx index 6bbae3960..94acccb85 100644 --- a/src/Core/Common/DemonstrateAllOperators/Code.cxx +++ b/src/Core/Common/DemonstrateAllOperators/Code.cxx @@ -53,8 +53,7 @@ main() operators.push_back(new AnnulusOperatorType); operators.push_back(new BackwardDifferenceOperatorType); - itk::Size<2> radius; - radius.Fill(1); + auto radius = itk::Size<2>::Filled(1); for (auto & operatorId : operators) { diff --git a/src/Core/Common/DistanceBetweenIndices/Code.cxx b/src/Core/Common/DistanceBetweenIndices/Code.cxx index 8bff941d7..a82f1dfb4 100644 --- a/src/Core/Common/DistanceBetweenIndices/Code.cxx +++ b/src/Core/Common/DistanceBetweenIndices/Code.cxx @@ -25,11 +25,9 @@ int main() { - itk::Index<2> pixel1; - pixel1.Fill(2); + auto pixel1 = itk::Index<2>::Filled(2); - itk::Index<2> pixel2; - pixel2.Fill(4); + auto pixel2 = itk::Index<2>::Filled(4); itk::Point p1; p1[0] = pixel1[0]; diff --git a/src/Core/Common/IsPixelInsideRegion/Code.cxx b/src/Core/Common/IsPixelInsideRegion/Code.cxx index 2865f62b4..e6e6f2478 100644 --- a/src/Core/Common/IsPixelInsideRegion/Code.cxx +++ b/src/Core/Common/IsPixelInsideRegion/Code.cxx @@ -29,8 +29,7 @@ main() using SizeType = RegionType::SizeType; using IndexType = RegionType::IndexType; - SizeType size; - size.Fill(3); + auto size = SizeType::Filled(3); IndexType start{}; diff --git a/src/Core/Common/IterateImageStartingAtSeed/Code.cxx b/src/Core/Common/IterateImageStartingAtSeed/Code.cxx index c342cf741..e0de5060c 100644 --- a/src/Core/Common/IterateImageStartingAtSeed/Code.cxx +++ b/src/Core/Common/IterateImageStartingAtSeed/Code.cxx @@ -61,8 +61,7 @@ CreateImage(ImageType::Pointer image) { itk::Index<2> start{}; - itk::Size<2> size; - size.Fill(100); + auto size = itk::Size<2>::Filled(100); itk::ImageRegion<2> region(start, size); image->SetRegions(region); @@ -74,8 +73,7 @@ CreateImage(ImageType::Pointer image) // Make a line for (unsigned int i = 20; i < 50; ++i) { - itk::Index<2> pixelIndex; - pixelIndex.Fill(i); + auto pixelIndex = itk::Index<2>::Filled(i); image->SetPixel(pixelIndex, 255); } diff --git a/src/Core/Common/IterateLineThroughImage/Code.cxx b/src/Core/Common/IterateLineThroughImage/Code.cxx index 4ec3ece3d..3a8dbbb0e 100644 --- a/src/Core/Common/IterateLineThroughImage/Code.cxx +++ b/src/Core/Common/IterateLineThroughImage/Code.cxx @@ -88,8 +88,7 @@ main(int argc, char * argv[]) void CreateImage(ImageType::Pointer image) { - ImageType::SizeType regionSize; - regionSize.Fill(100); + auto regionSize = ImageType::SizeType::Filled(100); ImageType::IndexType regionIndex{}; diff --git a/src/Core/Common/IterateLineThroughImageWithoutWriteAccess/Code.cxx b/src/Core/Common/IterateLineThroughImageWithoutWriteAccess/Code.cxx index 918c8ac77..0f4f6e191 100644 --- a/src/Core/Common/IterateLineThroughImageWithoutWriteAccess/Code.cxx +++ b/src/Core/Common/IterateLineThroughImageWithoutWriteAccess/Code.cxx @@ -50,8 +50,7 @@ main() void CreateImage(ImageType::Pointer image) { - ImageType::SizeType regionSize; - regionSize.Fill(3); + auto regionSize = ImageType::SizeType::Filled(3); ImageType::IndexType regionIndex{}; diff --git a/src/Core/Common/IterateOverARegionWithAShapedNeighborhoodIterator/Code.cxx b/src/Core/Common/IterateOverARegionWithAShapedNeighborhoodIterator/Code.cxx index 59d3c0352..479eb8138 100644 --- a/src/Core/Common/IterateOverARegionWithAShapedNeighborhoodIterator/Code.cxx +++ b/src/Core/Common/IterateOverARegionWithAShapedNeighborhoodIterator/Code.cxx @@ -40,8 +40,7 @@ main() ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(10); + auto size = ImageType::SizeType::Filled(10); ImageType::RegionType region(start, size); diff --git a/src/Core/Common/IterateOverARegionWithAShapedNeighborhoodIteratorManual/Code.cxx b/src/Core/Common/IterateOverARegionWithAShapedNeighborhoodIteratorManual/Code.cxx index 1f21f424f..e61e85303 100644 --- a/src/Core/Common/IterateOverARegionWithAShapedNeighborhoodIteratorManual/Code.cxx +++ b/src/Core/Common/IterateOverARegionWithAShapedNeighborhoodIteratorManual/Code.cxx @@ -39,8 +39,7 @@ main() using IteratorType = itk::ShapedNeighborhoodIterator; - itk::Size<2> radius; - radius.Fill(1); + auto radius = itk::Size<2>::Filled(1); IteratorType iterator(radius, image, image->GetLargestPossibleRegion()); std::cout << "By default there are " << iterator.GetActiveIndexListSize() << " active indices." << std::endl; @@ -87,8 +86,7 @@ CreateImage(ImageType::Pointer image) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(10); + auto size = ImageType::SizeType::Filled(10); ImageType::RegionType region(start, size); diff --git a/src/Core/Common/IterateOverSpecificRegion/Code.cxx b/src/Core/Common/IterateOverSpecificRegion/Code.cxx index 6ebeacfb2..d38068c8e 100644 --- a/src/Core/Common/IterateOverSpecificRegion/Code.cxx +++ b/src/Core/Common/IterateOverSpecificRegion/Code.cxx @@ -29,8 +29,7 @@ int main() { - ImageType::SizeType exclusionRegionSize; - exclusionRegionSize.Fill(2); + auto exclusionRegionSize = ImageType::SizeType::Filled(2); ImageType::IndexType exclusionRegionIndex{}; @@ -58,8 +57,7 @@ main() void CreateImage(ImageType::Pointer image) { - ImageType::SizeType regionSize; - regionSize.Fill(3); + auto regionSize = ImageType::SizeType::Filled(3); ImageType::IndexType regionIndex{}; diff --git a/src/Core/Common/NeighborhoodIteratorOnVectorImage/Code.cxx b/src/Core/Common/NeighborhoodIteratorOnVectorImage/Code.cxx index 57dcd28d2..1af89261c 100644 --- a/src/Core/Common/NeighborhoodIteratorOnVectorImage/Code.cxx +++ b/src/Core/Common/NeighborhoodIteratorOnVectorImage/Code.cxx @@ -28,8 +28,7 @@ main() itk::Index<2> start{}; - itk::Size<2> size; - size.Fill(10); + auto size = itk::Size<2>::Filled(10); itk::ImageRegion<2> region(start, size); diff --git a/src/Core/Common/ObserveAnEvent/Code.cxx b/src/Core/Common/ObserveAnEvent/Code.cxx index 7f9417a2d..e4ae8755b 100644 --- a/src/Core/Common/ObserveAnEvent/Code.cxx +++ b/src/Core/Common/ObserveAnEvent/Code.cxx @@ -58,8 +58,7 @@ main() using SourceType = itk::GaussianImageSource; auto source = SourceType::New(); - ImageType::SizeType size; - size.Fill(128); + auto size = ImageType::SizeType::Filled(128); source->SetSize(size); SourceType::ArrayType sigma; diff --git a/src/Core/Common/RandomSelectPixelFromRegionWithoutReplacee/Code.cxx b/src/Core/Common/RandomSelectPixelFromRegionWithoutReplacee/Code.cxx index b25fc59b7..8bbc67a5d 100644 --- a/src/Core/Common/RandomSelectPixelFromRegionWithoutReplacee/Code.cxx +++ b/src/Core/Common/RandomSelectPixelFromRegionWithoutReplacee/Code.cxx @@ -24,8 +24,7 @@ main() using ImageType = itk::Image; auto image = ImageType::New(); - ImageType::SizeType regionSize; - regionSize.Fill(3); + auto regionSize = ImageType::SizeType::Filled(3); ImageType::IndexType regionIndex{}; diff --git a/src/Core/Common/StoreNonPixelDataInImage/Code.cxx b/src/Core/Common/StoreNonPixelDataInImage/Code.cxx index 92c1f8f2b..5c23c5acf 100644 --- a/src/Core/Common/StoreNonPixelDataInImage/Code.cxx +++ b/src/Core/Common/StoreNonPixelDataInImage/Code.cxx @@ -78,8 +78,7 @@ CreateImage(ImageType::Pointer image) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(10); + auto size = ImageType::SizeType::Filled(10); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Core/Common/StreamAPipeline/Code.cxx b/src/Core/Common/StreamAPipeline/Code.cxx index af01cfc23..dfcbfb340 100644 --- a/src/Core/Common/StreamAPipeline/Code.cxx +++ b/src/Core/Common/StreamAPipeline/Code.cxx @@ -35,9 +35,8 @@ main(int argc, char * argv[]) using ImageType = itk::Image; using SourceType = itk::RandomImageSource; - auto source = SourceType::New(); - ImageType::SizeType size; - size.Fill(numberOfSplits); + auto source = SourceType::New(); + auto size = ImageType::SizeType::Filled(numberOfSplits); source->SetSize(size); using MonitorFilterType = itk::PipelineMonitorImageFilter; diff --git a/src/Core/Common/WatchAFilter/Code.cxx b/src/Core/Common/WatchAFilter/Code.cxx index 164415102..635b2fbf3 100644 --- a/src/Core/Common/WatchAFilter/Code.cxx +++ b/src/Core/Common/WatchAFilter/Code.cxx @@ -31,8 +31,7 @@ CreateImage(typename TImage::Pointer image) typename ImageType::RegionType region; typename ImageType::IndexType start{}; - typename ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); region.SetSize(size); region.SetIndex(start); diff --git a/src/Core/ImageAdaptors/AddConstantToPixelsWithoutDuplicatingImage/Code.cxx b/src/Core/ImageAdaptors/AddConstantToPixelsWithoutDuplicatingImage/Code.cxx index ba0f1d945..89a644394 100644 --- a/src/Core/ImageAdaptors/AddConstantToPixelsWithoutDuplicatingImage/Code.cxx +++ b/src/Core/ImageAdaptors/AddConstantToPixelsWithoutDuplicatingImage/Code.cxx @@ -64,8 +64,7 @@ CreateImage(ImageType::Pointer image) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(10); + auto size = ImageType::SizeType::Filled(10); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Core/ImageAdaptors/ExtractChannelOfImageWithMultipleComponents/Code.cxx b/src/Core/ImageAdaptors/ExtractChannelOfImageWithMultipleComponents/Code.cxx index 43c7397c5..0db9c1013 100644 --- a/src/Core/ImageAdaptors/ExtractChannelOfImageWithMultipleComponents/Code.cxx +++ b/src/Core/ImageAdaptors/ExtractChannelOfImageWithMultipleComponents/Code.cxx @@ -51,8 +51,7 @@ CreateImage(VectorImageType::Pointer image) { VectorImageType::IndexType start{}; - VectorImageType::SizeType size; - size.Fill(2); + auto size = VectorImageType::SizeType::Filled(2); VectorImageType::RegionType region; region.SetSize(size); diff --git a/src/Core/ImageAdaptors/PresentImageAfterOperation/Code.cxx b/src/Core/ImageAdaptors/PresentImageAfterOperation/Code.cxx index 70f66555d..2a76cf704 100644 --- a/src/Core/ImageAdaptors/PresentImageAfterOperation/Code.cxx +++ b/src/Core/ImageAdaptors/PresentImageAfterOperation/Code.cxx @@ -80,8 +80,7 @@ CreateImage(VectorImageType::Pointer image) { VectorImageType::IndexType start{}; - VectorImageType::SizeType size; - size.Fill(2); + auto size = VectorImageType::SizeType::Filled(2); VectorImageType::RegionType region; region.SetSize(size); diff --git a/src/Core/ImageAdaptors/ProcessNthComponentOfVectorImage/Code.cxx b/src/Core/ImageAdaptors/ProcessNthComponentOfVectorImage/Code.cxx index ef27646a4..ca0639f4b 100644 --- a/src/Core/ImageAdaptors/ProcessNthComponentOfVectorImage/Code.cxx +++ b/src/Core/ImageAdaptors/ProcessNthComponentOfVectorImage/Code.cxx @@ -51,8 +51,7 @@ CreateImage(VectorImageType::Pointer image) { VectorImageType::IndexType start{}; - VectorImageType::SizeType size; - size.Fill(2); + auto size = VectorImageType::SizeType::Filled(2); VectorImageType::RegionType region; region.SetSize(size); diff --git a/src/Core/ImageAdaptors/ViewComponentVectorImageAsScaleImage/Code.cxx b/src/Core/ImageAdaptors/ViewComponentVectorImageAsScaleImage/Code.cxx index 559b87b4b..4df495060 100644 --- a/src/Core/ImageAdaptors/ViewComponentVectorImageAsScaleImage/Code.cxx +++ b/src/Core/ImageAdaptors/ViewComponentVectorImageAsScaleImage/Code.cxx @@ -51,8 +51,7 @@ CreateImage(VectorImageType::Pointer image) { VectorImageType::IndexType start{}; - VectorImageType::SizeType size; - size.Fill(2); + auto size = VectorImageType::SizeType::Filled(2); VectorImageType::RegionType region; region.SetSize(size); diff --git a/src/Core/ImageFunction/ComputeMedianOfImageAtPixel/Code.cxx b/src/Core/ImageFunction/ComputeMedianOfImageAtPixel/Code.cxx index e37b0e0e1..283e6d77c 100644 --- a/src/Core/ImageFunction/ComputeMedianOfImageAtPixel/Code.cxx +++ b/src/Core/ImageFunction/ComputeMedianOfImageAtPixel/Code.cxx @@ -35,8 +35,7 @@ main() auto medianImageFunction = MedianImageFunctionType::New(); medianImageFunction->SetInputImage(image); - itk::Index<2> index; - index.Fill(10); + auto index = itk::Index<2>::Filled(10); std::cout << "Median at " << index << " is " << static_cast(medianImageFunction->EvaluateAtIndex(index)) << std::endl; return EXIT_SUCCESS; @@ -47,8 +46,7 @@ CreateImage(UnsignedCharImageType::Pointer image) { itk::Index<2> start{}; - itk::Size<2> size; - size.Fill(100); + auto size = itk::Size<2>::Filled(100); itk::ImageRegion<2> region(start, size); diff --git a/src/Core/ImageFunction/MultiplyKernelWithAnImageAtLocation/Code.cxx b/src/Core/ImageFunction/MultiplyKernelWithAnImageAtLocation/Code.cxx index 184c180a2..d1f0ce3b5 100644 --- a/src/Core/ImageFunction/MultiplyKernelWithAnImageAtLocation/Code.cxx +++ b/src/Core/ImageFunction/MultiplyKernelWithAnImageAtLocation/Code.cxx @@ -44,24 +44,21 @@ main() neighborhoodOperatorImageFunction->SetInputImage(image); { - itk::Index<2> index; - index.Fill(20); + auto index = itk::Index<2>::Filled(20); float output = neighborhoodOperatorImageFunction->EvaluateAtIndex(index); std::cout << "Sum on border: " << output << std::endl; } { - itk::Index<2> index; - index.Fill(35); + auto index = itk::Index<2>::Filled(35); float output = neighborhoodOperatorImageFunction->EvaluateAtIndex(index); std::cout << "Sum in center: " << output << std::endl; } { - itk::Index<2> index; - index.Fill(7); + auto index = itk::Index<2>::Filled(7); float output = neighborhoodOperatorImageFunction->EvaluateAtIndex(index); std::cout << "Sum outside: " << output << std::endl; @@ -76,8 +73,7 @@ CreateImage(UnsignedCharImageType::Pointer image) // Create an image with 2 connected components UnsignedCharImageType::IndexType start{}; - UnsignedCharImageType::SizeType size; - size.Fill(100); + auto size = UnsignedCharImageType::SizeType::Filled(100); UnsignedCharImageType::RegionType region(start, size); diff --git a/src/Core/SpatialObjects/ContourSpatialObject/Code.cxx b/src/Core/SpatialObjects/ContourSpatialObject/Code.cxx index 4f7a0b82c..bcbc14a0a 100644 --- a/src/Core/SpatialObjects/ContourSpatialObject/Code.cxx +++ b/src/Core/SpatialObjects/ContourSpatialObject/Code.cxx @@ -55,9 +55,8 @@ main(int /*argc*/, char * /*argv*/[]) auto contour = ContourType::New(); contour->SetControlPoints(points); - auto imageFilter = SpatialObjectToImageFilterType::New(); - itk::Size<2> size; - size.Fill(50); + auto imageFilter = SpatialObjectToImageFilterType::New(); + auto size = itk::Size<2>::Filled(50); imageFilter->SetInsideValue(255); // white imageFilter->SetSize(size); imageFilter->SetInput(contour); diff --git a/src/Core/SpatialObjects/CreateALineSpatialObject/Code.cxx b/src/Core/SpatialObjects/CreateALineSpatialObject/Code.cxx index 2c7e9f6ba..8f2e45f51 100644 --- a/src/Core/SpatialObjects/CreateALineSpatialObject/Code.cxx +++ b/src/Core/SpatialObjects/CreateALineSpatialObject/Code.cxx @@ -51,9 +51,8 @@ main(int itkNotUsed(argc), char * itkNotUsed(argv)[]) auto line = LineType::New(); line->SetPoints(points); - auto imageFilter = SpatialObjectToImageFilterType::New(); - itk::Size<2> size; - size.Fill(50); + auto imageFilter = SpatialObjectToImageFilterType::New(); + auto size = itk::Size<2>::Filled(50); imageFilter->SetInsideValue(255); // white imageFilter->SetSize(size); imageFilter->SetInput(line); diff --git a/src/Core/TestKernel/GenerateRandomImage/Code.cxx b/src/Core/TestKernel/GenerateRandomImage/Code.cxx index 82476a0a2..fd63c3101 100644 --- a/src/Core/TestKernel/GenerateRandomImage/Code.cxx +++ b/src/Core/TestKernel/GenerateRandomImage/Code.cxx @@ -36,8 +36,7 @@ main(int argc, char * argv[]) using ImageType = itk::Image; - ImageType::SizeType size; - size.Fill(10); + auto size = ImageType::SizeType::Filled(10); using RandomImageSourceType = itk::RandomImageSource; diff --git a/src/Core/Transform/TranslateAVectorImage/Code.cxx b/src/Core/Transform/TranslateAVectorImage/Code.cxx index 6e540150f..339c4ba0d 100644 --- a/src/Core/Transform/TranslateAVectorImage/Code.cxx +++ b/src/Core/Transform/TranslateAVectorImage/Code.cxx @@ -31,8 +31,7 @@ main() auto image = VectorImageType::New(); itk::Index<2> start{}; - itk::Size<2> size; - size.Fill(10); + auto size = itk::Size<2>::Filled(10); itk::ImageRegion<2> region(start, size); image->SetRegions(region); diff --git a/src/Developer/ImageFilterMultipleOutputsDifferentType.hxx b/src/Developer/ImageFilterMultipleOutputsDifferentType.hxx index b40ff0430..1a16c6de7 100644 --- a/src/Developer/ImageFilterMultipleOutputsDifferentType.hxx +++ b/src/Developer/ImageFilterMultipleOutputsDifferentType.hxx @@ -26,8 +26,7 @@ ImageFilterMultipleOutputsDifferentType start{}; - itk::Size<2> size; - size.Fill(20); + auto size = itk::Size<2>::Filled(20); itk::ImageRegion<2> region(start, size); diff --git a/src/Filtering/BinaryMathematicalMorphology/ThinImage/Code.cxx b/src/Filtering/BinaryMathematicalMorphology/ThinImage/Code.cxx index 2a731b977..10737842f 100644 --- a/src/Filtering/BinaryMathematicalMorphology/ThinImage/Code.cxx +++ b/src/Filtering/BinaryMathematicalMorphology/ThinImage/Code.cxx @@ -64,8 +64,7 @@ CreateImage(ImageType::Pointer image) // Create an image ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region(start, size); diff --git a/src/Filtering/Convolution/ColorNormalizedCorrelation/Code.cxx b/src/Filtering/Convolution/ColorNormalizedCorrelation/Code.cxx index 240639aed..c2e8bf468 100644 --- a/src/Filtering/Convolution/ColorNormalizedCorrelation/Code.cxx +++ b/src/Filtering/Convolution/ColorNormalizedCorrelation/Code.cxx @@ -60,11 +60,9 @@ main(int argc, char * argv[]) auto extractFilter = ExtractFilterType::New(); - FloatImageType::IndexType start; - start.Fill(50); + auto start = FloatImageType::IndexType::Filled(50); - FloatImageType::SizeType patchSize; - patchSize.Fill(51); + auto patchSize = FloatImageType::SizeType::Filled(51); FloatImageType::RegionType desiredRegion(start, patchSize); diff --git a/src/Filtering/Convolution/ConvolveImageWithKernel/Code.cxx b/src/Filtering/Convolution/ConvolveImageWithKernel/Code.cxx index 0fc0ab299..e71e96b4f 100644 --- a/src/Filtering/Convolution/ConvolveImageWithKernel/Code.cxx +++ b/src/Filtering/Convolution/ConvolveImageWithKernel/Code.cxx @@ -79,8 +79,7 @@ CreateKernel(ImageType::Pointer kernel, unsigned int width) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(width); + auto size = ImageType::SizeType::Filled(width); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Filtering/Convolution/NormalizedCorrelation/Code.cxx b/src/Filtering/Convolution/NormalizedCorrelation/Code.cxx index d49837bc8..96b6e0025 100644 --- a/src/Filtering/Convolution/NormalizedCorrelation/Code.cxx +++ b/src/Filtering/Convolution/NormalizedCorrelation/Code.cxx @@ -49,11 +49,9 @@ main(int argc, char * argv[]) auto extractFilter = ExtractFilterType::New(); - FloatImageType::IndexType start; - start.Fill(50); + auto start = FloatImageType::IndexType::Filled(50); - FloatImageType::SizeType patchSize; - patchSize.Fill(51); + auto patchSize = FloatImageType::SizeType::Filled(51); FloatImageType::RegionType desiredRegion(start, patchSize); diff --git a/src/Filtering/Convolution/NormalizedCorrelationOfMaskedImage/Code.cxx b/src/Filtering/Convolution/NormalizedCorrelationOfMaskedImage/Code.cxx index 23109453d..95c32b648 100644 --- a/src/Filtering/Convolution/NormalizedCorrelationOfMaskedImage/Code.cxx +++ b/src/Filtering/Convolution/NormalizedCorrelationOfMaskedImage/Code.cxx @@ -128,8 +128,7 @@ CreateMask(MaskType * const mask) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(51); + auto size = ImageType::SizeType::Filled(51); ImageType::RegionType region(start, size); @@ -162,8 +161,7 @@ CreateImage(ImageType * const image) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(51); + auto size = ImageType::SizeType::Filled(51); ImageType::RegionType region(start, size); @@ -177,8 +175,7 @@ CreateImageOfSquare(ImageType * const image, const itk::Index<2> & cornerOfSquar { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(51); + auto size = ImageType::SizeType::Filled(51); ImageType::RegionType region(start, size); diff --git a/src/Filtering/Convolution/NormalizedCorrelationUsingFFT/Code.cxx b/src/Filtering/Convolution/NormalizedCorrelationUsingFFT/Code.cxx index be82e3268..fb7b93ed9 100644 --- a/src/Filtering/Convolution/NormalizedCorrelationUsingFFT/Code.cxx +++ b/src/Filtering/Convolution/NormalizedCorrelationUsingFFT/Code.cxx @@ -103,8 +103,7 @@ CreateImage(ImageType::Pointer image, const itk::Index<2> & cornerOfSquare) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(51); + auto size = ImageType::SizeType::Filled(51); ImageType::RegionType region(start, size); diff --git a/src/Filtering/Convolution/NormalizedCorrelationUsingFFTWithMaskImages/Code.cxx b/src/Filtering/Convolution/NormalizedCorrelationUsingFFTWithMaskImages/Code.cxx index 1b3646eaf..645057e3c 100644 --- a/src/Filtering/Convolution/NormalizedCorrelationUsingFFTWithMaskImages/Code.cxx +++ b/src/Filtering/Convolution/NormalizedCorrelationUsingFFTWithMaskImages/Code.cxx @@ -110,8 +110,7 @@ CreateImage(ImageType::Pointer image, const itk::Index<2> & cornerOfSquare) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(51); + auto size = ImageType::SizeType::Filled(51); ImageType::RegionType region(start, size); @@ -141,8 +140,7 @@ CreateMask(MaskType * const mask) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(51); + auto size = ImageType::SizeType::Filled(51); ImageType::RegionType region(start, size); diff --git a/src/Filtering/DistanceMap/ApproxDistanceMapOfBinary/Code.cxx b/src/Filtering/DistanceMap/ApproxDistanceMapOfBinary/Code.cxx index a88542946..1cc089135 100644 --- a/src/Filtering/DistanceMap/ApproxDistanceMapOfBinary/Code.cxx +++ b/src/Filtering/DistanceMap/ApproxDistanceMapOfBinary/Code.cxx @@ -75,8 +75,7 @@ CreateImage(UnsignedCharImageType::Pointer image) // Create an image itk::Index<2> start{}; - itk::Size<2> size; - size.Fill(100); + auto size = itk::Size<2>::Filled(100); itk::ImageRegion<2> region(start, size); image->SetRegions(region); @@ -86,8 +85,7 @@ CreateImage(UnsignedCharImageType::Pointer image) // Create a line of white pixels for (unsigned int i = 40; i < 60; ++i) { - itk::Index<2> pixel; - pixel.Fill(i); + auto pixel = itk::Index<2>::Filled(i); image->SetPixel(pixel, 255); } } diff --git a/src/Filtering/DistanceMap/MaurerDistanceMapOfBinary/Code.cxx b/src/Filtering/DistanceMap/MaurerDistanceMapOfBinary/Code.cxx index 3a947ea95..db58ee283 100644 --- a/src/Filtering/DistanceMap/MaurerDistanceMapOfBinary/Code.cxx +++ b/src/Filtering/DistanceMap/MaurerDistanceMapOfBinary/Code.cxx @@ -73,8 +73,7 @@ CreateImage(UnsignedCharImageType::Pointer image) // Create an image itk::Index<2> start{}; - itk::Size<2> size; - size.Fill(100); + auto size = itk::Size<2>::Filled(100); itk::ImageRegion<2> region(start, size); image->SetRegions(region); @@ -84,8 +83,7 @@ CreateImage(UnsignedCharImageType::Pointer image) // Create a line of white pixels for (unsigned int i = 40; i < 60; ++i) { - itk::Index<2> pixel; - pixel.Fill(i); + auto pixel = itk::Index<2>::Filled(i); image->SetPixel(pixel, 255); } } diff --git a/src/Filtering/DistanceMap/SignedDistanceMapOfBinary/Code.cxx b/src/Filtering/DistanceMap/SignedDistanceMapOfBinary/Code.cxx index a5c2ad4db..5d516d870 100644 --- a/src/Filtering/DistanceMap/SignedDistanceMapOfBinary/Code.cxx +++ b/src/Filtering/DistanceMap/SignedDistanceMapOfBinary/Code.cxx @@ -73,8 +73,7 @@ CreateImage(UnsignedCharImageType::Pointer image) // Create an image itk::Index<2> start{}; - itk::Size<2> size; - size.Fill(100); + auto size = itk::Size<2>::Filled(100); itk::ImageRegion<2> region(start, size); image->SetRegions(region); @@ -84,8 +83,7 @@ CreateImage(UnsignedCharImageType::Pointer image) // Create a line of white pixels for (unsigned int i = 40; i < 60; ++i) { - itk::Index<2> pixel; - pixel.Fill(i); + auto pixel = itk::Index<2>::Filled(i); image->SetPixel(pixel, 255); } } diff --git a/src/Filtering/ImageCompare/AbsValueOfTwoImages/Code.cxx b/src/Filtering/ImageCompare/AbsValueOfTwoImages/Code.cxx index 01cc191dd..2acfe87a1 100644 --- a/src/Filtering/ImageCompare/AbsValueOfTwoImages/Code.cxx +++ b/src/Filtering/ImageCompare/AbsValueOfTwoImages/Code.cxx @@ -53,8 +53,7 @@ CreateImage1(UnsignedCharImageType::Pointer image) { UnsignedCharImageType::IndexType start{}; - UnsignedCharImageType::SizeType size; - size.Fill(10); + auto size = UnsignedCharImageType::SizeType::Filled(10); UnsignedCharImageType::RegionType region; region.SetSize(size); @@ -80,8 +79,7 @@ CreateImage2(UnsignedCharImageType::Pointer image) // Create an image with 2 connected components UnsignedCharImageType::IndexType start{}; - UnsignedCharImageType::SizeType size; - size.Fill(10); + auto size = UnsignedCharImageType::SizeType::Filled(10); UnsignedCharImageType::RegionType region; region.SetSize(size); diff --git a/src/Filtering/ImageCompare/CombineTwoImagesWithCheckerBoardPattern/Code.cxx b/src/Filtering/ImageCompare/CombineTwoImagesWithCheckerBoardPattern/Code.cxx index 14eb76d66..c846d723a 100644 --- a/src/Filtering/ImageCompare/CombineTwoImagesWithCheckerBoardPattern/Code.cxx +++ b/src/Filtering/ImageCompare/CombineTwoImagesWithCheckerBoardPattern/Code.cxx @@ -37,8 +37,7 @@ main(int argc, char * argv[]) ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Filtering/ImageCompare/SquaredDifferenceOfTwoImages/Code.cxx b/src/Filtering/ImageCompare/SquaredDifferenceOfTwoImages/Code.cxx index e7055b51c..3a560e304 100644 --- a/src/Filtering/ImageCompare/SquaredDifferenceOfTwoImages/Code.cxx +++ b/src/Filtering/ImageCompare/SquaredDifferenceOfTwoImages/Code.cxx @@ -52,8 +52,7 @@ CreateImage1(UnsignedCharImageType::Pointer image) { UnsignedCharImageType::IndexType start{}; - UnsignedCharImageType::SizeType size; - size.Fill(10); + auto size = UnsignedCharImageType::SizeType::Filled(10); UnsignedCharImageType::RegionType region; region.SetSize(size); @@ -79,8 +78,7 @@ CreateImage2(UnsignedCharImageType::Pointer image) // Create an image with 2 connected components UnsignedCharImageType::IndexType start{}; - UnsignedCharImageType::SizeType size; - size.Fill(10); + auto size = UnsignedCharImageType::SizeType::Filled(10); UnsignedCharImageType::RegionType region; region.SetSize(size); diff --git a/src/Filtering/ImageCompose/ComposeVectorFromThreeScalarImages/Code.cxx b/src/Filtering/ImageCompose/ComposeVectorFromThreeScalarImages/Code.cxx index b3084a89c..daa156a96 100644 --- a/src/Filtering/ImageCompose/ComposeVectorFromThreeScalarImages/Code.cxx +++ b/src/Filtering/ImageCompose/ComposeVectorFromThreeScalarImages/Code.cxx @@ -53,8 +53,7 @@ CreateImage(ScalarImageType::Pointer image) { ScalarImageType::IndexType start{}; - ScalarImageType::SizeType size; - size.Fill(2); + auto size = ScalarImageType::SizeType::Filled(2); ScalarImageType::RegionType region; region.SetSize(size); diff --git a/src/Filtering/ImageCompose/CreateVectorImageFromScalarImages/Code.cxx b/src/Filtering/ImageCompose/CreateVectorImageFromScalarImages/Code.cxx index 503a13f59..e1f86b476 100644 --- a/src/Filtering/ImageCompose/CreateVectorImageFromScalarImages/Code.cxx +++ b/src/Filtering/ImageCompose/CreateVectorImageFromScalarImages/Code.cxx @@ -57,8 +57,7 @@ CreateImage(ScalarImageType::Pointer image) { ScalarImageType::IndexType start{}; - ScalarImageType::SizeType size; - size.Fill(100); + auto size = ScalarImageType::SizeType::Filled(100); ScalarImageType::RegionType region(start, size); diff --git a/src/Filtering/ImageCompose/JoinImages/Code.cxx b/src/Filtering/ImageCompose/JoinImages/Code.cxx index 2a1490d5e..14e608841 100644 --- a/src/Filtering/ImageCompose/JoinImages/Code.cxx +++ b/src/Filtering/ImageCompose/JoinImages/Code.cxx @@ -57,8 +57,7 @@ CreateImage(ImageType::Pointer image, unsigned char value) // Create an image ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region(start, size); diff --git a/src/Filtering/ImageFeature/ApplyAFilterOnlyToASpecifiedImageRegion/Code.cxx b/src/Filtering/ImageFeature/ApplyAFilterOnlyToASpecifiedImageRegion/Code.cxx index b97cd9c87..5cc30e987 100644 --- a/src/Filtering/ImageFeature/ApplyAFilterOnlyToASpecifiedImageRegion/Code.cxx +++ b/src/Filtering/ImageFeature/ApplyAFilterOnlyToASpecifiedImageRegion/Code.cxx @@ -24,15 +24,13 @@ main() { using ImageType = itk::Image; - itk::Size<2> smallSize; - smallSize.Fill(10); + auto smallSize = itk::Size<2>::Filled(10); itk::Index<2> index{}; itk::ImageRegion<2> region(index, smallSize); - itk::Size<2> bigSize; - bigSize.Fill(10000); + auto bigSize = itk::Size<2>::Filled(10000); itk::RandomImageSource::Pointer randomImageSource = itk::RandomImageSource::New(); randomImageSource->SetNumberOfWorkUnits(1); // to produce non-random results diff --git a/src/Filtering/ImageFeature/ExtractContoursFromImage/Code.cxx b/src/Filtering/ImageFeature/ExtractContoursFromImage/Code.cxx index bdd667422..a57a92e1a 100644 --- a/src/Filtering/ImageFeature/ExtractContoursFromImage/Code.cxx +++ b/src/Filtering/ImageFeature/ExtractContoursFromImage/Code.cxx @@ -50,8 +50,7 @@ void CreateImage(UnsignedCharImageType::Pointer image) // Create an image itk::Index<2> start{}; - itk::Size<2> size; - size.Fill(100); + auto size = itk::Size<2>::Filled(100); itk::ImageRegion<2> region(start,size); @@ -62,8 +61,7 @@ void CreateImage(UnsignedCharImageType::Pointer image) // Create a line pixels for(unsigned int i = 40; i < 60; ++i) { - itk::Index<2> pixel; - pixel.Fill(i); + auto pixel = itk::Index<2>::Filled(i); image->SetPixel(pixel, 255); } diff --git a/src/Filtering/ImageFeature/FindZeroCrossingsInSignedImage/Code.cxx b/src/Filtering/ImageFeature/FindZeroCrossingsInSignedImage/Code.cxx index e3b3c924f..c3549c4e0 100644 --- a/src/Filtering/ImageFeature/FindZeroCrossingsInSignedImage/Code.cxx +++ b/src/Filtering/ImageFeature/FindZeroCrossingsInSignedImage/Code.cxx @@ -69,8 +69,7 @@ CreateImage(ImageType::Pointer image) { itk::Index<2> start{}; - itk::Size<2> size; - size.Fill(100); + auto size = itk::Size<2>::Filled(100); itk::ImageRegion<2> region(start, size); diff --git a/src/Filtering/ImageFilterBase/ApplyKernelToEveryPixel/Code.cxx b/src/Filtering/ImageFilterBase/ApplyKernelToEveryPixel/Code.cxx index 30bc47129..54bbb83b9 100644 --- a/src/Filtering/ImageFilterBase/ApplyKernelToEveryPixel/Code.cxx +++ b/src/Filtering/ImageFilterBase/ApplyKernelToEveryPixel/Code.cxx @@ -37,9 +37,8 @@ main() using SobelOperatorType = itk::SobelOperator; SobelOperatorType sobelOperator; - itk::Size<2> radius; - radius.Fill(1); // a radius of 1x1 creates a 3x3 operator - sobelOperator.SetDirection(0); // Create the operator for the X axis derivative + auto radius = itk::Size<2>::Filled(1); // a radius of 1x1 creates a 3x3 operator + sobelOperator.SetDirection(0); // Create the operator for the X axis derivative sobelOperator.CreateToRadius(radius); using NeighborhoodOperatorImageFilterType = itk::NeighborhoodOperatorImageFilter; @@ -58,8 +57,7 @@ CreateImage(FloatImageType::Pointer image) { FloatImageType::IndexType start{}; - FloatImageType::SizeType size; - size.Fill(100); + auto size = FloatImageType::SizeType::Filled(100); FloatImageType::RegionType region(start, size); diff --git a/src/Filtering/ImageFilterBase/ApplyKernelToEveryPixelInNonZeroImage/Code.cxx b/src/Filtering/ImageFilterBase/ApplyKernelToEveryPixelInNonZeroImage/Code.cxx index da502b288..02c939ea5 100644 --- a/src/Filtering/ImageFilterBase/ApplyKernelToEveryPixelInNonZeroImage/Code.cxx +++ b/src/Filtering/ImageFilterBase/ApplyKernelToEveryPixelInNonZeroImage/Code.cxx @@ -44,9 +44,8 @@ main() using SobelOperatorType = itk::SobelOperator; SobelOperatorType sobelOperator; - itk::Size<2> radius; - radius.Fill(1); // a radius of 1x1 creates a 3x3 operator - sobelOperator.SetDirection(0); // Create the operator for the X axis derivative + auto radius = itk::Size<2>::Filled(1); // a radius of 1x1 creates a 3x3 operator + sobelOperator.SetDirection(0); // Create the operator for the X axis derivative sobelOperator.CreateToRadius(radius); // Visualize mask image @@ -112,8 +111,7 @@ CreateImage(UnsignedCharImageType::Pointer image) { itk::Index<2> start{}; - itk::Size<2> size; - size.Fill(100); + auto size = itk::Size<2>::Filled(100); itk::ImageRegion<2> region(start, size); diff --git a/src/Filtering/ImageFilterBase/ComputeLocalNoise/Code.cxx b/src/Filtering/ImageFilterBase/ComputeLocalNoise/Code.cxx index 09178d50e..19514c9ae 100644 --- a/src/Filtering/ImageFilterBase/ComputeLocalNoise/Code.cxx +++ b/src/Filtering/ImageFilterBase/ComputeLocalNoise/Code.cxx @@ -47,8 +47,7 @@ CreateImage(ImageType::Pointer image) // Create an image that is mostly constant but has some different kinds of objects. ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region(start, size); @@ -71,8 +70,7 @@ CreateImage(ImageType::Pointer image) } // Create a rogue white pixel - ImageType::IndexType pixel; - pixel.Fill(20); + auto pixel = ImageType::IndexType::Filled(20); image->SetPixel(pixel, 255); itk::WriteImage(image, "input.mhd"); diff --git a/src/Filtering/ImageFilterBase/CustomOperationToCorrespondingPixelsInTwoImages/Code.cxx b/src/Filtering/ImageFilterBase/CustomOperationToCorrespondingPixelsInTwoImages/Code.cxx index 14a33df42..d10d1fcb6 100644 --- a/src/Filtering/ImageFilterBase/CustomOperationToCorrespondingPixelsInTwoImages/Code.cxx +++ b/src/Filtering/ImageFilterBase/CustomOperationToCorrespondingPixelsInTwoImages/Code.cxx @@ -94,8 +94,7 @@ CreateImage(ImageType::Pointer image) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(10); + auto size = ImageType::SizeType::Filled(10); ImageType::RegionType region(start, size); image->SetRegions(region); diff --git a/src/Filtering/ImageFilterBase/PredefinedOperationToCorrespondingPixelsInTwoImages/Code.cxx b/src/Filtering/ImageFilterBase/PredefinedOperationToCorrespondingPixelsInTwoImages/Code.cxx index 996692544..6e4749e36 100644 --- a/src/Filtering/ImageFilterBase/PredefinedOperationToCorrespondingPixelsInTwoImages/Code.cxx +++ b/src/Filtering/ImageFilterBase/PredefinedOperationToCorrespondingPixelsInTwoImages/Code.cxx @@ -60,8 +60,7 @@ CreateImage(ImageType::Pointer image) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(10); + auto size = ImageType::SizeType::Filled(10); ImageType::RegionType region(start, size); image->SetRegions(region); diff --git a/src/Filtering/ImageFusion/ColorBoundariesOfRegions/Code.cxx b/src/Filtering/ImageFusion/ColorBoundariesOfRegions/Code.cxx index febedafdb..41ab2bf35 100644 --- a/src/Filtering/ImageFusion/ColorBoundariesOfRegions/Code.cxx +++ b/src/Filtering/ImageFusion/ColorBoundariesOfRegions/Code.cxx @@ -65,8 +65,7 @@ CreateImage(ImageType::Pointer image) // Create a black image with a white square ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Filtering/ImageFusion/ColorLabeledRegions/Code.cxx b/src/Filtering/ImageFusion/ColorLabeledRegions/Code.cxx index ac6b75ac3..d8914b647 100644 --- a/src/Filtering/ImageFusion/ColorLabeledRegions/Code.cxx +++ b/src/Filtering/ImageFusion/ColorLabeledRegions/Code.cxx @@ -60,8 +60,7 @@ CreateImage(ImageType::Pointer image) // Create a black image with a white square ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Filtering/ImageFusion/OverlayLabelMapOnImage/Code.cxx b/src/Filtering/ImageFusion/OverlayLabelMapOnImage/Code.cxx index 64835d2eb..9348a81ac 100644 --- a/src/Filtering/ImageFusion/OverlayLabelMapOnImage/Code.cxx +++ b/src/Filtering/ImageFusion/OverlayLabelMapOnImage/Code.cxx @@ -65,8 +65,7 @@ CreateImage(ImageType::Pointer image) // Create a black image with a white square ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Filtering/ImageGrid/FitSplineIntoPointSet/Code.cxx b/src/Filtering/ImageGrid/FitSplineIntoPointSet/Code.cxx index 88e238526..1966d5eba 100644 --- a/src/Filtering/ImageGrid/FitSplineIntoPointSet/Code.cxx +++ b/src/Filtering/ImageGrid/FitSplineIntoPointSet/Code.cxx @@ -91,9 +91,8 @@ main() // The output will consist of a 1-D image where each voxel contains the // (x,y,z) locations of the points using OutputImageType = itk::Image; - auto outputImage = OutputImageType::New(); - OutputImageType::SizeType size; - size.Fill(200); + auto outputImage = OutputImageType::New(); + auto size = OutputImageType::SizeType::Filled(200); OutputImageType::IndexType start{}; diff --git a/src/Filtering/ImageGrid/PadAnImageWithAConstant/Code.cxx b/src/Filtering/ImageGrid/PadAnImageWithAConstant/Code.cxx index 1df566111..84a981e06 100644 --- a/src/Filtering/ImageGrid/PadAnImageWithAConstant/Code.cxx +++ b/src/Filtering/ImageGrid/PadAnImageWithAConstant/Code.cxx @@ -41,11 +41,9 @@ main(int argc, char * argv[]) const auto input = itk::ReadImage(argv[1]); - ImageType::SizeType lowerExtendRegion; - lowerExtendRegion.Fill(std::stoi(argv[3])); + auto lowerExtendRegion = ImageType::SizeType::Filled(std::stoi(argv[3])); - ImageType::SizeType upperExtendRegion; - upperExtendRegion.Fill(std::stoi(argv[4])); + auto upperExtendRegion = ImageType::SizeType::Filled(std::stoi(argv[4])); using FilterType = itk::ConstantPadImageFilter; auto filter = FilterType::New(); diff --git a/src/Filtering/ImageGrid/RunImageFilterOnRegionOfImage/Code.cxx b/src/Filtering/ImageGrid/RunImageFilterOnRegionOfImage/Code.cxx index acab40732..54bd7dac0 100644 --- a/src/Filtering/ImageGrid/RunImageFilterOnRegionOfImage/Code.cxx +++ b/src/Filtering/ImageGrid/RunImageFilterOnRegionOfImage/Code.cxx @@ -50,9 +50,8 @@ main(int argc, char * argv[]) const auto input = itk::ReadImage(inputFileName); // Create and setup a median filter - auto medianFilter = FilterType::New(); - FilterType::InputSizeType radius; - radius.Fill(2); + auto medianFilter = FilterType::New(); + auto radius = FilterType::InputSizeType::Filled(2); if (argc > 2) { radius.Fill(atoi(argv[2])); diff --git a/src/Filtering/ImageGrid/ShrinkImage/Code.cxx b/src/Filtering/ImageGrid/ShrinkImage/Code.cxx index 2338b707f..79144abcc 100644 --- a/src/Filtering/ImageGrid/ShrinkImage/Code.cxx +++ b/src/Filtering/ImageGrid/ShrinkImage/Code.cxx @@ -52,8 +52,7 @@ CreateImage(ImageType::Pointer image) // Create an image with 2 connected components ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region(start, size); image->SetRegions(region); diff --git a/src/Filtering/ImageIntensity/AddConstantToEveryPixel/Code.cxx b/src/Filtering/ImageIntensity/AddConstantToEveryPixel/Code.cxx index d0d68156d..e91aa498d 100644 --- a/src/Filtering/ImageIntensity/AddConstantToEveryPixel/Code.cxx +++ b/src/Filtering/ImageIntensity/AddConstantToEveryPixel/Code.cxx @@ -45,8 +45,7 @@ CreateImage(ImageType::Pointer image) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Filtering/ImageIntensity/ApplyAtanImageFilter/Code.cxx b/src/Filtering/ImageIntensity/ApplyAtanImageFilter/Code.cxx index 7db777245..e7494c5ed 100644 --- a/src/Filtering/ImageIntensity/ApplyAtanImageFilter/Code.cxx +++ b/src/Filtering/ImageIntensity/ApplyAtanImageFilter/Code.cxx @@ -38,8 +38,7 @@ main(int argc, char * argv[]) using InputImageType = itk::Image; - InputImageType::SizeType size; - size.Fill(100); + auto size = InputImageType::SizeType::Filled(100); using RandomImageSourceType = itk::RandomImageSource; diff --git a/src/Filtering/ImageIntensity/BinaryANDTwoImages/Code.cxx b/src/Filtering/ImageIntensity/BinaryANDTwoImages/Code.cxx index 136325964..0a6add525 100644 --- a/src/Filtering/ImageIntensity/BinaryANDTwoImages/Code.cxx +++ b/src/Filtering/ImageIntensity/BinaryANDTwoImages/Code.cxx @@ -57,8 +57,7 @@ CreateImage1(ImageType::Pointer image) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region; region.SetSize(size); @@ -89,8 +88,7 @@ CreateImage2(ImageType::Pointer image) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Filtering/ImageIntensity/BinaryORTwoImages/Code.cxx b/src/Filtering/ImageIntensity/BinaryORTwoImages/Code.cxx index e629b173d..16fd3645a 100644 --- a/src/Filtering/ImageIntensity/BinaryORTwoImages/Code.cxx +++ b/src/Filtering/ImageIntensity/BinaryORTwoImages/Code.cxx @@ -56,8 +56,7 @@ CreateImage1(ImageType::Pointer image) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region; region.SetSize(size); @@ -88,8 +87,7 @@ CreateImage2(ImageType::Pointer image) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Filtering/ImageIntensity/BinaryXORTwoImages/Code.cxx b/src/Filtering/ImageIntensity/BinaryXORTwoImages/Code.cxx index 465d087d5..61ed419b5 100644 --- a/src/Filtering/ImageIntensity/BinaryXORTwoImages/Code.cxx +++ b/src/Filtering/ImageIntensity/BinaryXORTwoImages/Code.cxx @@ -52,8 +52,7 @@ CreateImage1(ImageType::Pointer image) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region; region.SetSize(size); @@ -84,8 +83,7 @@ CreateImage2(ImageType::Pointer image) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Filtering/ImageIntensity/CompareTwoImagesAndSetOutputPixelToMax/Code.cxx b/src/Filtering/ImageIntensity/CompareTwoImagesAndSetOutputPixelToMax/Code.cxx index 645ffd62f..354acfc78 100644 --- a/src/Filtering/ImageIntensity/CompareTwoImagesAndSetOutputPixelToMax/Code.cxx +++ b/src/Filtering/ImageIntensity/CompareTwoImagesAndSetOutputPixelToMax/Code.cxx @@ -50,8 +50,7 @@ CreateImage1(ImageType * image) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region; region.SetSize(size); @@ -82,8 +81,7 @@ CreateImage2(ImageType * image) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Filtering/ImageIntensity/CompareTwoImagesAndSetOutputPixelToMin/Code.cxx b/src/Filtering/ImageIntensity/CompareTwoImagesAndSetOutputPixelToMin/Code.cxx index 69023d249..fe2284a82 100644 --- a/src/Filtering/ImageIntensity/CompareTwoImagesAndSetOutputPixelToMin/Code.cxx +++ b/src/Filtering/ImageIntensity/CompareTwoImagesAndSetOutputPixelToMin/Code.cxx @@ -50,8 +50,7 @@ CreateImage1(ImageType * image) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region; region.SetSize(size); @@ -82,8 +81,7 @@ CreateImage2(ImageType * image) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Filtering/ImageIntensity/ComputeEdgePotential/Code.cxx b/src/Filtering/ImageIntensity/ComputeEdgePotential/Code.cxx index 9ef8a1e08..4445a437c 100644 --- a/src/Filtering/ImageIntensity/ComputeEdgePotential/Code.cxx +++ b/src/Filtering/ImageIntensity/ComputeEdgePotential/Code.cxx @@ -71,8 +71,7 @@ CreateImage(UnsignedCharImageType::Pointer image) UnsignedCharImageType::IndexType start{}; - UnsignedCharImageType::SizeType size; - size.Fill(200); + auto size = UnsignedCharImageType::SizeType::Filled(200); UnsignedCharImageType::RegionType region(start, size); image->SetRegions(region); diff --git a/src/Filtering/ImageIntensity/ExtractComponentOfVectorImage/Code.cxx b/src/Filtering/ImageIntensity/ExtractComponentOfVectorImage/Code.cxx index 93693620a..541981711 100644 --- a/src/Filtering/ImageIntensity/ExtractComponentOfVectorImage/Code.cxx +++ b/src/Filtering/ImageIntensity/ExtractComponentOfVectorImage/Code.cxx @@ -50,8 +50,7 @@ CreateImage(VectorImageType::Pointer image) { VectorImageType::IndexType start{}; - VectorImageType::SizeType size; - size.Fill(2); + auto size = VectorImageType::SizeType::Filled(2); VectorImageType::RegionType region(start, size); diff --git a/src/Filtering/ImageIntensity/IntensityWindowing/Code.cxx b/src/Filtering/ImageIntensity/IntensityWindowing/Code.cxx index 39bc2ac2b..d26f528fa 100644 --- a/src/Filtering/ImageIntensity/IntensityWindowing/Code.cxx +++ b/src/Filtering/ImageIntensity/IntensityWindowing/Code.cxx @@ -51,8 +51,7 @@ CreateImage(ImageType::Pointer image) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region(start, size); diff --git a/src/Filtering/ImageIntensity/InverseOfMaskToImage/Code.cxx b/src/Filtering/ImageIntensity/InverseOfMaskToImage/Code.cxx index 67dd9da64..6f49f35f9 100644 --- a/src/Filtering/ImageIntensity/InverseOfMaskToImage/Code.cxx +++ b/src/Filtering/ImageIntensity/InverseOfMaskToImage/Code.cxx @@ -80,8 +80,7 @@ CreateImage(ImageType::Pointer image) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region(start, size); diff --git a/src/Filtering/ImageIntensity/ScalePixelSumToConstant/Code.cxx b/src/Filtering/ImageIntensity/ScalePixelSumToConstant/Code.cxx index 81ab7acaa..0a112fa59 100644 --- a/src/Filtering/ImageIntensity/ScalePixelSumToConstant/Code.cxx +++ b/src/Filtering/ImageIntensity/ScalePixelSumToConstant/Code.cxx @@ -59,8 +59,7 @@ CreateImage(ImageType::Pointer image) ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(3); + auto size = ImageType::SizeType::Filled(3); ImageType::RegionType region(start, size); diff --git a/src/Filtering/ImageIntensity/SquareEveryPixel/Code.cxx b/src/Filtering/ImageIntensity/SquareEveryPixel/Code.cxx index d50ee6a33..b02bd8885 100644 --- a/src/Filtering/ImageIntensity/SquareEveryPixel/Code.cxx +++ b/src/Filtering/ImageIntensity/SquareEveryPixel/Code.cxx @@ -44,8 +44,7 @@ CreateImage(ImageType::Pointer image) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Filtering/ImageIntensity/SubtractConstantFromEveryPixel/Code.cxx b/src/Filtering/ImageIntensity/SubtractConstantFromEveryPixel/Code.cxx index 3a7791de5..aeb7c6285 100644 --- a/src/Filtering/ImageIntensity/SubtractConstantFromEveryPixel/Code.cxx +++ b/src/Filtering/ImageIntensity/SubtractConstantFromEveryPixel/Code.cxx @@ -45,8 +45,7 @@ CreateImage(ImageType::Pointer image) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Filtering/ImageLabel/ExtractInnerAndOuterBoundariesOfBlobsInBinaryImage/Code.cxx b/src/Filtering/ImageLabel/ExtractInnerAndOuterBoundariesOfBlobsInBinaryImage/Code.cxx index c4936569b..3685e58a4 100644 --- a/src/Filtering/ImageLabel/ExtractInnerAndOuterBoundariesOfBlobsInBinaryImage/Code.cxx +++ b/src/Filtering/ImageLabel/ExtractInnerAndOuterBoundariesOfBlobsInBinaryImage/Code.cxx @@ -73,8 +73,7 @@ CreateImage(ImageType::Pointer image) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(20); + auto size = ImageType::SizeType::Filled(20); ImageType::RegionType region(start, size); diff --git a/src/Filtering/ImageStatistics/AdaptiveHistogramEqualizationImageFilter/Code.cxx b/src/Filtering/ImageStatistics/AdaptiveHistogramEqualizationImageFilter/Code.cxx index 941a45258..e796732f6 100644 --- a/src/Filtering/ImageStatistics/AdaptiveHistogramEqualizationImageFilter/Code.cxx +++ b/src/Filtering/ImageStatistics/AdaptiveHistogramEqualizationImageFilter/Code.cxx @@ -47,9 +47,8 @@ main(int argc, char * argv[]) float beta = std::stod(argv[4]); adaptiveHistogramEqualizationImageFilter->SetBeta(beta); - int radiusSize = std::stoi(argv[5]); - AdaptiveHistogramEqualizationImageFilterType::ImageSizeType radius; - radius.Fill(radiusSize); + int radiusSize = std::stoi(argv[5]); + auto radius = AdaptiveHistogramEqualizationImageFilterType::ImageSizeType::Filled(radiusSize); adaptiveHistogramEqualizationImageFilter->SetRadius(radius); adaptiveHistogramEqualizationImageFilter->SetInput(input); diff --git a/src/Filtering/ImageStatistics/StatisticalPropertiesOfRegions/Code.cxx b/src/Filtering/ImageStatistics/StatisticalPropertiesOfRegions/Code.cxx index 6c6132f5c..a6609916a 100644 --- a/src/Filtering/ImageStatistics/StatisticalPropertiesOfRegions/Code.cxx +++ b/src/Filtering/ImageStatistics/StatisticalPropertiesOfRegions/Code.cxx @@ -85,8 +85,7 @@ CreateImage(ImageType::Pointer image) // Create a black image with a white square ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(20); + auto size = ImageType::SizeType::Filled(20); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Filtering/LabelMap/ConvertLabelMapToImage/Code.cxx b/src/Filtering/LabelMap/ConvertLabelMapToImage/Code.cxx index 925b58135..dd26611e8 100644 --- a/src/Filtering/LabelMap/ConvertLabelMapToImage/Code.cxx +++ b/src/Filtering/LabelMap/ConvertLabelMapToImage/Code.cxx @@ -51,8 +51,7 @@ CreateImage(ImageType::Pointer image) // Create a black image with a white square ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(20); + auto size = ImageType::SizeType::Filled(20); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Filtering/LabelMap/InvertImageUsingBinaryNot/Code.cxx b/src/Filtering/LabelMap/InvertImageUsingBinaryNot/Code.cxx index 39eae1144..733c40998 100644 --- a/src/Filtering/LabelMap/InvertImageUsingBinaryNot/Code.cxx +++ b/src/Filtering/LabelMap/InvertImageUsingBinaryNot/Code.cxx @@ -51,8 +51,7 @@ CreateImage(ImageType::Pointer image) { ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Filtering/LabelMap/KeepRegionsAboveLevel/Code.cxx b/src/Filtering/LabelMap/KeepRegionsAboveLevel/Code.cxx index ee4434518..f3ea16b78 100644 --- a/src/Filtering/LabelMap/KeepRegionsAboveLevel/Code.cxx +++ b/src/Filtering/LabelMap/KeepRegionsAboveLevel/Code.cxx @@ -77,8 +77,7 @@ CreateImage(ImageType::Pointer image) // Create a black image with three white squares ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(200); + auto size = ImageType::SizeType::Filled(200); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Filtering/LabelMap/KeepRegionsThatMeetSpecific/Code.cxx b/src/Filtering/LabelMap/KeepRegionsThatMeetSpecific/Code.cxx index 4cdc92fd3..953ec8d2e 100644 --- a/src/Filtering/LabelMap/KeepRegionsThatMeetSpecific/Code.cxx +++ b/src/Filtering/LabelMap/KeepRegionsThatMeetSpecific/Code.cxx @@ -79,8 +79,7 @@ CreateImage(ImageType::Pointer image) // Create a black image with three white squares ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(200); + auto size = ImageType::SizeType::Filled(200); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Filtering/LabelMap/LabelBinaryRegionsAndGetProperties/Code.cxx b/src/Filtering/LabelMap/LabelBinaryRegionsAndGetProperties/Code.cxx index cd1a730f8..0f0490ab1 100644 --- a/src/Filtering/LabelMap/LabelBinaryRegionsAndGetProperties/Code.cxx +++ b/src/Filtering/LabelMap/LabelBinaryRegionsAndGetProperties/Code.cxx @@ -62,8 +62,7 @@ CreateImage(ImageType::Pointer image) // Create a black image with a white square ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(20); + auto size = ImageType::SizeType::Filled(20); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Filtering/LabelMap/LabelBinaryRegionsInImage/Code.cxx b/src/Filtering/LabelMap/LabelBinaryRegionsInImage/Code.cxx index a16b617e1..c1af50bfe 100644 --- a/src/Filtering/LabelMap/LabelBinaryRegionsInImage/Code.cxx +++ b/src/Filtering/LabelMap/LabelBinaryRegionsInImage/Code.cxx @@ -62,8 +62,7 @@ CreateImage(ImageType::Pointer image) // Create a black image with a white square ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(20); + auto size = ImageType::SizeType::Filled(20); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Filtering/LabelMap/MaskOneImageGivenLabelMap/Code.cxx b/src/Filtering/LabelMap/MaskOneImageGivenLabelMap/Code.cxx index f0149237d..351fb903f 100644 --- a/src/Filtering/LabelMap/MaskOneImageGivenLabelMap/Code.cxx +++ b/src/Filtering/LabelMap/MaskOneImageGivenLabelMap/Code.cxx @@ -92,8 +92,7 @@ main(int argc, char * argv[]) // The crop border defaults to 0, and the image is not cropped by default. filter->SetCrop(crop); - FilterType::SizeType border; - border.Fill(borderSize); + auto border = FilterType::SizeType::Filled(borderSize); filter->SetCropBorder(border); diff --git a/src/Filtering/LabelMap/RemoveLabelsFromLabelMap/Code.cxx b/src/Filtering/LabelMap/RemoveLabelsFromLabelMap/Code.cxx index ee0748520..8173dedd8 100644 --- a/src/Filtering/LabelMap/RemoveLabelsFromLabelMap/Code.cxx +++ b/src/Filtering/LabelMap/RemoveLabelsFromLabelMap/Code.cxx @@ -79,8 +79,7 @@ CreateImage(ImageType::Pointer image) // Create a black image with a white square ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(20); + auto size = ImageType::SizeType::Filled(20); ImageType::RegionType region(start, size); image->SetRegions(region); diff --git a/src/Filtering/Path/ExtractContoursFromImage/Code.cxx b/src/Filtering/Path/ExtractContoursFromImage/Code.cxx index 5ac88b0fe..82c3ce517 100644 --- a/src/Filtering/Path/ExtractContoursFromImage/Code.cxx +++ b/src/Filtering/Path/ExtractContoursFromImage/Code.cxx @@ -72,8 +72,7 @@ CreateImage(UnsignedCharImageType::Pointer image) // Create an image itk::Index<2> start{}; - itk::Size<2> size; - size.Fill(100); + auto size = itk::Size<2>::Filled(100); itk::ImageRegion<2> region(start, size); image->SetRegions(region); @@ -83,8 +82,7 @@ CreateImage(UnsignedCharImageType::Pointer image) // Create a line of white pixels for (unsigned int i = 40; i < 60; ++i) { - itk::Index<2> pixel; - pixel.Fill(i); + auto pixel = itk::Index<2>::Filled(i); image->SetPixel(pixel, 255); } diff --git a/src/Filtering/Smoothing/MeanFilteringOfAnImage/Code.cxx b/src/Filtering/Smoothing/MeanFilteringOfAnImage/Code.cxx index c9cde2c95..fa23ca3c6 100644 --- a/src/Filtering/Smoothing/MeanFilteringOfAnImage/Code.cxx +++ b/src/Filtering/Smoothing/MeanFilteringOfAnImage/Code.cxx @@ -45,8 +45,7 @@ main(int argc, char * argv[]) using FilterType = itk::MeanImageFilter; auto meanFilter = FilterType::New(); - FilterType::InputSizeType radius; - radius.Fill(radiusValue); + auto radius = FilterType::InputSizeType::Filled(radiusValue); meanFilter->SetRadius(radius); meanFilter->SetInput(input); diff --git a/src/Filtering/Smoothing/MedianFilteringOfAnImage/Code.cxx b/src/Filtering/Smoothing/MedianFilteringOfAnImage/Code.cxx index e41415fb1..f6a948c54 100644 --- a/src/Filtering/Smoothing/MedianFilteringOfAnImage/Code.cxx +++ b/src/Filtering/Smoothing/MedianFilteringOfAnImage/Code.cxx @@ -45,8 +45,7 @@ main(int argc, char * argv[]) using FilterType = itk::MedianImageFilter; auto medianFilter = FilterType::New(); - FilterType::InputSizeType radius; - radius.Fill(radiusValue); + auto radius = FilterType::InputSizeType::Filled(radiusValue); medianFilter->SetRadius(radius); medianFilter->SetInput(input); diff --git a/src/Filtering/Smoothing/MedianFilteringOfAnRGBImage/Code.cxx b/src/Filtering/Smoothing/MedianFilteringOfAnRGBImage/Code.cxx index dae0948f0..ddd1c8983 100644 --- a/src/Filtering/Smoothing/MedianFilteringOfAnRGBImage/Code.cxx +++ b/src/Filtering/Smoothing/MedianFilteringOfAnRGBImage/Code.cxx @@ -76,8 +76,7 @@ main(int argc, char * argv[]) using FilterType = itk::MedianImageFilter; auto medianFilter = FilterType::New(); - FilterType::InputSizeType radius; - radius.Fill(std::stoi(argv[3])); + auto radius = FilterType::InputSizeType::Filled(std::stoi(argv[3])); medianFilter->SetRadius(radius); medianFilter->SetInput(input); diff --git a/src/Filtering/Thresholding/SeparateGroundUsingOtsu/Code.cxx b/src/Filtering/Thresholding/SeparateGroundUsingOtsu/Code.cxx index f10c0948d..a0a55a6bf 100644 --- a/src/Filtering/Thresholding/SeparateGroundUsingOtsu/Code.cxx +++ b/src/Filtering/Thresholding/SeparateGroundUsingOtsu/Code.cxx @@ -77,8 +77,7 @@ CreateImage(ImageType::Pointer image) // Create an image ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Nonunit/Review/GeometricPropertiesOfRegion/Code.cxx b/src/Nonunit/Review/GeometricPropertiesOfRegion/Code.cxx index eab5315f2..3ea2b2ccc 100644 --- a/src/Nonunit/Review/GeometricPropertiesOfRegion/Code.cxx +++ b/src/Nonunit/Review/GeometricPropertiesOfRegion/Code.cxx @@ -146,8 +146,7 @@ CreateIntensityImage(ImageType::Pointer image) // Create a random image. ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(20); + auto size = ImageType::SizeType::Filled(20); ImageType::RegionType region; region.SetSize(size); @@ -173,8 +172,7 @@ CreateLabelImage(ImageType::Pointer image) // Create a black image with labeled squares. ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(20); + auto size = ImageType::SizeType::Filled(20); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Numerics/Statistics/ComputeTextureFeatures/Code.cxx b/src/Numerics/Statistics/ComputeTextureFeatures/Code.cxx index 1c6e193d8..a523a93ce 100644 --- a/src/Numerics/Statistics/ComputeTextureFeatures/Code.cxx +++ b/src/Numerics/Statistics/ComputeTextureFeatures/Code.cxx @@ -48,8 +48,7 @@ CreateImage(ImageType::Pointer image) { itk::Index<2> index{}; - itk::Size<2> size; - size.Fill(100); + auto size = itk::Size<2>::Filled(100); itk::ImageRegion<2> region(index, size); image->SetRegions(region); diff --git a/src/Registration/Common/MatchFeaturePoints/Code.cxx b/src/Registration/Common/MatchFeaturePoints/Code.cxx index 8d7dcd6fc..718cbab59 100644 --- a/src/Registration/Common/MatchFeaturePoints/Code.cxx +++ b/src/Registration/Common/MatchFeaturePoints/Code.cxx @@ -81,9 +81,8 @@ void CreateImage(ImageType::Pointer image, const unsigned int x) { // Allocate empty image - itk::Index<2> start{}; - itk::Size<2> size; - size.Fill(100); + itk::Index<2> start{}; + auto size = itk::Size<2>::Filled(100); ImageType::RegionType region(start, size); image->SetRegions(region); image->Allocate(); diff --git a/src/Registration/Common/MultiresolutionPyramidFromImage/Code.cxx b/src/Registration/Common/MultiresolutionPyramidFromImage/Code.cxx index 22ba9d5c8..b0b51d389 100644 --- a/src/Registration/Common/MultiresolutionPyramidFromImage/Code.cxx +++ b/src/Registration/Common/MultiresolutionPyramidFromImage/Code.cxx @@ -71,8 +71,7 @@ CreateImage(UnsignedCharImageType::Pointer image) UnsignedCharImageType::IndexType start{}; - UnsignedCharImageType::SizeType size; - size.Fill(200); + auto size = UnsignedCharImageType::SizeType::Filled(200); UnsignedCharImageType::RegionType region(start, size); image->SetRegions(region); diff --git a/src/Registration/Common/RegisterImageToAnotherUsingLandmarks/Code.cxx b/src/Registration/Common/RegisterImageToAnotherUsingLandmarks/Code.cxx index 2b89148e5..50599e3e7 100644 --- a/src/Registration/Common/RegisterImageToAnotherUsingLandmarks/Code.cxx +++ b/src/Registration/Common/RegisterImageToAnotherUsingLandmarks/Code.cxx @@ -112,8 +112,7 @@ CreateFixedImage(ImageType::Pointer image) // Create a black image with a white square ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region; region.SetSize(size); @@ -145,8 +144,7 @@ CreateMovingImage(ImageType::Pointer image) // Create a black image with a white square ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region; region.SetSize(size); diff --git a/src/Segmentation/LabelVoting/IterativeHoleFilling/Code.cxx b/src/Segmentation/LabelVoting/IterativeHoleFilling/Code.cxx index 33891e7d2..4a4e68c83 100644 --- a/src/Segmentation/LabelVoting/IterativeHoleFilling/Code.cxx +++ b/src/Segmentation/LabelVoting/IterativeHoleFilling/Code.cxx @@ -47,8 +47,7 @@ main(int argc, char * argv[]) const auto input = itk::ReadImage(inputFileName); using FilterType = itk::VotingBinaryIterativeHoleFillingImageFilter; - FilterType::InputSizeType radius; - radius.Fill(r); + auto radius = FilterType::InputSizeType::Filled(r); auto filter = FilterType::New(); filter->SetInput(input); diff --git a/src/Segmentation/Voronoi/VoronoiDiagram/Code.cxx b/src/Segmentation/Voronoi/VoronoiDiagram/Code.cxx index 050fd1f7e..094415851 100644 --- a/src/Segmentation/Voronoi/VoronoiDiagram/Code.cxx +++ b/src/Segmentation/Voronoi/VoronoiDiagram/Code.cxx @@ -123,8 +123,7 @@ main() ImageType::IndexType start{}; - ImageType::SizeType size; - size.Fill(100); + auto size = ImageType::SizeType::Filled(100); ImageType::RegionType region(start, size); diff --git a/src/Segmentation/Watersheds/MorphologicalWatershedSegmentation/Code.cxx b/src/Segmentation/Watersheds/MorphologicalWatershedSegmentation/Code.cxx index 074f3b841..47e9cf54b 100644 --- a/src/Segmentation/Watersheds/MorphologicalWatershedSegmentation/Code.cxx +++ b/src/Segmentation/Watersheds/MorphologicalWatershedSegmentation/Code.cxx @@ -96,8 +96,7 @@ CreateImage(UnsignedCharImageType::Pointer image) itk::Index<2> start{}; - itk::Size<2> size; - size.Fill(200); + auto size = itk::Size<2>::Filled(200); itk::ImageRegion<2> region(start, size); image->SetRegions(region);