How to use IJBlob shape filter to remove blobs inside incomplete circles/ellipses

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

How to use IJBlob shape filter to remove blobs inside incomplete circles/ellipses

jmcginnity
Hi,  I wish to remove from this image both the blobs within the incomplete circles/ellipses and also the incomplete circle/ellipses.  I wish to keep the other blobs.  I am trying to do this using the IJBlob shape filter by setting solidity to about 0.8-1 but without success.

Solidity is A/C
Area (A): The area enclosed by the outer contour of an object.
Area Convex Hull (C): The area enclosed by the convex hull of the outer contour of an object.

Any tips on what I am doing wrong?  Or, any tips on how I might achieve this?

Also is Shape Filter able to work on stacks?

Test image

Thanks for any assistance,

Justin McGinnity
Reply | Threaded
Open this post in threaded view
|

Re: How to use IJBlob shape filter to remove blobs inside incomplete circles/ellipses

jumpfunky

Dear Justin,

I think to use the solidity is the right thing to start with. I would generate a use image which contain the ONLY the incomplete ellipses by setting the solidity range to 0-0.8. I also draw the convex hull around each incomplete ellipse.

My idea was to combine both the original image and the new image. Please find attached my result. This is the macro leading to these results:

run("Duplicate...", " ");

//Get Incomplete ellipses and draw convex hull
run("Shape Filter", "area=0-Infinity area_convex_hull=0-Infinity perimeter=0-Infinity perimeter_convex_hull=0-Infinity feret_diameter=0-Infinity min._feret_diameter=0-Infinity max._inscr._circle_diameter=0-Infinity long_side_min._bounding_rect.=0-Infinity short_side_min._bounding_rect.=0-Infinity aspect_ratio=1-Infinity area_to_perimeter_ratio=0-Infinity circularity=0-Infinity elongation=0-1 convexity=0-1 solidity=0-0.8 num._of_holes=0-Infinity thinnes_ratio=0-1 contour_temperatur=0-1 orientation=0-180 fractal_box_dimension=0-2 option->box-sizes=2,3,4,6,8,12,16,32,64 draw_holes draw_convex_hull exclude_on_edges");

//Make it binary again
setAutoThreshold("Default dark");
setOption("BlackBackground", true);
run("Convert to Mask");
run("Close");

//Fill holes
run("Invert");
run("Fill Holes");

//Now combine the new image and the original image
selectWindow("Testimage1.jpg");
run("Invert");
imageCalculator("Subtract", "Testimage1.jpg","Testimage1-1.jpg");
selectWindow("Testimage1-1.jpg");
close();
selectWindow("Testimage1.jpg");
run("Invert");

Cheers,
Thorsten Wagner

--
Kind regards



Thorsten Wagner, M.Sc.
Biomedical Imaging Group
University of Applied Sciences and Arts Dortmund




Am Mittwoch, den 21.10.2015, 01:48 -0700 schrieb jmcginnity:

> Hi,  I wish to remove from this image both the blobs within the
> incomplete
> circles/ellipses and also the incomplete circle/ellipses.  I wish to
> keep
> the other blobs.  I am trying to do this using the IJBlob shape
> filter by
> setting solidity to about 0.8-1 but without success.
>
> Solidity is A/C
> Area (A): The area enclosed by the outer contour of an object.
> Area Convex Hull (C): The area enclosed by the convex hull of the
> outer
> contour of an object.
>
> Any tips on what I am doing wrong?  Or, any tips on how I might
> achieve
> this?
>
> Also is Shape Filter able to work on stacks?
>
> <http://imagej.1557.x6.nabble.com/file/n5014694/Testimage1.jpg>
>
> Thanks for any assistance,
>
> Justin McGinnity
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/How-to
> -use-IJBlob-shape-filter-to-remove-blobs-inside-incomplete-circles-
> ellipses-tp5014694.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

Testimage1_result.jpg (164K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to use IJBlob shape filter to remove blobs inside incomplete circles/ellipses

jumpfunky
Just to correct my unreadable sentence:

I would generate a new image which contains ONLY the incomplete
ellipses by setting the solidity range to 0-0.8.

Am Mittwoch, den 21.10.2015, 12:08 +0200 schrieb Thorsten Wagner:

> Dear Justin,
>
> I think to use the solidity is the right thing to start with. I would
> generate a use image which contain the ONLY the incomplete ellipses
> by setting the solidity range to 0-0.8. I also draw the convex hull
> around each incomplete ellipse.
>
> My idea was to combine both the original image and the new image.
> Please find attached my result. This is the macro leading to these
> results:
>
> run("Duplicate...", " ");
>
> //Get Incomplete ellipses and draw convex hull
> run("Shape Filter", "area=0-Infinity area_convex_hull=0-Infinity
> perimeter=0-Infinity perimeter_convex_hull=0-Infinity
> feret_diameter=0-Infinity min._feret_diameter=0-Infinity
> max._inscr._circle_diameter=0-Infinity
> long_side_min._bounding_rect.=0-Infinity
> short_side_min._bounding_rect.=0-Infinity aspect_ratio=1-Infinity
> area_to_perimeter_ratio=0-Infinity circularity=0-Infinity
> elongation=0-1 convexity=0-1 solidity=0-0.8 num._of_holes=0-Infinity
> thinnes_ratio=0-1 contour_temperatur=0-1 orientation=0-180
> fractal_box_dimension=0-2 option->box-sizes=2,3,4,6,8,12,16,32,64
> draw_holes draw_convex_hull exclude_on_edges");
>
> //Make it binary again
> setAutoThreshold("Default dark");
> setOption("BlackBackground", true);
> run("Convert to Mask");
> run("Close");
>
> //Fill holes
> run("Invert");
> run("Fill Holes");
>
> //Now combine the new image and the original image
> selectWindow("Testimage1.jpg");
> run("Invert");
> imageCalculator("Subtract", "Testimage1.jpg","Testimage1-1.jpg");
> selectWindow("Testimage1-1.jpg");
> close();
> selectWindow("Testimage1.jpg");
> run("Invert");
>
> Cheers,
> Thorsten Wagner
>

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

Re: How to use IJBlob shape filter to remove blobs inside incomplete circles/ellipses

jmcginnity
Dear Thorsten,

Thanks!  I have a stack of 60 images (349 MB) but when I try to run this (I've modified it to work on stacks), it runs out of memory.  Can you suggest anything?

Kind regards,
Justin
Reply | Threaded
Open this post in threaded view
|

Re: How to use IJBlob shape filter to remove blobs inside incomplete circles/ellipses

jumpfunky
Dear Justing,

you can try to open your images as a virtual stack:

File -> Import -> Image Sequence

Select "Use Virtual Stack" in the Sequence Options. This means that the
data is read on the fly from your harddisk. It's slow, but it should
work with really large image data.

Cheers,
Thorsten

Am Montag, den 26.10.2015, 02:25 -0700 schrieb jmcginnity:

> Dear Thorsten,
>
> Thanks!  I have a stack of 60 images (349 MB) but when I try to run
> this
> (I've modified it to work on stacks), it runs out of memory.  Can you
> suggest anything?
>
> Kind regards,
> Justin
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/How-to
> -use-IJBlob-shape-filter-to-remove-blobs-inside-incomplete-circles-
> ellipses-tp5014694p5014767.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html