niftynet.engine.application_driver module

This module defines a general procedure for running applications Example usage:

app_driver = ApplicationDriver() app_driver.initialise_application(system_param, input_data_param) app_driver.run_application()

system_param and input_data_param should be generated using: niftynet.utilities.user_parameters_parser.run()

class niftynet.engine.application_driver.ApplicationDriver

Bases: object

This class initialises an application by building a TF graph, and maintaining a session and coordinator. It controls the starting/stopping of an application. Applications should be implemented by inheriting niftynet.application.base_application to be compatible with this driver.

initialise_application(workflow_param, data_param)

This function receives all parameters from user config file, create an instance of application. :param workflow_param: a dictionary of user parameters, keys correspond to sections in the config file :param data_param: a dictionary of input image parameters, keys correspond to data properties to be used by image_reader :return:

run_application()

Initialise a TF graph, connect data sampler and network within the graph context, run training loops or inference loops.

The training loop terminates when self.final_iter reached. The inference loop terminates when there is no more image sample to be processed from image reader. :return: