Tiff (tifflib) append reaching limit of frames

5 visualizaciones (últimos 30 días)
Felipe Bayona
Felipe Bayona el 27 de Jul. de 2021
Comentada: Walter Roberson el 27 de Jul. de 2021
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 comentario
Walter Roberson
Walter Roberson el 27 de Jul. de 2021
I am not clear why you construct t in the loop? It does not appear to depend on the loop variable?

Iniciar sesión para comentar.

Respuestas (0)

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by