Login  Register

Re: 1-D Gaussian multiplier/convolution function around line in image.

Posted by Cohen, Ethan D on Jan 29, 2019; 11:30pm
URL: http://imagej.273.s1.nabble.com/1-D-Gaussian-multiplier-convolution-function-around-line-in-image-tp5021719p5021733.html

Thanks Herbie:
That worked.  b=0.001; v=v*3*exp(-b*(y-h*0.5)*(y-h*0.5));
Nice.

So I am trying to make a macro using  to feed in the cursor Y level value using your code to modify an image stack.

Say the image is w=500, h = 1000.


So I look at https://imagej.nih.gov/ij/macros/examples/MathMacroDemo.txt demo

I see on the comment line:

// All built-in variables and functions of the IJ macro language can be used in
// the specified formula

So my macro collects the cursor Y value, which I call Ylevel.

run("Macro...", "code=[b=0.001; v=v*3*exp(-b*(y-Ylevel)*(y-Ylevel))] stack");

But this does not run, because Ylevel is not a "Built-in variable in ImageJ".
but if I manually put a number instead of Y level it works.

How to fix?

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