File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Modules/Filtering/ImageGrid/test Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1919#include " itkOrientImageFilter.h"
2020#include " itkImageToImageFilter.h"
2121#include " itkTestingMacros.h"
22- #include " vnl/vnl_sample.h "
22+ #include < random > // For mt19937.
2323
2424using ImageType = itk::Image<unsigned int , 3 >;
2525
@@ -32,10 +32,14 @@ CreateRandomImage()
3232 auto img = ImageType::New ();
3333 img->SetRegions (region);
3434 img->Allocate ();
35+
36+ std::mt19937 randomNumberEngine{};
37+ std::uniform_int_distribution<unsigned int > randomNumberDistribution (0 , 32767 );
38+
3539 itk::ImageRegionIterator<ImageType> ri (img, region);
3640 while (!ri.IsAtEnd ())
3741 {
38- ri.Set (static_cast < unsigned int >( vnl_sample_uniform ( 0 , 32767 ) ));
42+ ri.Set (randomNumberDistribution (randomNumberEngine ));
3943 ++ri;
4044 }
4145 return img;
You can’t perform that action at this time.
0 commit comments