Selecting largest object

Hi there,
I want to keep largest object and get rid of other parts of following image.

How do I do this in imagej?

Hi @Denuwan,

Have you tried using >Analyze >Analyze Particles… and define a certain minimal exclusion size?
If the size to be excluded is in a similar range over your image series that would be the way to go.

I tried it. but I have no idea how give exclusion size. I mean after >Analyze >Analyze Particles… How do I perform the next step.?

This depends on what you actually need to do.
Do you need a ROI around your object of interest or do you want to measure a specific parameter?
If you give us some insight into the need we can more specifically address this.
Depending on your needs, you can either use Analyze Particles and create a new binary image by choosing “Masks” in the show field. If you need a ROI you can tick the checkbox “Add to Manager”. Then you can transfer the ROI back on the original or a related image as needed. The mininal exclusion size is simply set in the field "size"as a pixels or square units depending on you images’ scaling.

Actually I need to keep the largest object of above binary image and remove other objects(in red circles). I tried attribute morphological closing. It seems work well.

While a morphological operation is an option it can lead to alterations in shape at certain positions. If this is neglectable in your case you could use it.

I would still see size or shape exclusion the most practical and fast forward approach here.

If you have time can you please give me the steps.

I’m on the road and can’t produce any screenshots or macros at the moment but actually all steps are described in my second post already.
And the ImageJ User Guide is a very valuable resource to learn about the basic analysis functions of the software.

1 Like

Thank you very much I will refer those.