See this helpful workshop on Image Segmentation for another great overview of Segmentation!
Image segmentation is “the process of partitioning a digital image into multiple segments.” (Wikipedia)
It is typically used to locate objects and boundaries.
More precisely, image segmentation is the process of assigning a label to every pixel in an image such that pixels with the same label share certain visual characteristics.
One plugin which is designed to be very powerful, yet easy to use for non-experts in image processing:
A tool that combines a collection of machine learning algorithms with a set of selected image features to produce pixel-based segmentations.
Give it a try—you might like it!
One good workflow for segmentation in ImageJ is as follows:
- Preprocess the given images
- Apply an Auto Threshold
- Create and manipulate a mask
- Create and transfer a selection from a mask to your original image
- Analyze the resulting data
Preprocess the image using filters, to make later thresholding more effective. Which filter(s) to use is highly dependent on your data, but some commonly useful filters include:
- [https://imagej.net/docs/guide/146-29.html#sub:Subtract-Background… Subtract Background]
- [https://imagej.net/docs/guide/146-29.html#sub:Gaussian-Blur… Gaussian Blur]
- Find Edges
Ideally you want to use one of the auto-threshold methods, rather than manually tweaking, so that your result is reproducible later on the same data, and on multiple other datasets.
- Open your image
Select Image › Adjust › Threshold…
- Specify whether or not the background should be dark or light
- Adjust the minimum and maximum sliders until you are satisfied with the saturation level of your image
- [https://imagej.net/docs/guide/146-28.html#sub:Threshold…%5BT%5D More information]
Select Edit › Selection › Create Mask
- Based on the image and set threshold, some portions of the image may be over/under saturated
- One quick way to split overlapping objects is the Watershed command.
- Select Edit › Selection › Create Selection to select the objects within the mask
To deselect a portion of the image, select
Before transferring the mask’s selections, revert the image to its original form by selecting
Select first the mask, then the original image, and select
Eto transfer the mask’s selections
Do some numerical analysis on the selected data:
- [https://imagej.net/docs/guide/146-30.html#sub:Measure…%5Bm%5D Measure] the entire selection directly.
- Control which measurements are done using [https://imagej.net/docs/guide/146-30.html#sub:Set-Measurements… Set Measurements].
- Use [https://imagej.net/docs/guide/146-30.html#sub:Analyze-Particles… Analyze Particles] to extract desirable objects from your selection and report individual statistics on them.
- Use the ROI Manager to Add the selection and then Split it (under the More button), then use Multi Measure (also under More) to report statistics on the objects.
- Write a macro to automate this sort of analysis, loop over objects in the ROI manager, measure and manipulate them, etc.
- The Introduction to Image Segmentation using ImageJ/Fiji workshop.
- The Segmentation with Fiji workshop slides.
- :Category:Segmentation, a list of pages about image segmentation.