ImageJ only writes the first IFD for TIFF files larger than 4GB at the beginning of the file.
The other IFD entries are placed at the end of the TIFF file.
ImageJ is able to read such files because it sees "images=n" in the ImageDescription tag and realizes it needs to open n images.
As a workaround in MATLAB, you can try whether below code works. Note: This code assumes that the TIFF image has Stripped Planar Configuration and contains one strip per image. This might not work for all images but it could provide you a general idea about how to read such files generated by ImageJ using low-level I/O functions.
fileName = 'Mylarge.tif';
info = imfinfo(fileName)
This may yield something similar to (amongst others)
FileSize: 1.055313188500000e+10
Format: 'tif'
FormatVersion: []
Width: 692
Height: 520
BitDepth: 16
ColorType: 'grayscale'
FormatSignature: [77 77 0 42]
ByteOrder: 'big-endian'
NewSubFileType: 0
BitsPerSample: 16
Compression: 'Uncompressed'
PhotometricInterpretation: 'BlackIsZero'
StripOffsets: 3342765
SamplesPerPixel: 1
RowsPerStrip: 520
StripByteCounts: 719680
Now determine the number of frames:
numFramesStr = regexp(info.ImageDescription, 'images=(\d*)', 'tokens');
numFrames = str2double(numFramesStr{1}{1});
fp = fopen(fileName , 'rb');
fseek(fp, info.StripOffsets, 'bof');
framenum=100;
imData=cell(1,framenum);
for cnt = 1:framenum
imData{cnt} = fread(fp, [info.Width info.Height], 'uint16', 0, 'ieee-be')';
end
fclose(fp);
Best Answer