BioGTK  6.0.0
A .NET library & program for annotating, editing various microscopy imaging formats using Bioformats supported images. Including whole slide, pyramidal, and series.
All Classes Namespaces Functions
Bio.ROIManager Class Reference
Inheritance diagram for Bio.ROIManager:

Public Member Functions

void InitItems ()
 
void UpdateAnnotationList ()
 
void updateROI (int index, ROI an)
 
void UpdatePointBox ()
 

Static Public Member Functions

static ROIManager Create ()
 

Public Attributes

BioImage image
 
ROI anno = new ROI()
 
bool autoUpdate = true
 

Static Public Attributes

static Dictionary< string, ROI > rois = new Dictionary<string, ROI>()
 
static bool showBounds = true
 
static bool showText = false
 
static bool showR = true
 
static bool showG = true
 
static bool showB = true
 

Protected Member Functions

 ROIManager (Builder builder, IntPtr handle)
 

Detailed Description

Definition at line 15 of file ROIManager.cs.

Constructor & Destructor Documentation

◆ ROIManager()

Bio.ROIManager.ROIManager ( Builder builder,
IntPtr handle )
protected

Definition at line 92 of file ROIManager.cs.

92 : base(handle)
93 {
94 _builder = builder;
95 builder.Autoconnect(this);
96 xBox.ValueChanged += xBox_ValueChanged;
97 yBox.ValueChanged += yBox_ValueChanged;
98 wBox.ValueChanged += wBox_ValueChanged;
99 hBox.ValueChanged += hBox_ValueChanged;
100 rBox.ValueChanged += rBox_ValueChanged;
101 gBox.ValueChanged += gBox_ValueChanged;
102 bBox.ValueChanged += bBox_ValueChanged;
103 zBox.ValueChanged += zBox_ValueChanged;
104 cBox.ValueChanged += cBox_ValueChanged;
105 tBox.ValueChanged += tBox_ValueChanged;
106 widthBox.ValueChanged += strokeWBox_ValueChanged;
107 pointXBox.ValueChanged += pointXBox_ValueChanged;
108 pointYBox.ValueChanged += pointYBox_ValueChanged;
109 pointBox.ValueChanged += pointBox_ValueChanged;
110 selBox.ValueChanged += selectBoxSize_ValueChanged;
111 widthBox.ValueChanged += strokeWBox_ValueChanged;
112 textBox.Changed += textBox_TextChanged;
113 idBox.Changed += idBox_TextChanged;
114 boundsBox.Clicked += showBoundsBox_ActiveChanged;
115 showTextBox.Clicked += showTextBox_ActiveChanged;
116 showRBox.Clicked += showRBox_ActiveChanged;
117 showGBox.Clicked += showGBox_ActiveChanged;
118 showBBox.Clicked += showBBox_ActiveChanged;
119 showMasksBox.Clicked += ShowMasksBox_Clicked;
120 this.DeleteEvent += ROIManager_DeleteEvent;
121
122 //roiView.Selection.Changed += roiView_SelectedIndexChanged;
123 roiView.RowActivated += RoiView_RowActivated;
124 roiView.ActivateOnSingleClick = true;
125 this.FocusInEvent += ROIManager_FocusInEvent;
126
127 xBox.Adjustment.Upper = PointD.MaxX;
128 xBox.Adjustment.StepIncrement= 0.1;
129 xBox.Adjustment.PageIncrement= 1;
130 yBox.Adjustment.Upper = PointD.MaxY;
131 yBox.Adjustment.StepIncrement = 0.1;
132 yBox.Adjustment.PageIncrement = 1;
133 wBox.Adjustment.Upper = PointD.MaxX;
134 wBox.Adjustment.StepIncrement = 0.1;
135 wBox.Adjustment.PageIncrement = 1;
136 hBox.Adjustment.Upper = PointD.MaxY;
137 xBox.Adjustment.StepIncrement = 0.1;
138 xBox.Adjustment.PageIncrement = 1;
139 rBox.Adjustment.Upper = byte.MaxValue;
140 rBox.Adjustment.StepIncrement = 1;
141 rBox.Adjustment.PageIncrement = 1;
142 gBox.Adjustment.Upper = byte.MaxValue;
143 gBox.Adjustment.StepIncrement = 1;
144 gBox.Adjustment.PageIncrement = 1;
145 bBox.Adjustment.Upper = byte.MaxValue;
146 bBox.Adjustment.StepIncrement = 1;
147 bBox.Adjustment.PageIncrement = 1;
148 zBox.Adjustment.Upper = 10000;
149 zBox.Adjustment.StepIncrement = 1;
150 zBox.Adjustment.PageIncrement = 1;
151 cBox.Adjustment.Upper = 10000;
152 cBox.Adjustment.StepIncrement = 1;
153 cBox.Adjustment.PageIncrement = 1;
154 tBox.Adjustment.Upper = 10000;
155 tBox.Adjustment.StepIncrement = 1;
156 tBox.Adjustment.PageIncrement = 1;
157 widthBox.Adjustment.Upper = 100;
158 widthBox.Adjustment.StepIncrement = 1;
159 widthBox.Adjustment.PageIncrement = 1;
160 pointBox.Adjustment.Upper = 100000;
161 pointBox.Adjustment.StepIncrement = 1;
162 pointBox.Adjustment.PageIncrement = 1;
163 pointXBox.Adjustment.Upper = PointD.MaxX;
164 pointXBox.Adjustment.StepIncrement = 0.1;
165 pointXBox.Adjustment.PageIncrement = 1;
166 pointYBox.Adjustment.Upper = PointD.MaxY;
167 pointYBox.Adjustment.StepIncrement = 0.1;
168 pointYBox.Adjustment.PageIncrement = 1;
169 selBox.Value = ROI.selectBoxSize;
170 selBox.Adjustment.Upper = 100;
171 selBox.Adjustment.StepIncrement = 1;
172 InitItems();
173 App.ApplyStyles(this);
174 }

