monai.deploy.core.executors.SingleProcessExecutor

class monai.deploy.core.executors.SingleProcessExecutor(app, datastore=None, **kwargs)[source]

Bases: monai.deploy.core.executors.executor.Executor

This class implements execution of a MONAI App in a single process in environment.

Constructor of the class.

Given an application it invokes the compose method on the app, which in turn creates the necessary operator and links them up.

Parameters
  • app (Application) – An application that needs to be executed.

  • datastore (Optional[Datastore]) – A data store that is used to store the data.

Methods

__init__(app[, datastore])

Constructor of the class.

run()

Run the app.

Attributes

app

Returns the application that is executed by the executor.

datastore

Returns the data store that is used to store the data.

__init__(app, datastore=None, **kwargs)

Constructor of the class.

Given an application it invokes the compose method on the app, which in turn creates the necessary operator and links them up.

Parameters
  • app (Application) – An application that needs to be executed.

  • datastore (Optional[Datastore]) – A data store that is used to store the data.

property app: monai.deploy.core.application.Application

Returns the application that is executed by the executor.

Return type

Application

property datastore: monai.deploy.core.datastores.datastore.Datastore

Returns the data store that is used to store the data.

Return type

Datastore

run()[source]

Run the app.

This method executes operators of the graph in topological order:

  • If a node (operator) is a root node, its input is treated as a data path (DataPath, IOType.DISK).

  • If a node (operator) is a leaf node, its output is treated as a data path (DataPath, IOType.DISK).

  • After the execution of an operator, the output of the operator is used as the input of the next operator.