BioGTK  6.5.0
A .NET library & program for annotating, editing various microscopy imaging formats using Bioformats supported images. Including whole slide, pyramidal, and series.
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]
 

Detailed Description

Definition at line 10 of file ChannelsTool.cs.

Constructor & Destructor Documentation

◆ ChannelsTool()

BioGTK.ChannelsTool.ChannelsTool ( Builder builder,
IntPtr handle )
protected

Definition at line 64 of file ChannelsTool.cs.

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

Member Function Documentation

◆ Create()

static ChannelsTool BioGTK.ChannelsTool.Create ( )
static

Definition at line 57 of file ChannelsTool.cs.

58 {
59 string s = System.IO.Path.GetDirectoryName(Environment.ProcessPath).Replace("\\", "/") + "/" + "Glade/ChannelsTool.glade";
60 Builder builder = new Builder(new FileStream(s, FileMode.Open));
61 return new ChannelsTool(builder, builder.GetObject("chanTool").Handle);
62 }

◆ UpdateItems()

void BioGTK.ChannelsTool.UpdateItems ( )

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

Definition at line 365 of file ChannelsTool.cs.

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

Property Documentation

◆ Channels

List<Channel> BioGTK.ChannelsTool.Channels
get

Definition at line 336 of file ChannelsTool.cs.

337 {
338 get
339 {
340 return ImageView.SelectedImage.Channels;
341 }
342 }

◆ SelectedChannel

Channel BioGTK.ChannelsTool.SelectedChannel
get

Definition at line 343 of file ChannelsTool.cs.

344 {
345 get
346 {
347 if (channelsBox.Active != -1)
348 return Channels[channelsBox.Active];
349 else
350 return Channels[0];
351 }
352 }

◆ SelectedSample

int BioGTK.ChannelsTool.SelectedSample
getset

Definition at line 353 of file ChannelsTool.cs.

354 {
355 get
356 {
357 return (int)sampleBox.Value;
358 }
359 set
360 {
361 sampleBox.Value = value;
362 }
363 }

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