Write a multipage tiff error

조회 수: 4 (최근 30일)
Dante Basile
Dante Basile 2019년 8월 8일
댓글: Dante Basile 2019년 8월 13일
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?

채택된 답변

Vimal Rathod
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.
  댓글 수: 1
Dante Basile
Dante Basile 2019년 8월 13일
Thank you, this makes sense.
The only reason I bring this up is that when it says "Writing TIFFs with 144 components is not supported with IMWRITE" it lead me to believe that imwrite is not usable for writing multipage tiffs, which seems not to be the case.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile 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!

Translated by