Error opening large tif files

8 Ansichten (letzte 30 Tage)
Allan Millsteed
Allan Millsteed am 13 Feb. 2018
Bearbeitet: per isakson am 13 Feb. 2018
I need to open some very large tif files (up to 25-50GB) and have been trying to use the bigTiffWriter example code given at https://blogs.mathworks.com/steve/2013/08/07/tiff-bigtiff-and-blockproc/ .
When I try and execute inFileInfo = imfinfo(inFile); MATLAB generates seemingly infinite amounts of error messages like this:
Warning: Did not recognize tag format 65535.
> In matlab.io.internal.imagesci.imtifinfo (line 27)
In imtifinfo (line 13)
In imfinfo (line 184) .
It sometimes pauses long enough to also display:
Warning: The next image file directory at byte position 4294967295 is at or beyond the end of the file.
> In matlab.io.internal.imagesci.imtifinfo (line 27)
In imtifinfo (line 13).
The file I'm trying to open is a 'small' test file of only about 1.7GB and is 2160x2560 pixels x 597 layers (z height). The actual images I need to handle will have over 2500 layers. Basically they're cross-sectional tomography images of a kidney and I need to somehow deal with them in 3D to perform spatial analysis of the internal structures. Are these files just too large for MATLAB to handle or am I simply using the wrong methods? My experience with MATLAB is limited to basic introductory calculations and I only have access to R2016a.
Edit to add: I left it to run and it finally stopped with this error message:
Error using matlab.io.internal.imagesci.tifftagsread
Unexpected Standard exception from MEX file.
What() is:bad allocation
..
Error in matlab.io.internal.imagesci.imtifinfo (line 27)
raw_tags = matlab.io.internal.imagesci.tifftagsread(filename,0,0,0);
Error in imtifinfo (line 13)
info = matlab.io.internal.imagesci.imtifinfo(filename);
Error in imfinfo (line 184)
info = feval(fmt_s.info, filename);
Is this potentially more helpful to diagnose the issue?
  3 Kommentare
Walter Roberson
Walter Roberson am 13 Feb. 2018
It would help to run the tiff file through an analyzer to determine whether there is anything unusual about the tags.
Allan Millsteed
Allan Millsteed am 13 Feb. 2018
Bearbeitet: per isakson am 13 Feb. 2018
This file is the reduced one, so it's a little smaller than the others. Here's what tags I got:
SubFileType (1 Long): Zero
ImageWidth (1 Long): 1968
ImageLength (1 Long): 1455
BitsPerSample (1 Short): 8
Photometric (1 Short): MinIsWhite
ImageDescription (71 ASCII): ImageJ=1.51s images=597 slices=597 unit=micro...
StripOffsets (1 Long): 112249
SamplesPerPixel (1 Short): 1
RowsPerStrip (1 Short): 1455
StripByteCounts (1 Long): 2863440
XResolution (1 Rational): 0.384615
YResolution (1 Rational): 0.384615
ResolutionUnit (1 Short): None
50838 (599 Long): 20, 32086, 128, 128, 128, 128, 128, 128,...
50839 (109572 Byte): 73, 74, 73, 74, 105, 110, 102, 111, 0, 0, 0,...
I tried one of the larger files and the tag viewers would only grab the first 'page' of the tiff and ignored the other 2429. This one registered all 597 'pages' though.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Convert Image Type finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by