Posted by
Krs5 on
URL: http://imagej.273.s1.nabble.com/Extracting-tif-Metadata-from-SEM-image-tp5018744p5018745.html
Dear Silas,
In general I think you can get the header info via getMetadata("Info") or maybe via getImageInfo()
I don't know the format of your header but to start with try for example:
print(getMetadata("Info")); find the line with the data you want to extract and put it into the code below where you replace the 1 in N = lines[1] with the line number -1 you want to extract.
print(getMetadata("Info"));
selectWindow("Log");
lines = split(getInfo(),"\n");
N = lines[1];
print(N);
Best wishes
Kees
Dr Ir K.R. Straatman
Senior Experimental Officer
Advanced Imaging Facility
Centre for Core Biotechnology Services
University of Leicester
http://www2.le.ac.uk/colleges/medbiopsych/facilities-and-services/cbs/lite/aifImageJ workshops 1 and 2 June:
http://www2.le.ac.uk/colleges/medbiopsych/facilities-and-services/cbs/AIF/workshops/imagej-workshops-June-2017-----Original Message-----
From: Silas Kraus [mailto:
[hidden email]]
Sent: 17 May 2017 23:16
To:
[hidden email]
Subject: Extracting .tif Metadata from SEM image?
Greetings.
I am using Fiji to analyse images taken with a Scanning Electron Microscope (FEI Quanta 250). I want to analyse particle density and therefore need the magnification or Pixel size. The SEM stores this data as text in the .tif file together with many other metadata, but Fiji's "Show Info..." function does not show this data. Debug mode won't do the trick either.
I managed to fetch the information with the simple bash-command:
> "grep --text -e Pixel -i <image.tif>"
But my goal is to write a single ImageJ macro that I can give to my colleagues who are working on Windows, with just Fiji and maybe a few plugins installed.
So, my question is:
How can I find a text line in a .tif file that reads something like "PixelSize = 1.4681e-008"
and process the number, all in a simple ImageJ macro?
I've been searching the Internet for a few days now. There seem to be a few similar discussions online, but I didn't manage to make use of them, mostly because they often involve Java programming, which I understand nothing about. Any help would be greatly appreciated.
Silas Kraus
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html