Login  Register

Re: Macro-getOption Built-in function

Posted by Paola Lepanto on Aug 04, 2009; 8:07pm
URL: http://imagej.273.s1.nabble.com/volume-measurement-and-memory-problems-tp3691572p3691579.html

Damon Poburko escribió:

> Gabriel Landini wrote:
>> On Monday 03 August 2009, Damon Poburko wrote:
>>  
>>>   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]");
>>>    
>>
>> I think that slices start at "1" and end at "nSlices".
>>
>> G.
>>  
> Thanks for the correction Gabriel. I must have been a little off when
> writing this.
>
> Cheers,
> Damon
Thank you, but I couldn´t make it work through the way you showed me: it
makes a Z proyection  from the whole stack. What I would like to do is
to select in each image the range of slices to make the projection. So I
tried to  make this other macro that  fails to recognize A as the number
(a pop up says that it expects a numeric value for "Stop") I put in the
dialog box. Am I using the correct functions?, perhaps you can help me:

Dialog.create("Z projection stop");
Dialog.addNumber("Stop:", 30);
Dialog.show();
A = Dialog.getNumber();
run("Z Project...", "start=1 stop=+A+ projection=[Average Intensity]");

Thank you again,
Paola