Login  Register

Store metadata in a user-defined variable? getInfo?

Posted by moxed on Apr 27, 2015; 4:18pm
URL: http://imagej.273.s1.nabble.com/Store-metadata-in-a-user-defined-variable-getInfo-tp5012626.html

Hi all,

I have very limited programming experience but have been working with the ImageJ macros to make my life a little easier. I'm just writing the macros in the ijm format.

For downstream calculations, I need certain pieces of information stored in the Image Info/metadata.

Right now I have the user input the information manually:
s= getNumber("enter pixels/um", 2.2756)

But I would like the information to be pulled automatically from the image data

For certain values, which are unitless in the Show Info file, this command works fine:

b= getInfo("ImageLength");
print(b);

but for values that have a unit, like resolution, I am unable to store just the value in a variable. So a command like:

a= getInfo("Resolution");
print(a);

returns nothing and does not work.

Is there a simple fix around this?

Thanks in advance!