class_docstr: This class handles iteration events to log summaries to
  the TensorBoard log.
code: def __init__(
      self,
      model_dir=None,
      initial_iter=0,
      tensorboard_every_n=0,
      **_unused,
  ):
      self.tensorboard_every_n = tensorboard_every_n
      # creating new summary subfolder if it's not finetuning
      self.summary_dir = get_latest_subfolder(
          os.path.join(model_dir, "logs"), create_new=initial_iter == 0
      )
      self.writer_train = None
      self.writer_valid = None
  
      GRAPH_CREATED.connect(self.init_writer)
      ITER_STARTED.connect(self.read_tensorboard_op)
      ITER_FINISHED.connect(self.write_tensorboard)
  
file_path: NiftyNet/niftynet/engine/handler_tensorboard.py
imports: import os
  import tensorflow
  from niftynet.engine.application_variables import TF_SUMMARIES
  from niftynet.engine.signal import TRAIN, VALID, ITER_STARTED, ITER_FINISHED, GRAPH_CREATED
  from niftynet.io.misc_io import get_latest_subfolder
label_desc: Use image node_id 1 to create a new TensorBoardLogger object from inherited base classes: object with example: obj = TensorBoardLogger(model_dir, initial_iter, tensorboard_every_n)