Member Function Documentation

◆ Create()

static ROIManager Bio.ROIManager.Create ( )
static

Definition at line 86 of file ROIManager.cs.

87 {
88 Builder builder = new Builder(new FileStream(System.IO.Path.GetDirectoryName(Environment.ProcessPath) + "/" + "Glade/ROIManager.glade", FileMode.Open));
89 return new ROIManager(builder, builder.GetObject("roiManager").Handle);
90 }

◆ InitItems()

void Bio.ROIManager.InitItems ( )

It creates a treeview with 4 columns, and then populates the treeview with the data from the Images class

Definition at line 289 of file ROIManager.cs.

290 {
291 Gtk.TreeViewColumn typeCol = new Gtk.TreeViewColumn();
292 typeCol.Title = "Type";
293 Gtk.CellRendererText typeCell = new Gtk.CellRendererText();
294 typeCol.PackStart(typeCell, true);
295
296 Gtk.TreeViewColumn idCol = new Gtk.TreeViewColumn();
297 idCol.Title = "ID";
298 Gtk.CellRendererText idCell = new Gtk.CellRendererText();
299 idCol.PackStart(idCell, true);
300
301 Gtk.TreeViewColumn textCol = new Gtk.TreeViewColumn();
302 textCol.Title = "Text";
303 Gtk.CellRendererText textCell = new Gtk.CellRendererText();
304 textCol.PackStart(textCell, true);
305
306 Gtk.TreeViewColumn rectCol = new Gtk.TreeViewColumn();
307 rectCol.Title = "Bounds";
308 Gtk.CellRendererText rectCell = new Gtk.CellRendererText();
309 rectCol.PackStart(rectCell, true);
310
311
312 roiView.AppendColumn(typeCol);
313 roiView.AppendColumn(idCol);
314 roiView.AppendColumn(textCol);
315 roiView.AppendColumn(rectCol);
316
317 typeCol.AddAttribute(typeCell, "text", 0);
318 idCol.AddAttribute(idCell, "text", 1);
319 textCol.AddAttribute(textCell, "text", 2);
320 rectCol.AddAttribute(rectCell, "text", 3);
321
322 Gtk.TreeStore store = new Gtk.TreeStore(typeof(string), typeof(string), typeof(string), typeof(string));
323
324 foreach (BioImage b in Images.images)
325 {
326 Gtk.TreeIter iter = store.AppendValues(System.IO.Path.GetFileName(b.Filename));
327 foreach (ROI r in b.Annotations)
328 {
329 store.AppendValues(iter, r.type.ToString(), r.id, r.Text, r.BoundingBox.ToString());
330 }
331 }
332 roiView.Model = store;
333
334 }

