CBlobMeasureIO

class ikomia.dataprocess.pydataprocess.CBlobMeasureIO

Define input or output for a task consuming or producing measures on blobs (ie connected components). It is possible to compute and store several measures for a single blob. A CBlobMeasureIO instance stores a list of measures for each blob of an image, so you have a list of CObjectMeasure list. Please note that it is possible to map each blob with its associated graphics item stored in a CGraphicsOutput instance. You just need to pass the graphics item identifier to the object measure . Blob measures can also be handled by CNumericIO. Although CNumericIO is more generic, it can’t map measure values with graphics item, which can be useful to give visual information from object measures to users. Derived from CWorkflowTaskIO

Import

from ikomia.dataprocess import CBlobMeasureIO

Methods

__init__(arg1)

__init__( (object)self) -> None :

add_object_measure(self, measure)

Add a new blob measure.

add_object_measures(self, measures)

Add a new list of measures for a blob.

get_measures(self)

Get measures for all blobs.

set_object_measure(self, index, measure)

Set measure for the blob specified by the given index.

Overridden methods

clear_data(self)

See clear_data().

from_json(self, jsonStr)

Set input/output data from JSON formatted string.

is_data_available(self)

Return True if there is at least one measure for one blob, False otherwise.

to_json(self)

Return input/output data in JSON formatted string (compact mode).

Attributes

auto_save

Auto-save status

data_type

I/O data type

dim_count

Number of dimensions

description

Custom description to explain input/output type and use

displayable

Displayable status (Ikomia Studio)

name

I/O name

source_file_path

Path to the source file used as workflow input (if any)

Details

__init__((object)arg1) None
__init__( (object)self) -> None :

Default constructor

__init__( (object)self, (str)name) -> None :

Construct a CBlobMeasureIO instance with the given name.

Args:

name (str): input or output custom name (to give insigths to end user)

__init__( (object)arg1, (CBlobMeasureIO)arg2) -> None :

Copy constructor

add_object_measure((CBlobMeasureIO)self, (CObjectMeasure)measure) None :

Add a new blob measure. Use this method if only one measure is computed for a blob.

Parameters:

measure (CObjectMeasure)

add_object_measures((CBlobMeasureIO)self, (object)measures) None :

Add a new list of measures for a blob.

Parameters:

measures (list of CObjectMeasure)

from_json((CBlobMeasureIO)self, (str)jsonStr) None :

Set input/output data from JSON formatted string.

Parameters:

str – data as JSON formatted string

get_measures((CBlobMeasureIO)self) object :

Get measures for all blobs.

Returns:

measures (list of CObjectMeasure list)

set_object_measure((CBlobMeasureIO)self, (int)index, (CObjectMeasure)measure) None :

Set measure for the blob specified by the given index.

Parameters:
  • index (int) – zeo-based index in the blob list

  • measure (CObjectMeasure)

clear_data((CBlobMeasureIO)self) None :

See clear_data().

is_data_available((CBlobMeasureIO)self) bool :

Return True if there is at least one measure for one blob, False otherwise.

to_json((CBlobMeasureIO)self) str :

Return input/output data in JSON formatted string (compact mode).

Returns:

string: JSON formatted string

to_json( (CBlobMeasureIO)self, (object)options) -> str :

Return input/output data in JSON formatted string. JSON format option can be set, possible values are:

  • [‘json_format’, ‘compact’] (default)

  • [‘json_format’, ‘indented’]

Args:

list of str: format-specific options encoded as pairs [option_name, option_value]

Returns:

string: JSON formatted string