CGraphicsInput¶
- class ikomia.dataprocess.pydataprocess.CGraphicsInput¶
Define task input containing graphics items. Consult
GraphicsItem
to see the list of possible graphics types. Instance can be added as input of aCWorkflowTask
or derived. This kind of input is used to manage user-defined ROI or to forward graphics items generated by a previous task in your workflow. Derived fromCWorkflowTaskIO
.Import
from ikomia.dataprocess import CGraphicsInput
Methods
__init__
(arg1)__init__( (object)self) -> None :
get_items
(self)Get list of graphics items.
set_items
(self, items)Fill input/output with the given graphics item list.
Overridden methods
clear_data
(self)Clear input/output data.
from_json
(self, jsonStr)Set input/output data from JSON formatted string.
is_data_available
(self)Check whether the input/output contains data.
load
(self, path)Load graphics input/output from previsouly exported file.
save
(self, path)Save graphics input/output data to file.
to_json
(self)Return input/output data in JSON formatted string (compact mode).
Inherited methods
copy_static_data
(self, io)Copy the static data from the given input or ouput.
get_unit_element_count
(self)Get the number of unit elements in terms of processing scheme.
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 CGraphicsInput instance with the given name.
Args:
name (str): input custom name (to give insights to end user)
- __init__( (object)arg1, (CGraphicsInput)arg2) -> None :
Copy constructor
- clear_data((CGraphicsInput)self) None : ¶
Clear input/output data.
clear_data( (CGraphicsInput)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((CGraphicsInput)self, (str)jsonStr) None : ¶
Set input/output data from JSON formatted string.
Args:
str: data as JSON formatted string
from_json( (CGraphicsInput)self, (str)jsonStr) -> None
- get_items((CGraphicsInput)self) object : ¶
Get list of graphics items.
- Returns:
list of
CGraphicsItem
based objects
- 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_data_available((CGraphicsInput)self) bool : ¶
Check whether the input/output contains data.
Returns:
bool: True if input contains data, False otherwise
is_data_available( (CGraphicsInput)self) -> bool
- load((CGraphicsInput)self, (str)path) None : ¶
Load graphics input/output from previsouly exported file. The file must be in JSON format.
Args:
path (str)
load( (CGraphicsInput)self, (str)path) -> None
- save((CGraphicsInput)self, (str)path) None : ¶
Save graphics input/output data to file. The file must be in JSON format.
Args:
path (str)
save( (CGraphicsInput)self, (str)path) -> None
- set_items((CGraphicsInput)self, (object)items) None : ¶
Fill input/output with the given graphics item list.
- Parameters:
items (list of
CGraphicsItem
) – based objects
- to_json((CGraphicsInput)self) str : ¶
Return input/output data in JSON formatted string (compact mode).
Returns:
string: JSON formatted string
to_json( (CGraphicsInput)self) -> str
- to_json( (CGraphicsInput)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
to_json( (CGraphicsInput)self, (object)options) -> str