Module: Hough Circle Fitting ()

Description:

This is an experimental module from the Xtra Library: https://xtras.amira-avizo.com.

This module uses Hough-transform to detect circles in an image.

The idea of circular Hough-transform:
For each pixel in a binary image containing only edges, the likelihood of a circle with specific center-location and radius is determined by counting (accumulating) the number of matching edge-points. (Please read further to learn about the actual algorithm.) If a range of radius-values is analyzed, for each radius a separate accumulator-image is calculated.
In the end, the most likely circle is determined by the highest accumulator-value, and successively more circles are detected by selecting the next-highest accumulator-values while taking into account constraints (e.g. maximum number of circles, minimum distance).

For performing the calculation, the Python-library scikit-image is used.

Circle-fitting is done per XY-slice.

As input, you can use either a label-field or a grey-value image.
If the input is a label-field, it is assumed that it is containing edge-information only, so Canny edge-detection is switched off by default. If the input is a grey-value image, it is assumed that edge-detection is necessary, so the module-internal Canny edge-detection is activated by default. However, you may enable/disable Canny edge-detection in cases where you want to have it differently.

Three results are created, two label-fields and one spreadsheet:

Connections:

Data [required]
The image to search circles in. Supported are 2D or 3D images, either grey-scale or label-fields.

Ports:

Minimum Radius

This is the minimum radius for circles to be considered (in pixels).

Maximum Radius

This is the maximum radius for circles to be considered (in pixels).

Radius Step Size

Step-size for the radius variation (in pixels).

Minimum Distance of Circle Centers

The centers of detected circles have to be seperated by at least this value (in pixels). A good first guess is twice the minimum radius.

Maximum Number of Circles

This is the maximum number of circles to be detected per XY-slice. In the algorithm, the accumulator-values are sorted descendingly and the circles are detected by finding the highest accumulator-values while taking the specified minimum distance into account.

Min Accum-Value

Accumulator-values are scaled to the range (0,1]. Low accumulator-values often correspond to false detections. Raising the value will suppress low-accumulator detections.

Normalise Accum-Values

Without normalisation, larger circles would get higher accumulator-values and would thus be preferred over smaller circles at the same position.

Apply Canny Edge-Detection

If the image is a grey-scale image, the edges can be detected using Canny edge-detection. If the input data is a label-field containing the edges, the edge-detection should be switched off.
On (re-)connection of data, this toggle is per default switched on for grey-value data, and switched off for label data. However, you may enable/disable Canny edge-detection in cases where you want to have it differently.

Edge Sigma

The width of edges in the image (in pixels). If the edges are not sharp, the value of sigma should be increased.