private void generateTestImagesFromLUTToolStripMenuItem_Click(object sender, EventArgs e) { var ofd = new OpenFileDialog(); if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string basePath = settings.LUTImagePath; if (basePath.Length > 0) { basePath += Path.DirectorySeparatorChar; } using (var lut = new Bitmap(ofd.FileName)) { var cfg = settings.trackerConfig; var cc = QTrkComputedConfig.FromConfig(cfg); FloatImg lutf = new FloatImg(lut, 0); FloatImg img = new FloatImg(cfg.width, cfg.height); for (int i = 0; i < lut.Height; i++) { QTrkUtil.GenerateImageFromLUT(img, lutf, cfg.ZLUT_minradius, cc.zlut_maxradius, new Vector3(cfg.width / 2, cfg.height / 2, i), false, 1); string fn = basePath + string.Format("lut{0:000}.png", i); Trace.WriteLine("Writing " + fn); using (var planeimg = img.ToImage()) planeimg.Save(fn); } lutf.Dispose(); img.Dispose(); } } }
public BeadSelectorDlg(FloatImg image, int ROI, Int2[] beadCenterPos) { InitializeComponent(); if (!DesignMode) { dispImage = image.ToImage(); this.image = image; pictureBox.Image = dispImage; roiPositions = beadCenterPos.ToList(); } DialogResult = System.Windows.Forms.DialogResult.Cancel; textBoxROI.Text = ROI.ToString(); }
private void GenerateImageFromLUT() { QTrkConfig cfg = QTrkConfig; using (var dst = new FloatImg(100, 100)) { QTrkUtil.GenerateImageFromLUT(dst, zlut, 3, 40, new Vector3(dst.w / 2, dst.h / 2, zpos), false, 1); if (trackBarNoise.Value > 0) { QTrkUtil.ApplyPoissonNoise(dst, trackBarNoise.Value, 255); } pictureBoxFrameView.Image = dst.ToImage(); } }
private void buttonOpenLUT_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog() { Title = "Select LUT image" }; if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Bitmap img = new Bitmap(ofd.FileName); // pictureBoxLUT.Image = img; zlut = new FloatImg(img, 0); pictureBoxLUT.Image = zlut.ToImage(); } }