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/CreateAnImageRegion/Code.cxx b/src/Core/Common/CreateAnImageRegion/Code.cxx index 29deed7fd..c249a28d8 100644 --- a/src/Core/Common/CreateAnImageRegion/Code.cxx +++ b/src/Core/Common/CreateAnImageRegion/Code.cxx @@ -26,8 +26,7 @@ main() using RegionType = itk::ImageRegion; 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/CropImageBySpecifyingRegion/Code.cxx b/src/Core/Common/CropImageBySpecifyingRegion/Code.cxx index 6f025cdf1..ed8cf2654 100644 --- a/src/Core/Common/CropImageBySpecifyingRegion/Code.cxx +++ b/src/Core/Common/CropImageBySpecifyingRegion/Code.cxx @@ -38,8 +38,7 @@ main() std::cout << "Image largest region: " << image->GetLargestPossibleRegion() << std::endl; - ImageType::IndexType desiredStart; - desiredStart.Fill(3); + auto desiredStart = ImageType::IndexType::Filled(3); auto desiredSize = ImageType::SizeType::Filled(4); @@ -60,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/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/IterateImageStartingAtSeed/Code.cxx b/src/Core/Common/IterateImageStartingAtSeed/Code.cxx index 8c0468805..e0de5060c 100644 --- a/src/Core/Common/IterateImageStartingAtSeed/Code.cxx +++ b/src/Core/Common/IterateImageStartingAtSeed/Code.cxx @@ -73,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/ImageFunction/ComputeMedianOfImageAtPixel/Code.cxx b/src/Core/ImageFunction/ComputeMedianOfImageAtPixel/Code.cxx index 4947dd98d..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; diff --git a/src/Core/ImageFunction/MultiplyKernelWithAnImageAtLocation/Code.cxx b/src/Core/ImageFunction/MultiplyKernelWithAnImageAtLocation/Code.cxx index 51c63d174..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; diff --git a/src/Filtering/Convolution/ColorNormalizedCorrelation/Code.cxx b/src/Filtering/Convolution/ColorNormalizedCorrelation/Code.cxx index 46b6bf66e..c2e8bf468 100644 --- a/src/Filtering/Convolution/ColorNormalizedCorrelation/Code.cxx +++ b/src/Filtering/Convolution/ColorNormalizedCorrelation/Code.cxx @@ -60,8 +60,7 @@ main(int argc, char * argv[]) auto extractFilter = ExtractFilterType::New(); - FloatImageType::IndexType start; - start.Fill(50); + auto start = FloatImageType::IndexType::Filled(50); auto patchSize = FloatImageType::SizeType::Filled(51); diff --git a/src/Filtering/Convolution/NormalizedCorrelation/Code.cxx b/src/Filtering/Convolution/NormalizedCorrelation/Code.cxx index 22fbbebad..96b6e0025 100644 --- a/src/Filtering/Convolution/NormalizedCorrelation/Code.cxx +++ b/src/Filtering/Convolution/NormalizedCorrelation/Code.cxx @@ -49,8 +49,7 @@ main(int argc, char * argv[]) auto extractFilter = ExtractFilterType::New(); - FloatImageType::IndexType start; - start.Fill(50); + auto start = FloatImageType::IndexType::Filled(50); auto patchSize = FloatImageType::SizeType::Filled(51); diff --git a/src/Filtering/DistanceMap/ApproxDistanceMapOfBinary/Code.cxx b/src/Filtering/DistanceMap/ApproxDistanceMapOfBinary/Code.cxx index 0b935c834..1cc089135 100644 --- a/src/Filtering/DistanceMap/ApproxDistanceMapOfBinary/Code.cxx +++ b/src/Filtering/DistanceMap/ApproxDistanceMapOfBinary/Code.cxx @@ -85,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 d573b33d5..db58ee283 100644 --- a/src/Filtering/DistanceMap/MaurerDistanceMapOfBinary/Code.cxx +++ b/src/Filtering/DistanceMap/MaurerDistanceMapOfBinary/Code.cxx @@ -83,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 7398656b1..5d516d870 100644 --- a/src/Filtering/DistanceMap/SignedDistanceMapOfBinary/Code.cxx +++ b/src/Filtering/DistanceMap/SignedDistanceMapOfBinary/Code.cxx @@ -83,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/ImageFeature/ExtractContoursFromImage/Code.cxx b/src/Filtering/ImageFeature/ExtractContoursFromImage/Code.cxx index b948eedb7..a57a92e1a 100644 --- a/src/Filtering/ImageFeature/ExtractContoursFromImage/Code.cxx +++ b/src/Filtering/ImageFeature/ExtractContoursFromImage/Code.cxx @@ -61,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/ImageFilterBase/ComputeLocalNoise/Code.cxx b/src/Filtering/ImageFilterBase/ComputeLocalNoise/Code.cxx index 80beeea9b..19514c9ae 100644 --- a/src/Filtering/ImageFilterBase/ComputeLocalNoise/Code.cxx +++ b/src/Filtering/ImageFilterBase/ComputeLocalNoise/Code.cxx @@ -70,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/Path/ExtractContoursFromImage/Code.cxx b/src/Filtering/Path/ExtractContoursFromImage/Code.cxx index dda16885b..82c3ce517 100644 --- a/src/Filtering/Path/ExtractContoursFromImage/Code.cxx +++ b/src/Filtering/Path/ExtractContoursFromImage/Code.cxx @@ -82,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); }