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.TabsView Class Reference
Inheritance diagram for BioImager.TabsView:

Public Member Functions

 TabsView (BioImage arg)
 
 TabsView (string[] arg)
 
void AddTab (BioImage b)
 
void ResizeView ()
 
void OpenInNewProcess (string file)
 
void UpdateViewMode (ImageView.ViewMode v)
 

Public Attributes

Filter filters = null
 

Static Public Attributes

static bool init = false
 
static System.Drawing.Graphics graphics = null
 

Protected Member Functions

override void Dispose (bool disposing)
 Clean up any resources being used. More...
 

Properties

ImageView Viewer [get]
 
static BioImage SelectedImage [get]
 
static ImageView SelectedViewer [get]
 
BioImage Image [get]
 
int TabCount [get]
 

Detailed Description

Definition at line 13 of file TabsView.cs.

Constructor & Destructor Documentation

◆ TabsView() [1/3]

BioImager.TabsView.TabsView ( BioImage  arg)

Definition at line 46 of file TabsView.cs.

47 {
48 InitializeComponent();
49 LoadProperties();
50 ResizeView();
51 Init();
52 }

◆ TabsView() [2/3]

BioImager.TabsView.TabsView ( )

Definition at line 53 of file TabsView.cs.

54 {
55 InitializeComponent();
56 LoadProperties();
57 ResizeView();
58 Init();
59 }

◆ TabsView() [3/3]

BioImager.TabsView.TabsView ( string[]  arg)

Definition at line 62 of file TabsView.cs.

63 {
64 InitializeComponent();
65 LoadProperties();
66 Init();
67 if (arg.Length == 0)
68 return;
69 else
70 {
71 for (int i = 0; i < arg.Length; i++)
72 {
73 if (arg[i].EndsWith(".cs"))
74 {
75 App.runner.RunScriptFile(arg[0]);
76 return;
77 }
78 if (arg[i].EndsWith(".ijm"))
79 {
80 ImageJ.RunMacro(arg[i], "");
81 return;
82 }
83 else
84 {
85 BioImage.OpenFile(arg[i], true);
86 }
87 }
88 }
89 }

Member Function Documentation

◆ AddTab()

void BioImager.TabsView.AddTab ( BioImage  b)

It creates a new tab, adds an image to it, and then resizes the window to fit the image

Parameters
BioImageThis is a class that contains the image data, and some other information about the image.
Returns
The method is returning a void.

Definition at line 96 of file TabsView.cs.

97 {
98 if (b == null)
99 return;
100 if (b.filename.Contains("/") || b.filename.Contains("\\"))
101 b.filename = Path.GetFileName(b.filename);
102 TabPage t = new TabPage(b.filename);
103 ImageView v = new ImageView(b);
104 v.ShowStage = false;
105 v.Dock = DockStyle.Fill;
106 t.Controls.Add(v);
107 if (Width < b.SizeX || Height < b.SizeY)
108 {
109 Width = b.SizeX;
110 Height = b.SizeY + 190;
111 }
112 tabControl.TabPages.Add(t);
113 tabControl.SelectedIndex = tabControl.TabCount - 1;
114 ResizeView();
115 }

References BioImager.TabsView.ResizeView().

Referenced by BioImager.BioImage.Bake().

◆ Dispose()

override void BioImager.TabsView.Dispose ( bool  disposing)
protected

Clean up any resources being used.

Parameters
disposingtrue if managed resources should be disposed; otherwise, false.

Definition at line 15 of file TabsView.designer.cs.

16 {
17 if (disposing && (components != null))
18 {
19 components.Dispose();
20 }
21 base.Dispose(disposing);
22 }

◆ OpenInNewProcess()

void BioImager.TabsView.OpenInNewProcess ( string  file)

It creates a new process, sets the file name to the current executable, and sets the arguments to the file name

Parameters
fileThe file to open

Definition at line 237 of file TabsView.cs.

238 {
239 Process p = new Process();
240 p.StartInfo.FileName = Application.ExecutablePath;
241 p.StartInfo.Arguments = file;
242 p.Start();
243 }

◆ ResizeView()

void BioImager.TabsView.ResizeView ( )

If the image is pyramidal, add 42 to the width and 206 to the height. Otherwise, add 20 to the width and 180 to the height

Returns
The size of the image.

Definition at line 190 of file TabsView.cs.

191 {
192 if (Image == null)
193 return;
194 System.Drawing.Size s;
195 if (SelectedImage.isPyramidal)
196 s = new System.Drawing.Size(ImageView.SelectedImage.Resolutions[Viewer.Level].SizeX + 42, ImageView.SelectedImage.Resolutions[Viewer.Level].SizeY + 206);
197 else
198 s = new System.Drawing.Size(ImageView.SelectedImage.SizeX + 20, ImageView.SelectedImage.SizeY + 180);
199 if (s.Width > Screen.PrimaryScreen.Bounds.Width || s.Height > Screen.PrimaryScreen.Bounds.Height)
200 {
201 this.WindowState = FormWindowState.Maximized;
202 Viewer.GoToImage();
203 }
204 else
205 {
206 Size = s;
207 Viewer.GoToImage();
208 }
209 }
int Level
Current level when viewing whole-slide and pyramidal images.
Definition: ImageView.cs:758

References BioImager.ImageView.GoToImage(), and BioImager.ImageView.Level.

Referenced by BioImager.TabsView.AddTab().

◆ UpdateViewMode()

void BioImager.TabsView.UpdateViewMode ( ImageView.ViewMode  v)

It updates the view mode of the image.

Parameters
vThe view mode that the user has selected.

Definition at line 512 of file TabsView.cs.

513 {
514 if (v == ImageView.ViewMode.RGBImage)
515 rGBToolStripMenuItem.Checked = true;
516 if (v == ImageView.ViewMode.Filtered)
517 filteredToolStripMenuItem.Checked = true;
518 if (v == ImageView.ViewMode.Raw)
519 rawToolStripMenuItem.Checked = true;
520 }

Member Data Documentation

◆ filters

Filter BioImager.TabsView.filters = null

Definition at line 16 of file TabsView.cs.

◆ graphics

System.Drawing.Graphics BioImager.TabsView.graphics = null
static

Definition at line 17 of file TabsView.cs.

◆ init

bool BioImager.TabsView.init = false
static

Definition at line 15 of file TabsView.cs.

Property Documentation

◆ Image

BioImage BioImager.TabsView.Image
get

Definition at line 212 of file TabsView.cs.

213 {
214 get
215 {
216 if (Viewer == null)
217 return null;
218 if (ImageView.SelectedImage == null)
219 return null;
220 return ImageView.SelectedImage;
221 }
222 }

◆ SelectedImage

BioImage BioImager.TabsView.SelectedImage
staticget

Definition at line 32 of file TabsView.cs.

33 {
34 get
35 {
36 return App.tabsView.Image;
37 }
38 }

◆ SelectedViewer

ImageView BioImager.TabsView.SelectedViewer
staticget

Definition at line 39 of file TabsView.cs.

40 {
41 get
42 {
43 return App.tabsView.Viewer;
44 }
45 }

◆ TabCount

int BioImager.TabsView.TabCount
get

Definition at line 225 of file TabsView.cs.

226 {
227 get
228 {
229 return tabControl.TabPages.Count;
230 }
231 }

◆ Viewer

ImageView BioImager.TabsView.Viewer
get

Definition at line 19 of file TabsView.cs.

20 {
21 get
22 {
23 if (tabControl.TabPages.Count == 0)
24 return null;
25 if (tabControl.SelectedIndex == -1)
26 return null;
27 if (tabControl.SelectedTab.Controls.Count == 0)
28 return null;
29 return (ImageView)tabControl.SelectedTab.Controls[0];
30 }
31 }

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