Threshold plus create selection prolem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Threshold plus create selection prolem

Yaman
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Threshold plus create selection prolem

CARL Philippe (LBP)
Dear Yousouf,
Within the Threshold window there is a Dark_background button which allow you to inverse, or not, the treshold result.
My best regards,
Philippe

Le Vendredi 22 Mars 2019 00:00 CET, Yaman <[hidden email]> a écrit:

> Hi every body,
>
> I am using macro of color threshold followed by create selection. After the
> latest update of ImageJ, I noticed that the selected area was inversed so I
> need to write..
>
> run("Create Selection");
> run("Make Inverse");
>
> Is it a bug?!
>
>
>
> --
> Sent from: http://imagej.1557.x6.nabble.com/
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html





--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Threshold plus create selection prolem

Yaman
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