Re: How to convert a threshold area to a selection?
Posted by
Hugo Gratama van Andel on
URL: http://imagej.273.s1.nabble.com/How-to-convert-a-threshold-area-to-a-selection-tp3700180p3700183.html
Thanks Gabriel for your macro. It's a pity it doesn't work for stacks.
Wayne wrote about the wand, but I was glad you shown a way to automize
it for the whole image.
Still it does seems strange to me that you need a macro for such simple
operation (from one sort of selection--thresholding to another selection
). It is defenitely on my personal feature-request list for ImageJ.
with regards,
Hugo Gratama van Andel
Gabriel Landini wrote:
> On Monday 20 February 2006 12:43, Hugo Gratama van Andel wrote:
>
>>If I specifiy a threshold value ( with Image->Adjust->Threshold )How can
>>I convert the threshold area to a selection afterwards? I can't see how
>>to do this with ImageJ.
>
>
> Here there is way (you probably do not need the Set Measurements line):
> Please mind the line breaks inserted by the mailer.
>
> //-------------------------8<---------------------------
> // AreasToROIs.txt
> // G. Landini @ bham. ac. uk
> // 26/Nov/2004
> // Converts thresholded areas to a complex ROI
> //
> // No to be used with stacks! (works on the current slice only)
>
> // --- example image
> run("Dot Blot (7K)");
> run("Smooth");
> run("Smooth");
> setThreshold(0,159);
> // --- example image
>
> run("Select None");
> run("Set Measurements...", "area perimeter circularity decimal=3");
> run("Analyze Particles...", "minimum=1 maximum=999999 bins=20 show=Nothing
> clear record");
> run("Select None");
> for (i=0; i<nResults; i++) {
> x = getResult('XStart', i);
> y = getResult('YStart', i);
> if (i!=0) setKeyDown("shift");
> doWand(x,y);
> }
> setKeyDown("none");
> resetThreshold();
> //-------------------------8<---------------------------
>
--
Hugo Gratama van Andel - MSc
Academic Medical Centre - University of Amsterdam
Dept. Medical Physics L0-152
Meibergdreef 9
1105 AZ Amsterdam
The Netherlands
Phone : +31 20 566 5206
FAX : +31 20 691 7233
e-mail :
[hidden email]