class_docstr: This class generates samples by rescaling
  the whole image to the desired size
  Assuming the reader's output is 5d:
  ``Height x Width x Depth x time x Modality``
class_docstr_tok: ["This","class","generates","samples","by","rescaling","the","whole","image","to","the","desired","size","Assuming","the","reader","'s","output","is","5d",":","``","Height","x","Width","x","Depth","x","time","x","Modality","``"]
code: def __init__(
      self,
      reader,
      csv_reader=None,
      window_sizes=None,
      batch_size=1,
      spatial_window_size=None,
      windows_per_image=1,
      shuffle=True,
      queue_length=10,
      num_threads=4,
      smaller_final_batch_mode="pad",
      name="resize_sampler_v2",
  ):
      tf.logging.info("reading size of preprocessed images")
      self.csv_reader = csv_reader
      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,
          num_threads=num_threads,
          shuffle=shuffle,
          epoch=-1 if shuffle else 1,
          smaller_final_batch_mode=smaller_final_batch_mode,
          name=name,
      )
      if spatial_window_size:
          # override all spatial window defined in input
          # modalities sections
          # this is useful when do inference with a spatial window
          # which is different from the training specifications
          self.window.set_spatial_shape(spatial_window_size)
  
file_path: NiftyNet/niftynet/contrib/csv_reader/sampler_resize_v2_csv.py
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import scipy.ndimage
  import tensorflow
  from niftynet.contrib.csv_reader.sampler_csv_rows import ImageWindowDatasetCSV
  from niftynet.engine.image_window import LOCATION_FORMAT
label_desc: Use image node_id 1 to create a new ResizeSamplerCSV object from inherited base classes: ImageWindowDatasetCSV with example: obj = ResizeSamplerCSV(reader, csv_reader, window_sizes, batch_size, spatial_window_size, windows_per_image, shuffle, queue_length, num_threads, smaller_final_batch_mode, name)