Write a multipage tiff error

5 Ansichten (letzte 30 Tage)
Dante Basile
Dante Basile am 8 Aug. 2019
Kommentiert: Dante Basile am 13 Aug. 2019
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?

Akzeptierte Antwort

Vimal Rathod
Vimal Rathod am 13 Aug. 2019
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 Kommentar
Dante Basile
Dante Basile am 13 Aug. 2019
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Read, Write, and Modify Image finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by