Update coding style.
[master-thesis.git] / Parasitemia / ParasitemiaCore / MatchingEllipses.fs
index 13fd556..03a3869 100644 (file)
@@ -34,10 +34,10 @@ type private EllipseScoreFlaggedKd (matchingScore : float32, e : Ellipse) =
         member this.Y = this.Ellipse.Cy
 
 type MatchingEllipses (radius : float32) =
-    let ellipses = List<EllipseScoreFlaggedKd>()
+    let ellipses = List<EllipseScoreFlaggedKd> ()
 
     member this.Add (e : Ellipse) =
-        ellipses.Add(EllipseScoreFlaggedKd(0.f, e))
+        ellipses.Add (EllipseScoreFlaggedKd (0.f, e))
 
     member this.Ellipses : Ellipse list =
         List.ofSeq ellipses |> List.map (fun e -> e.Ellipse)
@@ -69,8 +69,8 @@ type MatchingEllipses (radius : float32) =
                             // Because of approximation error, see https://github.com/chraibi/EEOver/issues/4
                             when overlapArea - areaE < 1.f && overlapArea - areaOther < 1.f ->
                                 let matchingScore = (2.f * overlapArea / (areaE + areaOther)) ** matchingScorePower
-                                other.AddMatchingScore(matchingScore)
-                                e.AddMatchingScore(matchingScore)
+                                other.AddMatchingScore matchingScore
+                                e.AddMatchingScore matchingScore
                         | _ -> ()
 
             // 3) Remove ellipses whose center is near the center of another ellipse with a better score.
@@ -89,7 +89,7 @@ type MatchingEllipses (radius : float32) =
                     for other in tree.Search window do
                         if not other.Removed && e.MatchingScore > other.MatchingScore then
                             // Case where ellipses are too close.
-                            if distanceTwoPoints (PointF(e.Ellipse.Cx, e.Ellipse.Cy)) (PointF(other.Ellipse.Cx, other.Ellipse.Cy)) < minimumDistanceFromCenterRadiusFactor * e.Ellipse.B then
+                            if distanceTwoPoints (PointF (e.Ellipse.Cx, e.Ellipse.Cy)) (PointF (other.Ellipse.Cx, other.Ellipse.Cy)) < minimumDistanceFromCenterRadiusFactor * e.Ellipse.B then
                                 other.Removed <- true
                             else
                                 // Case where ellipses are overlapped.
@@ -101,6 +101,6 @@ type MatchingEllipses (radius : float32) =
             ellipses
             |> List.ofSeq
             |> List.filter (fun e -> not e.Removed)
-            |> List.sortWith (fun e1 e2 -> e2.MatchingScore.CompareTo(e1.MatchingScore))
+            |> List.sortWith (fun e1 e2 -> e2.MatchingScore.CompareTo e1.MatchingScore)
             |> List.map (fun e -> e.Ellipse)