◆ UpdateAnnotationList()

void Bio.ROIManager.UpdateAnnotationList ( )

It takes a list of images, and for each image, it takes a list of annotations, and for each annotation, it adds the annotation to a dictionary, and then adds the annotation to a treeview

Definition at line 338 of file ROIManager.cs.

339 {
340 rois.Clear();
341 Gtk.TreeStore store = new Gtk.TreeStore(typeof(string), typeof(string), typeof(string), typeof(string));
342 foreach (BioImage b in Images.images)
343 {
344 Gtk.TreeIter iter = store.AppendValues(System.IO.Path.GetFileName(b.Filename));
345 foreach (ROI r in b.Annotations)
346 {
347 rois.Add(r.type.ToString() + "," + r.id + "," + r.Text + "," + r.BoundingBox.ToString(),r);
348 store.AppendValues(iter, r.type.ToString(), r.id, r.Text, r.BoundingBox.ToString());
349 }
350 }
351 roiView.Model = store;
352 }

◆ UpdatePointBox()

void Bio.ROIManager.UpdatePointBox ( )

This function updates the point box with the current point

Returns
The point of the annotation.

Definition at line 636 of file ROIManager.cs.

637 {
638 if (anno == null)
639 return;
640 PointD d = anno.GetPoint((int)pointBox.Value);
641 pointXBox.Value = (int)d.X;
642 pointYBox.Value = (int)d.Y;
643 }

◆ updateROI()

void Bio.ROIManager.updateROI ( int index,
ROI an )

‍Update the ROI at the specified index with the specified ROI

Parameters
indexthe index of the annotation to be updated
ROIThe ROI object to be updated
Returns
The ROI object is being returned.

Definition at line 365 of file ROIManager.cs.

366 {
367 if (ImageView.SelectedImage == null)
368 return;
369 ImageView.SelectedImage.Annotations[index] = an;
370 UpdateView();
371 }

Member Data Documentation

◆ anno

ROI Bio.ROIManager.anno = new ROI()

Definition at line 206 of file ROIManager.cs.

◆ autoUpdate

bool Bio.ROIManager.autoUpdate = true

Definition at line 632 of file ROIManager.cs.

◆ image

BioImage Bio.ROIManager.image

Definition at line 84 of file ROIManager.cs.

◆ rois

Dictionary<string, ROI> Bio.ROIManager.rois = new Dictionary<string, ROI>()
static

Definition at line 85 of file ROIManager.cs.

◆ showB

bool Bio.ROIManager.showB = true
static

Definition at line 580 of file ROIManager.cs.

◆ showBounds

bool Bio.ROIManager.showBounds = true
static

Definition at line 576 of file ROIManager.cs.

◆ showG

bool Bio.ROIManager.showG = true
static

Definition at line 579 of file ROIManager.cs.

◆ showR

bool Bio.ROIManager.showR = true
static

Definition at line 578 of file ROIManager.cs.

◆ showText

bool Bio.ROIManager.showText = false
static

Definition at line 577 of file ROIManager.cs.


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