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
BioGTK.NodeView Class Reference
Inheritance diagram for BioGTK.NodeView:

Public Member Functions

void InitItems ()
 
void UpdateItems ()
 

Static Public Member Functions

static NodeView Create (string[] args)
 

Protected Member Functions

 NodeView (Builder builder, IntPtr handle, string[] args)
 
void SetupHandlers ()
 Sets up the handlers.
 
void OnLocalDeleteEvent (object sender, DeleteEventArgs a)
 Handle Close of Form, Quit Application.
 
void newTabsViewClick (object sender, EventArgs a)
 Handle Click of Button.
 
void aboutClick (object sender, EventArgs a)
 Handle Click of Button.
 

Detailed Description

Definition at line 12 of file NodeView.cs.

Constructor & Destructor Documentation

◆ NodeView()

BioGTK.NodeView.NodeView ( Builder builder,
IntPtr handle,
string[] args )
protected

Definition at line 48 of file NodeView.cs.

48 : base(handle)
49 {
50 _builder = builder;
51 builder.Autoconnect(this);
52 string st = System.IO.Path.GetDirectoryName(Environment.ProcessPath);
53 //Let's make sure the directories we need for startup exist.
54 Console.WriteLine("Reading start up folders.");
55 System.IO.Directory.CreateDirectory(st + "/Scripts");
56 System.IO.Directory.CreateDirectory(st + "/Functions");
57 System.IO.Directory.CreateDirectory(st + "/Tools");
58 System.IO.Directory.CreateDirectory(st + "/Plugins");
59 System.IO.Directory.CreateDirectory(st + "/Models");
60 App.nodeView = this;
61 App.Initialize();
63 Console.WriteLine("Parsing arguments.");
64 App.tabsView = TabsView.Create();
65 foreach (string item in args)
66 {
67 BioImage.OpenAsync(item, false, true, true, 0).Wait();
68 BioImage bm = Images.GetImage(item);
69 App.tabsView.AddTab(bm);
70 }
71 Console.WriteLine("Initializing nodes.");
72 InitItems();
73 App.ApplyStyles(this);
74 Console.WriteLine("NodeView initialized.");
75 }
void InitItems()
Definition NodeView.cs:79
void SetupHandlers()
Sets up the handlers.
Definition NodeView.cs:144

Member Function Documentation

◆ aboutClick()

void BioGTK.NodeView.aboutClick ( object sender,
EventArgs a )
protected

Handle Click of Button.

Parameters
senderSource of the event.
aEvent information to send to registered event handlers.

Definition at line 173 of file NodeView.cs.

174 {
176 about.Show();
177 }
static About Create()
Definition About.cs:32

◆ Create()

static NodeView BioGTK.NodeView.Create ( string[] args)
static

The function creates a NodeView object using a Glade file and returns it.

Parameters
argsThe "args" parameter is an array of strings that can be passed to the Create method. It is used to provide additional arguments or data that may be needed for the creation of the NodeView object. The specific purpose or usage of these arguments would depend on the implementation of the NodeView class and
Returns
The method is returning a NodeView object.

Definition at line 40 of file NodeView.cs.

41 {
42 Builder builder = new Builder(new FileStream(System.IO.Path.GetDirectoryName(Environment.ProcessPath) + "/" + "Glade/NodeView.glade", FileMode.Open));
43 return new NodeView(builder, builder.GetObject("nodeView").Handle,args);
44 }

◆ InitItems()

void BioGTK.NodeView.InitItems ( )

It takes a list of images, and for each image, it takes a list of bitmaps, and for each bitmap, it adds a row to the treeview with the bitmap's coordinate, exposure, and delta

Definition at line 79 of file NodeView.cs.

