ConvexHull

MLModule
genre Region
status stable
author Sarah Behrens
package MeVisLab/Standard
dll MLFuzzy
definition MLFuzzy.def
see also Rank
keywords convex, hull, konvex, gaps, closeGaps

Purpose

The module ConvexHull calculates the convex hull of an object in 2D slices.

An object is defined by voxels of the same non-zero value. For each object in the image, first all pixels with at least one zero valued neighbour are collected and then connected. After that, holes inside the object are filled. Pixels belonging to the object are set to the maximum image value and the background pixels are left to zero.

Note that the module is designed to find multiple objects in an image. All those different objects need to be identifyable by their unique voxel values. The input image is scanned Number of Objects-times, and at each scan the input image is investigated to contain voxels with the value of the current object number.

Details

Depending on the object size the calculation can take a while but is quite fast for 2D.

If the module's Number of Objects field is set to 1 (default), only voxels with value 1 are taken into consideration for computing the convex hull.

If the input image yields an object consisting of voxels with a value of, for example, 255, the Number of Objects field needs to be set to 255 in order to detect the object in the input image correctly. Note that this would also result in 254 scans of the entire input image with no objects to be found and in a 255th scan that finally detects the object. In such a case, leave the Number of Objects field to 1 and alter the input image's object voxel values to 1 (i.e. by using a Scale module).

Windows

Default Panel

../../../Modules/ML/MLFuzzy/mhelp/Images/Screenshots/ConvexHull._default.png

Input Fields

input0

name: input0, type: Image

The input image of a scalar type.

Since the objects are found by their voxel value and this value needs to correspond to the object number, the objects' voxel values needs to be of integer type.

Output Fields

output0

name: output0, type: Image

The convex hull of the objects in the input image.

The voxel values of the convex hull(s) in the output image correspond to the object number and thus to the voxel values in the input image.

Parameter Fields

Visible Fields

Number of Objects

name: numObjects, type: Integer, default: 0

Sets the number of objects to scan for and by that, the number of scans. In each scan, the module searches for objects with the voxel value that correspond to the current object number

If the field is set to 2, the module scans first for voxels of value 1 forming an object, and then for voxels with value 2, forming another object.