getting length of an image for a macro

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

getting length of an image for a macro

Jose Guzman-2
Hi

I would like programmatically obtain the length (in seconds) of an image
obtained with an SP5 microscope (Leica Microsystems).

Currently, I can see the length in Image->Properties as

 >>> DimensionDescription|Length 1 = 4.000000e+000

I wondered whether there's something like getDimensions(); to obtain
that value and use it in a macro.

Thanks in advance

Jose

--
Jose Guzman
http://www.ist.ac.at/~jguzman/

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

Re: getting length of an image for a macro

Michael Schmid
Hi Jose,

you can get the values of 'key = value' and 'key: value' lines in the ImageInfo with the getInfo('key') macro command (a space is needed before the "=" sign, but no space before the colon).
In your case, you probably want to use it as a number, not as a String (text), so you have to use parseFloat to convert it into a number:

parseFloat(getInfo("DimensionDescription|Length 1"));

Michael
________________________________________________________________
On Jan 28, 2014, at 11:11, Jose Guzman wrote:

> Hi
>
> I would like programmatically obtain the length (in seconds) of an image obtained with an SP5 microscope (Leica Microsystems).
>
> Currently, I can see the length in Image->Properties as
>
> >>> DimensionDescription|Length 1 = 4.000000e+000
>
> I wondered whether there's something like getDimensions(); to obtain that value and use it in a macro.
>
> Thanks in advance
>
> Jose
>
> --
> Jose Guzman
> http://www.ist.ac.at/~jguzman/
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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