Region Competition

This plugins is based on the MOSAIC Discrete region competition algorithm, for image segmentation

J. Cardinale, G. Paul, and I. F. Sbalzarini. Discrete region competition for unknown numbers of connected regions. IEEE Trans. Image Process., 21(8):3531-3545, 2012. (PDF)


Copy the mosaic plugins.jar file into the ImageJs plugins directory, restart ImageJ. The plugin can be launched from the Mosaic submenu in ImageJs plugin menu. The plugin handles 8-bit, 16-bit and 32-bit grayscale images or stacks.

Algorithm and Interface

The algorithm require the following inputs and produce the following outputs



Image source Label output image
Energy function Intensity normalized image
Energy function parameters Animated iteration sequence
Label image source (optional)

Image source: Can be in any format recognized by ImageJ, the image is automaticaly converted into a floating point intensity image
Intensity normalized image: All pixels of the original image are rescaled so that each pixel is ranged from 0.0 to 1.0
Label image source: Is the segmented image produced by the algorithm, it can be saved in all imageJ supported formats
Animated sequence: Is the evolution of the segmentation produced by the algorithm, can be saved in all imageJ supported formats
Energy function: The segmentation is driven by the minimization of an energy function. In this plugin several energy functions or combinations of energy functions can be selected. In the following we introduce briefly all them, but for a complete explanation of which one use and in which situation use the paper [1]. Label image source: This is an optional image that defines the initial segmentation from which the algoritm should start. If not given the default behaviour is to use an autogenerated starting labels image.
Energy function parameters:The energy function in general have free parameter, that should be setted by the user or initialized to some default value.

Step by step tutorial

Select an image

Press OpenImage button and choose the file, or drag and drop the file inside the rectangle. if the file is is already opened in ImageJ, choose it from the input selector.

Select paramenters

Press Parameters button in the main window, you can tune global parameters like the maxium number of iteration and the oscillation threshold that control the convergence of the algorithm. You can also tune global parameters related to the energy, like Lambda and Theta that we will explain below.

Lambda E length: Lambda E length: Is a scaling factor for the Energy length, this term in general is sensitive to the shape of the region
Theta E merge: Is a factor needed for the merging energy function, this term implements model that controls the merging of two regions
Max Iteration: Is the maximum number of iteration
Oscillation Threadshold: This parameter controls the convergence of the algorithm in this way, at each iteration the global energy is stored, the standard deviation is calculated along all history and starting from the last 10 iterations. Each time the event in fig A occurs the number of fixed particles needed to converge is reduced by a factor two

E data

This is the Energy part that depend from the input image, each model have an "options window" that can be opened pressing the near "Options" button


No Additional options are available


Radius: Radius of the sphere where the mean of the intensity is calculated
Beta Balloon force: Beta controls the strenght of the Balloon force


Open PSF Image: Open an image and use it as Point Spread Function
Generate:Generate a gaussian PSF Image, before starting the simulation

Use paper [1] for a detailed explanation of each model, term and parameter

Energy length model

From a practical point of view, this energy locally reduces concavity, tips , and globally the length of the countor region. The image show what happen when the segmentation is driven only by the Sphere Regularization energy term

Sphere Regularization

Radius: Radius of the hypersphere in the curvature regularization


Countor length regularization, no other parameters needed

Energy Merge


This parameter is controlled in the global region competition parameters (Theta E Merge)



Create a grid of bubbles with a specified radius and padding


Create a rectangle in the center of the image, the ratio is the division of the side of the rectangle with the side of the image on each dimension


Before the simulation start, the normalized intensity image is shown, and it ask to user to draw a starting region using the selection tools of ImageJ, when done press shift to start the simulation

Local Maxima

the initial regions are created around the local maxima of the image, and the following three steps are performed

1) Sigma:The first stage is to apply a gaussian blur filter to the image with sigma variance

2) Tolerance: Find out the locals maxima according to the tollerance parameter. The maxima are accepted only if protruding more than this value from the ridge to a higher maximum. High value of tollerance means that only high local maxima will be accepted, reducing the Tolerance, increases the group of possible maxima accepted (from left to right in the image)

3) Region Tol:Filter the regions found such that: If the region is smaller that "Region Tol", creates a bubble with radius (Radius) [1], otherwise leave the region unchanged [2]

Handle, fission, fusion

The algorithm is able to manage changes of topology, you can enable or disable the creation of handles, and fission and fusion of regions

Other options

Show progress: Show the progress of the segmentation process during computation
Keep frames: Save all frames produced by the algorithm
Show normalized: Show the floating point normalized image
Show statistics: Show statistics of the segmentation



Oscillation threshold: 0.001
Theta E merge: 0.01
Lambda E length: 0.2
R_k: 8
Local Max Radius : 5
Local Max Sigma : 8
Local Max Tolarance: 0.002


Oscillation threshold: 0.00001
Theta E merge: 0.2
Lambda E length: 0.04
R_k: 8
Bubble radius: 20
Bubble padding: 20


Oscillation threshold: 0.02
Theta E merge: 0.2
Lambda E length: 0.07
R_k: 4
Rectangle fill ratio: 0.80


Oscillation threshold: 0.01
Theta E merge: 0.4
Lambda E length: 0.08
R_k: 4
PS Radius: 4
Beta Ballon: 0.01
Rectangle fill ratio: 0.80


Oscillation threshold: 0.8
Theta E merge: 0.1
Lambda E length: 0.15
R_k: 2
Local Maxima


Oscillation threshold: 0.18
Theta E merge: 0.2
Lambda E length: 0.07
R_k: 4
Rectangle fill ratio: 0.80