Tiff (tifflib) append reaching limit of frames
조회 수: 5 (최근 30일)
이전 댓글 표시
Hi Community
I have a function that export a 3D matrix to a tiff file.
Its working well, but when appending the submatrix 4096 and error is shown
Error using tifflib
Unable to write strip #1.
Error in Tiff/writeAllStrips (line 1978)
tifflib('writeEncodedStrip',obj.FileID, stripNum-1,imageData(row_inds,:));
Error in Tiff/write (line 1486)
obj.writeAllStrips(varargin{:});
Error in exportToTIF (line 52)
write(t,single(imgdata(:,:,i))); %% When i = 4096
Have you seen that behaviour before?
Thanks a lot
Here's the code
% Config. Tif
tagstruct.SampleFormat = Tiff.SampleFormat.IEEEFP;
tagstruct.Photometric = Tiff.Photometric.MinIsBlack;
tagstruct.BitsPerSample = 32;
tagstruct.SamplesPerPixel = 1;
tagstruct.PlanarConfiguration = Tiff.PlanarConfiguration.Chunky;
tagstruct.Software = 'MATLAB';
tagstruct.ImageLength = size(imgdata,1);
tagstruct.ImageWidth = size(imgdata,2);
% Writting first frame
t = Tiff(selpath + folder + fileName + ".tif",'w');
setTag(t,tagstruct)
write(t,single(imgdata(:,:,1)));
close(t);
% Appending the rest
for i = 2 : size(imgdata,3)
t = Tiff(selpath + folder + fileName + ".tif",'a');
setTag(t,tagstruct)
write(t,single(imgdata(:,:,i))); % Here the error when i = 4069
end
close(t);
댓글 수: 1
Walter Roberson
2021년 7월 27일
I am not clear why you construct t in the loop? It does not appear to depend on the loop variable?
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!