Posted by
Tiago Ferreira-2 on
Mar 30, 2014; 9:46pm
URL: http://imagej.273.s1.nabble.com/color-pixel-for-Strahler-order-tp5007132p5007135.html
Hi Catherine,
On Mar 30, 2014, at 04:59, catherine <
[hidden email]> wrote:
> I am searching how I could color pixels of the skeleton after he analysis,
> for each order (order 1 in yellow, 2 in red, 3 in green for example).
> Isearch and founded pixel colro counter, but I really don't know how to
> colorpixel with a macro.
It can be done with built-in commands. You could try the following:
1) Run Strahler Analysis in debug mode so that it generates the animation stack
2) Project that stack using the "Sum Slices" option (Image>Stacks>Z Project...)
3) Such projection will have the Strahler numbers rendered as multiples of 255
4) Apply your favorite Lookup table to the summed projection, e.g., Fire
5) If you want to add a calibration bar (Analyze>Tools>Calibration Bar), you can
do one of the following:
a) Divide the projection by 255 (Process>Math>Divide...) or
b) Calibrate a non-32 bit version of the projection (Analyze>Calibrate...)
using a linear function of slope 1/255
In a macro this would be something like:
// <--- start of macro --->
// open an image
open("
http://fiji.sc/images/b/b3/StrahlerAnimation.gif");
setThreshold(0, 10);
run("Convert to Mask");
// run Strahler Analysis in debug mode
setKeyDown("alt");
run("Strahler Analysis", "max.=100");
// frontmost image is now the animation stack.
nOrders = nSlices();
run("Z Project...", "projection=[Sum Slices]");
run("Fire");
run("Divide...", "value=255");
setMinAndMax(0, nOrders);
run("Calibration Bar...", " overlay");
// <--- end of macro --->
Is this used frequently? If yes, it could be added as an option to the plugin.
-tiago
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html