コード例 #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();
        }
コード例 #2
0
ファイル: MainWindow.cs プロジェクト: sdluxeon/Polaris
        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;
        }
コード例 #3
0
 public Sperm(List <Point> points, Point center, SpermType spermType)
 {
     Points    = points;
     Center    = center;
     SpermType = spermType;
 }
コード例 #4
0
ファイル: MainWindow.cs プロジェクト: sdluxeon/Polaris
 private void btnOrangeMarker_Click(object sender, EventArgs e)
 {
     currentMarker = SpermType.Orange;
 }
コード例 #5
0
ファイル: MainWindow.cs プロジェクト: sdluxeon/Polaris
 private void btnRedMarker_Click(object sender, EventArgs e)
 {
     currentMarker = SpermType.Red;
 }
コード例 #6
0
ファイル: MainWindow.cs プロジェクト: sdluxeon/Polaris
 private void btnGreenMarker_Click(object sender, EventArgs e)
 {
     currentMarker = SpermType.Green;
 }