diff --git a/src/PBAnaly/MainForm.Designer.cs b/src/PBAnaly/MainForm.Designer.cs index a3c9d99..59bd40d 100644 --- a/src/PBAnaly/MainForm.Designer.cs +++ b/src/PBAnaly/MainForm.Designer.cs @@ -659,7 +659,7 @@ this.thunderLabel1.Name = "thunderLabel1"; this.thunderLabel1.Size = new System.Drawing.Size(200, 16); this.thunderLabel1.TabIndex = 19; - this.thunderLabel1.Text = "PBAnaly v0.1.4"; + this.thunderLabel1.Text = "PBAnaly v0.1.6"; // // MainForm // diff --git a/src/PBAnaly/MainForm.cs b/src/PBAnaly/MainForm.cs index 40fedab..958d524 100644 --- a/src/PBAnaly/MainForm.cs +++ b/src/PBAnaly/MainForm.cs @@ -25,6 +25,7 @@ namespace PBAnaly private LoginForm loginForm; private LogForm logForm; private TableLayoutPanel data_tab = null; + private TableLayoutPanel data_right_bar = null; private bool bioanalyBool = false; private int data_col = 2; private int data_row = 2; @@ -37,7 +38,7 @@ namespace PBAnaly System.Windows.Forms.TableLayoutPanel tlp_main_images; private Dictionary bioanalysisMannages = new Dictionary(); - + private List bioanalyName = new List(); bool isRun = false; private Thread thread; @@ -322,13 +323,14 @@ namespace PBAnaly return; } BioanalysisMannage bioanalysisMannage = new BioanalysisMannage(selectedFilePath, pl_right, bioanalysisMannages); - + DataProcess_panel.Controls.Add(bioanalysisMannage.GetImagePanel); bioanalysisMannage.GetImagePanel.BringToFront(); - - + bioanalyName.Add(selectedFilePath); + + } @@ -400,13 +402,56 @@ namespace PBAnaly bool isGridView = false; private void materialButton_changeFormSize_Click(object sender, EventArgs e) { + #region 排除已经不存在的 + // 如果list 不在字典中 将移除list中的某一个 + List indexF = new List(); + + foreach (var item in bioanalyName) + { + bool ret = false; + int i = -1; + foreach (var bio in bioanalysisMannages) + { + i++; + if (item == bio.Key) + { + ret = true; + } + } + if(ret == false) + { + indexF.Add(i); + } + } + + for (int i = indexF.Count-1; i >= 0; i--) + { + bioanalyName.RemoveAt(indexF[i]); + } + #endregion + if (bioanalysisMannages.Count == 1) { - foreach (var item in bioanalysisMannages) + #region 如果只有一张图时显示方案 + if (bioanalyBool == false) { - item.Value.Arrangement = false; - item.Value.WindowAdaptive(); + bioanalyBool = true; + foreach (var item in bioanalysisMannages) + { + item.Value.Arrangement = false; + item.Value.WindowAdaptive(); + } } + else + { + bioanalyBool = false; + foreach (var item in bioanalysisMannages) + { + item.Value.Arrangement = false; + item.Value.WindowNormalAdaptive(); + } + } + #endregion } else { @@ -431,6 +476,20 @@ namespace PBAnaly } DataProcess_panel.Controls.Clear(); pl_right.Controls.Clear(); + + if (data_right_bar != null) + { + data_right_bar.Controls.Clear(); + data_right_bar.Dispose(); + + } + data_right_bar = new TableLayoutPanel(); + data_right_bar.SuspendLayout(); + data_right_bar.RowCount = 2; + data_right_bar.ColumnCount = 1; + data_right_bar.RowStyles.Add(new RowStyle(SizeType.Percent, 100f / 1)); + data_right_bar.RowStyles.Add(new RowStyle(SizeType.Absolute, 60f)); + data_right_bar.ResumeLayout(); if (data_tab != null) { data_tab.Controls.Clear(); @@ -438,9 +497,12 @@ namespace PBAnaly } data_tab = new TableLayoutPanel(); data_tab.SuspendLayout(); + if(data_row >= 1 && data_row <=3)data_row = 3; + else if(data_row >=5 && data_row <=9) data_row = 9; data_tab.RowCount = data_row; data_tab.ColumnCount = data_col + 1; + for (int i = 0; i < data_row; i++) { data_tab.RowStyles.Add(new RowStyle(SizeType.Percent, 100f / data_row)); @@ -455,23 +517,27 @@ namespace PBAnaly int col = 0; int index = 0; - foreach (var item in bioanalysisMannages) + foreach (var bname in bioanalyName) { - + var item = bioanalysisMannages[bname]; if (index == bioanalysisMannages.Count - 1) { - pl_right.Controls.Add(item.Value.GetBioanayImagePanel); - item.Value.GetRight.Dock = DockStyle.Fill; - data_tab.Controls.Add(item.Value.GetRight, data_tab.ColumnCount - 1, 0); - data_tab.SetRowSpan(item.Value.GetRight, data_row); - //data_tab.Controls.Add(item.Value.GetBarImage, data_tab.ColumnCount-1,0); - //data_tab.SetRowSpan(item.Value.GetBarImage, data_row); - item.Value.Arrangement = true; - index++; + pl_right.Controls.Add(item.GetBioanayImagePanel); + //item.Value.GetRight.Dock = DockStyle.Fill; + //data_tab.Controls.Add(item.Value.GetRight, data_tab.ColumnCount - 1, 0); + //data_tab.SetRowSpan(item.Value.GetRight, data_row); + data_right_bar.Controls.Add(item.GetBarImage, 0, 0); + data_right_bar.Controls.Add(item.GetImagePanel.lb_wh, 0, 1); + data_right_bar.Dock = DockStyle.Fill; + data_tab.Controls.Add(data_right_bar, data_tab.ColumnCount - 1, 0); + data_tab.SetRowSpan(data_right_bar, data_row); + item.Arrangement = true; + } - item.Value.GetPanel.Dock = DockStyle.Fill; - data_tab.Controls.Add(item.Value.GetPanel, col, row); - item.Value.GetImagePanel.CenterPictureBox(); + index++; + item.GetPanel.Dock = DockStyle.Fill; + data_tab.Controls.Add(item.GetPanel, col, row); + item.GetImagePanel.CenterPictureBox(); if (col < data_tab.ColumnCount - 2) { col++; @@ -481,9 +547,8 @@ namespace PBAnaly row++; col = 0; } - } - + data_tab.Dock = DockStyle.Fill; diff --git a/src/PBAnaly/Module/BioanalysisMannage.cs b/src/PBAnaly/Module/BioanalysisMannage.cs index bbb53b4..922ab9b 100644 --- a/src/PBAnaly/Module/BioanalysisMannage.cs +++ b/src/PBAnaly/Module/BioanalysisMannage.cs @@ -76,7 +76,6 @@ namespace PBAnaly.Module private Image colorbar_rgb24_image = null; private int colorbarWW = 200, colorh_onecolor = 10; private int colorbarW = 600, colorbarH = 2600; - private ReaLTaiizor.Controls.Panel pl_right; private BioanalyImagePanel imagePanel = null; private BioanayImagePaletteForm imagePaletteForm = null; @@ -229,6 +228,13 @@ namespace PBAnaly.Module fix |= true; } + if (algAttribute.scientificON) + { + if (imagePaletteForm.tb_max != null) + { + imagePaletteForm.tb_max.Text = algAttribute.colorValue.ToString("E"); + } + } if (fix && isUpdateAlg) { queueAlgAttribute.Enqueue(algAttribute); @@ -257,7 +263,13 @@ namespace PBAnaly.Module imagePaletteForm.nud_colorMin.Value = algAttribute.colorMinValue; fix = true; } - + if (algAttribute.scientificON) + { + if (imagePaletteForm.tb_min != null) + { + imagePaletteForm.tb_min.Text = algAttribute.colorMinValue.ToString("E"); + } + } if (fix && isUpdateAlg) { @@ -710,10 +722,12 @@ namespace PBAnaly.Module { this.pl_right.Controls.Clear(); this.pl_right.Controls.Add(this.imagePaletteForm); + this.imagePanel.BringToFront(); } private void Cb_scientific_CheckedChanged(object sender, AntdUI.BoolEventArgs e) { ScientificON = imagePanel.cb_scientific.Checked; + imagePaletteForm.RefreshscientificON(ScientificON); } @@ -812,7 +826,7 @@ namespace PBAnaly.Module if (Arrangement) { foreach (var item in bioanalysisMannages) - { + { item.Value.ColorMax = (int)imagePaletteForm.nud_colorMax.Value; } } @@ -1284,13 +1298,16 @@ namespace PBAnaly.Module int y = Math.Min(leftTopPoint.Y, readLoction.Y); int width = Math.Abs(readLoction.X - leftTopPoint.X); int height = Math.Abs(readLoction.Y - leftTopPoint.Y); - + imagePaletteForm.SetInfo = "w:" + width + "h:" + height; currentRectangle = new System.Drawing.Rectangle(x, y, width, height); imagePanel.image_pl.Invalidate(); // 触发重绘 } else if (drawCircle && e.Button == MouseButtons.Left) { circleRadio = readLoction; + int radius = (int)Math.Sqrt(Math.Pow(circleCenter.X - circleRadio.X, 2) + + Math.Pow(circleCenter.Y - circleRadio.Y, 2)); + imagePaletteForm.SetInfo = "radio:" + radius.ToString(); imagePanel.image_pl.Invalidate(); } else if (drawpolygon && linepolygonON) @@ -1361,6 +1378,7 @@ namespace PBAnaly.Module default: break; } + imagePaletteForm.SetInfo = "w:" + recDragRect.Width + "h:" + recDragRect.Height; imagePanel.image_pl.Invalidate(); // 触发重绘 } else if (isCirDragging) @@ -1389,6 +1407,9 @@ namespace PBAnaly.Module circleRadio = readLoction; } } + int radius = (int)Math.Sqrt(Math.Pow(circleCenter.X - circleRadio.X, 2) + + Math.Pow(circleCenter.Y - circleRadio.Y, 2)); + imagePaletteForm.SetInfo = "radio:" + radius.ToString(); imagePanel.image_pl.Invalidate(); @@ -1473,6 +1494,7 @@ namespace PBAnaly.Module private void Image_pl_MouseDown(object sender, MouseEventArgs e) { + Wdb_title_Click(null, null); System.Drawing.Point readLoction = ImageProcess.ConvertPictureBoxToReal( e.Location, imagePanel.image_pl); if (e.Button == MouseButtons.Left) { @@ -1790,6 +1812,10 @@ namespace PBAnaly.Module { imagePanel.WindowState = FormWindowState.Maximized; } + public void WindowNormalAdaptive() + { + imagePanel.WindowState = FormWindowState.Normal; + } public PictureBox GetImage { @@ -1839,7 +1865,8 @@ namespace PBAnaly.Module imagePanel.pl_panel_image.Dock = DockStyle.Fill; imagePanel.tableLayoutPanel2.Controls.Add(imagePanel.pl_panel_image, 0, 0); imagePanel.tableLayoutPanel2.Controls.Add(imagePanel.tlp_right_panel, 1, 0); - + imagePanel.tlp_right_panel.Controls.Add(imagePanel.image_pr, 0, 0); + imagePanel.tlp_right_panel.Controls.Add(imagePanel.lb_wh, 0, 1); imagePanel.ava_auto_Click(null,null); } diff --git a/src/PBAnaly/UI/BioanalyImagePanel.Designer.cs b/src/PBAnaly/UI/BioanalyImagePanel.Designer.cs index ddb9492..5fd4cd4 100644 --- a/src/PBAnaly/UI/BioanalyImagePanel.Designer.cs +++ b/src/PBAnaly/UI/BioanalyImagePanel.Designer.cs @@ -294,6 +294,7 @@ // // tlp_right_panel // + this.tlp_right_panel.BackColor = System.Drawing.Color.White; this.tlp_right_panel.ColumnCount = 1; this.tlp_right_panel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tlp_right_panel.Controls.Add(this.lb_wh, 0, 1); @@ -304,17 +305,18 @@ this.tlp_right_panel.Name = "tlp_right_panel"; this.tlp_right_panel.RowCount = 2; this.tlp_right_panel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlp_right_panel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 67F)); + this.tlp_right_panel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 60F)); this.tlp_right_panel.Size = new System.Drawing.Size(66, 243); this.tlp_right_panel.TabIndex = 1; // // lb_wh // + this.lb_wh.BackColor = System.Drawing.Color.PaleGoldenrod; this.lb_wh.Dock = System.Windows.Forms.DockStyle.Fill; - this.lb_wh.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.lb_wh.Location = new System.Drawing.Point(3, 179); + this.lb_wh.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lb_wh.Location = new System.Drawing.Point(3, 186); this.lb_wh.Name = "lb_wh"; - this.lb_wh.Size = new System.Drawing.Size(60, 61); + this.lb_wh.Size = new System.Drawing.Size(60, 54); this.lb_wh.TabIndex = 3; this.lb_wh.Text = "Color Scale\r\nMin = 1\r\nMax= 2"; this.lb_wh.TextAlign = System.Drawing.ContentAlignment.TopCenter; @@ -326,7 +328,7 @@ this.image_pr.ImageFit = AntdUI.TFit.Fill; this.image_pr.Location = new System.Drawing.Point(3, 3); this.image_pr.Name = "image_pr"; - this.image_pr.Size = new System.Drawing.Size(60, 170); + this.image_pr.Size = new System.Drawing.Size(60, 177); this.image_pr.Speed = 1; this.image_pr.TabIndex = 1; this.image_pr.Text = "image3D1"; diff --git a/src/PBAnaly/UI/BioanayImagePaletteForm.Designer.cs b/src/PBAnaly/UI/BioanayImagePaletteForm.Designer.cs index 8ae6028..884c005 100644 --- a/src/PBAnaly/UI/BioanayImagePaletteForm.Designer.cs +++ b/src/PBAnaly/UI/BioanayImagePaletteForm.Designer.cs @@ -53,8 +53,6 @@ this.collapseItem2 = new AntdUI.CollapseItem(); this.cb_colortable = new System.Windows.Forms.ComboBox(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); - this.nud_colorMax = new System.Windows.Forms.NumericUpDown(); - this.nud_colorMin = new System.Windows.Forms.NumericUpDown(); this.nud_opacity = new System.Windows.Forms.NumericUpDown(); this.nud_brightness = new System.Windows.Forms.NumericUpDown(); this.dtb_colorMax = new ReaLTaiizor.Controls.DungeonTrackBar(); @@ -62,6 +60,10 @@ this.dtb_opacity = new ReaLTaiizor.Controls.DungeonTrackBar(); this.pb_bgimage = new System.Windows.Forms.PictureBox(); this.dtb_brightness = new ReaLTaiizor.Controls.DungeonTrackBar(); + this.pl_max = new AntdUI.Panel(); + this.nud_colorMax = new System.Windows.Forms.NumericUpDown(); + this.pl_min = new AntdUI.Panel(); + this.nud_colorMin = new System.Windows.Forms.NumericUpDown(); this.panel1 = new AntdUI.Panel(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.collapseItem1 = new AntdUI.CollapseItem(); @@ -71,11 +73,13 @@ this.panel2.SuspendLayout(); this.collapseItem2.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.nud_colorMax)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nud_colorMin)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nud_opacity)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nud_brightness)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pb_bgimage)).BeginInit(); + this.pl_max.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nud_colorMax)).BeginInit(); + this.pl_min.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nud_colorMin)).BeginInit(); this.panel1.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); this.collapseItem1.SuspendLayout(); @@ -131,9 +135,9 @@ this.foxLabel8.Dock = System.Windows.Forms.DockStyle.Fill; this.foxLabel8.Font = new System.Drawing.Font("宋体", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.foxLabel8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(76)))), ((int)(((byte)(88)))), ((int)(((byte)(100))))); - this.foxLabel8.Location = new System.Drawing.Point(3, 166); + this.foxLabel8.Location = new System.Drawing.Point(3, 177); this.foxLabel8.Name = "foxLabel8"; - this.foxLabel8.Size = new System.Drawing.Size(204, 18); + this.foxLabel8.Size = new System.Drawing.Size(195, 18); this.foxLabel8.TabIndex = 34; this.foxLabel8.Text = "Color Rable"; // @@ -144,9 +148,9 @@ this.flb_act_mm.Dock = System.Windows.Forms.DockStyle.Fill; this.flb_act_mm.Font = new System.Drawing.Font("宋体", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.flb_act_mm.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(76)))), ((int)(((byte)(88)))), ((int)(((byte)(100))))); - this.flb_act_mm.Location = new System.Drawing.Point(93, 137); + this.flb_act_mm.Location = new System.Drawing.Point(93, 151); this.flb_act_mm.Name = "flb_act_mm"; - this.flb_act_mm.Size = new System.Drawing.Size(164, 23); + this.flb_act_mm.Size = new System.Drawing.Size(164, 20); this.flb_act_mm.TabIndex = 30; this.flb_act_mm.Text = "0 mm"; // @@ -156,9 +160,9 @@ this.foxLabel9.Dock = System.Windows.Forms.DockStyle.Fill; this.foxLabel9.Font = new System.Drawing.Font("宋体", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.foxLabel9.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(76)))), ((int)(((byte)(88)))), ((int)(((byte)(100))))); - this.foxLabel9.Location = new System.Drawing.Point(3, 108); + this.foxLabel9.Location = new System.Drawing.Point(3, 115); this.foxLabel9.Name = "foxLabel9"; - this.foxLabel9.Size = new System.Drawing.Size(44, 23); + this.foxLabel9.Size = new System.Drawing.Size(44, 30); this.foxLabel9.TabIndex = 18; this.foxLabel9.Text = "Max"; // @@ -170,7 +174,7 @@ this.foxLabel6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(76)))), ((int)(((byte)(88)))), ((int)(((byte)(100))))); this.foxLabel6.Location = new System.Drawing.Point(3, 79); this.foxLabel6.Name = "foxLabel6"; - this.foxLabel6.Size = new System.Drawing.Size(44, 23); + this.foxLabel6.Size = new System.Drawing.Size(44, 30); this.foxLabel6.TabIndex = 13; this.foxLabel6.Text = "Min"; // @@ -226,10 +230,10 @@ this.hpb_line.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(196)))), ((int)(((byte)(204))))); this.hpb_line.Dock = System.Windows.Forms.DockStyle.Fill; this.hpb_line.Image = global::PBAnaly.Properties.Resources.线段; - this.hpb_line.Location = new System.Drawing.Point(3, 137); + this.hpb_line.Location = new System.Drawing.Point(3, 151); this.hpb_line.Name = "hpb_line"; this.hpb_line.PixelOffsetType = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality; - this.hpb_line.Size = new System.Drawing.Size(44, 23); + this.hpb_line.Size = new System.Drawing.Size(44, 20); this.hpb_line.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; this.hpb_line.SmoothingType = System.Drawing.Drawing2D.SmoothingMode.HighQuality; this.hpb_line.TabIndex = 9; @@ -410,7 +414,7 @@ "RGB", "Pseudo", "Gray"}); - this.cb_colortable.Location = new System.Drawing.Point(3, 190); + this.cb_colortable.Location = new System.Drawing.Point(3, 201); this.cb_colortable.Name = "cb_colortable"; this.cb_colortable.Size = new System.Drawing.Size(84, 20); this.cb_colortable.TabIndex = 35; @@ -422,9 +426,7 @@ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 50F)); - this.tableLayoutPanel2.Controls.Add(this.nud_colorMax, 4, 4); - this.tableLayoutPanel2.Controls.Add(this.nud_colorMin, 4, 3); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 59F)); this.tableLayoutPanel2.Controls.Add(this.nud_opacity, 4, 1); this.tableLayoutPanel2.Controls.Add(this.nud_brightness, 4, 0); this.tableLayoutPanel2.Controls.Add(this.dtb_colorMax, 1, 4); @@ -441,6 +443,8 @@ this.tableLayoutPanel2.Controls.Add(this.cb_colortable, 0, 7); this.tableLayoutPanel2.Controls.Add(this.pb_bgimage, 3, 7); this.tableLayoutPanel2.Controls.Add(this.dtb_brightness, 1, 0); + this.tableLayoutPanel2.Controls.Add(this.pl_max, 4, 4); + this.tableLayoutPanel2.Controls.Add(this.pl_min, 4, 3); this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0); this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(0); @@ -449,45 +453,29 @@ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 29F)); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 29F)); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 18F)); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 29F)); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 29F)); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 29F)); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 36F)); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 36F)); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 24F)); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 29F)); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel2.Size = new System.Drawing.Size(260, 272); this.tableLayoutPanel2.TabIndex = 0; // - // nud_colorMax - // - this.nud_colorMax.Dock = System.Windows.Forms.DockStyle.Fill; - this.nud_colorMax.Location = new System.Drawing.Point(213, 108); - this.nud_colorMax.Name = "nud_colorMax"; - this.nud_colorMax.Size = new System.Drawing.Size(44, 21); - this.nud_colorMax.TabIndex = 51; - // - // nud_colorMin - // - this.nud_colorMin.Dock = System.Windows.Forms.DockStyle.Fill; - this.nud_colorMin.Location = new System.Drawing.Point(213, 79); - this.nud_colorMin.Name = "nud_colorMin"; - this.nud_colorMin.Size = new System.Drawing.Size(44, 21); - this.nud_colorMin.TabIndex = 50; - // // nud_opacity // this.nud_opacity.Dock = System.Windows.Forms.DockStyle.Fill; - this.nud_opacity.Location = new System.Drawing.Point(213, 32); + this.nud_opacity.Location = new System.Drawing.Point(204, 32); this.nud_opacity.Name = "nud_opacity"; - this.nud_opacity.Size = new System.Drawing.Size(44, 21); + this.nud_opacity.Size = new System.Drawing.Size(53, 21); this.nud_opacity.TabIndex = 45; // // nud_brightness // this.nud_brightness.Dock = System.Windows.Forms.DockStyle.Fill; - this.nud_brightness.Location = new System.Drawing.Point(213, 3); + this.nud_brightness.Location = new System.Drawing.Point(204, 3); this.nud_brightness.Name = "nud_brightness"; - this.nud_brightness.Size = new System.Drawing.Size(44, 21); + this.nud_brightness.Size = new System.Drawing.Size(53, 21); this.nud_brightness.TabIndex = 44; // // dtb_colorMax @@ -500,13 +488,13 @@ this.dtb_colorMax.EmptyBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(221)))), ((int)(((byte)(221)))), ((int)(((byte)(221))))); this.dtb_colorMax.FillBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(217)))), ((int)(((byte)(99)))), ((int)(((byte)(50))))); this.dtb_colorMax.JumpToMouse = false; - this.dtb_colorMax.Location = new System.Drawing.Point(52, 107); + this.dtb_colorMax.Location = new System.Drawing.Point(52, 114); this.dtb_colorMax.Margin = new System.Windows.Forms.Padding(2); this.dtb_colorMax.Maximum = 100; this.dtb_colorMax.Minimum = 0; this.dtb_colorMax.MinimumSize = new System.Drawing.Size(35, 18); this.dtb_colorMax.Name = "dtb_colorMax"; - this.dtb_colorMax.Size = new System.Drawing.Size(156, 22); + this.dtb_colorMax.Size = new System.Drawing.Size(118, 22); this.dtb_colorMax.TabIndex = 40; this.dtb_colorMax.Text = "dungeonTrackBar5"; this.dtb_colorMax.ThumbBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(244)))), ((int)(((byte)(244)))), ((int)(((byte)(244))))); @@ -531,7 +519,7 @@ this.dtb_colorMin.Minimum = 0; this.dtb_colorMin.MinimumSize = new System.Drawing.Size(35, 18); this.dtb_colorMin.Name = "dtb_colorMin"; - this.dtb_colorMin.Size = new System.Drawing.Size(156, 22); + this.dtb_colorMin.Size = new System.Drawing.Size(118, 22); this.dtb_colorMin.TabIndex = 39; this.dtb_colorMin.Text = "dungeonTrackBar4"; this.dtb_colorMin.ThumbBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(244)))), ((int)(((byte)(244)))), ((int)(((byte)(244))))); @@ -556,7 +544,7 @@ this.dtb_opacity.Minimum = 0; this.dtb_opacity.MinimumSize = new System.Drawing.Size(35, 18); this.dtb_opacity.Name = "dtb_opacity"; - this.dtb_opacity.Size = new System.Drawing.Size(156, 22); + this.dtb_opacity.Size = new System.Drawing.Size(118, 22); this.dtb_opacity.TabIndex = 37; this.dtb_opacity.Text = "dungeonTrackBar2"; this.dtb_opacity.ThumbBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(244)))), ((int)(((byte)(244)))), ((int)(((byte)(244))))); @@ -568,10 +556,10 @@ // pb_bgimage // this.pb_bgimage.Dock = System.Windows.Forms.DockStyle.Fill; - this.pb_bgimage.Location = new System.Drawing.Point(90, 187); + this.pb_bgimage.Location = new System.Drawing.Point(90, 198); this.pb_bgimage.Margin = new System.Windows.Forms.Padding(0); this.pb_bgimage.Name = "pb_bgimage"; - this.pb_bgimage.Size = new System.Drawing.Size(120, 29); + this.pb_bgimage.Size = new System.Drawing.Size(111, 29); this.pb_bgimage.TabIndex = 36; this.pb_bgimage.TabStop = false; // @@ -591,7 +579,7 @@ this.dtb_brightness.Minimum = 0; this.dtb_brightness.MinimumSize = new System.Drawing.Size(35, 18); this.dtb_brightness.Name = "dtb_brightness"; - this.dtb_brightness.Size = new System.Drawing.Size(156, 22); + this.dtb_brightness.Size = new System.Drawing.Size(118, 22); this.dtb_brightness.TabIndex = 2; this.dtb_brightness.Text = "dungeonTrackBar1"; this.dtb_brightness.ThumbBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(244)))), ((int)(((byte)(244)))), ((int)(((byte)(244))))); @@ -600,6 +588,46 @@ this.dtb_brightness.ValueDivison = ReaLTaiizor.Controls.DungeonTrackBar.ValueDivisor.By1; this.dtb_brightness.ValueToSet = 0F; // + // pl_max + // + this.pl_max.Back = System.Drawing.SystemColors.Control; + this.pl_max.BackColor = System.Drawing.Color.Transparent; + this.pl_max.Controls.Add(this.nud_colorMax); + this.pl_max.Dock = System.Windows.Forms.DockStyle.Fill; + this.pl_max.Location = new System.Drawing.Point(201, 112); + this.pl_max.Margin = new System.Windows.Forms.Padding(0); + this.pl_max.Name = "pl_max"; + this.pl_max.Size = new System.Drawing.Size(59, 36); + this.pl_max.TabIndex = 52; + this.pl_max.Text = "panel3"; + // + // nud_colorMax + // + this.nud_colorMax.Location = new System.Drawing.Point(3, 3); + this.nud_colorMax.Name = "nud_colorMax"; + this.nud_colorMax.Size = new System.Drawing.Size(44, 21); + this.nud_colorMax.TabIndex = 51; + // + // pl_min + // + this.pl_min.Back = System.Drawing.SystemColors.Control; + this.pl_min.BackColor = System.Drawing.Color.Transparent; + this.pl_min.Controls.Add(this.nud_colorMin); + this.pl_min.Dock = System.Windows.Forms.DockStyle.Fill; + this.pl_min.Location = new System.Drawing.Point(201, 76); + this.pl_min.Margin = new System.Windows.Forms.Padding(0); + this.pl_min.Name = "pl_min"; + this.pl_min.Size = new System.Drawing.Size(59, 36); + this.pl_min.TabIndex = 53; + this.pl_min.Text = "panel3"; + // + // nud_colorMin + // + this.nud_colorMin.Location = new System.Drawing.Point(3, 3); + this.nud_colorMin.Name = "nud_colorMin"; + this.nud_colorMin.Size = new System.Drawing.Size(44, 21); + this.nud_colorMin.TabIndex = 50; + // // panel1 // this.panel1.Controls.Add(this.tableLayoutPanel2); @@ -666,11 +694,13 @@ this.panel2.PerformLayout(); this.collapseItem2.ResumeLayout(false); this.tableLayoutPanel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.nud_colorMax)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nud_colorMin)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nud_opacity)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nud_brightness)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pb_bgimage)).EndInit(); + this.pl_max.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.nud_colorMax)).EndInit(); + this.pl_min.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.nud_colorMin)).EndInit(); this.panel1.ResumeLayout(false); this.tableLayoutPanel1.ResumeLayout(false); this.collapseItem1.ResumeLayout(false); @@ -718,5 +748,7 @@ private ReaLTaiizor.Controls.DreamTextBox dtb_r; private ReaLTaiizor.Controls.DreamTextBox dtb_h; private ReaLTaiizor.Controls.DreamTextBox dtb_w; + private AntdUI.Panel pl_max; + private AntdUI.Panel pl_min; } } \ No newline at end of file diff --git a/src/PBAnaly/UI/BioanayImagePaletteForm.cs b/src/PBAnaly/UI/BioanayImagePaletteForm.cs index 47d23a8..ab2c862 100644 --- a/src/PBAnaly/UI/BioanayImagePaletteForm.cs +++ b/src/PBAnaly/UI/BioanayImagePaletteForm.cs @@ -14,6 +14,8 @@ namespace PBAnaly.UI { public partial class BioanayImagePaletteForm : Form { + public TextBox tb_min; + public TextBox tb_max; private int roi_w = 20; private int roi_h = 20; private int circle_r = 10; @@ -52,6 +54,45 @@ namespace PBAnaly.UI { set { flb_info.Text = value; flb_info.Refresh(); } } + + public void RefreshscientificON(bool scientificON) + { + if (scientificON == false) + { + + pl_max.Controls.Clear(); + pl_min.Controls.Clear(); + tb_max.Dispose(); + tb_min.Dispose(); + tb_max = null; + tb_min = null; + pl_max.Controls.Add(nud_colorMax); + pl_min.Controls.Add(nud_colorMin); + } + else + { + pl_max.Controls.Clear(); + pl_min.Controls.Clear(); + if (tb_max == null) + { + tb_max = new TextBox(); + tb_max.Dock = DockStyle.Fill; + tb_max.Enabled = false; + tb_max.Multiline = true; + tb_max.Text = nud_colorMax.Value.ToString("E"); + } + if (tb_min == null) + { + tb_min = new TextBox(); + tb_min.Dock = DockStyle.Fill; + tb_min.Enabled = false; + tb_min.Multiline = true; + tb_min.Text = nud_colorMin.Value.ToString("E"); + } + pl_max.Controls.Add(tb_max); + pl_min.Controls.Add(tb_min); + } + } #endregion } } diff --git a/src/PBBiologyVC/PBImageProcessVC.cpp b/src/PBBiologyVC/PBImageProcessVC.cpp index 9d7009d..f17d656 100644 --- a/src/PBBiologyVC/PBImageProcessVC.cpp +++ b/src/PBBiologyVC/PBImageProcessVC.cpp @@ -31,9 +31,9 @@ int PBBiologyVC::PBImageProcessVC::render_process(System::Byte* pseImage, System Mat bgr_tab_img = bgr_tab_image(colorbarWW, h_onecolor, bgr_tab); - // std::cout << "w = " << bgr_tab_img.cols << "c= " << bgr_tab_img.rows << "c = " << bgr_tab_img.channels() << std::endl; + std::cout << "w = " << bgr_tab_img.cols << "c= " << bgr_tab_img.rows << "c = " << bgr_tab_img.channels() << std::endl; Mat bgr_scale_img = bgr_scale_image(bgr_tab_img, max, min,scientific_flag); //õͼ - //std::cout << "w = " << bgr_scale_img.cols << "c= " << bgr_scale_img.rows<<"c = "<