Posted by
Frederic V. Hessman on
Feb 22, 2007; 11:01am
URL: http://imagej.273.s1.nabble.com/Need-to-add-new-metadata-to-image-file-tp3700273p3700274.html
Each image has a Properties object, so you can simply manipulate
information in strings via
void myPluginMethod (ImagePlus imp)
{
Properties props = imp.getProperties;
props.setProperty ("PI", "3.1415926");
String oldInfo = props.getProperty ("myOldInfo");
}
This info can thus be used immediately during the interactive session.
The only problem is to pack this info back into the output image
files - I'm working on doing this for FITS images (which has a rich
header info syntax) but I don't have any experience with tiff et al.
(some, I believe, support general purpose header info).
Rick
On 22 Feb 2007, at 2:15 am, Jim Cant wrote:
> I need to find a way to programatically add new metadata to image
> files (jpg,
> tiff, dicom); this data would be the results of image analysis done
> interactively. These would be fields/tags that did not not exist
> in the
> original image file.
>
> Also, how is the metadata of an image file represented within
> ImageJ once a
> file is loaded. All I've been able to discover is the FileInfo
> object which
> seems very generic; it's not clear, for example, where a user-
> defined tag
> from a tiff file would show up. Actually, I would have expected a
> class for
> each image file type (each likely an extension of a common base
> class.)
>
> I would expect the solution to my problem would be to create new
> additions
> to the internal representation of my image then write all this out
> to a
> file.
>
> Any pointers, suggestions, hints, or actual solutions would be greatly
> appreciated; I thank you in advance.
>
> Thanks,
> Jim Cant
> --
> View this message in context:
http://www.nabble.com/Need-to-add-new-
> metadata-to-image-file-tf3270337.html#a9092548
> Sent from the ImageJ mailing list archive at Nabble.com.
------------------------------------------------------------------------
------------------------
Dr. Frederic V. Hessman
[hidden email]
Institut für Astrophysik Tel. +49-551-39-5052
Friedrich-Hund-Platz 1 Fax +49-551-39-5043
37077 Goettingen Room F04-133
http://www.Astro.physik.Uni-Goettingen.de/~hessman------------------------------------------------------------------------
-------------------------
MONET: a MOnitoring NEtwork of Telescopes
http://monet.Uni-Goettingen.de------------------------------------------------------------------------
-------------------------