BioGTK  6.7.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 RefreshStatisticsForCoordinate (BioImage image, ZCT coordinate)
 
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 13 of file ChannelsTool.cs.

Constructor & Destructor Documentation

◆ ChannelsTool()

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

Definition at line 67 of file ChannelsTool.cs.

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 // Add items to the ListStore
76 store.AppendValues(item.ToString());
77 channelsBox.Active = 0;
78 }
79 channelsBox.Model = store;
80 // Set the text column to display
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 //meanStackBox.Clicked += MeanStackBox_Clicked;
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 // Set the text column to display
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 }

Member Function Documentation

◆ Create()

static ChannelsTool BioGTK.ChannelsTool.Create ( )
static

Definition at line 60 of file ChannelsTool.cs.

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

◆ RefreshStatisticsForCoordinate()

void BioGTK.ChannelsTool.RefreshStatisticsForCoordinate ( BioImage image,
ZCT coordinate )

Definition at line 360 of file ChannelsTool.cs.

361 {
362 if (image == null)
363 return;
364
365 int version = Interlocked.Increment(ref _statisticsRefreshVersion);
366 if (!image.IsZarrSource)
367 {
368 UpdateValues();
369 hist?.UpdateChannel(SelectedChannel);
370 hist?.UpdateView();
371 hist?.QueueDraw();
372 return;
373 }
374
375 _ = RefreshZarrStatisticsAsync(image, coordinate, version, debounce: true);
376 }
void UpdateChannel(Channel c)

◆ UpdateItems()

void BioGTK.ChannelsTool.UpdateItems ( )

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

Definition at line 554 of file ChannelsTool.cs.

555 {
556 channelsBox.Model = null;
557 var store = new ListStore(typeof(string));
558 // Add items to the ListStore
559 foreach (Channel item in Channels)
560 {
561 store.AppendValues(item.Name);
562 }
563 // Set the model for the ComboBox
564 channelsBox.Model = store;
565 // Set the text column to display
566 var renderer = new CellRendererText();
567 channelsBox.PackStart(renderer, false);
568 channelsBox.AddAttribute(renderer, "text", 0);
569
570 }

Property Documentation

◆ Channels

List<Channel> BioGTK.ChannelsTool.Channels
get

Definition at line 525 of file ChannelsTool.cs.

526 {
527 get
528 {
529 return ImageView.SelectedImage.Channels;
530 }
531 }

◆ SelectedChannel

Channel BioGTK.ChannelsTool.SelectedChannel
get

Definition at line 532 of file ChannelsTool.cs.

533 {
534 get
535 {
536 if (channelsBox.Active != -1)
537 return Channels[channelsBox.Active];
538 else
539 return Channels[0];
540 }
541 }

◆ SelectedSample

int BioGTK.ChannelsTool.SelectedSample
getset

Definition at line 542 of file ChannelsTool.cs.

543 {
544 get
545 {
546 return (int)sampleBox.Value;
547 }
548 set
549 {
550 sampleBox.Value = value;
551 }
552 }

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