80 {
81 Gtk.TreeViewColumn coordCol = new Gtk.TreeViewColumn();
82 coordCol.Title = "Coordinate";
83 Gtk.CellRendererText coordCell = new Gtk.CellRendererText();
84 coordCol.PackStart(coordCell, true);
85
86 Gtk.TreeViewColumn expCol = new Gtk.TreeViewColumn();
87 expCol.Title = "Exposure";
88 Gtk.CellRendererText expCell = new Gtk.CellRendererText();
89 expCol.PackStart(expCell, true);
90
91 Gtk.TreeViewColumn deltaCol = new Gtk.TreeViewColumn();
92 deltaCol.Title = "Delta";
93 Gtk.CellRendererText deltaCell = new Gtk.CellRendererText();
94 deltaCol.PackStart(deltaCell, true);
95
96
97 tree.AppendColumn(coordCol);
98 tree.AppendColumn(expCol);
99 tree.AppendColumn(deltaCol);
100
101 coordCol.AddAttribute(coordCell, "text", 0);
102 expCol.AddAttribute(expCell, "text", 1);
103 deltaCol.AddAttribute(deltaCell, "text", 2);
104
105 Gtk.TreeStore store = new Gtk.TreeStore(typeof(string), typeof(string), typeof(string));
106
107 foreach (BioImage b in Images.images)
108 {
109 Gtk.TreeIter iter = store.AppendValues(System.IO.Path.GetFileName(b.Filename));
110 foreach (AForge.Bitmap bit in b.Buffers)
111 {
112 store.AppendValues(iter, bit.Coordinate.ToString(), bit.Plane.Exposure, bit.Plane.Delta);
113 }
114 }
115 tree.Model = store;
116
117 }

◆ newTabsViewClick()

void BioGTK.NodeView.newTabsViewClick ( object sender,
EventArgs a )
protected

Handle Click of Button.

Parameters
senderSource of the event.
aEvent information to send to registered event handlers.

Definition at line 164 of file NodeView.cs.

165 {
167 tabsView.Show();
168
169 }
static TabsView Create()
Definition TabsView.cs:207

◆ OnLocalDeleteEvent()

void BioGTK.NodeView.OnLocalDeleteEvent ( object sender,
DeleteEventArgs a )
protected

Handle Close of Form, Quit Application.

Parameters
senderSource of the event.
aEvent information to send to registered event handlers.

Definition at line 155 of file NodeView.cs.

156 {
157 Application.Quit();
158 a.RetVal = true;
159 }

◆ SetupHandlers()

void BioGTK.NodeView.SetupHandlers ( )
protected

Sets up the handlers.

Definition at line 144 of file NodeView.cs.

145 {
146 DeleteEvent += OnLocalDeleteEvent;
147 newTabsViewMenu.ButtonPressEvent += newTabsViewClick;
148 aboutMenu.ButtonPressEvent += aboutClick;
149
150 }
void OnLocalDeleteEvent(object sender, DeleteEventArgs a)
Handle Close of Form, Quit Application.
Definition NodeView.cs:155
void aboutClick(object sender, EventArgs a)
Handle Click of Button.
Definition NodeView.cs:173
void newTabsViewClick(object sender, EventArgs a)
Handle Click of Button.
Definition NodeView.cs:164

◆ UpdateItems()

void BioGTK.NodeView.UpdateItems ( )

It takes a list of images, and for each image, it takes a list of bitmaps, and for each bitmap, it adds a row to the treeview

Definition at line 121 of file NodeView.cs.

122 {
123 Gtk.TreeStore store = new Gtk.TreeStore(typeof(string), typeof(string), typeof(string));
124
125 foreach (BioImage b in Images.images)
126 {
127 Gtk.TreeIter iter = store.AppendValues(System.IO.Path.GetFileName(b.Filename));
128 foreach (AForge.Bitmap bit in b.Buffers)
129 {
130 if(bit.Plane != null)
131 store.AppendValues(iter, bit.Coordinate.ToString(), bit.Plane.Exposure, bit.Plane.Delta);
132 else
133 store.AppendValues(iter, bit.Coordinate.ToString(), 0, 0);
134 }
135 }
136 tree.Model = store;
137
138 }

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