Write a multipage tiff error

4 visualizzazioni (ultimi 30 giorni)
Dante Basile
Dante Basile il 8 Ago 2019
Commentato: Dante Basile il 13 Ago 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?

Risposta accettata

Vimal Rathod
Vimal Rathod il 13 Ago 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 Commento
Dante Basile
Dante Basile il 13 Ago 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.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Read, Write, and Modify Image in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by