The images to be analyzed can be selected.
[master-thesis.git] / Parasitemia / Parasitemia / UnitsOfMeasure.fs
index ff9ea67..6a3b745 100644 (file)
@@ -1,18 +1,16 @@
 module UnitsOfMeasure
 
-[<Measure>]
-type px
+[<Measure>] type px
+[<Measure>] type μm
+[<Measure>] type inch
+[<Measure>] type ppi = px / inch
 
-[<Measure>]
-type μm =
-    static member ConvertToInch(x: float<μm>) : float<inch> =
-        x * 1.<inch> / 25.4e3<μm>
+let μmInchRatio = 25.4e3<μm/inch>
 
-and [<Measure>] inch
+let μmToInch(x: float<μm>) : float<inch> = x / μmInchRatio
+let inchToμm(x: float<inch>) : float<μm> = x * μmInchRatio
 
 
-[<Measure>]
-type ppi = px / inch