Login  Register

Re: Analyze particles ...: Help and bug

Posted by Md Tamjidul Hoque on May 27, 2010; 4:06am
URL: http://imagej.273.s1.nabble.com/Analyze-particles-Help-and-bug-tp3688137p3688141.html

Rasband, Wayne (NIH/NIMH) [E] wrote:

> In the 1.44b9 daily build you can generate the particle outlines by using the "In situ Show" option to display the outlines as an overlay and then drawing the overlay. Here is a JavaScript example:
>
>   imp = IJ.openImage("http://rsb.info.nih.gov/ij/images/blobs.gif");
>   IJ.setAutoThreshold(imp, "Default");
>   IJ.run(imp, "Analyze Particles...", "size=350 show=Outlines in_situ");
>   ip = imp.getProcessor().duplicate();
>   ip = ip.convertToByte(false);
>   ip.setColor(Color.black);
>   ip.fill();
>   ip.setColor(Color.white);
>   overlay = imp.getOverlay();
>   overlay.drawPixels(ip); // requires 1.44b9 or later
>   imp.setOverlay(null);
>   imp.show();
>   new ImagePlus("Outlines", ip).show();
>
> -wayne
>
>  
Dear Wayne

      I think the other theme behind the 'in_situ" was not to open the
window (specially for the batch mode) and to apply the output to current
imp .    

Now with the current change in 1.44b9, I could not figure out how can I
get a outlined and numbered object using "in_situ" for 'Analyze
Particles ...' (such as Image#1) ?

Because, "in_situ" mode I have to generate (a) outlined and numbered
objects as well as (b) outlined and non-numbered objects,

so that I can have

Image #1:(http://sites.google.com/site/tamjidulhoque/home/resume-of/useful-links/1_CountAllbySize.zip?attredirects=0&d=1)

as previously it was possible to get Image#1 which is not working now with the updated version 1.44b9 in "in_situ" mode).

But I can have Image #4:(http://sites.google.com/site/tamjidulhoque/home/resume-of/useful-links/4_Circularitybasedsubsetoutlinedinsitu.zip?attredirects=0&d=1)
now.


So, I can add Image #1 and Image #4 to form the final result (Image # 5:
http://sites.google.com/site/tamjidulhoque/home/resume-of/useful-links/5_finalResultof1add4.zip?attredirects=0&d=1).

But again he problem is I can not get Image #1 in 'in_situ' mode.

Thanks
Tamjid











>> For example, for an images (Image #0:
>> http://sites.google.com/site/tamjidulhoque/home/resume-of/useful-links/0_Intermediateimage.zip?attredirects=0&d=1
>> )
>>
>> with object based on size first,  I am making a superset of the objects
>> outlined in  red and numbers (Image #1:
>> http://sites.google.com/site/tamjidulhoque/home/resume-of/useful-links/1_CountAllbySize.zip?attredirects=0&d=1
>> ).
>>
>> Then I am defining circularity (say .8 to 1.0) and is running the (a)
>> Outlines in 'Analyze particles' in green remaining other parameter unchanged
>>
>> and then adding with the Image #1, so that I can get red outlined object
>> outside the circularity range and yellow (red+green) inside the circularity
>> range.
>> And as the objects are already numbered before (in Image #1) I was trying to
>> get the outlined image without the object being numbered in the circularity
>> based 2nd case.
>>
>> See the outcome, image # 2:
>> http://sites.google.com/site/tamjidulhoque/home/resume-of/useful-links/2_CircularitybasedsubsetOutlinefirst.zip?attredirects=0&d=1
>>
>>
>> As an alternate approach, as you have suggested to Masks in 'Analyze
>> particles'  and then Process>Binary>Outline:
>> I had applied the Masks in 'Analyze particles' on Image# 0 and then
>> Process>Binary>Outline and greened ...
>>
>> But, the outputs differ and the outlined of the circularity set is not fully
>> overlapped with the previous outline as generated in image #1.
>> So the outcome looks distorted (image #4:
>> http://sites.google.com/site/tamjidulhoque/home/resume-of/useful-links/3_CircularitybasedsubsetMaskfirst.zip?attredirects=0&d=1)
>> and for some images/case the outputs look very bad.
>>
>> So, please help on this issue. I am not sure if it is due to different
>> line-thickness or different outlining algorithms ....
>>
>> or, it would also have been better to have an option with the 'Analyze
>> particles' to tick for number-less outlined object.
>>
>>
>> Thanks
>> Tamjid
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>