# File vtk/tk/vtkTkImageViewerWidget.rb, line 282
  def UpdateQueryInteraction(x,y)
    viewer = @ImageViewer
    input = viewer.GetInput
    z = viewer.GetZSlice

    # y is flipped upside down
    y = self.winfo_height - y

    # make sure point is in the whole extent of the image.
    xMin,xMax,yMin,yMax,zMin,zMax = input.GetWholeExtent
    if (x < xMin || x > xMax || y < yMin || y > yMax || z < zMin || z > zMax)
      return nil
    end

    input.SetUpdateExtent(x,x,y,y,z,z)
    input.Update
    numComps = input.GetNumberOfScalarComponents
    text = ""
    for i in 0...numComps
      val = input.GetScalarComponentAsDouble(x,y,z,i)
      text = "#{text}  #{"%.1f"%val}"
    end

    @WindowMapper.SetInput("(#{"%d"%x}, #{"%d"%y}): #{text}")
        
    self.Render
  end