Hi,
I want to be able to convert (to 8-bit) and compress large 16-bit grayscale 3D images. I’ve been sent a sample file, 10GB, created by cropping a bigger file using ImageJ. The image, which can be viewed in ImageJ, is 3219 x 1820 x 929. When I attempt to read it using itk::ImageFileReader it tells me that the image is 3219 x 1820 x 1. Here is the relevant code (using ITK 4.5.2):
#include “itkImage.h”
#include “itkImageFileReader.h”
#include “itkImageFileWriter.h”
#include “itkSize.h”
typedef itk::Image<unsigned short,3> ImageType_u16;
ImageType_u16::Pointer im_16;
…
typedef itk::ImageFileReader<ImageType_u16> FileReaderType_u16;
FileReaderType_u16::Pointer reader = FileReaderType_u16::New();
reader->SetFileName(argv[1]);
try
{
reader->Update();
}
catch (itk::ExceptionObject &e)
{
std::cout << e << std::endl;
return 3;
}
im_16 = reader->GetOutput();
width = im_16->GetLargestPossibleRegion().GetSize()[0];
height = im_16->GetLargestPossibleRegion().GetSize()[1];
depth = im_16->GetLargestPossibleRegion().GetSize()[2];
printf("Image dimensions: width, height, depth: %d %d %d\n",width,height,depth);
Am I doing something wrong, or is this a limitation of this ITK version? The code works on a 880MB file.
Thanks, Gib