[ITK Community] Problem with multi-image tiff on Linux (ubuntu)
Gib Bogle
g.bogle at auckland.ac.nz
Wed Mar 5 23:24:29 EST 2014
The first thing I tried was to rebuild one of my programs with the CMake option ITK_USE_64BITS_IDS turned on. I added this line to CMakeLists.txt:
set(ITK_USE_64BITS_IDS ON)
The rebuilt program still crashes when I try to read the compressed version of a 4.5GB image.
I did ascertain that the truncation problem I see in Linux with the <1GB file does not occur in Windows.
I am unclear about the need to select USE_SYSTEM_LIBTIFF when building ITK on ubuntu. If that is not selected, what libtiff will be used?
As for the tests, I need to find out out to run these.
Gib
________________________________
From: Bradley Lowekamp [blowekamp at mail.nih.gov]
Sent: Thursday, 6 March 2014 2:55 a.m.
To: Gib Bogle
Cc: community at itk.org
Subject: Re: [ITK Community] Problem with multi-image tiff on Linux (ubuntu)
Hello,
For windows to handle larger than 4GB image the CMake option ITK_USE_64BITS_IDS needs to be turned on. ( In this day and age it really should be turned on by default now. )
I have had similar problems trying to convert large image to tiffs too. Specifically, I recall getting the same type of truncation when trying to convert the Visible Human cyro-slices to big tiff.
I think some serious time needs to be spend looking at itkTIFFImageIO for 64-bit issues, as my casual looks have not turned up anything.
Brad
On Mar 5, 2014, at 3:28 AM, Gib Bogle <g.bogle at auckland.ac.nz<mailto:g.bogle at auckland.ac.nz>> wrote:
I have recently started having to work with big multi-image tiff files, e.g. 4.5 GB. I discovered that ITK on Windows cannot handle such large images, so I am trying to use Linux (64-bit ubuntu 12.10). I managed to build ITK with libtiff5 (actually 4.0.2 I think) which does have bigtiff support, after downloading the latest source code with git, which contains a patch fix for a bug that prevented building. The patch was applied yesterday, so that was a bit of luck.
But there is something screwy happening when I read my multi-image tiff with ITK. After reading the image (which is compressed with Deflate) I look at each z-frame and compute the sum of pixel intensities. After z=346 all the intensities are 0, but I know this is not correct. I can view the frames with Imagemagick's display program, and those at z>346 are not qualitatively different from the earlier ones.
After reading the image in I am using a pointer to the buffer to access the data:
p = (unsigned char *)(im->GetBufferPointer());
then I access the voxel value at (x,y,z) as p[z*xysize+y*width+x]
I have declared x, y, z, width and xysize = width*height all as long int.
Another way to show the problem: When the compressed tiff that looks correct when viewed with Imagemagick-display is read with ITK and then written without compression, the uncompressed version has blank frames for z>346. This tiff has 693 frames, each 601x1380. Exactly the same thing is seen with another tiff that has 693 frames each 779x1380 - again the uncompressed version is blank after frame 346.
I'd be interested to know if anyone else is reading big tiffs with ITK, on Linux.
Thanks
Gib
_______________________________________________
Community mailing list
Community at itk.org<mailto:Community at itk.org>
http://public.kitware.com/cgi-bin/mailman/listinfo/community
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140306/453fd8f1/attachment-0002.html>
More information about the Community
mailing list