Re: 1-D Gaussian multiplier/convolution function around line in image.
Posted by
Herbie on
Jan 30, 2019; 2:35pm
URL: http://imagej.273.s1.nabble.com/1-D-Gaussian-multiplier-convolution-function-around-line-in-image-tp5021719p5021735.html
good day Cohen,
please try to familiarize with the macro language:
<
https://imagej.nih.gov/ij/developer/macro/macros.html>
<
https://imagej.nih.gov/ij/developer/macro/functions.html>
This works for me:
Ylevel = 164;
run("Macro...", "code=[a="+Ylevel+"; b=0.001; v=v*3*exp(-b*(y-a)*(y-a))]");
Please watch out for unwanted line breaks!
Regards
Herbie
:::::::::::::::::::::::::::::::::::::::::
Am 30.01.19 um 00:30 schrieb Ethan Cohen:
> 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>
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html