Push Metadata

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Push Metadata

Joel Sheffield
In view of the recent discussions about extracting metadata from image
files, I have been wondering if it is possible to add metadata to image
files in addition to calibration and, now, overlays.  i.e. something about
experimental conditions, etc.

Joel


--


Joel B. Sheffield, Ph.D
Department of Biology
Temple University
Philadelphia, PA 19122
Voice: 215 204 8839
e-mail: [hidden email]
URL:  http://astro.temple.edu/~jbs

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Push Metadata

Richard VanMetter
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