class_docstr: Each window is associated with a tuple of coordinates.
  These data properties are used to create TF
  placeholders or ``tf.data.Dataset`` when constructing a TF graph.
  Sampler read the data specifications and fill the placeholder/dataset.
class_docstr_tok: ["Each","window","is","associated","with","a","tuple","of","coordinates",".","These","data","properties","are","used","to","create","TF","placeholders","or","``","tf.data.Dataset","``","when","constructing","a","TF","graph",".","Sampler","read","the","data","specifications","and","fill","the","placeholder\/dataset","."]
docstr: Set all spatial window of the window.
  
  spatial_window should be a dictionary of window sizes tuples
  or single window size tuple.  In the latter case the size
  will be used by all output image windows.
  
  :param spatial_window: tuple of integers specifying new shape
  :param source_names: list/dictionary of input source names
  :return:
docstr_tok: ["Set","all","spatial","window","of","the","window",".","spatial_window","should","be","a","dictionary","of","window","sizes","tuples","or","single","window","size","tuple",".","In","the","latter","case","the","size","will","be","used","by","all","output","image","windows",".",":","param","spatial_window",":","tuple","of","integers","specifying","new","shape",":","param","source_names",":","list\/dictionary","of","input","source","names",":","return",":"]
code: def set_spatial_shape(self, spatial_window, source_names=None):
      """
      Set all spatial window of the window.
  
      spatial_window should be a dictionary of window sizes tuples
      or single window size tuple.  In the latter case the size
      will be used by all output image windows.
  
      :param spatial_window: tuple of integers specifying new shape
      :param source_names: list/dictionary of input source names
      :return:
      """
      win_sizes = copy.deepcopy(spatial_window)
      if isinstance(spatial_window, dict):
          for name in list(spatial_window):
              window_size = spatial_window[name]
              if isinstance(
                  window_size, (ParserNamespace, argparse.Namespace)
              ):
                  window_size = vars(window_size)
              if not isinstance(window_size, dict):
                  win_sizes[name] = tuple(window_size)
              elif "spatial_window_size" in window_size:
                  win_sizes[name] = tuple(
                      window_size["spatial_window_size"]
                  )
              else:
                  raise ValueError(
                      "window_sizes should be a nested dictionary"
                  )
      elif isinstance(spatial_window, (list, tuple)):
          # list or tuple of single window sizes
          win_sizes = {
              name: spatial_window for name in list(self._dtypes)
          }
  
      # complete window shapes based on user input and input_image sizes
      if source_names:
          spatial_shapes = _read_window_sizes(source_names, win_sizes)
      else:
          try:
              spatial_shapes = {}
              for name in list(self._dtypes):
                  spatial_shapes[name] = tuple(
                      int(win_size) for win_size in win_sizes[name]
                  )
          except ValueError:
              tf.logging.fatal(
                  "spatial window should be an array of int"
              )
              raise
  
      spatial_shapes = nest.map_structure_up_to(
          self._dtypes, tuple, spatial_shapes
      )
  
      self._shapes = {
          name: _complete_partial_window_sizes(
              spatial_shapes[name], self._shapes[name]
          )
          for name in list(self._shapes)
      }
  
      # update based on the latest spatial shapes
      self.has_dynamic_shapes = self._check_dynamic_shapes()
      if self._placeholders_dict is not None:
          self._update_placeholders_dict(n_samples=self.n_samples)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import argparse
  import copy
  import numpy
  import tensorflow
  from tensorflow.python.data.util import nest
  from niftynet.utilities.util_common import ParserNamespace
label_desc: Use image node_id 7 for calling the ImageWindow obj's underlying member method code with example usage: obj.set_spatial_shape(spatial_window, source_names) without return types