Re: Push Metadata

Posted by Richard VanMetter on
URL: http://imagej.273.s1.nabble.com/Push-Metadata-tp4999917p4999929.html

Yes. You can easily add text information to the metadata in ImageJ. I find this useful to track any image processing I do on image files. Otherwise, I have only cryptic file names and my notes as a reference. By updating the metadata, everything I do is internally documented in every image. I usually include the name of the plugin, the name of the input file as well as any parameters used by the plugin....

here is a snippet of Java code.... (imp is an ImagePlus)
--------------------------------------------------------------------------------------------------
Object prop = imp.getProperty("Info");     // get 'info' (metadata) from an ImagePlus
String oldInfo = (String)prop;                   // convert it to a string

String newInfo =                                       // add whatever you wish to the 'info' (metadata)
"Add your information here\n"
        +" as many lines as you like"\n"
        +oldInfo;                                           // concatenate with the original 'info' so nothing is lost

imp.setProperty("Info", newInfo);            // replace the old 'info' with your modified 'info'
--------------------------------------------------------------------------------------------------

As far as I know, the 'info' is saved only if you save the image as a tiff. Hope this is useful.

Richard

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html