imwrite fails for small images less than 64 rows high
2 次查看(过去 30 天)
显示 更早的评论
If I create an unsigned 16 bit array which is greater than 8192 columns wide and try to write it as a tiff image, it seems like it needs to be at least 64 rows high or Matlab 2014a throws an exception. To get around it, the 'RowsPerStrip' tag needs to be set manually to an integer value.
e.g:
x = ones([63 8192], 'uint16');
imwrite(x, 'C:\test\test.tif', 'tiff', 'Compression', 'none');
works fine.
BUT:
x = ones([63 8193], 'uint16');
imwrite(x, 'C:\test\test.tif', 'tiff', 'Compression', 'none');
gives an exception:
Error using wtifc
TIFF library error - '_TIFFVSetField: 4x8000.tif: Bad value 0 for "RowsPerStrip" tag.'
HOWEVER:
x = ones([64 8193], 'uint16');
imwrite(x, 'C:\test\test.tif', 'tiff', 'Compression', 'none');
works fine.
ALSO:
x = ones([63 8193], 'uint16');
imwrite(x, 'C:\test\test.tif', 'tiff', 'Compression', 'none', 'RowsPerStrip', 16);
works fine.
This was not a problem in 2011b
0 个评论
采纳的回答
Anand
2014-7-1
This looks like a bug.
Please contact MathWorks Tech Support by creating a Service Request:
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Hamamatsu Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!