basegraph module
- Module basegraph aims to define base classes related to the graphs in .sbs and .sbsar packages:
- class common_interfaces.basegraph.BaseGraph(aIdentifier, aParamInputs)
Bases:
objectClass used to provide a common interface between a
Graphand aModuleGraph.- Members:
mIdentifier: Unique identifier of the graph
mParamInputs: Absolute directory of the package
- getIdentifier()
getIdentifer()
- Returns:
str identifier
- getAttribute(aAttributeIdentifier)
Get the given attribute value
- Parameters:
aAttributeIdentifier (
AttributesEnum) – the attribute identifier- Returns:
the attribute value if defined, None otherwise
- getAllInputs()
Get the list of all inputs (images and parameters) defined on this graph
- Returns:
a list of inputs as
ParamInput
- abstractmethod getAllInputsInGroup(aGroup)
- Get the list of all inputs (images and parameters) contained in the given group.If aGroup is None, returns all the parameters that are not included in a group.
- Parameters:
aGroup (
SBSARGuiGroupor str) – The group of parameter to consider, given a SBSARGuiGroup object or a Group identifier- Returns:
a list of inputs
- getAllInputGroups()
Get the list of all groups used for the inputs of the graph.
- Returns:
a list of groups as strings
- getInput(aInputIdentifier)
Get the ParamInput with the given identifier, among the input images and parameters
- Parameters:
aInputIdentifier (str) – input parameter identifier
- Returns:
the corresponding
ParamInputobject if found, None otherwise
- getInputFromUID(aInputUID)
Get the ParamInput with the given UID, among the input images and parameters
- Parameters:
aInputUID (str) – input parameter UID
- Returns:
the corresponding
ParamInputobject if found, None otherwise
- getInputImages()
Get the list of image inputs
- Returns:
a list of image inputs as ParamInput
- getInputImage(aInputImageIdentifier)
Get the image input with the given identifier
- Parameters:
aInputImageIdentifier (str) – input image identifier
- Returns:
a
ParamInputif found, None otherwise
- getInputImageWithUsage(aUsage)
Get the first image input which has the given usage defined
- Parameters:
aUsage (
UsageEnumor str) – usage to look for- Returns:
a
ParamInputif found, None otherwise
- getInputParameters()
Get the list of input parameters (not image)
- Returns:
a list of
ParamInput
- getInputParameter(aInputParamIdentifier)
Get the input parameter with the given identifier
- Parameters:
aInputParamIdentifier (str) – input parameter identifier
- Returns:
the corresponding
ParamInputobject if found, None otherwise
- getInputParameterFromUID(aInputParamUID)
Get the input parameter with the given UID
- Parameters:
aInputParamUID (str) – input parameter UID
- Returns:
the corresponding
ParamInputobject if found, None otherwise
- class common_interfaces.basegraph.Graph(aIdentifier, aPrimaryInput, aParamInputs, aGraphOutputs, aPresets)
Bases:
BaseGraphClass used to provide a common interface between a
SBSGraphand aSBSARGraph.- Members:
mIdentifier: Unique identifier of the graph
mPrimaryInput: Execution context, with alias definition
mParamInputs: Absolute directory of the package
mGraphOutputs: Absolute path of the package
mPresets: List of parameters presets
- getAttribute(aAttributeIdentifier)
Get the given attribute value
- Parameters:
aAttributeIdentifier (
AttributesEnum) – the attribute identifier- Returns:
the attribute value if defined, None otherwise
- getGraphOutputs()
Get all the graph outputs
- Returns:
the list of
GraphOutputdefined on this graph
- getGraphOutput(aOutputIdentifier)
Get the graph output with the given identifier
- Parameters:
aOutputIdentifier (str) – identifier of the output
- Returns:
a
GraphOutputobject if found, None otherwise
- getGraphOutputWithUsage(aUsage)
Get the first graph output which has the given usage defined
- Parameters:
aUsage (
UsageEnumor str) – usage to look for- Returns:
a
GraphOutputobject if found, None otherwise
- getPreset(aPresetLabel)
Get the preset with the given label
- Returns:
a
Presetobject if found, None otherwise
- abstractmethod getPrimaryInput()
Get the primary input of the graph
- Returns:
The primary input as a string if it exists, None otherwise
- abstractmethod isPrimaryInput(aInput)
Check if the given input is the primary input for this graph or not
- Parameters:
aInput (str) – The input to check
- Returns:
True if this is the primary input, False otherwise