Login  Register

unconsistency while using YUV color threshold in macro

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

unconsistency while using YUV color threshold in macro

christian perrin
Hello,
I am using the ColorThreshold. I am trying to split different phases (i.e. =
color) on an image, and when I work on a case by case basis, the ColorThreshold works totally fine. Then I use the Macro recorder, and when I run the = macro, if the macro uses RGB or Hue system, then it works fine, if the macro uses YUV, then the macro cant reproduce the same result.

I work on windows, and I tried on 2 different machines, using 1.46r and 1.4= 7q versions and I am facing similar problem.

I observed weird behavior though. Sometimes, the image I want is processed only at the top, and sometimes, if there is several YUV color threshold applied in the same macro, it returns something but not with the threshold I input ....
Here below I copied twhat I included in my macro (coming from the Recorder actually).

Did anyone face this problem?

Best regards (and thanks for a great software and great helpfull community!),
 Christian Perrin

open("L:\\ImageJ WORK\\AP-19A Cropped Sharpen images\\AP-19A_3398.15_c.tif"= ); run("Color Threshold..."); // Color Thresholder 1.46r // Autogenerated macro, single images only!
min=3DnewArray(3);
max=3DnewArray(3);
filter=3DnewArray(3);
a=3DgetTitle();
call("ij.plugin.frame.ColorThresholder.RGBtoYUV");
run("RGB Stack");
run("Convert Stack to Images");
selectWindow("Red");
rename("0");
selectWindow("Green");
rename("1");
selectWindow("Blue");
rename("2");
min[0]=3D0;
max[0]=3D255;
filter[0]=3D"pass";
min[1]=3D0;
max[1]=3D255;
filter[1]=3D"pass";
min[2]=3D0;
max[2]=3D100;
filter[2]=3D"pass";
for (i=3D0;i<3;i++){
  selectWindow(""+i);
  setThreshold(min[i], max[i]);
  run("Convert to Mask");
  if (filter[i]=3D=3D"stop")  run("Invert"); } imageCalculator("AND create", "0","1"); imageCalculator("AND create", "Result of 0","2"); for (i=3D0;i<3;i++){
  selectWindow(""+i);
  close();
}
selectWindow("Result of 0");
close();
selectWindow("Result of Result of 0");
rename(a);
// Colour Thresholding-------------
saveAs("Tiff", "L:\\ImageJ WORK\\AP-19A Cropped Sharpen images\\OPENPOROSIT= Y_AP-19A_3398.tiff");