avid.actions.rttb.bioModelCalc.BioModelCalcAction

class avid.actions.rttb.bioModelCalc.BioModelCalcAction(inputDose, weight=None, nFractions=None, modelParameters=None, modelParameterMaps=None, plan=None, modelName='LQ', normalizeFractions=True, useDoseScaling=True, outputExt='nrrd', actionTag='DoseStat', alwaysDo=False, session=None, additionalActionProps=None, actionConfig=None, propInheritanceDict=None, cli_connector=None)

Bases: CLIActionBase

Class that wraps the single action for the RTTB tool BioModelCalc. The current implementation expects only one input dose element per call.

__init__(inputDose, weight=None, nFractions=None, modelParameters=None, modelParameterMaps=None, plan=None, modelName='LQ', normalizeFractions=True, useDoseScaling=True, outputExt='nrrd', actionTag='DoseStat', alwaysDo=False, session=None, additionalActionProps=None, actionConfig=None, propInheritanceDict=None, cli_connector=None)

@param cwd Specifies the current working directory that should be used for the cli call. if not set explicitly, it will be deduced automatically by the specified tool/action

Methods

__init__(inputDose[, weight, nFractions, ...])

@param cwd Specifies the current working directory that should be used for the cli call.

do()

Triggers the processing of an action instance.

do_finalize()

Function that has to be called after the data processing of an action processing to finalize the action state and do the bookkeeping (e.g. notifying the session, checking the validity and existence of the outputs).

do_processing()

Function that has to be called to do the data processing of an action processing.

do_setup()

Function that has to be called to prepare an action for the processing.

generateArtefact([reference, ...])

Helper method that can be used in derived action classes in their indicateOutputs() implementation.

indicateOutputs()

Return a list of artefact entries the action will produce if do_setup() is called.

Attributes

ACTION_FAILURE

Indicating the skipping of the (last) execution of an action.

ACTION_PENDING

Indicating that the action instance is currently generating the outputs.

ACTION_RUNNING

Indicating that the action instance is in an uninitialized state.

ACTION_SKIPPED

Indicating that the action instance was not executed so far.

ACTION_SUCCESS

Indicating the failure of the (last) execution of an action instance.

ACTION_UNINIT

actionInstanceUID

actionTag

action_tag_selector

cwd

returns the current working directory that is used by the action when executing the tool.

has_warnings

instanceName

isFailure

isPending

isRunning

isSkipped

isSuccess

is_uninitialized

last_cli_call_file_path

last_exec_state

last_warnings

logErrorFilePath

Returns the path of the error log file that contains the std::error stream of the execution, the action instance is associated with.

logFilePath

Returns the path of the log file that contains the std::out stream of the execution, the action instance is associated with.

outputArtefacts

ACTION_FAILURE = 'FAILURE'

Indicating the skipping of the (last) execution of an action. As any outputs the action instance would produce are available and still up to date.

ACTION_PENDING = 'PENDING'

Indicating that the action instance is currently generating the outputs.

ACTION_RUNNING = 'RUNNING'

Indicating that the action instance is in an uninitialized state.

ACTION_SKIPPED = 'SKIPPED'

Indicating that the action instance was not executed so far.

ACTION_SUCCESS = 'SUCCESS'

Indicating the failure of the (last) execution of an action instance.

property cwd

returns the current working directory that is used by the action when executing the tool.

do()

Triggers the processing of an action instance. This should be used as public trigger of an action. It is a convenient version that will trigger do_setup, do_process and do_finalize in the right way. Returns the action instance itself.

do_finalize()

Function that has to be called after the data processing of an action processing to finalize the action state and do the bookkeeping (e.g. notifying the session, checking the validity and existence of the outputs). After the call of the method the outputs of action instance are collected and verified. It is advised to use do(), which will use do_finalize() appropriately.

do_processing()

Function that has to be called to do the data processing of an action processing. After the call of the method the outputs of action instance are computed. It is advised to use do(), which will use do_processing() appropriately.

do_setup()

Function that has to be called to prepare an action for the processing. After the call of the method the action instance is able to process the data (if needed). The return value indicates of the instance can/needs to process (true) or not (false). It is advised to use do(), which will use do_setup() appropriately. After the call of this method, the instance will have one of the following states: (1) pending: expected state. Indicating that action should/needs to process and no waiting for triggering do_process() (2) skipped: indicated ouput data is already there and valid. No need for do_process, directly trigger do_finalize() (3) failed: indicated that the setup failed (e.g. because inputs are invalid). No need for do_process, directly trigger do_finalize()

generateArtefact(reference=None, copyAdditionalPropsFromReference=True, userDefinedProps=None, url_user_defined_part=None, url_extension=None, use_no_url_id=False)

Helper method that can be used in derived action classes in their indicateOutputs() implementation. The generation will be done in following steps: 1) It generates an artefact that has the actionTag of the current action. 2) Other properties will be taken from the reference (if given). 3) If a self._propInheritanceDict is specified it will be used to inherit property values. 4) self._additionalActionProps will be transferd. 5) the property values defined in userDefinedProps will be transfered. Remark: ActionTag will always be of this action. Remark: As default the URL will be None. If parameter url_user_defined_part or url_extension are not None, an artefact URL will be created. In this case the following pattern will be used: <artefact_path>[<url_user_defined_part>.]<artefact_id>[<><url_extension>] artefact_path: Return of artefactHelper.generateArtefactPath using the configured new artefact. url_user_defined_part: Parameter of the call artefact_id: ID of the new artefact extension_seperator: OS specific file extension seperator url_extension: Parameter of the call REMARK: Currently if self has a _propInheritanceDict specified, only the first artefact of the indicated input selection will be used to inherit the property. @param reference An other artefact as reference. If given, the following properties will be copied to the new artefact: Case, timepoint, type, format, objective. @param copyAdditionalPropsFromReference Indicates if also the additional properties should be transfered from the reference to the new artefact (only relevant of reference is not None). @param userDefinedProps Properties specified by the user that should be set for the new artefact. Parameter is a dictionary. The keys are the property ids and the dict values their value. Passing None indicates that there are no props @url_user_defined_part: specifies the humand readable prefix of the artefact url. If set a URL will be generated. @url_extension: specifies the file extension of the artefact url. If set a URL will be generated. @use_no_url_id Bool. If set to true, the unique id at the end of generated filenames will be removed, giving the user full control of the resulting filenames. WARNING: When using this option, the user has to take care themselves to avoid collisions between generated files.

indicateOutputs()

Return a list of artefact entries the action will produce if do_setup() is called. The method should return complete entries. Therefore, the entries should already contain the url where they will be stored if the action is executed. Remark: The output indication might not represent the final result of an action (e.g. because an action is not able to determine the outputs before they are actually generated.). This the list might only indicate the assumed outputs. Also An action can return None to signal that it cannot indicate the outputs before generation. :return: Either a list of indicated outputs or None.

property logErrorFilePath

Returns the path of the error log file that contains the std::error stream of the execution, the action instance is associated with. If it is None the action was not executed so far.

property logFilePath

Returns the path of the log file that contains the std::out stream of the execution, the action instance is associated with. If it is None the action was not executed so far.