parameters: (self)
docstring: Update the position of the cursors on each side view, as well
              as the image_plane_widgets in the 3D view.
docstring_summary: Update the position of the cursors on each side view, as well
              as the image_plane_widgets in the 3D view.
docstring_tokens: Update the position of the cursors on each side view as well as the image_plane_widgets in the 3D view .
function: def update_position(self):
          """ Update the position of the cursors on each side view, as well
              as the image_plane_widgets in the 3D view.
          """
  
          offset = np.abs(self.parent.spacing) / 2
          p = list(self.position + offset)
          p.pop(self.axis)
          if self.axis == 1:
              p = p[::-1]
          p.append(0)
          self.cursor.parent.parent.data.points = [p]
  
          if self.position[self.axis] != self._last:
              self._last = self.position[self.axis]
              origin = self.parent.origin * np.sign(self.parent.spacing)
  
              space, shape = self.ipw_space
              self.ipw_3d.ipw.slice_position = self.position[self.axis] + origin[self.axis]
              self.ipw_3d.ipw.reslice.set(output_spacing=space, output_origin=[space[0] / 2., space[1] / 2., 0])
              self.ipw_3d.ipw.poly_data_algorithm.output.point_data.t_coords = shape
              self.ipw.ipw.poly_data_algorithm.output.point_data.t_coords = shape
  
              origin, spacing = self.parent.origin, self.parent.spacing
              origin = origin * np.sign(spacing) - np.abs(spacing) / 2.
              
              gap = abs(spacing[self.axis]) / 2.
              pos = self.ipw_3d.ipw.slice_position
              pts = [0, 0, 0]
              pts[self.axis] = pos+gap
              self.planes[0].points = [tuple(pts)]
              pts[self.axis] = pos-gap 
              self.planes[1].points = [tuple(pts)]
              self.update_slab()
function_tokens: def update_position ( self ) : offset = np . abs ( self . parent . spacing ) / 2 p = list ( self . position + offset ) p . pop ( self . axis ) if self . axis == 1 : p = p [ : : - 1 ] p . append ( 0 ) self . cursor . parent . parent . data . points = [ p ] if self . position [ self . axis ] != self . _last : self . _last = self . position [ self . axis ] origin = self . parent . origin * np . sign ( self . parent . spacing ) space , shape = self . ipw_space self . ipw_3d . ipw . slice_position = self . position [ self . axis ] + origin [ self . axis ] self . ipw_3d . ipw . reslice . set ( output_spacing = space , output_origin = [ space [ 0 ] / 2. , space [ 1 ] / 2. , 0 ] ) self . ipw_3d . ipw . poly_data_algorithm . output . point_data . t_coords = shape self . ipw . ipw . poly_data_algorithm . output . point_data . t_coords = shape origin , spacing = self . parent . origin , self . parent . spacing origin = origin * np . sign ( spacing ) - np . abs ( spacing ) / 2. gap = abs ( spacing [ self . axis ] ) / 2. pos = self . ipw_3d . ipw . slice_position pts = [ 0 , 0 , 0 ] pts [ self . axis ] = pos + gap self . planes [ 0 ] . points = [ tuple ( pts ) ] pts [ self . axis ] = pos - gap self . planes [ 1 ] . points = [ tuple ( pts ) ] self . update_slab ( )