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