void UpdateImage() { if (lutImage != null) { using (var img = lutImage.ExtractSubsection(trackBarBeadIndex.Value * zplanes, zplanes)) { img.Normalize(); pictureBoxLUT.Image = img.ToImage(); } } else { pictureBoxLUT.Image = null; } }
/// <summary> /// update LUT /// update bead view /// update trace /// </summary> void UpdateBeadIndex() { int i = CurrentBeadIndex; if (i < 0) { return; } if (lut != null) { using (var img = lut.ExtractSubsection(numLUTSteps * i, numLUTSteps)) { img.Normalize(); pictureBoxLUT.Image = img.ToImage(); } } if (imageFiles != null && imageFiles.Length > 0 && beadCenterPosList.Count > 0) { string path = imageFiles[0]; if (File.Exists(path)) { using (var bmp = new Bitmap(path)) { int roi = settings.ROI; var dst = new Bitmap(roi, roi, System.Drawing.Imaging.PixelFormat.Format24bppRgb); Graphics g = Graphics.FromImage(dst); var pos = beadCenterPosList[i]; g.DrawImage(bmp, new Rectangle(0, 0, roi, roi), new Rectangle(pos.x - roi / 2, pos.y - roi / 2, settings.ROI, settings.ROI), GraphicsUnit.Pixel); pictureBoxBeadView.Image = dst; } } } labelBeadViewInfo.Text = string.Format("Bead {0} frame 0", i); UpdateTraceView(); }