How do I write individual 'labels' for each slice (e.g. ImageJ) of a multi-page TIF in Matlab?
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello!
I am working with some multi-page TIF files in Matlab, and have been able to successfully create multi-page TIFs by using the imwrite(img, filename, 'writemode', 'append') command.
f_identifier=('*_spot_*.tif');
f_list=dir(f_identifier);
for i=1:length(f_list)
im=imread(f_list(i).name);
fprintf('%s%d %s\n','Appending slice#',i,f_list(i).name);
imwrite(im,stack_name,'WriteMode','append','Description','FakeLabel');
end
However, once the stack is successfully generated, the individual images dont have a 'label' Is there an option to include a text string as a label for each slice?
For those who use ImageJ, I am trying to replicate the ImageJ function of assigning individual names to each slice of a stack ('ImageJ > Stacks > Tools > Set Label...' option).
I tried 'imfinfo' and tried adding a 'Description' field, but it didnt work: imwrite(im,stack_name,'WriteMode','append','Description','DesiredLabel');
I also looked into the Tiff() object tags, but cannot find the specific handle for individual slice labels.
0 commentaires
Réponses (1)
Rollin Baker
le 12 Avr 2017
Hi Dhrubajyoti,
Looking through the MATLAB documentation, I was able to find a "PageName" tag for TIFF objects. You can use the setTag function to configure these properties. You may be able to use this to achieve your desired behavior, although it's not clear if the property can applied to an individual slice.
Take a look at the link below for information on how to set the tags of a TIFF object, you can find the "PageName" property under the "Table 1: Supported TIFF Tags" header.
Good luck with your project!
-Rollin
Voir également
Catégories
En savoir plus sur Graphics Object Programming dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!