Login  Register

Re: Extracting .tif Metadata from SEM image?

Posted by Silas Kraus-2 on May 19, 2017; 7:35pm
URL: http://imagej.273.s1.nabble.com/Extracting-tif-Metadata-from-SEM-image-tp5018744p5018766.html

Hello everyone.

Thanks to Jerome Mutterer who provided a solution to this problem.
You'll find his answers below. Note that the tag number may vary for
different Microscopes.

Jerome wrote:
> The attached macro does calibrate an opened SEM image. The trick was
> to find out in which Tiff tag the metadata was stored. I did this
> with the Tif tags plugin.
> https://imagej.nih.gov/ij/plugins/tiff-tags.html You need to install
> this one by getting the jar file from
> https://imagej.nih.gov/ij/plugins/download/jars/tiff_tags.jar and put
> it in the plugins folder. Then I modified the example macro at
> https://imagej.nih.gov/ij/macros/SetScaleFromTiffTag.txt that was
> written for Zeiss SEM, and a different tag.


and in a followup mail:

> Here's a much better version of the macro that transfers the metadata to the standard ImageJ metadata info location, so that further saving of the image in Tif preserves the metadata.
> Also, I'm using a list object constructed from the metadata, so that it's very easy to retrieve any other value.
>
>
> // retrieves the calibration info from tiff tag 34682
> // uses https://imagej.nih.gov/ij/plugins/tiff-tags.html
> // adapted from https://imagej.nih.gov/ij/macros/SetScaleFromTiffTag.txt
>
> tagnum=34682;
> path = getDirectory("image");
> if (path=="") exit ("path not available");
> name = getInfo("image.filename");
> if (name=="") exit ("name not available");
> path = path + name;
> tag = call("TIFF_Tags.getTag", path, tagnum);
> tag = replace(tag, "  ", "\n");
> setMetadata("Info", tag);
> List.setList(tag);
> pixelSize = 1E6*List.getValue('PixelWidth');
> setVoxelSize(pixelSize, pixelSize, 1, "micron");
> // print (List.get("SystemType"));
>

See you.
Silas

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

read_SEM_cal.txt (988 bytes) Download Attachment