yujota / elm-asap-pathology-format / AsapPathology.Annotation

This module provides getters and setters for Annotation.

Types


type alias Coordinate =
{ order : Basics.Int
, x : Basics.Float
, y : Basics.Float 
}

Represents a coordinate of Annotation. Corresponding to <ASAP_Annotation><Annotations><Annotation><Coordinates><Coordinate>.

Constructor

dot : { name : String, partOfGroup : String, color : Color, x : Basics.Float, y : Basics.Float } -> Annotation

Create dot annotation.

rectangle : { name : String, partOfGroup : String, color : Color, x0 : Basics.Float, y0 : Basics.Float, x1 : Basics.Float, y1 : Basics.Float, x2 : Basics.Float, y2 : Basics.Float, x3 : Basics.Float, y3 : Basics.Float } -> Annotation

Create rectangle annotation.

polygon : { name : String, partOfGroup : String, color : Color, coordinates : List Coordinate } -> Annotation

Create polygon annotation.

spline : { name : String, partOfGroup : String, color : Color, coordinates : List Coordinate } -> Annotation

Create spline annotation.

pointSet : { name : String, partOfGroup : String, color : Color, coordinates : List Coordinate } -> Annotation

Create 'point set' annotation.

Getters & Setters

name : Annotation -> String

Getter for name of Annotation. Corresponding to attribute Name of <ASAP_Annotation><Annotations><Annotation>

setName : String -> Annotation -> Annotation

Setter for name of Annotation.

partOfGroup : Annotation -> String

Getter for 'part of group' of Annotation. Corresponding to attribute PartOfGroup of <ASAP_Annotation><Annotations><Annotation> In most cases, this value would be "None".

setPartOfGroup : String -> Annotation -> Annotation

Setter for 'part of group' of Annotation.

color : Annotation -> Color

Getter for color of Annotation. Corresponding to attribute Color of <ASAP_Annotation><Annotations><Annotation>

The type of return value is defined at avh4/elm-color

setColor : Color -> Annotation -> Annotation

Setter for color of Annotation.

coordinates : Annotation -> List { order : Basics.Int, x : Basics.Float, y : Basics.Float }

Getter for coordinates of Annotation. Corresponding to <ASAP_Annotation><Annotations><Annotation><Coordinates>

setCoordinates : List { order : Basics.Int, x : Basics.Float, y : Basics.Float } -> Annotation -> Annotation

Setter for coordinates of Annotation.

Utilities

isDot : Annotation -> Basics.Bool

Check given annotation is dot.

isRectangle : Annotation -> Basics.Bool

Check given annotation is rectangle.

isPolygon : Annotation -> Basics.Bool

Check given annotation is polygon

isSpline : Annotation -> Basics.Bool

Check given annotation is spline

isPointSet : Annotation -> Basics.Bool

Check given annotation is point set.

typeAsString : Annotation -> String

It returns annotation type as String Corresponding to attribute Type of <ASAP_Annotation><Annotations><Annotation>

dotAnnotation =
    dot { name = "Sample", partOfGroup = "None", color = Color.red, x = 100, y = 200 }
typeAsString dotAnnotation == "Dot"