Skip to content

Commit

Permalink
ENH: less memory pressure in itkNiftiLargeImageRegionReadTest
Browse files Browse the repository at this point in the history
Significantly reduce memory usage of the test.
  • Loading branch information
issakomi authored and hjmjohnson committed Nov 17, 2022
1 parent 54f4306 commit 55dad2b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Modules/IO/NIFTI/test/itkNiftiLargeImageRegionReadTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ itkNiftiLargeImageRegionReadTest(int argc, char * argv[])
return EXIT_FAILURE;
}

const std::string fname{ argv[1] };

constexpr int Dimension = 3;
using PixelType = unsigned short;
Expand All @@ -43,13 +44,12 @@ itkNiftiLargeImageRegionReadTest(int argc, char * argv[])
ImageType::RegionType region;
region.SetSize(size);

auto image = ImageType::New();
image->SetRegions(region);
image->Allocate(true);

const std::string fname{ argv[1] };
itk::WriteImage(image, fname);

{
auto image = ImageType::New();
image->SetRegions(region);
image->Allocate(true);
itk::WriteImage(image, fname);
}

using ReaderType = itk::ImageFileReader<ImageType>;
auto reader = ReaderType::New();
Expand Down

0 comments on commit 55dad2b

Please sign in to comment.