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.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 15 of file NodeView.cs.

Constructor & Destructor Documentation

◆ NodeView()

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

Definition at line 51 of file NodeView.cs.

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

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 177 of file NodeView.cs.

178 {
180 about.Show();
181 }
static About Create()
Definition About.cs:32
Definition ML.cs:17

◆ 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 43 of file NodeView.cs.

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

◆ 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 83 of file NodeView.cs.

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

◆ 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 168 of file NodeView.cs.

169 {
171 tabsView.Show();
172
173 }
static TabsView Create()
Definition TabsView.cs:212

◆ 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 159 of file NodeView.cs.

160 {
161 Application.Quit();
162 a.RetVal = true;
163 }

◆ SetupHandlers()

void BioGTK.NodeView.SetupHandlers ( )
protected

Sets up the handlers.

Definition at line 148 of file NodeView.cs.

149 {
150 DeleteEvent += OnLocalDeleteEvent;
151 newTabsViewMenu.ButtonPressEvent += newTabsViewClick;
152 aboutMenu.ButtonPressEvent += aboutClick;
153
154 }
void OnLocalDeleteEvent(object sender, DeleteEventArgs a)
Handle Close of Form, Quit Application.
Definition NodeView.cs:159
void aboutClick(object sender, EventArgs a)
Handle Click of Button.
Definition NodeView.cs:177
void newTabsViewClick(object sender, EventArgs a)
Handle Click of Button.
Definition NodeView.cs:168

◆ 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 125 of file NodeView.cs.

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

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