ClassesClassesClassesClasses | | | | Operators

region_to_labelregion_to_labelRegionToLabelregion_to_labelRegionToLabelRegionToLabel (Operator)

Name

region_to_labelregion_to_labelRegionToLabelregion_to_labelRegionToLabelRegionToLabel — Convert regions to a label image.

Signature

region_to_label(Region : ImageLabel : Type, Width, Height : )

Herror region_to_label(const Hobject Region, Hobject* ImageLabel, const char* Type, const Hlong Width, const Hlong Height)

Herror T_region_to_label(const Hobject Region, Hobject* ImageLabel, const Htuple Type, const Htuple Width, const Htuple Height)

Herror region_to_label(Hobject Region, Hobject* ImageLabel, const HTuple& Type, const HTuple& Width, const HTuple& Height)

HImage HRegion::RegionToLabel(const HTuple& Type, const HTuple& Width, const HTuple& Height) const

HImage HRegionArray::RegionToLabel(const HTuple& Type, const HTuple& Width, const HTuple& Height) const

void RegionToLabel(const HObject& Region, HObject* ImageLabel, const HTuple& Type, const HTuple& Width, const HTuple& Height)

HImage HRegion::RegionToLabel(const HString& Type, Hlong Width, Hlong Height) const

HImage HRegion::RegionToLabel(const char* Type, Hlong Width, Hlong Height) const

void HOperatorSetX.RegionToLabel(
[in] IHUntypedObjectX* Region, [out] IHUntypedObjectX*ImageLabel, [in] VARIANT Type, [in] VARIANT Width, [in] VARIANT Height)

IHImageX* HRegionX.RegionToLabel(
[in] BSTR Type, [in] Hlong Width, [in] Hlong Height)

static void HOperatorSet.RegionToLabel(HObject region, out HObject imageLabel, HTuple type, HTuple width, HTuple height)

HImage HRegion.RegionToLabel(string type, int width, int height)

Description

region_to_labelregion_to_labelRegionToLabelregion_to_labelRegionToLabelRegionToLabel converts the input regions into a label image according to their index (1..n), i.e., the first region is painted with the gray value 1, the second the gray value 2, etc. Only positive gray values are used. For 'byte'"byte""byte""byte""byte""byte"-images the index is entered modulo 256.

Regions larger than the generated image are clipped appropriately. If regions overlap the regions with the higher image are entered (i.e., they are painted in the order in which they are contained in the input regions). If so desired, the regions can be made non-overlapping by calling expand_regionexpand_regionExpandRegionexpand_regionExpandRegionExpandRegion.

The background, i.e., the area not covered by any regions, is set to 0. This can be used to test in which image range no region is present.

Parallelization

Parameters

RegionRegionRegionRegionRegionregion (input_object)  region(-array) objectHRegionHRegionHRegionHRegionXHobject

Regions to be converted.

ImageLabelImageLabelImageLabelImageLabelImageLabelimageLabel (output_object)  image objectHImageHImageHImageHImageXHobject * (byte / int2 / int4)

Result image of dimension Width * Height containing the converted regions.

TypeTypeTypeTypeTypetype (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Pixel type of the result image.

Default value: 'int2' "int2" "int2" "int2" "int2" "int2"

List of values: 'byte'"byte""byte""byte""byte""byte", 'int2'"int2""int2""int2""int2""int2", 'int4'"int4""int4""int4""int4""int4", 'int8'"int8""int8""int8""int8""int8"

WidthWidthWidthWidthWidthwidth (input_control)  extent.y HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Width of the image to be generated.

Default value: 512

Suggested values: 64, 128, 256, 512, 1024

Typical range of values: 1 ≤ Width Width Width Width Width width ≤ 1024 (lin)

Minimum increment: 1

Recommended increment: 16

Restriction: Width >= 1

HeightHeightHeightHeightHeightheight (input_control)  extent.x HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Height of the image to be generated.

Default value: 512

Suggested values: 64, 128, 256, 512, 1024

Typical range of values: 1 ≤ Height Height Height Height Height height ≤ 1024 (lin)

Minimum increment: 1

Recommended increment: 16

Restriction: Height >= 1

Complexity

O(2*HeightHeightHeightHeightHeightheight*WidthWidthWidthWidthWidthwidth).

Result

region_to_labelregion_to_labelRegionToLabelregion_to_labelRegionToLabelRegionToLabel always returns 2 (H_MSG_TRUE). The behavior in case of empty input (no regions given) can be set via set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>) and the behavior in case of an empty input region via set_system('empty_region_result',<Result>)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>). If necessary, an exception is raised.

Possible Predecessors

thresholdthresholdThresholdthresholdThresholdThreshold, regiongrowingregiongrowingRegiongrowingregiongrowingRegiongrowingRegiongrowing, connectionconnectionConnectionconnectionConnectionConnection, expand_regionexpand_regionExpandRegionexpand_regionExpandRegionExpandRegion

Possible Successors

get_grayvalget_grayvalGetGrayvalget_grayvalGetGrayvalGetGrayval, get_image_pointer1get_image_pointer1GetImagePointer1get_image_pointer1GetImagePointer1GetImagePointer1

Alternatives

region_to_binregion_to_binRegionToBinregion_to_binRegionToBinRegionToBin, paint_regionpaint_regionPaintRegionpaint_regionPaintRegionPaintRegion

See also

label_to_regionlabel_to_regionLabelToRegionlabel_to_regionLabelToRegionLabelToRegion

Module

Foundation


ClassesClassesClassesClasses | | | | Operators