Thank you Philippe,
I am not working directly with the Color threshold window, I am using the
following macro:
//
imgName=getTitle();
run("Duplicate...", "title=1.tif");
selectWindow(imgName);
// Color Thresholder...
min=newArray(3);
max=newArray(3);
filter=newArray(3);
a=getTitle();
run("Lab Stack");
run("Convert Stack to Images");
selectWindow("L*");
rename("0");
selectWindow("a*");
rename("1");
selectWindow("b*");
rename("2");
min[0]=0;
max[0]=55;
filter[0]="pass";
min[1]=0;
max[1]=127;
filter[1]="pass";
min[2]=-128;
max[2]=127;
filter[2]="pass";
for (i=0;i<3;i++){
selectWindow(""+i);
setThreshold(min[i], max[i]);
run("Convert to Mask");
if (filter[i]=="stop") run("Invert");
}
imageCalculator("AND create", "0","1");
imageCalculator("AND create", "Result of 0","2");
for (i=0;i<3;i++){
selectWindow(""+i);
close();
}
selectWindow("Result of 0");
close();
selectWindow("Result of Result of 0");
rename(a);
// Colour Thresholding-------------
run("Create Selection");
selectWindow("1.tif");
run("Lab Stack")
run("Next Slice [>]");
run("Restore Selection");
setOption("Area", true);
setOption("Perimeter", true);
setOption("Mean", true);
run("Measure");
area = getResult("Area", nResults-1);
perimeter = getResult("Perim.", nResults-1);
mean = getResult("Mean", nResults-1);
a = log(mean)/log(10);
dispersion = 0.5*perimeter/sqrt(PI*area);
setResult('Dispersion', nResults-1, dispersion);
setResult('Label', nResults-1, imgName);
updateResults();
mastimeter = 0.207*dispersion-12.358*a+17.596
setResult('Mastimeter', nResults-1, mastimeter);
updateResults();
selectWindow("1.tif");
close();
selectWindow(imgName);
close();
Something wrong happened when creating mask, the mask was set to the
background, this bug with the latest versions of imagaj.. I suppose that..
--
Sent from:
http://imagej.1557.x6.nabble.com/--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html