class_docstr: This class generators samples from a user provided
  frequency map for each input volume
  The sampling likelihood of each voxel (and window around)
  is proportional to its frequency
  
  This is implemented in a closed form using cumulative histograms
  for efficiency purposes i.e., the first three dims of image.
  
  This layer can be considered as a "weighted random cropping" layer of the
  input image.
code: def __init__(
      self,
      reader,
      csv_reader,
      window_sizes,
      batch_size=1,
      windows_per_image=1,
      queue_length=10,
      name="weighted_sampler",
  ):
      UniformSamplerCSV.__init__(
          self,
          reader=reader,
          csv_reader=csv_reader,
          window_sizes=window_sizes,
          batch_size=batch_size,
          windows_per_image=windows_per_image,
          queue_length=queue_length,
          name=name,
      )
      tf.logging.info("Initialised weighted sampler window instance")
      self.window_centers_sampler = weighted_spatial_coordinates
  
file_path: NiftyNet/niftynet/contrib/csv_reader/sampler_weighted_v2_csv.py
imports: from __future__ import absolute_import, division, print_function
  import numpy
  import tensorflow
  from niftynet.contrib.csv_reader.sampler_uniform_v2_csv import UniformSamplerCSV
  from niftynet.engine.image_window import N_SPATIAL
label_desc: Use image node_id 1 to create a new WeightedSamplerCSV object from inherited base classes: UniformSamplerCSV with example: obj = WeightedSamplerCSV(reader, csv_reader, window_sizes, batch_size, windows_per_image, queue_length, name)