File tree Expand file tree Collapse file tree 15 files changed +19
-38
lines changed
CropImageBySpecifyingRegion
IterateImageStartingAtSeed
ComputeMedianOfImageAtPixel
MultiplyKernelWithAnImageAtLocation
ColorNormalizedCorrelation
ApproxDistanceMapOfBinary
MaurerDistanceMapOfBinary
SignedDistanceMapOfBinary
ImageFilterBase/ComputeLocalNoise Expand file tree Collapse file tree 15 files changed +19
-38
lines changed Original file line number Diff line number Diff line change 2626{
2727 constexpr unsigned int Dimension = 2 ;
2828
29- itk::Index<Dimension> index;
30- index.Fill (5 );
29+ auto index = itk::Index<Dimension>::Filled (5 );
3130
3231 itk::Offset<Dimension> offset;
3332 offset.Fill (1 );
Original file line number Diff line number Diff line change 2626 using RegionType = itk::ImageRegion<Dimension>;
2727 auto size = RegionType::SizeType::Filled (3 );
2828
29- RegionType::IndexType index;
30- index.Fill (1 );
29+ auto index = RegionType::IndexType::Filled (1 );
3130
3231 RegionType region (index, size);
3332
Original file line number Diff line number Diff line change 3838
3939 std::cout << " Image largest region: " << image->GetLargestPossibleRegion () << std::endl;
4040
41- ImageType::IndexType desiredStart;
42- desiredStart.Fill (3 );
41+ auto desiredStart = ImageType::IndexType::Filled (3 );
4342
4443 auto desiredSize = ImageType::SizeType::Filled (4 );
4544
6059 output->DisconnectPipeline ();
6160 output->FillBuffer (2 );
6261
63- itk::Index<2 > index;
64- index.Fill (5 );
62+ auto index = itk::Index<2 >::Filled (5 );
6563
6664 std::cout << " new largest region: " << output->GetLargestPossibleRegion () << std::endl;
6765 std::cout << " new: " << (int )output->GetPixel (index) << std::endl;
Original file line number Diff line number Diff line change 2525int
2626main ()
2727{
28- itk::Index<2 > pixel1;
29- pixel1.Fill (2 );
28+ auto pixel1 = itk::Index<2 >::Filled (2 );
3029
31- itk::Index<2 > pixel2;
32- pixel2.Fill (4 );
30+ auto pixel2 = itk::Index<2 >::Filled (4 );
3331
3432 itk::Point<double , 2 > p1;
3533 p1[0 ] = pixel1[0 ];
Original file line number Diff line number Diff line change @@ -73,8 +73,7 @@ CreateImage(ImageType::Pointer image)
7373 // Make a line
7474 for (unsigned int i = 20 ; i < 50 ; ++i)
7575 {
76- itk::Index<2 > pixelIndex;
77- pixelIndex.Fill (i);
76+ auto pixelIndex = itk::Index<2 >::Filled (i);
7877
7978 image->SetPixel (pixelIndex, 255 );
8079 }
Original file line number Diff line number Diff line change 3535 auto medianImageFunction = MedianImageFunctionType::New ();
3636 medianImageFunction->SetInputImage (image);
3737
38- itk::Index<2 > index;
39- index.Fill (10 );
38+ auto index = itk::Index<2 >::Filled (10 );
4039 std::cout << " Median at " << index << " is " << static_cast <int >(medianImageFunction->EvaluateAtIndex (index))
4140 << std::endl;
4241 return EXIT_SUCCESS;
Original file line number Diff line number Diff line change @@ -44,24 +44,21 @@ main()
4444 neighborhoodOperatorImageFunction->SetInputImage (image);
4545
4646 {
47- itk::Index<2 > index;
48- index.Fill (20 );
47+ auto index = itk::Index<2 >::Filled (20 );
4948
5049 float output = neighborhoodOperatorImageFunction->EvaluateAtIndex (index);
5150 std::cout << " Sum on border: " << output << std::endl;
5251 }
5352
5453 {
55- itk::Index<2 > index;
56- index.Fill (35 );
54+ auto index = itk::Index<2 >::Filled (35 );
5755
5856 float output = neighborhoodOperatorImageFunction->EvaluateAtIndex (index);
5957 std::cout << " Sum in center: " << output << std::endl;
6058 }
6159
6260 {
63- itk::Index<2 > index;
64- index.Fill (7 );
61+ auto index = itk::Index<2 >::Filled (7 );
6562
6663 float output = neighborhoodOperatorImageFunction->EvaluateAtIndex (index);
6764 std::cout << " Sum outside: " << output << std::endl;
Original file line number Diff line number Diff line change @@ -60,8 +60,7 @@ main(int argc, char * argv[])
6060
6161 auto extractFilter = ExtractFilterType::New ();
6262
63- FloatImageType::IndexType start;
64- start.Fill (50 );
63+ auto start = FloatImageType::IndexType::Filled (50 );
6564
6665 auto patchSize = FloatImageType::SizeType::Filled (51 );
6766
Original file line number Diff line number Diff line change @@ -49,8 +49,7 @@ main(int argc, char * argv[])
4949
5050 auto extractFilter = ExtractFilterType::New ();
5151
52- FloatImageType::IndexType start;
53- start.Fill (50 );
52+ auto start = FloatImageType::IndexType::Filled (50 );
5453
5554 auto patchSize = FloatImageType::SizeType::Filled (51 );
5655
Original file line number Diff line number Diff line change @@ -85,8 +85,7 @@ CreateImage(UnsignedCharImageType::Pointer image)
8585 // Create a line of white pixels
8686 for (unsigned int i = 40 ; i < 60 ; ++i)
8787 {
88- itk::Index<2 > pixel;
89- pixel.Fill (i);
88+ auto pixel = itk::Index<2 >::Filled (i);
9089 image->SetPixel (pixel, 255 );
9190 }
9291}
You can’t perform that action at this time.
0 commit comments