Class TranslationOffsetInMM

  • All Implemented Interfaces:
    Serializable

    public class TranslationOffsetInMM
    extends TranslationOffset

    Description: Class for representing translation offset of two images in pixels and millimeters.

    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 Detail

      • xOffsetInMM

        protected double xOffsetInMM
      • yOffsetInMM

        protected double yOffsetInMM
    • Constructor Detail

      • TranslationOffsetInMM

        protected TranslationOffsetInMM()
      • TranslationOffsetInMM

        public TranslationOffsetInMM​(double xOffset,
                                     double yOffset,
                                     double xOffsetInMM,
                                     double yOffsetInMM)
    • Method Detail

      • create

        public static TranslationOffsetInMM create​(TranslationOffset offset,
                                                   double ratio)
        Method for creating a TranslationOffsetInMM Object
        Parameters:
        offset - The pixel based Offset
        ratio - The ratio between width or height in pixels to width in millimeters
        Returns:
        Returns new TranslationOffsetInMM object.
      • create

        public static TranslationOffsetInMM create​(TranslationOffset offset,
                                                   double dimensionInPixel,
                                                   double dimensionInMM)
        Method for creating a TranslationOffsetInMM Object (Dimension parameters must represent both the height or both the width!)
        Parameters:
        offset - The pixel based Offset
        dimensionInPixel - The height/width in pixels
        dimensionInMM - The height/width in millimeters
        Returns:
        Returns new TranslationOffsetInMM object.
      • setXOffset

        public void setXOffset​(double xOffset)
        Setter for of x-axis offset (Also updates xOffsetInMM!)
        Overrides:
        setXOffset in class TranslationOffset
        Parameters:
        xOffset - Value which should be set
      • setYOffset

        public void setYOffset​(double yOffset)
        Setter for of y-axis offset (Also updates yOffsetInMM!)
        Overrides:
        setYOffset in class TranslationOffset
        Parameters:
        yOffset - Value which should be set
      • getxOffsetInMM

        public double getxOffsetInMM()
        Getter for mm offset on x-axis
        Returns:
        Returns the offset on x-axis
      • setxOffsetInMM

        public void setxOffsetInMM​(double xOffsetInMM)
        Setter for of x-axis offset (Also updates xOffset!)
        Parameters:
        xOffsetInMM - Value which should be set
      • getyOffsetInMM

        public double getyOffsetInMM()
        Getter for mm offset on y-axis
        Returns:
        Returns the offset on y-axis
      • setyOffsetInMM

        public void setyOffsetInMM​(double yOffsetInMM)
        Setter for of y-axis offset (Also updates yOffset!)
        Parameters:
        yOffsetInMM - Value which should be set
      • 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 TranslationOffset
        Returns:
        the string representation of offset