Write a multipage tiff error
5 次查看(过去 30 天)
显示 更早的评论
I attempted to write a 144 page tiff using imwrite and I got the following error message:
Error using writetif (line 40)
Writing TIFFs with 144 components is not supported with IMWRITE. Use Tiff instead. Type "help Tiff" for more information.
However, I was able to use imwrite to write the stack as far as I can tell by using the append feature.
imwrite(wallShroom(:, :, 1), strcat(outputPath, patientID, '_', selectedChamber, '_shroomed.tif')) %write first slice of tiff
for i = 2:size(wallShroom, 3) %append the rest of the slices
imwrite(wallShroom(:, :, i), strcat(outputPath, patientID, '_', selectedChamber, '_shroomed.tif'), 'WriteMode', 'append')
end
I felt that the error message's reference to the Tiff object in this scenario was slightly misleading as this complex approach was not needed as far as I can tell.
I just wanted to give some feedback.
What are your opinions on this?
0 个评论
采纳的回答
Vimal Rathod
2019-8-13
The message’s reference to a TIFF object is to enable the users to utilize this broader functionality. Creating a tiff file using this object provides some additional features such as reading subimages, writing tiles and strips of image data, modifying individual tiff tags among others.
Also, to overcome the error, you could use the imwrite function with append feature.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Read, Write, and Modify Image 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!