BioGTK  5.1.1
A .NET library & program for annotating, editing various microscopy imaging formats using Bioformats supported images.
Loading...
Searching...
No Matches
BioGTK.ChannelsTool Class Reference
Inheritance diagram for BioGTK.ChannelsTool:

Public Member Functions

void UpdateItems ()
 It takes the list of channels and adds them to the ComboBox.
 

Static Public Member Functions

static ChannelsTool Create ()
 

Protected Member Functions

 ChannelsTool (Builder builder, IntPtr handle)
 

Properties

List< Channel > Channels [get]
 
Channel SelectedChannel [get]
 
int SelectedSample [get, set]
 

Constructor & Destructor Documentation

◆ ChannelsTool()

BioGTK.ChannelsTool.ChannelsTool ( Builder  builder,
IntPtr  handle 
)
inlineprotected
63 : base(handle)
64 {
65 _builder = builder;
66 builder.Autoconnect(this);
67 App.channelsTool = this;
68 var store = new ListStore(typeof(string));
69 foreach (Channel item in Channels)
70 {
71 // Add items to the ListStore
72 store.AppendValues(item.ToString());
73 channelsBox.Active = 0;
74 }
75 channelsBox.Model = store;
76 // Set the text column to display
77 var renderer = new CellRendererText();
78 channelsBox.PackStart(renderer, false);
79 channelsBox.AddAttribute(renderer, "text", 0);
80
81 UpdateGUI();
82
83 minBox.Value = (int)Channels[0].stats[0].StackMin;
84 maxBox.Value = (int)Channels[0].stats[0].StackMax;
85 binBox.Value = 1;
86 binBox.Adjustment = new Adjustment(1, 1, 255, 1, 1, 1);
87 hist = HistogramControl.Create(Channels[0]);
88 hist.GraphMax = (int)maxBox.Value;
89 graphMax.Value = (int)maxBox.Value;
90 hist.Show();
91
92 minBox.ButtonPressEvent += minBox_ValueChanged;
93 //meanStackBox.Clicked += MeanStackBox_Clicked;
94 setMinAllBut.ButtonPressEvent += setMinAllBut_Click;
95 setMaxAllBut.ButtonPressEvent += setMaxAllBut_Click;
96 minBox.ValueChanged+= minBox_ValueChanged;
97 maxBox.ValueChanged+= maxBox_ValueChanged;
98 fluorBox.Changed += fluorBox_TextChanged;
99 emissionBox.ValueChanged += emissionBox_ValueChanged;
100 excitationBox.ValueChanged += excitationBox_ValueChanged;
101 binBox.ValueChanged += binBox_ValueChanged;
102 graphMinBox.ValueChanged += minGraphBox_ValueChanged;
103 graphMax.ValueChanged += maxGraphBox_ValueChanged;
104 applyBut.ButtonPressEvent += applyBut_Click;
105 resetBut.ButtonPressEvent += ResetButton_ButtonPressEvent;
106 this.ButtonPressEvent += ChannelsTool_MouseDown;
107 this.FocusActivated += ChannelsTool_Activated;
108 channelsBox.Changed += ChannelsBox_Changed;
109 sampleBox.Changed += SampleBox_Changed;
110 meanStackBox.Clicked += MeanStackBox_Clicked;
111
112 maxUintBox.Changed += MaxUintBox_Changed;
113 maxUintBox2.Changed += MaxUintBox2_Changed;
114
115 var st = new ListStore(typeof(string));
116 st.AppendValues(ushort.MaxValue.ToString());
117 st.AppendValues(16383);
118 st.AppendValues(4096);
119 st.AppendValues(1023);
120 st.AppendValues(byte.MaxValue.ToString());
121 maxUintBox.Model = st;
122 maxUintBox2.Model = st;
123 // Set the text column to display
124 var rend = new CellRendererText();
125 maxUintBox.PackStart(rend, false);
126 maxUintBox.AddAttribute(rend, "text", 0);
127 var rend2 = new CellRendererText();
128 maxUintBox2.PackStart(rend2, false);
129 maxUintBox2.AddAttribute(rend2, "text", 0);
130 ShowAll();
131 App.ApplyStyles(this);
132 }
List< Channel > Channels
Definition ChannelsTool.cs:335
static HistogramControl Create(Channel channel)
Definition HistogramControl.cs:44

Member Function Documentation

◆ Create()

static ChannelsTool BioGTK.ChannelsTool.Create ( )
inlinestatic
58 {
59 Builder builder = new Builder(new FileStream(System.IO.Path.GetDirectoryName(Environment.ProcessPath) + "/" + "Glade/ChannelsTool.glade", FileMode.Open));
60 return new ChannelsTool(builder, builder.GetObject("chanTool").Handle);
61 }
ChannelsTool(Builder builder, IntPtr handle)
Definition ChannelsTool.cs:63

◆ UpdateItems()

void BioGTK.ChannelsTool.UpdateItems ( )
inline

It takes the list of channels and adds them to the ComboBox.

364 {
365 channelsBox.Model = null;
366 var store = new ListStore(typeof(string));
367 // Add items to the ListStore
368 foreach (Channel item in Channels)
369 {
370 store.AppendValues(item.Name);
371 }
372 // Set the model for the ComboBox
373 channelsBox.Model = store;
374 // Set the text column to display
375 var renderer = new CellRendererText();
376 channelsBox.PackStart(renderer, false);
377 channelsBox.AddAttribute(renderer, "text", 0);
378
379 }

Property Documentation

◆ Channels

List<Channel> BioGTK.ChannelsTool.Channels
get
335 {
336 get
337 {
338 return ImageView.SelectedImage.Channels;
339 }
340 }

◆ SelectedChannel

Channel BioGTK.ChannelsTool.SelectedChannel
get
342 {
343 get
344 {
345 if (channelsBox.Active != -1)
346 return Channels[channelsBox.Active];
347 else
348 return Channels[0];
349 }
350 }

◆ SelectedSample

int BioGTK.ChannelsTool.SelectedSample
getset
352 {
353 get
354 {
355 return (int)sampleBox.Value;
356 }
357 set
358 {
359 sampleBox.Value = value;
360 }
361 }

The documentation for this class was generated from the following file: