projects
/
master-thesis.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
be048d8
)
Use an absolute value for thickness and font size
1.0.13
author
Greg Burri
<greg.burri@gmail.com>
Mon, 22 Mar 2021 13:18:42 +0000
(14:18 +0100)
committer
Greg Burri
<greg.burri@gmail.com>
Mon, 22 Mar 2021 13:18:42 +0000
(14:18 +0100)
Parasitemia/ParasitemiaUI/GUI.fs
patch
|
blob
|
history
diff --git
a/Parasitemia/ParasitemiaUI/GUI.fs
b/Parasitemia/ParasitemiaUI/GUI.fs
index
74aba27
..
c85017f
100644
(file)
--- a/
Parasitemia/ParasitemiaUI/GUI.fs
+++ b/
Parasitemia/ParasitemiaUI/GUI.fs
@@
-50,11
+50,11
@@
let run (defaultConfig : Config) (fileToOpen : string option) =
frame.manuallyAdded.Fill <- color
frame.border.Stroke <- color
frame.manuallyAdded.Fill <- color
frame.border.Stroke <- color
- let frameStrokeThickness (
averageRBCSize : float
) =
- max 1. (averageRBCSize / 60.)
+ let frameStrokeThickness () =
+ state.CurrentImage |> Option.map (fun img -> max 1. (img.AverageRBCSize / 100.)) |> Option.defaultValue 1.
- let frameFontSize (
averageRBCSize : float
) =
- max 1. (averageRBCSize / 6.)
+ let frameFontSize () =
+ state.CurrentImage |> Option.map (fun img -> max 1. (img.AverageRBCSize / 6.)) |> Option.defaultValue 1.
let createRBCFrameFromExisting (srcImg : SourceImage) (rbc : RBC) (frame : RBCFrame) (frameThickness : float) (fontSize : float) (isTextBelow : bool) : RBCFrame =
frame.Visibility <- Visibility.Visible
let createRBCFrameFromExisting (srcImg : SourceImage) (rbc : RBC) (frame : RBCFrame) (frameThickness : float) (fontSize : float) (isTextBelow : bool) : RBCFrame =
frame.Visibility <- Visibility.Visible
@@
-82,16
+82,15
@@
let run (defaultConfig : Config) (fileToOpen : string option) =
statusMessageTimer.Start ()
let highlightRBC (rbc : RBC) (highlight : bool) =
statusMessageTimer.Start ()
let highlightRBC (rbc : RBC) (highlight : bool) =
- // let rbc = frame.Tag :?> RBC
- // Find the two frames in previews and current image.
+ let strokeThickness = frameStrokeThickness ()
for rbcFrame in (win.stackRBC.Children |> Seq.cast<RBCFrame>).Concat(win.canvasCurrentImage.Children |> Seq.cast<RBCFrame>) do
if (rbcFrame.Tag :?> RBC) = rbc then
if highlight then
for rbcFrame in (win.stackRBC.Children |> Seq.cast<RBCFrame>).Concat(win.canvasCurrentImage.Children |> Seq.cast<RBCFrame>) do
if (rbcFrame.Tag :?> RBC) = rbc then
if highlight then
- rbcFrame.border.StrokeThickness <- 3. *
rbcFrame.border.S
trokeThickness
+ rbcFrame.border.StrokeThickness <- 3. *
s
trokeThickness
if not rbc.infected && not rbc.setManually && not displayHealthy then rbcFrame.Opacity <- 1.
else
if not rbc.infected && not rbc.setManually && not displayHealthy then rbcFrame.Opacity <- 1.
else
- rbcFrame.border.StrokeThickness <-
rbcFrame.border.StrokeThickness / 3.
+ rbcFrame.border.StrokeThickness <-
strokeThickness
if not rbc.infected && not rbc.setManually && not displayHealthy then rbcFrame.Opacity <- 0.
let zoomToRBC (rbc : RBC) =
if not rbc.infected && not rbc.setManually && not displayHealthy then rbcFrame.Opacity <- 0.
let zoomToRBC (rbc : RBC) =
@@
-232,8
+231,8
@@
let run (defaultConfig : Config) (fileToOpen : string option) =
match state.CurrentImage with
| Some srcImg ->
let mutable currentCanvas = 0
match state.CurrentImage with
| Some srcImg ->
let mutable currentCanvas = 0
- let strokeThickness = frameStrokeThickness
srcImg.AverageRBCSize
- let fontSize = frameFontSize
srcImg.AverageRBCSize
+ let strokeThickness = frameStrokeThickness
()
+ let fontSize = frameFontSize
()
for rbc in srcImg.RBCs do
let frame =
if currentCanvas < win.canvasCurrentImage.Children.Count then
for rbc in srcImg.RBCs do
let frame =
if currentCanvas < win.canvasCurrentImage.Children.Count then