def image(*args)
      raise ArgumentError, "Expected one or none arguments, got #{args.length}." unless [0, 1].include?(args.length)
      if args.length == 1
        if args.first.is_a?(Float)
          # Presumably an image position:
          return @image_positions[args.first.round(2)]
        else
          # Presumably a uid string:
          return @frame.image(args.first)
        end
      else
        # No argument used, therefore we return the first Image instance:
        return @images.first
      end
    end
def image(*args)
      raise ArgumentError, "Expected one or none arguments, got #{args.length}." unless [0, 1].include?(args.length)
      if args.length == 1
        if args.first.is_a?(Float)
          # Presumably an image position:
          return @image_positions[args.first.round(2)]
        else
          # Presumably a uid string:
          return @frame.image(args.first)
        end
      else
        # No argument used, therefore we return the first Image instance:
        return @images.first
      end
    end
=begin
    # Gives the index in the sorted array of slices that positionally is
    # closest to the provided slice.
    #
    # @note If the slice value is out of bounds (it is further from the
    #   boundaries than the slice interval), then false is returned.
    # @param [Float] slice the slice position
    # @param [Array<Float>] slices an array of slice positions
    # @return [Fixnum, FalseClass] the determined slice index (or false if no match)
    #
    def corresponding_slice(slice, slices)
      above_pos = (0...slices.length).select{|x| slices[x]>=slice}.first
      below_pos = (0...slices.length).select{|x| slices[x]<=slice}.last
      # With Ruby 1.9 this can supposedly be simplified to:  below_pos = slices.index{|x| x<=slice}
      # Exact match or between two slices?
      if above_pos == below_pos
        # Exact match (both point to the same index).
        slice_index = above_pos
      else
        # Value in between. Return the index of the value that is closest to our value.
        if (slice-slices[above_pos]).abs < (slice-slices[below_pos]).abs
          slice_index = above_pos
        else
          slice_index = below_pos
        end
      end
      return slice_index
    end
=end
 Computes a hash code for this object.

 @note Two objects with the same attributes will have the same hash code.

 @return [Fixnum] the object's hash code

 Gives the Image instance mathcing the specified UID or image position.

 @overload image(pos)
   @param [Float] pos image slice position
   @return [SliceImage, NilClass] the matched image (or nil if no image is matched)
 @overload image(uid)
   @param [String] uid image UID
   @return [SliceImage, NilClass] the matched image (or nil if no image is matched)
 @overload image
   @return [SliceImage, NilClass] the first image of this instance (or nil if no child images exists)