Class VOIProtractor

java.lang.Object
java.util.AbstractCollection<WildMagic.LibFoundation.Mathematics.Vector3f>
java.util.AbstractList<WildMagic.LibFoundation.Mathematics.Vector3f>
java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>
gov.nih.mipav.model.structures.VOIBase
gov.nih.mipav.model.structures.VOIProtractor
All Implemented Interfaces:
Serializable, Cloneable, Iterable<WildMagic.LibFoundation.Mathematics.Vector3f>, Collection<WildMagic.LibFoundation.Mathematics.Vector3f>, List<WildMagic.LibFoundation.Mathematics.Vector3f>, RandomAccess, SequencedCollection<WildMagic.LibFoundation.Mathematics.Vector3f>

public class VOIProtractor extends VOIBase
This class is fundamental to the VOI class in which points are stored that describe a Protractor VOI. The points are 3D and are floats (see Vector3f). It extends VOIBase and therefore it extends Vector. Point 1 is the common vertex of the 2 intersecting lines, point 0 is the outer point of the initially shorter line, and point 2 is the outer point of the initially longer line. This kind of VOI is used to measure angles.
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • allSlices

      private boolean allSlices
      Set to true, displays this protractor object for any z-value.
  • Constructor Details

    • VOIProtractor

      public VOIProtractor()
      Default constructor.
    • VOIProtractor

      public VOIProtractor(Vector<WildMagic.LibFoundation.Mathematics.Vector3f> kPositions)
      Constructor, sets the position of the protractor.
      Parameters:
      kPositions -
    • VOIProtractor

      public VOIProtractor(VOIProtractor kVOI)
      Copy constructor.
      Parameters:
      kVOI -
  • Method Details

    • clone

      public VOIProtractor clone()
      Specified by:
      clone in class VOIBase
    • getAllSlices

      public boolean getAllSlices()
      Returns true if this protractor is displayed independent of z-value.
      Returns:
    • getAngleString

      public String getAngleString(double fAngle)
      Returns the angle of the protractor as a string. Based on the input image resolutions.
      Parameters:
      afResolutions -
      Returns:
    • getAngleString

      public String getAngleString(float[] afResolutions)
      Returns the angle of the protractor as a string. Based on the input image resolutions.
      Parameters:
      afResolutions -
      Returns:
    • getTheta

      public double getTheta(float[] afResolutions)
      Gets the angle between the two lines of the protractor.
      Returns:
      theta
    • getLengthPtToPt

      public double getLengthPtToPt(float[] resolutions)
      Returns the total length of this contour, based on the input resolutions.
      Overrides:
      getLengthPtToPt in class VOIBase
      Parameters:
      resolutions - .
      Returns:
      total length of this contour, scaled by the resolutions.
    • setAllSlices

      public void setAllSlices(boolean bValue)
      Sets the all-slice flag. Displays this protractor independent of z-value. Used in the TriPlanar View for rotating images.
      Parameters:
      bValue -
    • translate

      public void translate(float xT, float yT)
      Translates 3 points of the protractor VOI.
      Parameters:
      xT - amount to translate in the x direction
      yT - amount to translate in the y direction