Auto Area Selection ( ROI )



Hi guys , is it possible to carry out auto area selection in IMAGE J ?
My Image J version is ImageJ_1.50
For example , the area can be auto selected based on threshold or colour.





Welcome to the Forum! Let’s see if we can get you some help…

Just a couple things to start:

  1. In general, we recommend users download/use Fiji. Fiji is Just ImageJ - it is simply a distribution of ImageJ that comes with a bunch of plugins bundled - ready for you to use out-of-the-box. If you are just getting started, we recommend downloading/using Fiji.

  2. Would you be able to post/link the original image file here? This way we can get a better idea of your dataset. And also - we do not recommend saving images in jpeg… this format actually introduces artifacts, etc. You can read more on that here.

And here are some other helpful links that will shed some light on Segmentation - which is what you need to do to select the area of your image:

eta :slight_smile:


Hi eta , thanks for your reply ^^
I need auto area selection to avoid the human factor .
the original images are something like this …

Case 1 . Select the intermetallic compound same as example above

Case 2. Select the void / white dot / white region



You can test out a few options:

  1. Edge Detection by @ThomasBoudier

  2. Built-in Find Edges function that simply applies Sobel edge detection …

  3. MorphoLibJ is also a great toolkit with tons of goodies that include edge preservation/detection …

These are the only ones I can pull from the top of my head… I’m sure others here will be able to provide more insight.

But it would be helpful to know your aims in this workflow… what exactly do you wish to measure, etc?



I think what I need is not edge detection.Area selection is more suitable @@

For case 1 , the workflow as follows…
1.Open image
2.Drag area
3.Clear outside
5.Auto threshold
6.Measure to get intermetallic compound coverage area in percentage

Step 3 until 6 can be done by using macro. But I hope the Step 2 can be auto also to prevent user bias…

For case 2 , I just want to get the result like this …the percentage of void …



Just go through that Segmentation workshop/slides that I posted above - that should really help you develop a workflow. For example - there is no need for the ‘clear outside’ step if all you care about is area measurements, etc.

You can also check out the TWS plugin I linked above as well (which is macro-compatible). Here is a quick-and-dirty segmentation that I got with just the default settings:

To calculate the measurements you want - of course you’ll have to script that, but it’s doable. There is also a helpful Scripting workshop that has corresponding slides that you might find helpful.



Thanks for your suggestion.
I tried TWS but we just need the area inside the yellow polygon.
Then , I don’t know the next step to get the area %.

Besides that , we have to draw the line / add classifier when open a new image in every single time ? @@