class_docstr: This class generates samples using the coordinates of the centre as
  extracted from a csv file
  
  This layer can be considered as a "guided cropping" layer of the
  input image based on preselected input.
class_docstr_tok: ["This","class","generates","samples","using","the","coordinates","of","the","centre","as","extracted","from","a","csv","file","This","layer","can","be","considered","as","a","``","guided","cropping","''","layer","of","the","input","image","based","on","preselected","input","."]
code: def __init__(
      self,
      reader,
      csv_reader,
      window_sizes,
      batch_size=1,
      windows_per_image=1,
      queue_length=10,
      mode_correction="pad",
      name="csv_patchsampler_v2",
  ):
      ImageWindowDatasetCSV.__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,
          shuffle=True,
          epoch=-1,
          smaller_final_batch_mode="drop",
          name=name,
      )
  
      tf.logging.info(
          "initialised csv patch sampler %s ", self.window.shapes
      )
      self.mode_correction = mode_correction
      self.window_centers_sampler = rand_spatial_coordinates
      self.available_subjects = reader._file_list.subject_id
  
file_path: NiftyNet/niftynet/contrib/csv_reader/sampler_csvpatch.py
imports: from __future__ import absolute_import, division, print_function
  import numpy
  import tensorflow
  from niftynet.contrib.csv_reader.sampler_csv_rows import ImageWindowDatasetCSV
  from niftynet.engine.image_window import N_SPATIAL, LOCATION_FORMAT
  from niftynet.io.misc_io import do_reorientation_idx, do_resampling_idx
label_desc: Use image node_id 1 to create a new CSVPatchSampler object from inherited base classes: ImageWindowDatasetCSV with example: obj = CSVPatchSampler(reader, csv_reader, window_sizes, batch_size, windows_per_image, queue_length, mode_correction, name)