Skip to content

Instantly share code, notes, and snippets.

@mutterer
Created May 7, 2015 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mutterer/38cc6b9207de1ab4f5b3 to your computer and use it in GitHub Desktop.
Save mutterer/38cc6b9207de1ab4f5b3 to your computer and use it in GitHub Desktop.
run("RGB Stack"); // convert RGB image in a stack
run("32-bit"); // make it 32 bit for computations
run("Multiply...", "value=-1 stack"); // invert values for r,g,b
setSlice(2); // go to the green channel
run("Multiply...", "value=-2 slice"); // -g*-2 = +2g
run("Z Project...", "start=1 stop=3 projection=[Sum Slices]"); // sum all channels result= -r + 2g -b
setAutoThreshold("Intermodes dark"); // auto thresholding now works
@mutterer
Copy link
Author

mutterer commented May 7, 2015

This ImageJ macro helps with segmenting image areas that are greener.
I first learned about this method at the ImageJ conference 2010 from Gerrit Polder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment