BioImager  3.9.1
A .NET microscopy imaging library. Supports various microscopes by using imported libraries & GUI automation. Supported libraries include Prior® & Zeiss® & all devices supported by Micromanager 2.0 and python-microscope.
Loading...
Searching...
No Matches
BioImager.App Class Reference

Static Public Member Functions

static void Initialize ()
 Initialize() is a function that initializes the BioImager UI. More...
 
static void Hide ()
 Hide() hides all the tools. More...
 
static List< ToolStripMenuItem > GetMenuItems ()
 
static List< ToolStripMenuItem > GetContextItems ()
 
static ToolStripItem GetMenuItemFromPath (string s, Function f)
 
static ToolStripItem GetContextMenuItemFromPath (string s, Function f)
 
static ToolStripItem GetMenuItemFromPath (string s)
 
static ToolStripItem GetContextMenuItemFromPath (string s)
 
static void AddMenu (string menu, Function f)
 
static void AddContextMenu (string menu, Function f)
 
static void AddMenu (string menu)
 
static void AddContextMenu (string menu)
 
static void AddROI (string an)
 

Static Public Attributes

static ROIManager manager = null
 
static ChannelsTool channelsTool = null
 
static TabsView tabsView = null
 
static NodeView nodeView = null
 
static Scripting runner = null
 
static Recorder recorder = null
 
static Imager imager = null
 
static Tools tools = null
 
static StackTools stackTools = null
 
static ImageView viewer = null
 
static StageTool stage = null
 
static Series seriesTool = null
 
static Recordings recordings = null
 
static Automation automation = null
 
static MicroscopeSetup setup = null
 
static CellImager cellImager = null
 
static SlideImager slideImager = null
 
static BioConsole console = null
 
static Light lightTool = null
 
static Library lib = null
 
static List< string > recent = new List<string>()
 

Properties

static BioImage Image [get]
 
static List< Channel > Channels [get]
 
static List< ROIAnnotations [get]
 

Detailed Description

Definition at line 12 of file App.cs.

Member Function Documentation

◆ AddContextMenu() [1/2]

static void BioImager.App.AddContextMenu ( string  menu)
static

It takes a string and a function and adds a context menu item to the context menu

Parameters
menuThe path to the menu item.
FunctionThe function that will be called when the menu item is clicked.

Definition at line 393 of file App.cs.

394 {
396 }
static ToolStripItem GetContextMenuItemFromPath(string s, Function f)
Definition: App.cs:207

References BioImager.App.GetContextMenuItemFromPath().

◆ AddContextMenu() [2/2]

static void BioImager.App.AddContextMenu ( string  menu,
Function  f 
)
static

It takes a string and a function and adds a context menu item to the context menu

Parameters
menuThe path to the menu item.
FunctionThe function that will be called when the menu item is clicked.

Definition at line 375 of file App.cs.

376 {
378 }

References BioImager.App.GetContextMenuItemFromPath().

Referenced by BioImager.Function.Initialize().

◆ AddMenu() [1/2]

static void BioImager.App.AddMenu ( string  menu)
static

It takes a string and a function and adds the function to the menu item specified by the string

Parameters
menuThe menu path to add the menu item to.
FunctionThe function that will be called when the menu item is clicked.

Definition at line 385 of file App.cs.

386 {
388 }
static ToolStripItem GetMenuItemFromPath(string s, Function f)
Definition: App.cs:153

References BioImager.App.GetMenuItemFromPath().

◆ AddMenu() [2/2]

static void BioImager.App.AddMenu ( string  menu,
Function  f 
)
static

It takes a string and a function and adds the function to the menu item specified by the string

Parameters
menuThe menu path to add the menu item to.
FunctionThe function that will be called when the menu item is clicked.

Definition at line 367 of file App.cs.

368 {
369 GetMenuItemFromPath(menu, f);
370 }

References BioImager.App.GetMenuItemFromPath().

Referenced by BioImager.Function.Initialize().

◆ AddROI()

static void BioImager.App.AddROI ( string  an)
static

It takes a string, converts it to a ROI, and adds it to the list of ROIs

Parameters
anthe string representation of the ROI

Definition at line 433 of file App.cs.

434 {
435 Annotations.Add(BioImage.StringToROI(an));
436 Recorder.AddLine("App.AddROI(" + '"' + an + "'" + ");");
437 }
static ROI StringToROI(string sts)
Definition: Bio.cs:7737

References BioImager.BioImage.StringToROI().

◆ GetContextItems()

static List< ToolStripMenuItem > BioImager.App.GetContextItems ( )
static

It takes the context menu of the viewer and returns a list of all the items in the menu

Returns
A list of ToolStripMenuItems

Definition at line 136 of file App.cs.

137 {
138 List<ToolStripMenuItem> allItems = new List<ToolStripMenuItem>();
139 foreach (ToolStripMenuItem toolItem in viewer.ViewContextMenu.Items)
140 {
141 allItems.Add(toolItem);
142 allItems.AddRange(GetItems(toolItem));
143 }
144 return allItems;
145 }
ContextMenuStrip ViewContextMenu
A property that returns a ContextMenuStrip object. *‍/.
Definition: ImageView.cs:832

References BioImager.ImageView.ViewContextMenu.

Referenced by BioImager.App.GetContextMenuItemFromPath().

◆ GetContextMenuItemFromPath() [1/2]

static ToolStripItem BioImager.App.GetContextMenuItemFromPath ( string  s)
static

It takes a string and a function, and adds the function to the context menu at the location specified by the string

Parameters
sThe path to the item.
Function
Returns
A ToolStripItem

Definition at line 315 of file App.cs.

316 {
317 if (s == "" || s == null)
318 return null;
319 string[] sts = s.Split('/');
320 start:
321 List<ToolStripMenuItem> allItems = GetContextItems();
322 //Find path or create it.
323 bool found = false;
324 ToolStripMenuItem item = null;
325
326 for (int t = 0; t < sts.Length; t++)
327 {
328 found = false;
329 for (int i = 0; i < allItems.Count; i++)
330 {
331 if (allItems[i].Text == sts[t])
332 {
333 item = allItems[i];
334 found = true;
335 if (t == sts.Length - 1)
336 return allItems[i];
337 }
338 }
339 if (!found)
340 {
341 if (t == 0)
342 {
343 viewer.ViewContextMenu.Items.Add(sts[t]);
344 goto start;
345 }
346 else if (t > 0 && t < sts.Length)
347 {
348 ToolStripMenuItem itm = new ToolStripMenuItem();
349 itm.Name = Path.GetFileName(s);
350 item.DropDownItems.Add(Path.GetFileName(s), null, ItemClicked);
351 return item;
352 }
353 else
354 {
355 item.DropDownItems.Add(sts[t]);
356 }
357 }
358 }
359 return item;
360 }
static List< ToolStripMenuItem > GetContextItems()
Definition: App.cs:136

References BioImager.App.GetContextItems(), and BioImager.ImageView.ViewContextMenu.

◆ GetContextMenuItemFromPath() [2/2]

static ToolStripItem BioImager.App.GetContextMenuItemFromPath ( string  s,
Function  f 
)
static

It takes a string and a function, and adds the function to the context menu at the location specified by the string

Parameters
sThe path to the item.
Function
Returns
A ToolStripItem

Definition at line 207 of file App.cs.

208 {
209 if (s == "" || s == null)
210 return null;
211 string[] sts = s.Split('/');
212 start:
213 List<ToolStripMenuItem> allItems = GetContextItems();
214 //Find path or create it.
215 bool found = false;
216 ToolStripMenuItem item = null;
217
218 for (int t = 0; t < sts.Length; t++)
219 {
220 found = false;
221 for (int i = 0; i < allItems.Count; i++)
222 {
223 if (allItems[i].Text == sts[t])
224 {
225 item = allItems[i];
226 found = true;
227 if (t == sts.Length - 1)
228 return allItems[i];
229 }
230 }
231 if (!found)
232 {
233 if (t == 0)
234 {
235 viewer.ViewContextMenu.Items.Add(sts[t]);
236 goto start;
237 }
238 else if (t > 0 && t < sts.Length)
239 {
240 ToolStripMenuItem itm = new ToolStripMenuItem();
241 itm.Tag = f;
242 itm.Name = f.Name;
243 item.DropDownItems.Add(f.Name, null, ItemClicked);
244 return item;
245 }
246 else
247 {
248 item.DropDownItems.Add(sts[t]);
249 }
250 }
251 }
252 return item;
253 }

References BioImager.App.GetContextItems(), and BioImager.ImageView.ViewContextMenu.

Referenced by BioImager.App.AddContextMenu().

◆ GetMenuItemFromPath() [1/2]

static ToolStripItem BioImager.App.GetMenuItemFromPath ( string  s)
static

It takes a string and a function, and adds the function to the menu item specified by the string

Parameters
sThe path to the menu item.
Function
Returns
A ToolStripItem

Definition at line 262 of file App.cs.

263 {
264 if (s == "" || s == null)
265 return null;
266 string[] sts = s.Split('/');
267 start:
268 List<ToolStripMenuItem> allItems = GetMenuItems();
269 //Find path or create it.
270 bool found = false;
271 ToolStripMenuItem item = null;
272
273 for (int t = 0; t < sts.Length; t++)
274 {
275 found = false;
276 for (int i = 0; i < allItems.Count; i++)
277 {
278 if (allItems[i].Text == sts[t])
279 {
280 item = allItems[i];
281 found = true;
282 if (t == sts.Length - 1)
283 return allItems[i];
284 }
285 }
286 if (!found)
287 {
288 if (t == 0)
289 {
290 tabsView.MainMenuStrip.Items.Add(sts[t]);
291 goto start;
292 }
293 else if (t > 0 && t < sts.Length)
294 {
295 ToolStripMenuItem itm = new ToolStripMenuItem();
296 itm.Text = Path.GetFileName(s);
297 item.DropDownItems.Add(Path.GetFileName(s), null, ItemClicked);
298 return item;
299 }
300 else
301 {
302 item.DropDownItems.Add(sts[t]);
303 }
304 }
305 }
306 return item;
307 }
static List< ToolStripMenuItem > GetMenuItems()
Definition: App.cs:123

References BioImager.App.GetMenuItems().

◆ GetMenuItemFromPath() [2/2]

static ToolStripItem BioImager.App.GetMenuItemFromPath ( string  s,
Function  f 
)
static

It takes a string and a function, and adds the function to the menu item specified by the string

Parameters
sThe path to the menu item.
Function
Returns
A ToolStripItem

Definition at line 153 of file App.cs.

154 {
155 if (s == "" || s == null)
156 return null;
157 string[] sts = s.Split('/');
158 start:
159 List<ToolStripMenuItem> allItems = GetMenuItems();
160 //Find path or create it.
161 bool found = false;
162 ToolStripMenuItem item = null;
163
164 for (int t = 0; t < sts.Length; t++)
165 {
166 found = false;
167 for (int i = 0; i < allItems.Count; i++)
168 {
169 if (allItems[i].Text == sts[t])
170 {
171 item = allItems[i];
172 found = true;
173 if (t == sts.Length - 1)
174 return allItems[i];
175 }
176 }
177 if (!found)
178 {
179 if(t == 0)
180 {
181 tabsView.MainMenuStrip.Items.Add(sts[t]);
182 goto start;
183 }
184 else if(t > 0 && t < sts.Length)
185 {
186 ToolStripMenuItem itm = new ToolStripMenuItem();
187 itm.Tag = f;
188 itm.Name = f.Name;
189 item.DropDownItems.Add(f.Name, null, ItemClicked);
190 return item;
191 }
192 else
193 {
194 item.DropDownItems.Add(sts[t]);
195 }
196 }
197 }
198 return item;
199 }

References BioImager.App.GetMenuItems().

Referenced by BioImager.App.AddMenu().

◆ GetMenuItems()

static List< ToolStripMenuItem > BioImager.App.GetMenuItems ( )
static

It takes a menu strip and returns a list of all the menu items in the menu strip

Returns
A list of ToolStripMenuItems

Definition at line 123 of file App.cs.

124 {
125 List<ToolStripMenuItem> allItems = new List<ToolStripMenuItem>();
126 foreach (ToolStripMenuItem toolItem in tabsView.MainMenuStrip.Items)
127 {
128 allItems.Add(toolItem);
129 allItems.AddRange(GetItems(toolItem));
130 }
131 return allItems;
132 }

Referenced by BioImager.App.GetMenuItemFromPath().

◆ Hide()

static void BioImager.App.Hide ( )
static

Hide() hides all the tools.

Definition at line 90 of file App.cs.

91 {
92 tools.Hide();
93 stackTools.Hide();
94 manager.Hide();
95 runner.Hide();
96 recorder.Hide();
97 seriesTool.Hide();
98 recordings.Hide();
99 console.Hide();
100 }

◆ Initialize()

static void BioImager.App.Initialize ( )
static

Initialize() is a function that initializes the BioImager UI.

Definition at line 56 of file App.cs.

57 {
59 do
60 {
61 Thread.Sleep(100);
62 } while (!BioImage.Initialized);
63 imager = new Imager();
64 Microscope.Initialize();
66 setup = new MicroscopeSetup();
67 stage = new StageTool();
68 cellImager = new CellImager();
69 stackTools = new StackTools();
70 tools = new Tools();
71 manager = new ROIManager();
72 runner = new Scripting();
73 recorder = new Recorder();
74 seriesTool = new Series();
75 recordings = new Recordings();
76 automation = new Automation();
77 slideImager = new SlideImager();
78 if (!Properties.Settings.Default.PycroManager && !Properties.Settings.Default.PMicroscope)
79 {
80 lightTool = new Light();
81 }
82 lib = new Library();
83
84 console = new BioConsole();
85 imager.Show();
86
87 //ImageJ.Initialize(Properties.Settings.Default.ImageJPath);
88 }
static void Initialize()
Definition: Bio.cs:4470
static bool Initialize()
Definition: ImageJ.cs:247

References BioImager.BioImage.Initialize(), and BioImager.ImageJ.Initialize().

Member Data Documentation

◆ automation

Automation BioImager.App.automation = null
static

Definition at line 27 of file App.cs.

◆ cellImager

CellImager BioImager.App.cellImager = null
static

Definition at line 29 of file App.cs.

◆ channelsTool

ChannelsTool BioImager.App.channelsTool = null
static

Definition at line 15 of file App.cs.

◆ console

BioConsole BioImager.App.console = null
static

Definition at line 31 of file App.cs.

◆ imager

Imager BioImager.App.imager = null
static

Definition at line 20 of file App.cs.

◆ lib

Library BioImager.App.lib = null
static

Definition at line 33 of file App.cs.

◆ lightTool

Light BioImager.App.lightTool = null
static

Definition at line 32 of file App.cs.

◆ manager

ROIManager BioImager.App.manager = null
static

Definition at line 14 of file App.cs.

◆ nodeView

NodeView BioImager.App.nodeView = null
static

Definition at line 17 of file App.cs.

◆ recent

List<string> BioImager.App.recent = new List<string>()
static

Definition at line 34 of file App.cs.

◆ recorder

Recorder BioImager.App.recorder = null
static

Definition at line 19 of file App.cs.

◆ recordings

Recordings BioImager.App.recordings = null
static

Definition at line 26 of file App.cs.

◆ runner

Scripting BioImager.App.runner = null
static

Definition at line 18 of file App.cs.

◆ seriesTool

Series BioImager.App.seriesTool = null
static

Definition at line 25 of file App.cs.

◆ setup

MicroscopeSetup BioImager.App.setup = null
static

Definition at line 28 of file App.cs.

◆ slideImager

SlideImager BioImager.App.slideImager = null
static

Definition at line 30 of file App.cs.

◆ stackTools

StackTools BioImager.App.stackTools = null
static

Definition at line 22 of file App.cs.

◆ stage

StageTool BioImager.App.stage = null
static

Definition at line 24 of file App.cs.

◆ tabsView

TabsView BioImager.App.tabsView = null
static

Definition at line 16 of file App.cs.

◆ tools

Tools BioImager.App.tools = null
static

Definition at line 21 of file App.cs.

◆ viewer

ImageView BioImager.App.viewer = null
static

Definition at line 23 of file App.cs.

Property Documentation

◆ Annotations

List<ROI> BioImager.App.Annotations
staticget

Definition at line 51 of file App.cs.

52 {
53 get { return Image.Annotations; }
54 }

◆ Channels

List<Channel> BioImager.App.Channels
staticget

Definition at line 46 of file App.cs.

47 {
48 get { return Image.Channels; }
49 }

◆ Image

BioImage BioImager.App.Image
staticget

Definition at line 37 of file App.cs.

38 {
39 get
40 {
41 if (ImageView.SelectedImage == null)
42 return tabsView.Image;
43 return ImageView.SelectedImage;
44 }
45 }
ImageView control for image stacks, pyramidal and whole-slide-images.
Definition: ImageView.cs:19

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