public BeadSelectorDlg(FloatImg image, int ROI, Int2[] positions) { InitializeComponent(); if (!DesignMode) { dispImage = image.ToImage(); this.image = image; pictureBox.Image = dispImage; roiPositions = positions.ToList(); } DialogResult = System.Windows.Forms.DialogResult.Cancel; textBoxROI.Text = ROI.ToString(); }
private void buttonGenerateTestLUT_Click(object sender, EventArgs e) { var ofd = new OpenFileDialog(); if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string basePath = textLUTDir.Text; if (basePath.Length > 0) basePath += Path.DirectorySeparatorChar; using (var lut = new Bitmap(ofd.FileName)) { var cfg=GetTrackerConfig(); 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(); } } }