Task

Module dedicated to high-level features around task management.

See also CWorkflowTask for all available methods from task object instance.

Import

from ikomia.core import task

Classes

TaskParam()

Base class to manage task parameters.

Functions

create([name])

Create task instance (ie algorithm) from the given name.

get_array_output(task[, index])

Get ARRAY output(s) of the given task.

get_blob_measure_output(task[, index])

Get BLOB MEASURE output(s) of the given task.

get_dataset_output(task[, index])

Get DATASET output(s) of the given task.

get_graphics_output(task[, index])

Get GRAPHICS output(s) of the given task.

get_image_output(task[, index])

Get IMAGE output(s) of the given task.

get_image_with_graphics(task[, image_index, ...])

Get image (numpy array) of a specific IMAGE output with graphics items from a specific GRAPHICS output burnt into it.

get_numeric_output(task[, index])

Get NUMERIC output(s) of the given task.

get_data_string_output(task[, index])

Get data string output(s) of the given task.

get_path_output(task[, index])

Get ARRAY output(s) of the given task.

set_parameters(task, params)

Set parameters of the given task from a dict structure.

Details

ikomia.core.task.create(name='')

Create task instance (ie algorithm) from the given name. See IkomiaRegistry for details.

Parameters

name (str) – unique algorithm name

Returns

algorithm instance

Return type

CWorkflowTask or derived

ikomia.core.task.get_array_output(task, index=- 1)

Get ARRAY output(s) of the given task. A task can have multiple ARRAY outputs so the index argument can be set to specify the wanted output.

Parameters
  • task (CWorkflowTask or derived) – object instance.

  • index (int) – zero-based index of the output in case of multiple matches. With default -1, all outputs are returned.

Returns

output or list of outputs.

Return type

CArrayIO

ikomia.core.task.get_blob_measure_output(task, index=- 1)

Get BLOB MEASURE output(s) of the given task. A task can have multiple BLOB MEASURE outputs so the index argument can be set to specify the wanted output.

Parameters
  • task (CWorkflowTask or derived) – object instance.

  • index (int) – zero-based index of the output in case of multiple matches. With default -1, all outputs are returned.

Returns

output or list of outputs.

Return type

CBlobMeasureIO

ikomia.core.task.get_dataset_output(task, index=- 1)

Get DATASET output(s) of the given task. A task can have multiple DATASET outputs so the index argument can be set to specify the wanted output.

Parameters
  • task (CWorkflowTask or derived) – object instance.

  • index (int) – zero-based index of the output in case of multiple matches. With default -1, all outputs are returned.

Returns

output or list of outputs.

Return type

CDatasetIO

ikomia.core.task.get_graphics_output(task, index=- 1)

Get GRAPHICS output(s) of the given task. A task can have multiple GRAPHICS outputs so the index argument can be set to specify the wanted output.

Parameters
  • task (CWorkflowTask or derived) – object instance.

  • index (int) – zero-based index of the output in case of multiple matches. With default -1, all outputs are returned.

Returns

output or list of outputs.

Return type

CGraphicsOutput

ikomia.core.task.get_image_output(task, index=- 1)

Get IMAGE output(s) of the given task. A task can have multiple IMAGE outputs so the index argument can be set to specify the wanted output.

Parameters
  • task (CWorkflowTask or derived) – object instance.

  • index (int) – zero-based index of the output in case of multiple matches. With default -1, all outputs are returned.

Returns

output or list of outputs.

Return type

CImageIO

ikomia.core.task.get_image_with_graphics(task, image_index=0, graphics_index=0)

Get image (numpy array) of a specific IMAGE output with graphics items from a specific GRAPHICS output burnt into it. Index of IMAGE and GRAPHICS outputs must be given.

Parameters
  • task (CWorkflowTask or derived) – object instance.

  • image_index (int) – zero-based index of the IMAGE output.

  • graphics_index (int) – zero-based index of the GRAPHICS output.

Returns

result image.

Return type

Numpy array

ikomia.core.task.get_numeric_output(task, index=- 1)

Get NUMERIC output(s) of the given task. A task can have multiple NUMERIC outputs so the index argument can be set to specify the wanted output.

Parameters
  • task (CWorkflowTask or derived) – object instance.

  • index (int) – zero-based index of the output in case of multiple matches. With default -1, all outputs are returned.

Returns

output or list of outputs.

Return type

CNumericIO

ikomia.core.task.get_data_string_output(task, index=- 1)

Get data string output(s) of the given task. A task can have multiple NUMERIC outputs so the index argument can be set to specify the wanted output.

Parameters
  • task (CWorkflowTask or derived) – object instance.

  • index (int) – zero-based index of the output in case of multiple matches. With default -1, all outputs are returned.

Returns

output or list of outputs.

Return type

CDataStringIO

ikomia.core.task.get_path_output(task, index=- 1)

Get ARRAY output(s) of the given task. A task can have multiple ARRAY outputs so the index argument can be set to specify the wanted output.

Parameters
  • task (CWorkflowTask or derived) – object instance.

  • index (int) – zero-based index of the output in case of multiple matches. With default -1, all outputs are returned.

Returns

output or list of outputs.

Return type

CPathIO

ikomia.core.task.set_parameters(task, params: dict)

Set parameters of the given task from a dict structure.

Parameters
  • task (CWorkflowTask or derived) – object instance.

  • params (dict) – pair of key, value for each parameter. The key will be treated as str.