Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
 public Sperm(List <Point> points, Point center, SpermType spermType)
 {
     Points    = points;
     Center    = center;
     SpermType = spermType;
 }
Ejemplo n.º 4
0
 private void btnOrangeMarker_Click(object sender, EventArgs e)
 {
     currentMarker = SpermType.Orange;
 }
Ejemplo n.º 5
0
 private void btnRedMarker_Click(object sender, EventArgs e)
 {
     currentMarker = SpermType.Red;
 }
Ejemplo n.º 6
0
 private void btnGreenMarker_Click(object sender, EventArgs e)
 {
     currentMarker = SpermType.Green;
 }