Class TranslationOffset

  • All Implemented Interfaces:
    Serializable
    Direct Known Subclasses:
    RotationOffset, TranslationOffsetInMM

    public class TranslationOffset
    extends Object
    implements Serializable

    Class for representing translation offset of two images in pixels.

    Also contains a failure-value representing the correctness of the result.

    • Failure < 0 means that correctness of the offsets was not determined
    • Failure = 0 means offset is accurate.
    • Failure > 0 means offset is not total accurate (the higher this value, the less it is sure that the offset is correct).
    Since:
    1.0
    Author:
    Christoph Praschl
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static double EPSILON  
      protected double failure  
      protected double xOffset  
      protected double yOffset  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean equalDoubles​(double a, double b)
      Method which compares to doubles
      protected boolean equalToMaxValue​(double d)
      Method which compares value with Double.MAX_VALUE
      protected boolean equalToMinValue​(double d)
      Method which compares value with Double.MIN_VALUE
      double getFailure()
      Getter for failure-value which represents the correctness of the offset result
      double getXOffset()
      Getter pixel offset on x-axis
      double getYOffset()
      Getter pixel offset on y-axis
      void setFailure​(double failure)
      Setter for failure-value which represents the correctness of the offset result
      void setXOffset​(double xOffset)
      Setter for of x-axis offset
      void setYOffset​(double yOffset)
      Setter for of y-axis offset
      String toString()
      toString Overload for TranslationOffset class Printing the TranslationOffset with rounded values (6 digits after decimal point) Displays ? for not set values.
    • Field Detail

      • failure

        protected double failure
      • xOffset

        protected double xOffset
      • yOffset

        protected double yOffset
    • Constructor Detail

      • TranslationOffset

        public TranslationOffset()
      • TranslationOffset

        public TranslationOffset​(double xOffset,
                                 double yOffset)
      • TranslationOffset

        public TranslationOffset​(double xOffset,
                                 double yOffset,
                                 double failure)
    • Method Detail

      • getFailure

        public double getFailure()
        Getter for failure-value which represents the correctness of the offset result
        Returns:
        failure
      • setFailure

        public void setFailure​(double failure)
        Setter for failure-value which represents the correctness of the offset result
        Parameters:
        failure - Value which should be set
      • getXOffset

        public double getXOffset()
        Getter pixel offset on x-axis
        Returns:
        Returns the offset on x-axis
      • setXOffset

        public void setXOffset​(double xOffset)
        Setter for of x-axis offset
        Parameters:
        xOffset - Value which should be set
      • getYOffset

        public double getYOffset()
        Getter pixel offset on y-axis
        Returns:
        Returns the offset on y-axis
      • setYOffset

        public void setYOffset​(double yOffset)
        Setter for of y-axis offset
        Parameters:
        yOffset - Value which should be set
      • equalDoubles

        protected boolean equalDoubles​(double a,
                                       double b)
        Method which compares to doubles
        Parameters:
        a - First double to compare with second double
        b - Second double which should be compared
        Returns:
        True if a == b; else false
      • equalToMaxValue

        protected boolean equalToMaxValue​(double d)
        Method which compares value with Double.MAX_VALUE
        Parameters:
        d - double which should be compared
        Returns:
        Returns true if d is equal to Double.MAX_Value
      • equalToMinValue

        protected boolean equalToMinValue​(double d)
        Method which compares value with Double.MIN_VALUE
        Parameters:
        d - double which should be compared
        Returns:
        Returns true if d is equal to Double.MIN_VALUE
      • toString

        public String toString()
        toString Overload for TranslationOffset class Printing the TranslationOffset with rounded values (6 digits after decimal point) Displays ? for not set values. Excludes offset areas if no value in area is set
        Overrides:
        toString in class Object
        Returns:
        the string representation of offset