class_docstr: This class initialises an application by building a TF graph,
  and maintaining a session. It controls the
  starting/stopping of an application. Applications should be
  implemented by inheriting ``niftynet.application.base_application``
  to be compatible with this driver.
class_docstr_tok: ["This","class","initialises","an","application","by","building","a","TF","graph",",","and","maintaining","a","session",".","It","controls","the","starting\/stopping","of","an","application",".","Applications","should","be","implemented","by","inheriting","``","niftynet.application.base_application","``","to","be","compatible","with","this","driver","."]
docstr: Calling ``tf.session.run`` with parameters encapsulated in
  iteration message as an iteration.
  Broadcasting ITER_* events before and afterward.
  
  :param application:
  :param iteration_message: an ``engine.IterationMessage`` instances
  :return:
docstr_tok: ["Calling","``","tf.session.run","``","with","parameters","encapsulated","in","iteration","message","as","an","iteration",".","Broadcasting","ITER_","*","events","before","and","afterward",".",":","param","application",":",":","param","iteration_message",":","an","``","engine.IterationMessage","``","instances",":","return",":"]
code: def loop_step(application, iteration_message):
      """
      Calling ``tf.session.run`` with parameters encapsulated in
      iteration message as an iteration.
      Broadcasting ITER_* events before and afterward.
  
      :param application:
      :param iteration_message: an ``engine.IterationMessage`` instances
      :return:
      """
      # broadcasting event of starting an iteration
      ITER_STARTED.send(application, iter_msg=iteration_message)
  
      # ``iter_msg.ops_to_run`` are populated with the ops to run in
      # each iteration, fed into ``session.run()`` and then
      # passed to the application (and observers) for interpretation.
      sess = tf.get_default_session()
      assert (
          sess
      ), "method should be called within a TF session context."
  
      iteration_message.current_iter_output = sess.run(
          iteration_message.ops_to_run,
          feed_dict=iteration_message.data_feed_dict,
      )
  
      # broadcasting event of finishing an iteration
      ITER_FINISHED.send(application, iter_msg=iteration_message)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import time
  import tensorflow
  from niftynet.engine.application_factory import ApplicationFactory, EventHandlerFactory, IteratorFactory
  from niftynet.engine.application_iteration import IterationMessage
  from niftynet.engine.application_variables import GradientsCollector, OutputsCollector
  from niftynet.engine.signal import TRAIN, ITER_STARTED, ITER_FINISHED, GRAPH_CREATED, SESS_FINISHED, SESS_STARTED
  from niftynet.io.image_sets_partitioner import ImageSetsPartitioner
  from niftynet.io.misc_io import infer_latest_model_file
  from niftynet.utilities.user_parameters_default import DEFAULT_EVENT_HANDLERS, DEFAULT_ITERATION_GENERATOR
  from niftynet.utilities.util_common import set_cuda_device, tf_config, device_string
  from niftynet.utilities.util_common import traverse_nested
label_desc: Use image node_id 7 for calling the ApplicationDriver obj's underlying member method code with example usage: obj.loop_step(application, iteration_message) without return types