Find Connected Regions

PlugIn for ImageJ


This plugin find clusters of voxels in images based on some simple criteria and separates out those clusters into images. It can also act like a 3D flood fill. This is probably most easily demonstrated by two examples:

Example 1 (Splitting a label field into connected regions)

Tell the plugin to look for all of the connected regions with the same value (where that value is greater than 0) in a 8 bit label field:


Example 2 (Creating masks for two large clusters)

Tell the plugin to start from a point selection and look for the first two regions of connected values over 40 in an 8 bit image stack:


Please let me know of any problems you have with this plugin or any suggestions you have. I hope it is of some use to you.


This plugin was written by Mark Longair apart from the AmiraMesh file loading that was written by Johannes Schindelin. Thank you to Johannes as well for suggesting strategies for this plugin.

Known Bugs


This plugin is now bundled as part of Fiji (a distribution of ImageJ with many useful plugins), and no longer supported as a standalone ImageJ plugin. Please download and install Fiji and you will find the plugin in "Plugins > Process > Find Connected Regions"


The initial dialog box is rather complex, but all these options should be explained below:

Allow diagonal connections?

If you check the box for "Allow diagonal connections?" then two voxels that meet all the other criteria will be considered to be connected even if they only touch at the corners or along one edge. Otherwise, the voxels must share a face. To put that in less sloppy language, the search will be 26-connected rather than 6-connected if this option is selected.

Display an image for each region?

If this is selected then the plugin will generate and display a new image stack each time it finds a connected region. If you are finding lots of regions, you may not have enough memory for this, and you may just be interested in the counts of points in each region.

The images produced are masks, rather than being the original values in the stack, since this has been typically more useful in my experience. (The original values can be trivially recovered from the mask, of course.) The exception to this is if you have selected "Regions must have the same value?" in which case original values are kept, so you'll only have two colours in the image anyway.

Display results table?

If this is selected then the plugin will display information about the regions found (sorted by size of region) in the standard ImageJ results dialog.

Regions must have the same value?

In some situations (such as the first example above) you want to restrict the regions to have exactly the same value. In those situations you should select this box, otherwise (e.g. if you have an image with a smooth range of values) leave it unchecked.

Start from point selection?

By selecting this option you can specify that the search for the first cluster should start at a particular point by creating a point selection in the image stack and leaving the stack in on the right slice before starting the plugin. (Point selections and other regions of interest in ImageJ are not specific to particular slices.)

Otherwise one of two strategies is used for finding the starting point for the next cluster search:

Regions for values over:

Points will not be included in any cluster unless the value at the point is over this value. You probably need to tune this a little to get the kind of clusters you want.

Minimum number of points in a region:

In many situations you're only interested in really large clusters of points, so you can use this to specify the minimum number of points you want to consider as a cluster.

Stop after this number of regions are found:

You may know that you only want two large clusters in an image, for example, so you can use this option to stop the plugin after it has found those.


This plugin is licensed under the GPL (the GNU General Public License version 3). The source code for the plugin is available from the Fiji git repository.