class_docstr: ### Description
      implementation of generator from
          Hu et al., "Freehand Ultrasound Image Simulation with Spatially-Conditioned
          Generative Adversarial Networks", MICCAI RAMBO 2017
          https://arxiv.org/abs/1707.05392
  
  ### Building blocks
  [FC]            - Fully connected layer
  [CONV]          - Convolutional layer, conditioning is concatenated to input before the convolution
                      (if conditioning is used)
                      kernel size = 3, activation = relu
  [UPCONV]        - Upsampling block composed of upsampling deconvolution (stride 2, kernel size = 3,
                      activation = relu) and concatenation of conditioning
  [fCONV]         - Final convolutional layer, with no conditioning. Kernel size = 3, activation = tanh
  
  ### Diagram
  
  RANDOM NOISE --> [FC] --> [CONV] --> [UPCONV]x3 --> [fCONV] --> OUTPUT IMAGE
  
  ### Constraints
class_docstr_tok: ["#","#","#","Description","implementation","of","generator","from","Hu","et","al.",",","``","Freehand","Ultrasound","Image","Simulation","with","Spatially-Conditioned","Generative","Adversarial","Networks","''",",","MICCAI","RAMBO","2017","https",":","\/\/arxiv.org\/abs\/1707.05392","#","#","#","Building","blocks","[","FC","]","-","Fully","connected","layer","[","CONV","]","-","Convolutional","layer",",","conditioning","is","concatenated","to","input","before","the","convolution","(","if","conditioning","is","used",")","kernel","size","=","3",",","activation","=","relu","[","UPCONV","]","-","Upsampling","block","composed","of","upsampling","deconvolution","(","stride","2",",","kernel","size","=","3",",","activation","=","relu",")","and","concatenation","of","conditioning","[","fCONV","]","-","Final","convolutional","layer",",","with","no","conditioning",".","Kernel","size","=","3",",","activation","=","tanh","#","#","#","Diagram","RANDOM","NOISE","--",">","[","FC","]","--",">","[","CONV","]","--",">","[","UPCONV","]","x3","--",">","[","fCONV","]","--",">","OUTPUT","IMAGE","#","#","#","Constraints"]
docstr: :param name: layer name
docstr_tok: [":","param","name",":","layer","name"]
code: def __init__(self, name):
      """
  
      :param name: layer name
      """
      super(ImageGenerator, self).__init__(name=name)
      self.initializers = {
          "w": tf.random_normal_initializer(0, 0.02),
          "b": tf.constant_initializer(0.001),
      }
      self.noise_channels_per_layer = 0
      self.with_conditionings = [True, True, True, True, False]
  
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import tensorflow
  from niftynet.layer.activation import ActiLayer
  from niftynet.layer.convolution import ConvolutionalLayer
  from niftynet.layer.deconvolution import DeconvolutionalLayer
  from niftynet.layer.fully_connected import FullyConnectedLayer
  from niftynet.layer.gan_blocks import BaseDiscriminator
  from niftynet.layer.gan_blocks import BaseGenerator
  from niftynet.layer.gan_blocks import GANImageBlock
label_desc: Use image node_id 1 to create a new ImageGenerator object from inherited base classes: BaseGenerator with example: obj = ImageGenerator(name)