def initialize_contour_reorder_structures
      @reorder = Hash.new
      @reorder[:west] = NArray[0,1,2,5,8,7,6,3]
      @reorder[:nw]    = NArray[1,2,5,8,7,6,3,0]
      @reorder[:north] = NArray[2,5,8,7,6,3,0,1]
      @reorder[:ne]     = NArray[5,8,7,6,3,0,1,2]
      @reorder[:east]  = NArray[8,7,6,3,0,1,2,5]
      @reorder[:se]     = NArray[7,6,3,0,1,2,5,8]
      @reorder[:south] = NArray[6,3,0,1,2,5,8,7]
      @reorder[:sw]     = NArray[3,0,1,2,5,8,7,6]
      @arrived_from_directions = Hash.new
      @arrived_from_directions[0] = :se
      @arrived_from_directions[1] = :south
      @arrived_from_directions[2] = :sw
      @arrived_from_directions[3] = :east
      @arrived_from_directions[5] = :west
      @arrived_from_directions[6] = :ne
      @arrived_from_directions[7] = :north
      @arrived_from_directions[8] = :nw
      # Set up the index of pixels in a neighborhood image extract:
      @relative_indices = NArray.int(3, 3).indgen!
    end
def initialize_contour_reorder_structures
      @reorder = Hash.new
      @reorder[:west] = NArray[0,1,2,5,8,7,6,3]
      @reorder[:nw]    = NArray[1,2,5,8,7,6,3,0]
      @reorder[:north] = NArray[2,5,8,7,6,3,0,1]
      @reorder[:ne]     = NArray[5,8,7,6,3,0,1,2]
      @reorder[:east]  = NArray[8,7,6,3,0,1,2,5]
      @reorder[:se]     = NArray[7,6,3,0,1,2,5,8]
      @reorder[:south] = NArray[6,3,0,1,2,5,8,7]
      @reorder[:sw]     = NArray[3,0,1,2,5,8,7,6]
      @arrived_from_directions = Hash.new
      @arrived_from_directions[0] = :se
      @arrived_from_directions[1] = :south
      @arrived_from_directions[2] = :sw
      @arrived_from_directions[3] = :east
      @arrived_from_directions[5] = :west
      @arrived_from_directions[6] = :ne
      @arrived_from_directions[7] = :north
      @arrived_from_directions[8] = :nw
      # Set up the index of pixels in a neighborhood image extract:
      @relative_indices = NArray.int(3, 3).indgen!
    end
Initializes a couple of instance variables containing directional information, which are used by the contour algorithm.

 The directional vectors of indices are used for extracting a vector of neighbour pixels from a 3*3 pixel array,
 where the resulting vector contains 7 neighbour pixels (the previous pixel is removed), in a clockwise order,
 where the first pixel is the neighbour pixel that is next to the previous pixel, following a clockwise rotation.