class_docstr: SlidingWindow
  Sliding window iterator which produces slice objects to slice in a sliding
  window. This is useful for inference.
code: def __next__(self):
      if self.done:
          raise StopIteration()
  
      if self.has_batch_dim:
          slicer = [slice(None)] * (self.rank + 1)
      else:
          slicer = [slice(None)] * self.rank
  
      move_dim = True
      for dim, pos in enumerate(self.curr_pos):
          low = pos
          high = pos + self.window_shape[dim]
          if move_dim:
              if high >= self.img_shape[dim]:
                  self.curr_pos[dim] = 0
                  move_dim = True
              else:
                  self.curr_pos[dim] += self.striding[dim]
                  move_dim = False
          if high >= self.img_shape[dim]:
              low = self.img_shape[dim] - self.window_shape[dim]
              high = self.img_shape[dim]
  
          if self.has_batch_dim:
              slicer[dim + 1] = slice(low, high)
          else:
              slicer[dim] = slice(low, high)
  
      if (np.array(self.curr_pos) == self.end_pos).all():
          self.done = True
      return slicer
  
file_path: DLTK/dltk/utils.py
imports: from __future__ import unicode_literals
  from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import numpy
label_desc: Use image node_id 4 for calling the SlidingWindow obj's underlying member method code with example usage: obj.__next__() and returns: slicer