Login  Register

Re: Macro-getOption Built-in function

Posted by dpoburko on Aug 03, 2009; 10:43pm
URL: http://imagej.273.s1.nabble.com/volume-measurement-and-memory-problems-tp3691572p3691576.html

Paola Lepanto wrote:

> Hi everyone
> Now I´m trying to do a macro using (of course) macro recorder. I would
> like to use stack Z-projection plugin using the run() function but I
> would need it to allow me to set the range of slices to project for each
> stack while running the macro. I know there´s the built-in function:
> Macro.getOption, but I couldn´t find it (I´ve updated ImageJ recently).
> Is there any alternative or somewhere to download it from? Also if you
> can give me some little help about how to call this function in relation
> to Z projection plugin, it would be great.
> Thanks in advance
> Paola
Hi Paola,

  If I understand your problem ,you simply need a way to run a
Z-projection, where the first and last image are somehow dynamically set.

Here is an example:

//first slice
A = 0;    
//nslices give you the number of slices, whereas the "slice
number/position will be numbered starting at zero
B = nslices()-1;  

run("Z Project...", "start="+ A +" stop=" + B + " projection=[Average
Intensity]");

Alternatively, you could create simple dialogue box to input the values
for A and B (see the dialog box Macro example
http://rsb.info.nih.gov/ij/macros/DialogDemo.txt )

Cheers,
Damon