Login  Register

Stack RGB measure with label

Posted by Manuel Costa on May 10, 2009; 7:05pm
URL: http://imagej.273.s1.nabble.com/Stack-RGB-measure-with-label-tp3692594.html

Hi!

I have joined different scripts in order to get the RGB values of a image
stack and got this:

// Measure Stack
//
// This macro measure all the slices in a stack.

 macro "Measure Stack" {
       for (n=1; n<=nSlices; n++) {
          setSlice(n);

            requires("1.35b");
  if (bitDepth!=24)
     exit("This macro requires an RGB image");

 
  setRGBWeights(1, 0, 0);
  run("Measure");
  setResult("Label", nResults-1, "Red");
 }

for (n=1; n<=nSlices; n++) {
          setSlice(n);

   setRGBWeights(0, 1, 0);
  run("Measure");
  setResult("Label", nResults-1, "Green");

}

for (n=1; n<=nSlices; n++) {
          setSlice(n);

  setRGBWeights(0, 0, 1);
  run("Measure");
  setResult("Label", nResults-1, "Blue");

}


However, I could not manage to find a way of displaying the name of each
file analysed followed by the parameter measured (blue, red and green) in
the label column. Is there any way to do that?

Thank you very much!