public void Mark(Point point, SpermType spermType) { var radius = Math.Sqrt(avarageSpermArea / Math.PI); var circle = point.GetCircle(radius); var newSperm = new Sperm(circle.ToList(), point, spermType); AddSperm(newSperm); ShowAll(); }
public MainWindow(ProgramStatus status, ImageBrowser imageBrowser, SpermogramViewer spermogramaViewer) { InitializeComponent(); this.currentMarker = SpermType.Green; this.status = status; this.imageBrowser = imageBrowser; this.spermogramaViewer = spermogramaViewer; btnGreenMarker.Click += btnGreenMarker_Click; btnRedMarker.Click += btnRedMarker_Click; btnOrangeMarker.Click += btnOrangeMarker_Click; status.AddObserver(text => { this.ChangeStatus(text); }); imageBrowser.Images.OnChange(images => { this.BrowseFiles(images); }); imagesView.AfterSelect += ImagesListView_SelectedIndexChanged; imageBrowser.SelectedImage.OnChange(x => { spermogramaViewer.View(x); }); spermogramaViewer.CurrentSpermogram.OnChange(spermograma => { spermograma.DisplayImage.OnChange(image => { this.UpdateImage(image); }); }); spermogramaViewer.CurrentSpermogram.OnChange(spermograma => { spermograma.Spermatosoids.OnChange((x) => { if (x != null) { this.lblRed.InvokeAsync(lbl => { lbl.Text = x.Count(xx => xx.SpermType == SpermType.Red).ToString(); }); this.lblGreen.InvokeAsync(lbl => { lbl.Text = x.Count(xx => xx.SpermType == SpermType.Green).ToString(); }); this.lblOrange.InvokeAsync(lbl => { lbl.Text = x.Count(xx => xx.SpermType == SpermType.Orange).ToString(); }); } }); }); pictureBox.Click += pictureBox_Click; // imageBrowser.Scan(@"D:\SampleImages"); this.KeyPreview = true; }
public Sperm(List <Point> points, Point center, SpermType spermType) { Points = points; Center = center; SpermType = spermType; }
private void btnOrangeMarker_Click(object sender, EventArgs e) { currentMarker = SpermType.Orange; }
private void btnRedMarker_Click(object sender, EventArgs e) { currentMarker = SpermType.Red; }
private void btnGreenMarker_Click(object sender, EventArgs e) { currentMarker = SpermType.Green; }