nextDirectory failing at 65535
2 views (last 30 days)
Show older comments
I have a tiff stack of > 65535 images. Doing the following fails at n = 65535, where frames is the number of images which is significantly greater than 2^16.
img_stack = Tiff( 'FILENAME.tif' ) ;
[ i , j ] = size( img_stack.read() );
img = zeros( i , j , frames) ;
for n = 1 : frames
img_stack.nextDirectory()
img( : , : , n ) = img_stack.read() ;
SOME PROCESS ON img
end
This fails with,
Error using tifflib
Unable to read the next directory.
Error in Tiff/nextDirectory (line 934)
tifflib('readDirectory',obj.FileID)
Error in readin (line 5)
img_stack.nextDirectory()
Then if we start the for loop at 65535 the loop fails at ... 2 * 65535! Given this is one integer below 2^16 suggests that the integer being used to keep track of nextDirectory() is a 16 bit number...?
Is this something anyone has come accross and knows more?
1 Comment
Answers (0)
See Also
Categories
Find more on Image Data Workflows in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!