2using System.Collections.Generic;
3using System.ComponentModel;
8using System.Threading.Tasks;
9using System.Windows.Forms;
13 public partial class Filter : Form
18 InitializeComponent();
22 private void UpdateView()
32 public Node(TreeNode nod, Filt f)
39 return filt.name.ToString();
45 foreach (Filt.Type t in (Filt.Type[])Enum.GetValues(typeof(Filt.Type)))
47 TreeNode gr =
new TreeNode();
48 gr.Text = t.ToString();
49 filterView.Nodes.Add(gr);
51 foreach (Filt f
in Filters.filters)
53 TreeNode nod =
new TreeNode();
57 filterView.Nodes[(int)f.type].Nodes.Add(nod);
70 if (filterView.SelectedNode==
null)
72 Node n = (Node)filterView.SelectedNode.Tag;
73 if (n.filt.type == Filt.Type.Base)
78 if (n.filt.type == Filt.Type.Base2)
80 ApplyFilter two =
new ApplyFilter(
true);
81 if (two.ShowDialog() != DialogResult.OK)
83 Filters.Base2(two.ImageA.ID, two.ImageB.ID, n.filt.name,
false);
87 if (n.filt.type == Filt.Type.InPlace)
89 Filters.InPlace(ImageView.SelectedImage.ID, n.filt.name,
false);
92 if (n.filt.type == Filt.Type.InPlace2)
94 ApplyFilter two =
new ApplyFilter(
true);
95 if (two.ShowDialog() != DialogResult.OK)
97 Filters.InPlace2(two.ImageA.ID, two.ImageB.ID, n.filt.name,
false);
101 if (n.filt.type == Filt.Type.InPlacePartial)
103 Filters.InPlacePartial(ImageView.SelectedImage.ID, n.filt.name,
false);
107 if (n.filt.type == Filt.Type.Resize)
109 ApplyFilter two =
new ApplyFilter(
false);
110 if (two.ShowDialog() != DialogResult.OK)
112 Filters.Resize(ImageView.SelectedImage.ID, n.filt.name,
false, two.W,two.H);
115 if (n.filt.type == Filt.Type.Rotate)
117 ApplyFilter two =
new ApplyFilter(
false);
118 if (two.ShowDialog() != DialogResult.OK)
120 Filters.Rotate(ImageView.SelectedImage.ID, n.filt.name,
false, two.Angle, two.Color.A, two.Color.R, two.Color.G, two.Color.B);
123 if (n.filt.type == Filt.Type.Transformation)
125 ApplyFilter two =
new ApplyFilter(
false);
126 if (two.ShowDialog() != DialogResult.OK)
128 if (n.filt.name ==
"Crop")
130 Filters.Crop(two.ImageA.ID, two.Rectangle);
134 Filters.Transformation(ImageView.SelectedImage.ID, n.filt.name,
false, two.Angle);
138 if (n.filt.type == Filt.Type.Copy)
140 Filters.Copy(ImageView.SelectedImage.ID, n.filt.name,
false);
149 private void applyToolStripMenuItem_Click(
object sender, EventArgs e)
158 private void applyRGBToolStripMenuItem_Click(
object sender, EventArgs e)
167 private void topMostBox_CheckedChanged(
object sender, EventArgs e)
169 TopMost = topMostBox.Checked;
176 private void filterView_DoubleClick(
object sender, EventArgs e)
override string ToString()
Node(TreeNode nod, Filt f)
void Init()
It takes a list of filters and adds them to a treeview.
ImageView control for image stacks, pyramidal and whole-slide-images.
static BioImage SelectedImage