CWorkflowTaskIO¶
- class ikomia.core.pycore.CWorkflowTaskIO¶
Base class for task inputs and outputs. Each task can have as many inputs and outputs as necessary. Each input/output class must inherit this class and override the needed methods.
Import
from ikomia.core import CWorkflowTaskIO
Methods
__init__
(arg1)__init__( (object)self) -> None :
clear_data
(self)Clear the data stored in the object.
copy_static_data
(self, io)Copy the static data from the given input or ouput.
from_json
(self, jsonStr)Set input/output data from JSON formatted string.
get_sub_io_list
(self, types)Get the sub I/O objects of given types from a composite I/O.
get_unit_element_count
(self)Get the number of unit elements in terms of processing scheme.
is_composite
(self)Check whether I/O object is a composite one.
is_data_available
(self)Check whether input or output objects contain valid data.
load
(self, path)Load the input or output data from disk.
save
(self, path)Save the input or output data to disk.
to_json
(self)Return input/output data in JSON formatted string with default options.
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)
See
IODataType
for available data types.Details
- __init__((object)arg1) None ¶
- __init__( (object)self) -> None :
Default constructor
- __init__( (object)self, (IODataType)data_type) -> None :
Constructor with parameters
Args:
data_type (
IODataType
): data type identifier- __init__( (object)self, (IODataType)data_type, (str)name) -> None :
Constructor with parameters
Args:
data_type(
IODataType
): data type identifiername (str): custom name associated to input/output to give more insights to end user
- __init__( (object)arg1, (CWorkflowTaskIO)arg2) -> None :
Copy constructor
- clear_data((CWorkflowTaskIO)self) None : ¶
Clear the data stored in the object. Should be overriden for custom input or output.
clear_data( (CWorkflowTaskIO)self) -> None
- copy_static_data((CWorkflowTaskIO)self, (CWorkflowTaskIO)io) None : ¶
Copy the static data from the given input or ouput. Static data are those which are not generated at runtime. Should be overriden for custom input or output.
Args:
CWorkflowTaskIO
: input or ouput instance from which data is copiedcopy_static_data( (CWorkflowTaskIO)self, (CWorkflowTaskIO)io) -> None
- from_json((CWorkflowTaskIO)self, (str)jsonStr) None : ¶
Set input/output data from JSON formatted string. This method must be overriden.
Args:
jsonStr (str): data as JSON formatted string
from_json( (CWorkflowTaskIO)self, (str)jsonStr) -> None
- get_sub_io_list((CWorkflowTaskIO)self, (object)types) object : ¶
Get the sub I/O objects of given types from a composite I/O.
Args:
types (list of:py:class:~ikomia.core.pycore.IODataType): sub I/O types
Returns:
list of
CWorkflowTaskIO
based objects: sub IO objectsget_sub_io_list( (CWorkflowTaskIO)self, (object)types) -> object
- get_unit_element_count((CWorkflowTaskIO)self) int : ¶
Get the number of unit elements in terms of processing scheme. This value is used to define the number of progress steps for progress bar component in Ikomia STUDIO. For an image, the count is 1. For Z-stack volume, the count is the number of Z levels. Should be overriden for custom input or output.
Returns:
int: number of unit element to process
get_unit_element_count( (CWorkflowTaskIO)self) -> int
- is_composite((CWorkflowTaskIO)self) bool : ¶
Check whether I/O object is a composite one. This method should be overriden for custom input or output.
Returns:
bool: True or False
is_composite( (CWorkflowTaskIO)self) -> bool
- is_data_available((CWorkflowTaskIO)self) bool : ¶
Check whether input or output objects contain valid data. For inputs, it is the case when the previous process contains valid output data. For outputs, it is the case when the associated task had been computed at least once. Should be overriden for custom input or output.
Returns:
bool: True if data is available, False otherwise
is_data_available( (CWorkflowTaskIO)self) -> bool
- load((CWorkflowTaskIO)self, (str)path) None : ¶
Load the input or output data from disk. This method must be overriden.
Args:
path (str): file path
load( (CWorkflowTaskIO)self, (str)path) -> None
- save((CWorkflowTaskIO)self, (str)path) None : ¶
Save the input or output data to disk. This method must be overriden.
Args:
path (str): file path
save( (CWorkflowTaskIO)self, (str)path) -> None
- to_json((CWorkflowTaskIO)self) str : ¶
Return input/output data in JSON formatted string with default options. This method must be overriden.
Returns:
str: JSON formatted string
to_json( (CWorkflowTaskIO)self) -> str
- to_json( (CWorkflowTaskIO)self, (object)options) -> str :
Return input/output data in JSON formatted string. This method must be overriden. Options available depend on input/output type, a single option is available for all to set the JSON format:
[‘json_format’, ‘compact’] (default)
[‘json_format’, ‘indented’]
Args:
options (list of str): format-specific options encoded as pairs [option_name, option_value]
Returns:
str: JSON formatted string
to_json( (CWorkflowTaskIO)self, (object)options) -> str