Add functions to apply an area opening and to compute granulometry.
[master-thesis.git] / Parasitemia / Parasitemia / Types.fs
index d7bacbd..a551142 100644 (file)
@@ -30,6 +30,13 @@ type Ellipse (cx: float, cy: float, a: float, b: float, alpha: float) =
         this.CutAVericalLine 0.0 || this.CutAVericalLine width ||
         this.CutAnHorizontalLine 0.0 || this.CutAnHorizontalLine height
 
+    member this.Scale (factor: float) =
+        Ellipse(this.Cx, this.Cy, this.A * factor, this.B * factor, alpha)
+
+    // Approximation of Ramanujan.
+    member this.Perimeter =
+        Math.PI * (3.0 * (this.A + this.B) - sqrt ((3.0 * this.A + this.B) * (this.A + 3.0 * this.B)))
+
 
 type CellClass = HealthyRBC | InfectedRBC | Peculiar