BioImager  4.9.0
A .NET microscopy imaging application based on Bio library. Supports various microscopes by using imported libraries & GUI automation. Supports XInput game controllers to move stage, take images, run ImageJ macros on images or Bio C# scripts.
Loading...
Searching...
No Matches
BioImager.ImageView Class Reference

ImageView control for image stacks, pyramidal and whole-slide-images. More...

Inheritance diagram for BioImager.ImageView:

Classes

struct  Layer
 

Public Types

enum  ViewMode { Raw , Filtered , RGBImage , Emission }
 

Public Member Functions

 ImageView (BioImage im, bool OpenWithOpenSlide=true)
 Initializing the image viewer. *‍/.
 
 ImageView ()
 Initializing the ImageView class. *‍/.
 
void SetCoordinate (int z, int c, int t)
 
ZCT GetCoordinate ()
 
void AddImage (BioImage im)
 
void UpdateRGBChannels ()
 
void InitGUI ()
 
void UpdateSelectBoxSize (float size)
 
void UpdateOverlay ()
 
void UpdateStatus ()
 
void UpdateView (bool refreshImages=true)
 
void UpdateViewLegacy (bool refresh)
 
async void UpdateImages ()
 
void RemoveImage (int i)
 
void RemoveImages ()
 
void UpdateImage ()
 
void GetRange ()
 
void DrawView (System.Drawing.Graphics g)
 Draws the viewport when Hardware Acceleration is off.
 
double GetScale ()
 
double GetSelectionBoxHitSize ()
 
void CopySelection ()
 It takes the selected ROIs and copies them to the clipboard.
 
void PasteSelection ()
 
PointD ImageToViewSpace (double x, double y)
 
PointF ToViewSpace (PointF p)
 
PointD ToViewSpace (PointD p)
 
PointD ToViewSpace (double x, double y)
 
double ToViewSizeH (double d)
 
double ToViewW (double d)
 
double ToViewH (double d)
 
PointD ToScreenSpace (double x, double y)
 
PointD ToScreenSpace (PointD p)
 
PointF ToScreenSpace (PointF p)
 
PointF[] ToScreenSpace (PointF[] p)
 
PointF ToScreenSpace (Point3D p)
 
float ToScreenScaleW (double x)
 
float ToScreenScaleH (double y)
 
PointF ToScreenScale (PointD p)
 
RectangleD ToScreenRect (double x, double y, double w, double h)
 
SKRect ToSKRect (double x, double y, double w, double h)
 
RectangleD ToScreenSpace (RectangleD p)
 
RectangleD ToScreenSpace (RectangleF p)
 
RectangleD[] ToScreenSpace (RectangleD[] p)
 
RectangleF[] ToScreenSpace (RectangleF[] p)
 
PointF[] ToScreenSpace (PointD[] p)
 
float ToScreenW (double x)
 
float ToScreenH (double y)
 
void ImageView_KeyDown (object sender, KeyEventArgs e)
 
void GoToImage ()
 
void GoToImage (int i)
 
new void Dispose ()
 
void GoToStage ()
 
void MoveStageToImage ()
 
void MoveStageToImage (int i)
 

Public Attributes

List< LayerLayers = new List<Layer>()
 
Image Buf = null
 
bool init = false
 
List< BioImage > Images = new List<BioImage>()
 
string filepath = ""
 
int serie = 0
 
int minSizeX = 50
 
int minSizeY = 20
 
bool loopZ = true
 
bool loopT = true
 
bool loopC = true
 
bool showRROIs = true
 
bool showGROIs = true
 
bool showBROIs = true
 

Static Public Attributes

static List< ROI > selectedAnnotations = new List<ROI>()
 
static PointD mouseDown
 
static bool down
 
static PointD mouseUp
 
static bool up
 
static MouseButtons mouseUpButtons
 
static MouseButtons mouseDownButtons
 
static bool showBounds = true
 
static bool showText = true
 

Protected Member Functions

override bool ProcessCmdKey (ref Message msg, Keys keyData)
 
override void Dispose (bool disposing)
 Clean up any resources being used.
 

Properties

static BioImage SelectedImage [get, set]
 
static Bitmap SelectedBuffer [get]
 
static bool Ctrl [get]
 
int SelectedIndex = 0 [get, set]
 A property that is used to set the selected index of the image. *‍/.
 
Tools tools [get]
 
Rectangle OverView [get]
 
bool ShowStage [get, set]
 
bool ShowOverview [get, set]
 
bool ShowControls [get, set]
 Setting the visibility of the trackBarPanel. *‍/.
 
bool ShowStatus [get, set]
 Setting the value of the property ShowStatus. *‍/.
 
double PxWmicron [get, set]
 Only used when opening stacks.
 
double PxHmicron [get, set]
 Only used when opening stacks.
 
ViewMode Mode [get, set]
 Setting the view mode of the application. *‍/.
 
string Path [get]
 A property that returns the filepath. *‍/.
 
Channel RChannel [get]
 A property that returns the R channel of the selected image. *‍/.
 
Channel GChannel [get]
 A property that returns the G channel of the image. *‍/.
 
Channel BChannel [get]
 Getting the B channel of the image. *‍/.
 
bool OpenSlide [get]
 
int? MacroResolution [get]
 
int? LabelResolution [get]
 
int ViewWidth [get]
 
int ViewHeight [get]
 
PointD Origin [get, set]
 A property of the class PointD. *‍/.
 
PointD PyramidalOrigin [get, set]
 Setting the value of the pyramidalOrigin variable. *‍/.
 
double Resolution [get, set]
 A property of the class ImageViewer. It is a getter and setter for the resolution of the image.
 
int Level [get]
 Current level when viewing whole-slide and pyramidal images.
 
new AForge.SizeF Scale [get, set]
 Scale when opening image stacks.
 
ContextMenuStrip ViewContextMenu [get]
 A property that returns a ContextMenuStrip object. *‍/.
 
int ZFps [get, set]
 Setting the interval of the timer to the value of the fps. *‍/.
 
int TimeFps [get, set]
 Setting the interval of the timer to the value of the timefps variable. *‍/.
 
int CFps [get, set]
 Setting the interval of the timer to the inverse of the fps. *‍/.
 
List< ROI > AnnotationsR [get]
 
List< ROI > AnnotationsG [get]
 
List< ROI > AnnotationsB [get]
 
List< ROI > AnnotationsRGB [get]
 
PointD PyramidalOriginTransformed [get, set]
 
PointD MouseDownInt [get, set]
 
PointD MouseUpInt [get, set]
 
PointD MouseMoveInt [get, set]
 
bool ShowMasks = true [get, set]
 

Detailed Description

ImageView control for image stacks, pyramidal and whole-slide-images.

Definition at line 4 of file ImageView.designer.cs.

Member Enumeration Documentation

◆ ViewMode

enum BioImager.ImageView.ViewMode

Definition at line 822 of file ImageView.cs.

823 {
824 Raw,
825 Filtered,
826 RGBImage,
827 Emission,
828 }

Constructor & Destructor Documentation

◆ ImageView() [1/2]

BioImager.ImageView.ImageView ( BioImage im,
bool OpenWithOpenSlide = true )

Initializing the image viewer. *‍/.

Definition at line 38 of file ImageView.cs.

39 {
40 string file = im.ID.Replace("\\", "/");
41 InitializeComponent();
42 bool useGpuTiles = im.Resolutions.Count > 1;
43 BioLib.SlideSourceBase.UseGPU = useGpuTiles;
44 OpenSlideGTK.SlideSourceBase.useGPU = useGpuTiles;
45 viewpanel.Paint += Viewpanel_Paint;
46 AttachViewerInput(viewpanel);
47
48 if (im.isPyramidal)
49 {
50 gl.Size = new System.Drawing.Size(800, 600);
51 if (im.openSlideImage != null && OpenWithOpenSlide)
52 {
53 Initialize(im.file, im);
54 }
55 else
56 Initialize(im.file, im);
57 hScrollBar.Maximum = im.Resolutions[Level].SizeX;
58 vScrollBar.Maximum = im.Resolutions[Level].SizeY;
59 hScrollBar.Visible = true;
60 vScrollBar.Visible = true;
61 }
62 else
63 {
64 hScrollBar.Visible = false;
65 vScrollBar.Visible = false;
66 gl.Width += 18;
67 gl.Height += 18;
68 Tools.selectBoxSize = GetSelectBoxSize();
69 }
70 App.viewer = this;
71 serie = im.series;
72 gl.Dock = DockStyle.Fill;
73 viewpanel.Controls.Add(gl);
74 AttachViewerInput(gl);
75 InitializeOverviewOverlay();
76 Dock = DockStyle.Fill;
77 AddImage(im);
78 UpdateRenderSurfaceMode();
79 App.viewer = this;
80 if (file == "" || file == null)
81 return;
82 SetCoordinate(0, 0, 0);
83 InitGUI();
84 MouseWheel += new System.Windows.Forms.MouseEventHandler(ImageView_MouseWheel);
85 zBar.MouseWheel += new System.Windows.Forms.MouseEventHandler(ZTrackBar_MouseWheel);
86 cBar.MouseWheel += new System.Windows.Forms.MouseEventHandler(CTrackBar_MouseWheel);
87 tBar.MouseWheel += new System.Windows.Forms.MouseEventHandler(TimeTrackBar_MouseWheel);
88 //We set the trackbar event to handled so that it only scrolls one tick not the default multiple.
89 zBar.MouseWheel += (sender, e) => ((HandledMouseEventArgs)e).Handled = true;
90 tBar.MouseWheel += (sender, e) => ((HandledMouseEventArgs)e).Handled = true;
91 cBar.MouseWheel += (sender, e) => ((HandledMouseEventArgs)e).Handled = true;
92 this.SizeChanged += ImageView_SizeChanged;
93 this.KeyDown += ImageView_KeyDown;
94 this.KeyPress += ImageView_KeyPress;
95 this.KeyUp += ImageView_KeyUp;
96 TimeFps = 60;
97 ZFps = 60;
98 CFps = 1;
99 resolutions = im.Resolutions;
100 if (im.isPyramidal)
101 {
102 // Keep the renderer bound to the currently selected pyramidal source.
103 if (im.OpenSlideBase != null)
104 {
105 if (slideRenderer == null)
106 slideRenderer = new SlideRenderer(gl);
107 if (!slideRenderer.IsSource(im.OpenSlideBase))
108 slideRenderer.SetSource(im.OpenSlideBase);
109 }
110 else if (im.SlideBase != null)
111 {
112 if (slideRenderer == null)
113 slideRenderer = new SlideRenderer(gl);
114 if (!slideRenderer.IsSource(im.SlideBase))
115 slideRenderer.SetSource(im.SlideBase);
116 }
117 }
118 InitGL();
119 update = true;
120 InitPreview();
121 GoToImage();
122 UpdateImages();
123 Mode = ViewMode.Filtered;
124 UpdateView();
125
126 }
async void UpdateImages()
void SetCoordinate(int z, int c, int t)
Definition ImageView.cs:461
void UpdateView(bool refreshImages=true)
ViewMode Mode
Setting the view mode of the application. *‍/.
Definition ImageView.cs:833
int TimeFps
Setting the interval of the timer to the value of the timefps variable. *‍/.
int CFps
Setting the interval of the timer to the inverse of the fps. *‍/.
int ZFps
Setting the interval of the timer to the value of the fps. *‍/.
void ImageView_KeyDown(object sender, KeyEventArgs e)
int Level
Current level when viewing whole-slide and pyramidal images.
void AddImage(BioImage im)
Definition ImageView.cs:501

◆ ImageView() [2/2]

BioImager.ImageView.ImageView ( )

Initializing the ImageView class. *‍/.

Definition at line 128 of file ImageView.cs.

129 {
130 InitializeComponent();
131 viewpanel.Paint += Viewpanel_Paint;
132 AttachViewerInput(viewpanel);
133 InitGL();
134 AttachViewerInput(gl);
135 InitializeOverviewOverlay();
136 Dock = DockStyle.Fill;
137 App.viewer = this;
138 SetCoordinate(0, 0, 0);
139 InitGUI();
140 //Buf = image.GetBufByCoord(GetCoordinate());
141 MouseWheel += new System.Windows.Forms.MouseEventHandler(ImageView_MouseWheel);
142 zBar.MouseWheel += new System.Windows.Forms.MouseEventHandler(ZTrackBar_MouseWheel);
143 cBar.MouseWheel += new System.Windows.Forms.MouseEventHandler(CTrackBar_MouseWheel);
144 tBar.MouseWheel += new System.Windows.Forms.MouseEventHandler(TimeTrackBar_MouseWheel);
145 this.SizeChanged += ImageView_SizeChanged;
146 //We set the trackbar event to handled so that it only scrolls one tick not the default multiple.
147 zBar.MouseWheel += (sender, e) => ((HandledMouseEventArgs)e).Handled = true;
148 tBar.MouseWheel += (sender, e) => ((HandledMouseEventArgs)e).Handled = true;
149 cBar.MouseWheel += (sender, e) => ((HandledMouseEventArgs)e).Handled = true;
150 TimeFps = 60;
151 ZFps = 60;
152 CFps = 1;
153 update = true;
154 UpdateImages();
155 GoToImage();
156 UpdateView();
157 }

Member Function Documentation

◆ AddImage()

void BioImager.ImageView.AddImage ( BioImage im)

This function adds an image to the list of images, and then updates the GUI to reflect the new image

Parameters
BioImageThis is a class that contains the image data, and some other information about the image.

Definition at line 501 of file ImageView.cs.

502 {
503 Images.Add(im);
504 SelectedIndex = Images.Count - 1;
505 centerOnNextResize = true;
506 bool c = false;
507 foreach (var item in Layers)
508 {
509 if (item.Resolution == im.PhysicalSizeX)
510 c = true;
511 }
512 if (!c)
513 Layers.Add(new Layer(im.PhysicalSizeX));
514 if (im.isPyramidal)
515 {
516 hScrollBar.Maximum = im.Resolutions[Level].SizeX;
517 vScrollBar.Maximum = im.Resolutions[Level].SizeY;
518 hScrollBar.Visible = true;
519 vScrollBar.Visible = true;
520 }
521 else
522 {
523 hScrollBar.Visible = false;
524 vScrollBar.Visible = false;
525 gl.Width += 18;
526 gl.Height += 18;
527 Tools.selectBoxSize = GetSelectBoxSize();
528 }
529 InitGUI();
530 UpdateImages();
531
532 GoToImage(Images.Count - 1);
533 QueueInitialCenterAfterLayout(Images.Count - 1);
534 }
int SelectedIndex
A property that is used to set the selected index of the image. *‍/.
Definition ImageView.cs:422

◆ CopySelection()

void BioImager.ImageView.CopySelection ( )

It takes the selected ROIs and copies them to the clipboard.

Definition at line 3750 of file ImageView.cs.

3751 {
3752 copys.Clear();
3753 string s = "";
3754 foreach (ROI item in AnnotationsRGB)
3755 {
3756 if (item.Selected)
3757 {
3758 copys.Add(item);
3759 s += BioImage.ROIToString(item);
3760 }
3761 }
3762 System.Windows.Forms.Clipboard.SetText(s);
3763 }

◆ Dispose() [1/2]

new void BioImager.ImageView.Dispose ( )

Definition at line 4513 of file ImageView.cs.

4514 {
4515 for (int i = 0; i < Bitmaps.Count; i++)
4516 {
4517 if (Bitmaps[i] != null)
4518 Bitmaps[i].Dispose();
4519 }
4520 for (int i = 0; i < Bitmaps.Count; i++)
4521 {
4522 if (Bitmaps[i] != null)
4523 Bitmaps[i].Dispose();
4524 }
4525 }

◆ Dispose() [2/2]

override void BioImager.ImageView.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 ImageView.designer.cs.

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

◆ DrawView()

void BioImager.ImageView.DrawView ( System.Drawing.Graphics g)

Draws the viewport when Hardware Acceleration is off.

Parameters
g

Definition at line 2714 of file ImageView.cs.

2715 {
2716 try
2717 {
2718 drawing = true;
2719 if (SelectedImage == null)
2720 return;
2721 if (UsesSlideRenderer(SelectedImage))
2722 {
2723 UpdateImages();
2724 return;
2725 }
2726 g.TranslateTransform(ViewWidth / 2, ViewHeight / 2);
2727 if (Scale.Width == 0 || float.IsInfinity(Scale.Width))
2728 Scale = new SizeF(1, 1);
2729 g.ScaleTransform(Scale.Width, Scale.Height);
2730 if (Bitmaps.Count == 0)
2731 return;
2732 System.Drawing.RectangleF[] rf = new System.Drawing.RectangleF[1];
2733 System.Drawing.Pen blue = new System.Drawing.Pen(Brushes.Blue, 1 / Scale.Width);
2734 int i = 0;
2735 foreach (BioImage im in Images)
2736 {
2737 if (!IsLayerEnabled(im.PhysicalSizeX) && !im.isPyramidal)
2738 continue;
2739 RectangleD r = ToScreenRect(im.Volume.Location.X, im.Volume.Location.Y, im.Volume.Width, im.Volume.Height);
2740 double w = ToViewW(ViewWidth);
2741 double h = ToViewH(ViewHeight);
2742 RectangleF rg = new RectangleF((float)((-Origin.X) - (w / 2)), (float)((-Origin.Y) - (h / 2)), (float)(w), (float)(h));
2743 RectangleF rec = new RectangleF((float)im.Volume.Location.X, (float)im.Volume.Location.Y, (float)im.Volume.Width, (float)im.Volume.Height);
2744 if (SelectedImage.isPyramidal)
2745 {
2746 var tr = g.Transform;
2747 g.ResetTransform();
2748 g.DrawImage(Bitmaps[i], 0, 0);
2749 g.Transform = tr;
2750 }
2751 else
2752 if (rg.IntersectsWith(rec))
2753 {
2754 g.DrawImage(Bitmaps[i], (float)r.X, (float)r.Y, (float)r.W, (float)r.H);
2755 }
2756 if (i == SelectedIndex && !SelectedImage.isPyramidal)
2757 {
2758 rf[0] = new System.Drawing.RectangleF((float)r.X, (float)r.Y, (float)r.W, (float)r.H);
2759 g.DrawRectangles(blue, rf);
2760 }
2761 i++;
2762 }
2763 if (ShowStage)
2764 {
2765 RectangleD d = Microscope.GetViewRectangle(false);
2766 RectangleF[] rfs = new RectangleF[1] { new RectangleF((float)d.X, (float)d.Y, (float)d.W, (float)d.H) };
2767 var v = ToScreenSpace(rfs);
2768 System.Drawing.Pen red = new System.Drawing.Pen(Brushes.Red, 1 / Scale.Width);
2769 g.DrawRectangle(red, v[0].X, v[0].Y, v[0].Width, v[0].Height);
2770 }
2771 blue.Dispose();
2772 update = false;
2773 drawing = false;
2774 }
2775 catch (Exception e)
2776 {
2777 Console.WriteLine(e.Message);
2778 }
2779 }
new AForge.SizeF Scale
Scale when opening image stacks.
PointD Origin
A property of the class PointD. *‍/.
Definition ImageView.cs:942
PointD ToScreenSpace(double x, double y)
double ToViewW(double d)
RectangleD ToScreenRect(double x, double y, double w, double h)
double ToViewH(double d)

◆ GetCoordinate()

ZCT BioImager.ImageView.GetCoordinate ( )

It returns the coordinate of the selected image

Returns
The Coordinate property of the SelectedImage object.

Definition at line 489 of file ImageView.cs.

490 {
491 if (SelectedImage != null)
492 return SelectedImage.Coordinate;
493 else
494 return new ZCT();
495 }

◆ GetRange()

void BioImager.ImageView.GetRange ( )

It creates a new RangeTool object, which is a form that allows the user to set the range of the data to be displayed.

The RangeTool object is created with the following parameters:

  • timeEnabled: a boolean that indicates whether the data has a time component.
  • Mode: a ViewMode enum that indicates whether the data is filtered or not.
  • zBar.Minimum: the minimum value of the zBar.
  • zBar.Maximum: the maximum value of the zBar.
  • tBar.Minimum: the minimum value of the tBar.
  • tBar.Maximum: the maximum value of the tBar.
  • cBar.Minimum: the minimum value of the cBar.
  • cBar.Maximum: the maximum value of the cBar.

The RangeTool object is then shown to the user.

If the user clicks the

Returns
A RangeTool object.

Definition at line 2029 of file ImageView.cs.

2030 {
2031 RangeTool t;
2032 if (Mode == ViewMode.Filtered)
2033 t = new RangeTool(timeEnabled, true, zBar.Minimum, zBar.Maximum, tBar.Minimum, tBar.Maximum, cBar.Minimum, cBar.Maximum);
2034 else
2035 t = new RangeTool(timeEnabled, false, zBar.Minimum, zBar.Maximum, tBar.Minimum, tBar.Maximum, cBar.Minimum, cBar.Maximum);
2036 if (t.ShowDialog() != DialogResult.OK)
2037 return;
2038 zBar.Minimum = t.ZMin;
2039 zBar.Maximum = t.ZMax;
2040 tBar.Minimum = t.TimeMin;
2041 tBar.Maximum = t.TimeMax;
2042 cBar.Minimum = t.CMin;
2043 cBar.Maximum = t.CMax;
2044 }

◆ GetScale()

double BioImager.ImageView.GetScale ( )

GetScale() returns the scale of the image in the viewport.

Returns
The scale of the image.

Definition at line 3215 of file ImageView.cs.

3216 {
3217 return GetSelectionBoxHitSize();
3218 }

◆ GetSelectionBoxHitSize()

double BioImager.ImageView.GetSelectionBoxHitSize ( )

Definition at line 3220 of file ImageView.cs.

3221 {
3222 return GetSelectBoxSizeForScreenPixels(MinSelectionHitScreenSize);
3223 }

◆ GoToImage() [1/2]

void BioImager.ImageView.GoToImage ( )

If the selected image is not null, set the origin to the center of the image, and set the scale to the height of the image.

Returns
The method is returning the value of the variable "Scale"

Definition at line 4291 of file ImageView.cs.

4292 {
4294 }

◆ GoToImage() [2/2]

void BioImager.ImageView.GoToImage ( int i)

It takes an image index and centers the image in the viewport

Parameters
ithe index of the image to go to
Returns
The method is returning the value of the variable "i"

Definition at line 4333 of file ImageView.cs.

4334 {
4335 if (Images.Count <= i)
4336 return;
4337 if (SelectedIndex != i)
4338 SelectedIndex = i;
4339 BioImage image = Images[i];
4340 int viewportWidth = GetEffectiveViewWidth();
4341 int viewportHeight = GetEffectiveViewHeight();
4342 if (UsesSlideRenderer(image))
4343 {
4344 CenterPyramidalImage(image, viewportWidth, viewportHeight);
4345 UpdateView();
4346 return;
4347 }
4348
4349 double dx = image.Volume.Width / 2;
4350 double dy = image.Volume.Height / 2;
4351 origin = new PointD(-(image.Volume.Location.X + dx), -(image.Volume.Location.Y + dy));
4352 double screenWidth = Math.Abs(ToScreenScaleW(image.Volume.Width));
4353 double screenHeight = Math.Abs(ToScreenScaleH(image.Volume.Height));
4354 double wx = screenWidth > 0 ? viewportWidth / screenWidth : 1;
4355 double wy = screenHeight > 0 ? viewportHeight / screenHeight : 1;
4356 double fitScale = Math.Min(wx, wy);
4357 if (fitScale <= 0 || double.IsNaN(fitScale) || double.IsInfinity(fitScale))
4358 fitScale = 1;
4359 scale = new SizeF((float)fitScale, (float)fitScale);
4360 update = true;
4361 UpdateView();
4362 }
float ToScreenScaleH(double y)
float ToScreenScaleW(double x)

◆ GoToStage()

void BioImager.ImageView.GoToStage ( )

Definition at line 4639 of file ImageView.cs.

4640 {
4641 RectangleD d = Microscope.GetViewRectangle(false);
4642 double dx = d.W / 2;
4643 double dy = d.H / 2;
4644 Origin = new PointD(-(d.X + dx), -(d.Y + dy));
4645 double wx, wy;
4646 wx = Math.Abs(ViewWidth / ToScreenScaleW(d.W));
4647 wy = Math.Abs(ViewHeight / ToScreenScaleH(d.H));
4648 scale.Width = (float)wy;
4649 scale.Height = (float)wy;
4650 update = true;
4651 UpdateView();
4652 }

◆ ImageToViewSpace()

PointD BioImager.ImageView.ImageToViewSpace ( double x,
double y )

It takes a point in the image space and returns the point in the view space

Parameters
xthe x coordinate of the point in the image
ythe y coordinate of the point in the image
Returns
The point in the image space that corresponds to the point in the view space.

Definition at line 3864 of file ImageView.cs.

3865 {
3866 if (SelectedImage == null)
3867 return ToViewSpace(x, y);
3868 if (SelectedImage.isPyramidal)
3869 {
3870 return new PointD(PyramidalOrigin.X + (x * Resolution), PyramidalOrigin.Y + (y * Resolution));
3871 }
3872 else
3873 return ToViewSpace(x, y);
3874 }
PointD PyramidalOrigin
Setting the value of the pyramidalOrigin variable. *‍/.
Definition ImageView.cs:954
PointF ToViewSpace(PointF p)
double Resolution
A property of the class ImageViewer. It is a getter and setter for the resolution of the image.
Definition ImageView.cs:970

◆ ImageView_KeyDown()

void BioImager.ImageView.ImageView_KeyDown ( object sender,
KeyEventArgs e )

If the user presses the "C" key while holding down the "Control" key, then the function "CopySelection" is called

Parameters
senderThe object that raised the event.
KeyEventArgsThe event arguments for the key press.
Returns
The return value is a PointD object.

Definition at line 4214 of file ImageView.cs.

4215 {
4216 double moveAmount = 5 * Scale.Width;
4217 Plugins.KeyDownEvent(sender, e);
4218 if (e.KeyCode == Keys.C && e.Control)
4219 {
4220 CopySelection();
4221 return;
4222 }
4223 if (e.KeyCode == Keys.V && e.Control)
4224 {
4226 return;
4227 }
4228 if (e.KeyCode == Keys.Subtract || e.KeyCode == Keys.NumPad7)
4229 {
4230 if (SelectedImage.isPyramidal)
4231 ZoomPyramidalAt(new System.Drawing.Point(ViewWidth / 2, ViewHeight / 2), 0.9);
4232 else
4233 Scale = new SizeF(Scale.Width - 0.1f, Scale.Height - 0.1f);
4234 if (!SelectedImage.isPyramidal)
4235 UpdateView();
4236 }
4237 if (e.KeyCode == Keys.Add || e.KeyCode == Keys.NumPad9)
4238 {
4239 if (SelectedImage.isPyramidal)
4240 ZoomPyramidalAt(new System.Drawing.Point(ViewWidth / 2, ViewHeight / 2), 1.1);
4241 else
4242 Scale = new SizeF(Scale.Width + 0.1f, Scale.Height + 0.1f);
4243 if (!SelectedImage.isPyramidal)
4244 UpdateView();
4245 }
4246 if (e.KeyCode == Keys.W || e.KeyCode == Keys.NumPad8)
4247 {
4248 if (SelectedImage.isPyramidal)
4249 PyramidalOrigin = new PointD(PyramidalOrigin.X, PyramidalOrigin.Y - moveAmount);
4250 else
4251 Origin = new PointD(Origin.X, Origin.Y + moveAmount);
4252 UpdateView();
4253 }
4254 if (e.KeyCode == Keys.S || e.KeyCode == Keys.NumPad2)
4255 {
4256 if (SelectedImage.isPyramidal)
4257 PyramidalOrigin = new PointD(PyramidalOrigin.X, PyramidalOrigin.Y + moveAmount);
4258 else
4259 Origin = new PointD(Origin.X, Origin.Y - moveAmount);
4260 UpdateView();
4261 }
4262 if (e.KeyCode == Keys.A || e.KeyCode == Keys.NumPad4)
4263 {
4264 if (SelectedImage.isPyramidal)
4265 PyramidalOrigin = new PointD(PyramidalOrigin.X - moveAmount, PyramidalOrigin.Y);
4266 else
4267 Origin = new PointD(Origin.X + moveAmount, Origin.Y);
4268 UpdateView();
4269 }
4270 if (e.KeyCode == Keys.D || e.KeyCode == Keys.NumPad6)
4271 {
4272 if (SelectedImage.isPyramidal)
4273 PyramidalOrigin = new PointD(PyramidalOrigin.X + moveAmount, PyramidalOrigin.Y);
4274 else
4275 Origin = new PointD(Origin.X - moveAmount, Origin.Y);
4276 UpdateView();
4277 }
4278 }
void CopySelection()
It takes the selected ROIs and copies them to the clipboard.

◆ InitGUI()

void BioImager.ImageView.InitGUI ( )

It initializes the GUI

Returns
The image is being returned.

Definition at line 1119 of file ImageView.cs.

1120 {
1121 if (SelectedImage == null)
1122 return;
1123 if (SelectedImage.Buffers.Count == 0)
1124 return;
1125 zBar.Maximum = SelectedImage.SizeZ - 1;
1126
1127 if (SelectedImage.Buffers[0].RGBChannelsCount == 3)
1128 cBar.Maximum = 0;
1129 else
1130 cBar.Maximum = SelectedImage.SizeC - 1;
1131 if (SelectedImage.SizeT > 1)
1132 {
1133 tBar.Maximum = SelectedImage.SizeT - 1;
1134 timeEnabled = true;
1135 }
1136 else
1137 {
1138 tBar.Enabled = false;
1139 timeEnabled = false;
1140 tBar.Maximum = SelectedImage.SizeT - 1;
1141 }
1142 //rgbPictureBox.Image = image.plane.GetBitmap();
1143 //we clear the channel comboboxes incase we have channels from previous loaded image.
1144 channelBoxR.Items.Clear();
1145 channelBoxG.Items.Clear();
1146 channelBoxB.Items.Clear();
1147
1148 foreach (Channel ch in SelectedImage.Channels)
1149 {
1150 channelBoxR.Items.Add(ch);
1151 channelBoxG.Items.Add(ch);
1152 channelBoxB.Items.Add(ch);
1153 }
1154 if (SelectedImage.Channels.Count > 2)
1155 {
1156 channelBoxR.SelectedIndex = 0;
1157 channelBoxG.SelectedIndex = 1;
1158 channelBoxB.SelectedIndex = 2;
1159 }
1160 else
1161 if (SelectedImage.Channels.Count == 2)
1162 {
1163 channelBoxR.SelectedIndex = 0;
1164 channelBoxG.SelectedIndex = 1;
1165 }
1167
1168 init = true;
1169 }

◆ MoveStageToImage() [1/2]

void BioImager.ImageView.MoveStageToImage ( )

Move the stage to the location of the selected image

Returns
The method is returning the value of the SelectedImage property.

Definition at line 4656 of file ImageView.cs.

4657 {
4658 if (SelectedImage == null)
4659 return;
4660 Microscope.Stage.SetPosition(SelectedImage.Volume.Location.X, SelectedImage.Volume.Location.Y);
4661 update = true;
4662 UpdateView();
4663 }

◆ MoveStageToImage() [2/2]

void BioImager.ImageView.MoveStageToImage ( int i)

Move the stage to the location of the image at index i

Parameters
ithe index of the image in the list of images

Definition at line 4667 of file ImageView.cs.

4668 {
4669 update = true;
4670 Microscope.Stage.SetPosition(Images[i].Volume.Location.X, Images[i].Volume.Location.Y);
4671 UpdateView();
4672 }

◆ PasteSelection()

void BioImager.ImageView.PasteSelection ( )

We get the text from the clipboard, split it into lines, and then for each line, if it's longer than 8 characters, we convert it to an ROI and add it to the image

Definition at line 3766 of file ImageView.cs.

3767 {
3768 string[] sts = System.Windows.Forms.Clipboard.GetText().Split(BioImage.NewLine);
3769 foreach (string line in sts)
3770 {
3771 if (line.Length > 8)
3772 {
3773 ROI an = BioImage.StringToROI(line);
3774 //We set the coordinates of the ROI's we are pasting
3775 an.coord = GetCoordinate();
3776 SelectedImage.Annotations.Add(an);
3777 }
3778 }
3779 UpdateOverlay();
3780 }

◆ ProcessCmdKey()

override bool BioImager.ImageView.ProcessCmdKey ( ref Message msg,
Keys keyData )
protected

Definition at line 158 of file ImageView.cs.

159 {
160 const int WM_KEYDOWN = 0x0100;
161 const int WM_KEYUP = 0x0101;
162 const int WM_CHAR = 0x0102;
163
164 switch (msg.Msg)
165 {
166 case WM_KEYDOWN:
167 ImageView_KeyDown(this, new KeyEventArgs(keyData));
168 break;
169
170 case WM_KEYUP:
171 ImageView_KeyUp(this, new KeyEventArgs(keyData));
172 break;
173
174 case WM_CHAR:
175 char ch = (char)msg.WParam;
176 ImageView_KeyPress(this, new System.Windows.Forms.KeyPressEventArgs(ch));
177 break;
178 }
179
180 return base.ProcessCmdKey(ref msg, keyData);
181 }

◆ RemoveImage()

void BioImager.ImageView.RemoveImage ( int i)

Definition at line 1736 of file ImageView.cs.

1737 {
1738 do
1739 {
1740 System.Threading.Thread.Sleep(50);
1741 Application.DoEvents();
1742 } while (drawing || updating);
1743 Images[i].Dispose();
1744 Images.RemoveAt(i);
1745 UpdateImages();
1746 }

◆ RemoveImages()

void BioImager.ImageView.RemoveImages ( )

Definition at line 1747 of file ImageView.cs.

1748 {
1749 do
1750 {
1751 Thread.Sleep(50);
1752 Application.DoEvents();
1753 } while (drawing || updating);
1754 for (int i = 0; i < Images.Count; i++)
1755 {
1756 Images[i].Dispose();
1757 }
1758 Images.Clear();
1759 UpdateImages();
1760 }

◆ SetCoordinate()

void BioImager.ImageView.SetCoordinate ( int z,
int c,
int t )

‍Sets the coordinate of the image to the specified Z, C, and T values

Parameters
zthe z-coordinate of the image
cchannel
ttime
Returns
The method is returning the value of the zBar.Value, cBar.Value, and tBar.Value.

Definition at line 461 of file ImageView.cs.

462 {
463 if (IsDisposed)
464 return;
465
466 if (InvokeRequired)
467 {
468 BeginInvoke(new MethodInvoker(() => SetCoordinate(z, c, t)));
469 return;
470 }
471
472 if (SelectedImage == null)
473 return;
474
475 int targetZ = Math.Clamp(z, zBar.Minimum, zBar.Maximum);
476 int targetC = Math.Clamp(c, cBar.Minimum, cBar.Maximum);
477 int targetT = Math.Clamp(t, tBar.Minimum, tBar.Maximum);
478
479 if (zBar.Value != targetZ)
480 zBar.Value = targetZ;
481 if (cBar.Value != targetC)
482 cBar.Value = targetC;
483 if (tBar.Value != targetT)
484 tBar.Value = targetT;
485 }

◆ ToScreenH()

float BioImager.ImageView.ToScreenH ( double y)

‍Convert a value in microns to a value in pixels

Parameters
ythe y coordinate of the point to be converted
Returns
The return value is a float.

Definition at line 4203 of file ImageView.cs.

4204 {
4205 return (float)(y * PxHmicron);
4206 }
double PxHmicron
Only used when opening stacks.
Definition ImageView.cs:812

◆ ToScreenRect()

RectangleD BioImager.ImageView.ToScreenRect ( double x,
double y,
double w,
double h )

It converts a rectangle in microns to a rectangle in pixels

Parameters
xThe x coordinate of the rectangle
y-0.0015
wwidth of the image in microns
hheight of the rectangle
Returns
A RectangleF object.

Definition at line 4092 of file ImageView.cs.

4093 {
4094 if (SelectedImage == null)
4095 {
4096 PointD pf;
4097 pf = ToScreenSpace(x, y);
4098 return new RectangleD(pf.X, pf.Y, ToScreenScaleW(w), ToScreenScaleH(h));
4099 }
4100 if (SelectedImage.isPyramidal)
4101 {
4102 PointD d = ToScreenSpace(x, y);
4103 double dw = ToViewSizeW(w);
4104 double dh = ToViewSizeH(h);
4105 return new RectangleD(d.X, d.Y, dw, dh);
4106 }
4107 else
4108 {
4109 PointD pf = ToScreenSpace(x, y);
4110 return new RectangleD(pf.X, pf.Y, ToScreenScaleW(w), ToScreenScaleH(h));
4111 }
4112 }
double ToViewSizeH(double d)

◆ ToScreenScale()

PointF BioImager.ImageView.ToScreenScale ( PointD p)

‍Convert a point in the world coordinate system to a point in the screen coordinate system

Parameters
PointD
Returns
A PointF object.

Definition at line 4078 of file ImageView.cs.

4079 {
4080 float x = ToScreenScaleW((float)p.X);
4081 float y = ToScreenScaleH((float)p.Y);
4082 return new PointF(x, y);
4083 }

◆ ToScreenScaleH()

float BioImager.ImageView.ToScreenScaleH ( double y)

‍Convert a value in microns to a value in pixels

Parameters
ythe y coordinate of the point to be converted
Returns
The return value is a float.

Definition at line 4069 of file ImageView.cs.

4070 {
4071 return (float)(y * PxHmicron);
4072 }

◆ ToScreenScaleW()

float BioImager.ImageView.ToScreenScaleW ( double x)

ToScreenScaleW() returns the number of pixels that correspond to the given number of microns

Parameters
xthe x coordinate of the point to be converted
Returns
The return value is a float.

Definition at line 4060 of file ImageView.cs.

4061 {
4062 return (float)(x * PxWmicron);
4063 }
double PxWmicron
Only used when opening stacks.
Definition ImageView.cs:797

◆ ToScreenSpace() [1/10]

PointD BioImager.ImageView.ToScreenSpace ( double x,
double y )

‍It converts a point in world space to a point in screen space

Parameters
xThe x coordinate of the point to convert.
yThe y coordinate of the point to transform.
Returns
A PointD object.

Definition at line 3968 of file ImageView.cs.

3969 {
3970 if (SelectedImage != null && SelectedImage.isPyramidal)
3971 {
3972 return new PointD((x - PyramidalOrigin.X) / Resolution, (y - PyramidalOrigin.Y) / Resolution);
3973 }
3974 double fx = ToScreenScaleW(Origin.X + x);
3975 double fy = ToScreenScaleH(Origin.Y + y);
3976 return new PointD(fx, fy);
3977 }

◆ ToScreenSpace() [2/10]

PointF BioImager.ImageView.ToScreenSpace ( Point3D p)

‍It converts a 3D point to a 2D point

Parameters
Point3D
Returns
A PointF object.

Definition at line 4050 of file ImageView.cs.

4051 {
4052 PointD pd = ToScreenSpace(p.X, p.Y);
4053 return new PointF((float)pd.X, (float)pd.Y);
4054 }

◆ ToScreenSpace() [3/10]

PointD BioImager.ImageView.ToScreenSpace ( PointD p)

‍Converts a point from world space to screen space

Parameters
PointDA class that contains an X and Y value.
Returns
A PointD object.

Definition at line 3983 of file ImageView.cs.

3984 {
3985 return ToScreenSpace(p.X, p.Y);
3986 }

◆ ToScreenSpace() [4/10]

PointF[] BioImager.ImageView.ToScreenSpace ( PointD[] p)

‍Convert a list of points from world space to screen space

Parameters
pThe point to convert
Returns
A PointF[] array of points.

Definition at line 4179 of file ImageView.cs.

4180 {
4181 PointF[] rs = new PointF[p.Length];
4182 for (int i = 0; i < p.Length; i++)
4183 {
4184 PointD pd = ToScreenSpace(p[i]);
4185 rs[i] = new PointF((float)pd.X, (float)pd.Y);
4186 }
4187 return rs;
4188 }

◆ ToScreenSpace() [5/10]

PointF BioImager.ImageView.ToScreenSpace ( PointF p)

Convert a point in the world coordinate system to the screen coordinate system

Parameters
PointFThe point you want to convert to screen space.
Returns
A PointD object.

Definition at line 3992 of file ImageView.cs.

3993 {
3994 PointD pd = ToScreenSpace(p.X, p.Y);
3995 return new PointF((float)pd.X, (float)pd.Y);
3996 }

◆ ToScreenSpace() [6/10]

PointF[] BioImager.ImageView.ToScreenSpace ( PointF[] p)

‍It takes an array of points and returns an array of points

Parameters
pThe point to convert
Returns
A PointF array.

Definition at line 4002 of file ImageView.cs.

4003 {
4004 PointF[] pf = new PointF[p.Length];
4005 for (int i = 0; i < p.Length; i++)
4006 {
4007 pf[i] = ToScreenSpace(p[i]);
4008 }
4009 return pf;
4010 }

◆ ToScreenSpace() [7/10]

RectangleD BioImager.ImageView.ToScreenSpace ( RectangleD p)

‍It converts a rectangle from world space to screen space

Parameters
RectangleDThe rectangle to convert.
Returns
A RectangleF object.

Definition at line 4133 of file ImageView.cs.

4134 {
4135 return ToScreenRect(p.X, p.Y, p.W, p.H);
4136 }

◆ ToScreenSpace() [8/10]

RectangleD[] BioImager.ImageView.ToScreenSpace ( RectangleD[] p)

It takes an array of RectangleD objects and returns an array of RectangleF objects

Parameters
pThe rectangle to convert
Returns
A RectangleF[]

Definition at line 4151 of file ImageView.cs.

4152 {
4153 RectangleD[] rs = new RectangleD[p.Length];
4154 for (int i = 0; i < p.Length; i++)
4155 {
4156 rs[i] = ToScreenSpace(p[i]);
4157 }
4158 return rs;
4159 }

◆ ToScreenSpace() [9/10]

RectangleD BioImager.ImageView.ToScreenSpace ( RectangleF p)

‍It converts a rectangle from world space to screen space

Parameters
RectangleFThe rectangle to convert.
Returns
A RectangleF object.

Definition at line 4142 of file ImageView.cs.

4143 {
4144 return ToScreenRect(p.X, p.Y, p.Width, p.Height);
4145 }

◆ ToScreenSpace() [10/10]

RectangleF[] BioImager.ImageView.ToScreenSpace ( RectangleF[] p)

It takes an array of RectangleF objects and returns an array of RectangleF objects

Parameters
pThe rectangle to convert
Returns
A RectangleF[]

Definition at line 4165 of file ImageView.cs.

4166 {
4167 RectangleF[] rs = new RectangleF[p.Length];
4168 for (int i = 0; i < p.Length; i++)
4169 {
4170 rs[i] = ToScreenSpace(p[i]).ToRectangleF();
4171 }
4172 return rs;
4173 }

◆ ToScreenW()

float BioImager.ImageView.ToScreenW ( double x)

ToScreenW(x) = x * PxWmicron

Parameters
xthe x coordinate of the point to be converted
Returns
The return value is a float.

Definition at line 4194 of file ImageView.cs.

4195 {
4196 return (float)(x * PxWmicron);
4197 }

◆ ToSKRect()

SKRect BioImager.ImageView.ToSKRect ( double x,
double y,
double w,
double h )

‍It takes a rectangle in the coordinate system of the stage and returns a rectangle in the coordinate system of the picturebox

Parameters
xThe x coordinate of the upper-left corner of the rectangle.
yThe y-coordinate of the upper-left corner of the rectangle.
wwidth of the rectangle
hheight of the rectangle
Returns
A SKRect object.

Definition at line 4122 of file ImageView.cs.

4123 {
4124 double xd = gl.Width / 2;
4125 double yd = gl.Height / 2;
4126 return new SKRect((float)(xd - x), (float)(yd - y), (float)(xd - (x + w)), (float)(yd - (y + h)));
4127 }

◆ ToViewH()

double BioImager.ImageView.ToViewH ( double d)

‍Convert a distance in microns to a distance in pixels

Parameters
dthe distance in microns
Returns
The return value is the y-coordinate of the point in the view.

Definition at line 3957 of file ImageView.cs.

3958 {
3959 double y = (double)(d / PxHmicron) / scale.Height;
3960 return y;
3961 }

◆ ToViewSizeH()

double BioImager.ImageView.ToViewSizeH ( double d)

‍Convert a value in microns to a value in pixels

Parameters
dthe size in microns
Returns
The return value is the size of the object in pixels.

Definition at line 3932 of file ImageView.cs.

3933 {
3934 if (SelectedImage != null)
3935 if (SelectedImage.isPyramidal)
3936 {
3937 return d / Resolution;
3938 }
3939 double y = (double)(d / PxHmicron);
3940 return y;
3941 }

◆ ToViewSpace() [1/3]

PointD BioImager.ImageView.ToViewSpace ( double x,
double y )

‍ToViewSpace(x, y) = (ToViewSizeW(x - (ViewWidth / 2)) / Scale.Width) - Origin.X;

Parameters
xThe x coordinate of the point to convert
yThe y coordinate of the point to convert.
Returns
A PointD object.

Definition at line 3900 of file ImageView.cs.

3901 {
3902 if (SelectedImage != null)
3903 if (SelectedImage.isPyramidal)
3904 {
3905 return new PointD((x - PyramidalOrigin.X) / Resolution, (y - PyramidalOrigin.Y) / Resolution);
3906 }
3907 double dx, dy;
3908 dx = (ToViewSizeW(x - (ViewWidth / 2)) / Scale.Width) - Origin.X;
3909 dy = (ToViewSizeH(y - (ViewHeight / 2)) / Scale.Height) - Origin.Y;
3910 return new PointD(dx, dy);
3911 }

◆ ToViewSpace() [2/3]

PointD BioImager.ImageView.ToViewSpace ( PointD p)

‍Converts a point from world space to view space

Parameters
PointDA class that contains an X and Y value.
Returns
A PointD object.

Definition at line 3890 of file ImageView.cs.

3891 {
3892 return ToViewSpace(p.X, p.Y); ;
3893 }

◆ ToViewSpace() [3/3]

PointF BioImager.ImageView.ToViewSpace ( PointF p)

Convert a point from world space to view space

Parameters
PointFThe point to convert
Returns
A PointD object.

Definition at line 3880 of file ImageView.cs.

3881 {
3882 PointD d = ToViewSpace(p.X, p.Y);
3883 return new PointF((float)d.X, (float)d.Y);
3884 }

◆ ToViewW()

double BioImager.ImageView.ToViewW ( double d)

Convert a distance in microns to a distance in pixels on the screen

Parameters
dthe distance in microns
Returns
The width of the image in pixels.

Definition at line 3947 of file ImageView.cs.

3948 {
3949 double x = (double)(d / PxWmicron) / scale.Width;
3950 return x;
3951 }

◆ UpdateImage()

void BioImager.ImageView.UpdateImage ( )

It takes a 16-bit image, converts it to 8-bit, and then converts it to a DirectX texture

Returns
A bitmap

Definition at line 1765 of file ImageView.cs.

1766 {
1767 UpdateImages();
1768 }

◆ UpdateImages()

async void BioImager.ImageView.UpdateImages ( )

It takes a list of images, and for each image, it gets the image at the current Z, C, T coordinates, and then converts it to a bitmap

Returns
A Bitmap

Definition at line 1626 of file ImageView.cs.

1627 {
1628 if (SelectedImage == null)
1629 return;
1630 if (UsesSlideRenderer(SelectedImage) && gl.Width > 1 && gl.Height > 1)
1631 {
1632 SelectedImage.PyramidalOrigin = PyramidalOrigin;
1633 SelectedImage.PyramidalSize = new AForge.Size(gl.Width, gl.Height);
1634 if (slideRenderer == null)
1635 slideRenderer = new SlideRenderer(gl);
1636 if (SelectedImage.SlideBase != null)
1637 {
1638 if (!slideRenderer.IsSource(SelectedImage.SlideBase))
1639 slideRenderer.SetSource(SelectedImage.SlideBase);
1640 }
1641 else if (SelectedImage.OpenSlideBase != null)
1642 {
1643 if (!slideRenderer.IsSource(SelectedImage.OpenSlideBase))
1644 slideRenderer.SetSource(SelectedImage.OpenSlideBase);
1645 }
1646 _ = slideRenderer.UpdateViewAsync(
1648 gl.Width,
1649 gl.Height,
1650 Resolution,
1652 );
1653 Bitmaps.Clear();
1654 SelectedImage.Buffers.Clear();
1655 UpdateRenderSurfaceMode();
1656 RefreshPyramidalOverlayTexture();
1657 return;
1658 }
1659 for (int i = 0; i < Bitmaps.Count; i++)
1660 {
1661 if (Bitmaps[i] == null)
1662 continue;
1663 Bitmaps[i].Dispose();
1664 Bitmaps[i] = null;
1665 }
1666 Bitmaps.Clear();
1667 /*
1668 if (zBar.Maximum != SelectedImage.SizeZ - 1 || tBar.Maximum != SelectedImage.SizeT - 1)
1669 {
1670 InitGUI();
1671 }
1672 */
1673 int bi = 0;
1674 foreach (BioImage b in Images)
1675 {
1676 b.PyramidalOrigin = PyramidalOrigin;
1677 b.PyramidalSize = new AForge.Size(gl.Width, gl.Height);
1678 ZCT coords = new ZCT(zBar.Value, cBar.Value, tBar.Value);
1679 Bitmap bitmap = null;
1680
1681 int index = b.Coords[zBar.Value, cBar.Value, tBar.Value];
1682 if (Mode == ViewMode.Filtered)
1683 {
1684 bitmap = b.GetFiltered(coords, b.RChannel.RangeR, b.GChannel.RangeG, b.BChannel.RangeB);
1685 }
1686 else if (Mode == ViewMode.RGBImage)
1687 {
1688 bitmap = b.GetRGBBitmap(coords, b.RChannel.RangeR, b.GChannel.RangeG, b.BChannel.RangeB);
1689 }
1690 else if (Mode == ViewMode.Raw)
1691 {
1692 bitmap = (Bitmap)b.Buffers[index].GetImageRGBA();
1693 }
1694 else
1695 {
1696 bitmap = b.GetEmission(coords, b.RChannel.RangeR, b.GChannel.RangeG, b.BChannel.RangeB);
1697 }
1698 Bitmaps.Add(ToSysBitmap(bitmap));
1699 bi++;
1700 }
1701 update = true;
1702 UpdateRenderSurfaceMode();
1703 if (SelectedImage != null && SelectedImage.isPyramidal)
1704 RefreshPyramidalOverlayTexture();
1705 viewpanel.Invalidate();
1706 }

◆ UpdateOverlay()

void BioImager.ImageView.UpdateOverlay ( )

If hardware acceleration is enabled, render the frame. Otherwise, set a flag to update the overlay and invalidate the overlay picture box

Returns
The return value is the value of the last expression evaluated in the method.

Definition at line 1219 of file ImageView.cs.

1220 {
1221 UpdateToolSelectBoxSize();
1222 if (SelectedImage != null && UsesSlideRenderer(SelectedImage))
1223 {
1224 RefreshPyramidalOverlayTexture();
1225 gl.Invalidate();
1226 overviewOverlay?.Invalidate();
1227 }
1228 else
1229 viewpanel.Invalidate();
1230 }

◆ UpdateRGBChannels()

void BioImager.ImageView.UpdateRGBChannels ( )

"If the user has selected a channel, then set the channel to the selected index, otherwise set it to 0."

The above function is called when the user changes the channel selection

Definition at line 1050 of file ImageView.cs.

1051 {
1052 //Buf = image.GetBufByCoord(GetCoordinate());
1053 if (channelBoxR.SelectedIndex == -1)
1054 SelectedImage.rgbChannels[0] = 0;
1055 else
1056 SelectedImage.rgbChannels[1] = channelBoxR.SelectedIndex;
1057 if (channelBoxG.SelectedIndex == -1)
1058 SelectedImage.rgbChannels[1] = 0;
1059 else
1060 SelectedImage.rgbChannels[1] = channelBoxG.SelectedIndex;
1061 if (channelBoxB.SelectedIndex == -1)
1062 SelectedImage.rgbChannels[2] = 0;
1063 else
1064 SelectedImage.rgbChannels[2] = channelBoxB.SelectedIndex;
1065
1066 }

◆ UpdateSelectBoxSize()

void BioImager.ImageView.UpdateSelectBoxSize ( float size)

This function is called from the Unity Editor when the user changes the size of the select box

Parameters
sizeThe size of the box that will be drawn around the ROI.

Definition at line 1174 of file ImageView.cs.

1175 {
1176 ROI.selectBoxSize = size;
1177 UpdateToolSelectBoxSize();
1178 }

◆ UpdateStatus()

void BioImager.ImageView.UpdateStatus ( )

It updates the status bar of the image viewer

Returns
The statusLabel.Text is being returned.

Definition at line 1234 of file ImageView.cs.

1235 {
1236 if (SelectedImage == null)
1237 return;
1238 string res = "";
1239 if (SelectedImage.Type == BioImage.ImageType.well)
1240 res = "Well:" + SelectedImage.Level;
1241 else if (SelectedImage.isPyramidal)
1242 {
1243 res = "Res.:" + Resolution + " Level:" + Level;
1244 }
1245 if (Mode == ViewMode.RGBImage)
1246 {
1247 if (timeEnabled)
1248 {
1249 statusLabel.Text = (zBar.Value + 1) + "/" + (zBar.Maximum + 1) + ", " + (tBar.Value + 1) + "/" + (tBar.Maximum + 1) + ", " +
1250 mousePoint + mouseColor + ", " + SelectedImage.Buffers[0].PixelFormat.ToString() + ", (" + -Origin.X + ", " + -Origin.Y + "), (" + SelectedImage.Volume.Location.X + ", " + SelectedImage.Volume.Location.Y + ") " + res;
1251 }
1252 else
1253 {
1254 statusLabel.Text = (zBar.Value + 1) + "/" + (cBar.Maximum + 1) + ", " + mousePoint + mouseColor + ", " + SelectedImage.Buffers[0].PixelFormat.ToString()
1255 + ", (" + -Origin.X + ", " + -Origin.Y + "), (" + SelectedImage.Volume.Location.X + ", " + SelectedImage.Volume.Location.Y + ") " + res;
1256 }
1257
1258 }
1259 else
1260 {
1261 if (SelectedImage.isPyramidal)
1262 {
1263 statusLabel.Text = (zBar.Value + 1).ToString() + "/" + (zBar.Maximum + 1).ToString() + ", " + (cBar.Value + 1).ToString() + "/" + (cBar.Maximum + 1).ToString() + ", " + (tBar.Value + 1) + "/" + (tBar.Maximum + 1) + ", " + mousePoint + mouseColor + ", " +
1264 SelectedImage.Resolutions[Level].PixelFormat.ToString() + ", Origin: (" + PyramidalOrigin.X + ", " + PyramidalOrigin.Y + "), " + res;
1265 }
1266 else
1267 {
1268 statusLabel.Text = (zBar.Value + 1) + "/" + (zBar.Maximum + 1) + ", " + (cBar.Value + 1) + "/" + (cBar.Maximum + 1) + ", " + (tBar.Value + 1) + "/" + (tBar.Maximum + 1) + ", " + mousePoint + mouseColor + ", " +
1269 SelectedImage.Resolutions[Level].PixelFormat.ToString() + ", Origin: (" + -Origin.X + ", " + -Origin.Y + "), " + res;
1270 }
1271 }
1272 }

◆ UpdateView()

void BioImager.ImageView.UpdateView ( bool refreshImages = true)

If hardware acceleration is enabled, render the frame. Otherwise, invalidate the picture box.

Returns
The method is returning void.

Definition at line 1277 of file ImageView.cs.

1278 {
1279 UpdateStatus();
1280 update = true;
1281 UpdateToolSelectBoxSize();
1282 if (refreshImages)
1283 UpdateImages();
1284 UpdateRenderSurfaceMode();
1285 if (SelectedImage != null && UsesSlideRenderer(SelectedImage))
1286 {
1287 RefreshPyramidalOverlayTexture();
1288 gl.Invalidate();
1289 overviewOverlay?.Invalidate();
1290 }
1291 else
1292 viewpanel.Invalidate();
1293 }

◆ UpdateViewLegacy()

void BioImager.ImageView.UpdateViewLegacy ( bool refresh)

It draws the images and annotations to the screen

Returns
A Bitmap

‍Update the status of the application and then render the frame

Parameters
refreshboolean

Definition at line 1611 of file ImageView.cs.

1612 {
1613 UpdateStatus();
1614 update = refresh;
1615 if (update)
1616 {
1617 gl.Invalidate();
1618 overviewOverlay?.Invalidate();
1619 }
1620 }

Member Data Documentation

◆ Buf

Image BioImager.ImageView.Buf = null

Definition at line 348 of file ImageView.cs.

◆ down

bool BioImager.ImageView.down
static

Definition at line 331 of file ImageView.cs.

◆ filepath

string BioImager.ImageView.filepath = ""

Definition at line 437 of file ImageView.cs.

◆ Images

List<BioImage> BioImager.ImageView.Images = new List<BioImage>()

Definition at line 351 of file ImageView.cs.

◆ init

bool BioImager.ImageView.init = false

Definition at line 349 of file ImageView.cs.

◆ Layers

List<Layer> BioImager.ImageView.Layers = new List<Layer>()

Definition at line 282 of file ImageView.cs.

◆ loopC

bool BioImager.ImageView.loopC = true

Definition at line 443 of file ImageView.cs.

◆ loopT

bool BioImager.ImageView.loopT = true

Definition at line 442 of file ImageView.cs.

◆ loopZ

bool BioImager.ImageView.loopZ = true

Definition at line 441 of file ImageView.cs.

◆ minSizeX

int BioImager.ImageView.minSizeX = 50

Definition at line 439 of file ImageView.cs.

◆ minSizeY

int BioImager.ImageView.minSizeY = 20

Definition at line 440 of file ImageView.cs.

◆ mouseDown

PointD BioImager.ImageView.mouseDown
static

Definition at line 330 of file ImageView.cs.

◆ mouseDownButtons

MouseButtons BioImager.ImageView.mouseDownButtons
static

Definition at line 344 of file ImageView.cs.

◆ mouseUp

PointD BioImager.ImageView.mouseUp
static

Definition at line 332 of file ImageView.cs.

◆ mouseUpButtons

MouseButtons BioImager.ImageView.mouseUpButtons
static

Definition at line 343 of file ImageView.cs.

◆ selectedAnnotations

List<ROI> BioImager.ImageView.selectedAnnotations = new List<ROI>()
static

Definition at line 295 of file ImageView.cs.

◆ serie

int BioImager.ImageView.serie = 0

Definition at line 438 of file ImageView.cs.

◆ showBounds

bool BioImager.ImageView.showBounds = true
static

Definition at line 346 of file ImageView.cs.

◆ showBROIs

bool BioImager.ImageView.showBROIs = true

Definition at line 2324 of file ImageView.cs.

◆ showGROIs

bool BioImager.ImageView.showGROIs = true

Definition at line 2323 of file ImageView.cs.

◆ showRROIs

bool BioImager.ImageView.showRROIs = true

Definition at line 2322 of file ImageView.cs.

◆ showText

bool BioImager.ImageView.showText = true
static

Definition at line 347 of file ImageView.cs.

◆ up

bool BioImager.ImageView.up
static

Definition at line 333 of file ImageView.cs.

Property Documentation

◆ AnnotationsB

List<ROI> BioImager.ImageView.AnnotationsB
get

Definition at line 2355 of file ImageView.cs.

2356 {
2357 get
2358 {
2359 if (SelectedImage == null)
2360 return new List<ROI>();
2361 return SelectedImage.Annotations.Where(an =>
2362 an != null &&
2363 an.coord.Z == SelectedImage.Coordinate.Z &&
2364 an.coord.T == SelectedImage.Coordinate.T &&
2365 (an.type == ROI.Type.Polygon || an.type == ROI.Type.Freeform || an.type == ROI.Type.Polyline || an.coord.C == BChannel.Index)).ToList();
2366 }
2367 }
Channel BChannel
Getting the B channel of the image. *‍/.
Definition ImageView.cs:907

◆ AnnotationsG

List<ROI> BioImager.ImageView.AnnotationsG
get

Definition at line 2341 of file ImageView.cs.

2342 {
2343 get
2344 {
2345 if (SelectedImage == null)
2346 return new List<ROI>();
2347 return SelectedImage.Annotations.Where(an =>
2348 an != null &&
2349 an.coord.Z == SelectedImage.Coordinate.Z &&
2350 an.coord.T == SelectedImage.Coordinate.T &&
2351 (an.type == ROI.Type.Polygon || an.type == ROI.Type.Freeform || an.type == ROI.Type.Polyline || an.coord.C == GChannel.Index)).ToList();
2352 }
2353 }
Channel GChannel
A property that returns the G channel of the image. *‍/.
Definition ImageView.cs:899

◆ AnnotationsR

List<ROI> BioImager.ImageView.AnnotationsR
get

Definition at line 2327 of file ImageView.cs.

2328 {
2329 get
2330 {
2331 if (SelectedImage == null)
2332 return new List<ROI>();
2333 return SelectedImage.Annotations.Where(an =>
2334 an != null &&
2335 an.coord.Z == SelectedImage.Coordinate.Z &&
2336 an.coord.T == SelectedImage.Coordinate.T &&
2337 (an.type == ROI.Type.Polygon || an.type == ROI.Type.Freeform || an.type == ROI.Type.Polyline || an.coord.C == RChannel.Index)).ToList();
2338 }
2339 }
Channel RChannel
A property that returns the R channel of the selected image. *‍/.
Definition ImageView.cs:891

◆ AnnotationsRGB

List<ROI> BioImager.ImageView.AnnotationsRGB
get

Definition at line 2368 of file ImageView.cs.

2369 {
2370 get
2371 {
2372 if (SelectedImage == null)
2373 return null;
2374 List<ROI> ans = new List<ROI>();
2375 if (Mode == ViewMode.RGBImage)
2376 {
2377 if (showRROIs)
2378 ans.AddRange(AnnotationsR);
2379 if (showGROIs)
2380 ans.AddRange(AnnotationsG);
2381 if (showBROIs)
2382 ans.AddRange(AnnotationsB);
2383 }
2384 else
2385 {
2386 ans.AddRange(SelectedImage.Annotations.Where(an =>
2387 an != null &&
2388 an.coord.Z == SelectedImage.Coordinate.Z &&
2389 an.coord.T == SelectedImage.Coordinate.T &&
2390 (an.type == ROI.Type.Polygon || an.type == ROI.Type.Freeform || an.type == ROI.Type.Polyline || an.coord.C == SelectedImage.Coordinate.C)));
2391 }
2392 return ans;
2393 }
2394 }

◆ BChannel

Channel BioImager.ImageView.BChannel
get

Getting the B channel of the image. *‍/.

Definition at line 906 of file ImageView.cs.

907 {
908 get
909 {
910 return SelectedImage.Channels[SelectedImage.rgbChannels[2]];
911 }
912 }

◆ CFps

int BioImager.ImageView.CFps
getset

Setting the interval of the timer to the inverse of the fps. *‍/.

Definition at line 1103 of file ImageView.cs.

1104 {
1105 get
1106 {
1107 return cfps;
1108 }
1109 set
1110 {
1111 cfps = value;
1112 float f = value;
1113 cTimer.Interval = (int)Math.Floor(1000 / f);
1114 }
1115 }

◆ Ctrl

bool BioImager.ImageView.Ctrl
staticget

Definition at line 334 of file ImageView.cs.

335 {
336 get
337 {
338 return Win32.GetKeyState(Keys.LControlKey);
339 }
340 }

◆ GChannel

Channel BioImager.ImageView.GChannel
get

A property that returns the G channel of the image. *‍/.

Definition at line 898 of file ImageView.cs.

899 {
900 get
901 {
902 return SelectedImage.Channels[SelectedImage.rgbChannels[1]];
903 }
904 }

◆ LabelResolution

int? BioImager.ImageView.LabelResolution
get

Definition at line 920 of file ImageView.cs.

920{ get { return SelectedImage.LabelResolution; } }

◆ Level

int BioImager.ImageView.Level
get

Current level when viewing whole-slide and pyramidal images.

Definition at line 1010 of file ImageView.cs.

1011 {
1012 get
1013 {
1014 if (SelectedImage != null)
1015 return SelectedImage.Level;
1016 else
1017 return 0;
1018 }
1019 }

◆ MacroResolution

int? BioImager.ImageView.MacroResolution
get

Definition at line 919 of file ImageView.cs.

919{ get { return SelectedImage.MacroResolution; } }

◆ Mode

ViewMode BioImager.ImageView.Mode
getset

Setting the view mode of the application. *‍/.

Definition at line 832 of file ImageView.cs.

833 {
834 get
835 {
836 return viewMode;
837 }
838 set
839 {
840 viewMode = value;
841 //If view mode is changed we update.
842 update = true;
843 UpdateImages();
844 App.tabsView.UpdateViewMode(viewMode);
845 UpdateView();
847 if (viewMode == ViewMode.RGBImage)
848 {
849 cBar.Value = 0;
850 rgbBoxsPanel.BringToFront();
851 cBar.SendToBack();
852 cLabel.SendToBack();
853 BringRenderSurfacesToFront();
854 }
855 else
856 if (viewMode == ViewMode.Filtered)
857 {
858 rgbBoxsPanel.SendToBack();
859 cBar.BringToFront();
860 cLabel.BringToFront();
861 BringRenderSurfacesToFront();
862 }
863 else
864 if (viewMode == ViewMode.Raw)
865 {
866 rgbBoxsPanel.SendToBack();
867 cBar.BringToFront();
868 cLabel.BringToFront();
869 BringRenderSurfacesToFront();
870 }
871 else
872 {
873 cBar.Value = 0;
874 rgbBoxsPanel.BringToFront();
875 cBar.SendToBack();
876 cLabel.SendToBack();
877 BringRenderSurfacesToFront();
878 }
879 }
880 }

◆ MouseDownInt

PointD BioImager.ImageView.MouseDownInt
getset

Definition at line 4307 of file ImageView.cs.

4308 {
4309 get { return mouseDownInt; }
4310 set { mouseDownInt = value; }
4311 }

◆ MouseMoveInt

PointD BioImager.ImageView.MouseMoveInt
getset

Definition at line 4319 of file ImageView.cs.

4320 {
4321 get { return mouseMoveInt; }
4322 set { mouseMoveInt = value; }
4323 }

◆ MouseUpInt

PointD BioImager.ImageView.MouseUpInt
getset

Definition at line 4313 of file ImageView.cs.

4314 {
4315 get { return mouseUpInt; }
4316 set { mouseUpInt = value; }
4317 }

◆ OpenSlide

bool BioImager.ImageView.OpenSlide
get

Definition at line 915 of file ImageView.cs.

916 {
917 get { if (SelectedImage.SlideBase == null) return true; else return false; }
918 }

◆ Origin

PointD BioImager.ImageView.Origin
getset

A property of the class PointD. *‍/.

Definition at line 941 of file ImageView.cs.

942 {
943 get { return origin; }
944 set
945 {
946 origin = value;
947 update = true;
948 UpdateView();
949 }
950 }

◆ OverView

Rectangle BioImager.ImageView.OverView
get

Definition at line 445 of file ImageView.cs.

446 {
447 get { return overview; }
448 }

◆ Path

string BioImager.ImageView.Path
get

A property that returns the filepath. *‍/.

Definition at line 882 of file ImageView.cs.

883 {
884 get
885 {
886 return filepath;
887 }
888 }

◆ PxHmicron

double BioImager.ImageView.PxHmicron
getset

Only used when opening stacks.

Definition at line 811 of file ImageView.cs.

812 {
813 get
814 {
815 return pxHmicron;
816 }
817 set
818 {
819 pxHmicron = value;
820 }
821 }

◆ PxWmicron

double BioImager.ImageView.PxWmicron
getset

Only used when opening stacks.

Definition at line 796 of file ImageView.cs.

797 {
798 get
799 {
800 return pxWmicron;
801 }
802 set
803 {
804 pxWmicron = value;
805 }
806 }

◆ PyramidalOrigin

PointD BioImager.ImageView.PyramidalOrigin
getset

Setting the value of the pyramidalOrigin variable. *‍/.

Definition at line 953 of file ImageView.cs.

954 {
955 get
956 {
957 if (SelectedImage != null)
958 return SelectedImage.PyramidalOrigin;
959 else
960 return new PointD(0, 0);
961 }
962 set
963 {
964 SelectedImage.PyramidalOrigin = value;
965 }
966 }

◆ PyramidalOriginTransformed

PointD BioImager.ImageView.PyramidalOriginTransformed
getset

Definition at line 4296 of file ImageView.cs.

4297 {
4298 get { return new PointD(PyramidalOrigin.X * Resolution, PyramidalOrigin.Y * Resolution); }
4299 set { PyramidalOrigin = new PointD(value.X / Resolution, value.Y / Resolution); }
4300 }

◆ RChannel

Channel BioImager.ImageView.RChannel
get

A property that returns the R channel of the selected image. *‍/.

Definition at line 890 of file ImageView.cs.

891 {
892 get
893 {
894 return SelectedImage.Channels[SelectedImage.rgbChannels[0]];
895 }
896 }

◆ Resolution

double BioImager.ImageView.Resolution
getset

A property of the class ImageViewer. It is a getter and setter for the resolution of the image.

Definition at line 969 of file ImageView.cs.

970 {
971 get
972 {
973 if (SelectedImage == null)
974 return 1;
975 return SelectedImage.Resolution;
976 }
977 set
978 {
979 SelectedImage.Resolution = value;
980 if (SelectedImage.Type == BioImage.ImageType.well)
981 SelectedImage.Level = (int)value;
982 }
983 }

◆ Scale

new AForge.SizeF BioImager.ImageView.Scale
getset

Scale when opening image stacks.

Definition at line 1024 of file ImageView.cs.

1025 {
1026 get
1027 {
1028 return scale;
1029 }
1030 set
1031 {
1032 scale = value;
1033 update = true;
1034 UpdateView();
1035 Tools.selectBoxSize = GetSelectBoxSize();
1036 }
1037 }

◆ SelectedBuffer

Bitmap BioImager.ImageView.SelectedBuffer
staticget

Definition at line 322 of file ImageView.cs.

323 {
324 get
325 {
326 int ind = SelectedImage.Coords[SelectedImage.Coordinate.Z, SelectedImage.Coordinate.C, SelectedImage.Coordinate.T];
327 return SelectedImage.Buffers[ind];
328 }
329 }

◆ SelectedImage

BioImage BioImager.ImageView.SelectedImage
staticgetset

Definition at line 297 of file ImageView.cs.

298 {
299 get
300 {
301 if (App.viewer != null)
302 {
303 if (App.viewer.Images.Count > 0)
304 return App.viewer.Images[selectedIndex];
305 else
306 return null;
307 }
308 else
309 return null;
310 }
311 set
312 {
313 if (App.viewer != null)
314 {
315 if (App.viewer.Images.Count > 0)
316 App.viewer.Images[selectedIndex] = value;
317 else
318 App.viewer.AddImage(value);
319 }
320 }
321 }

◆ SelectedIndex

int BioImager.ImageView.SelectedIndex = 0
getset

A property that is used to set the selected index of the image. *‍/.

Definition at line 421 of file ImageView.cs.

422 {
423 get;
424 set
425 {
426 if (value >= 0 && Images.Count > 0)
427 {
428 field = value;
429 selectedIndex = field;
430 InitGUI();
431 if (UsesSlideRenderer(Images[field]))
432 BindSlideRendererSource(Images[field]);
433 }
434 }
435 } = 0;

◆ ShowControls

bool BioImager.ImageView.ShowControls
getset

Setting the visibility of the trackBarPanel. *‍/.

Definition at line 722 of file ImageView.cs.

723 {
724 get { return trackBarPanel.Visible; }
725 set
726 {
727 showControls = value;
728 if (!value)
729 {
730 trackBarPanel.Hide();
731 if (ShowStatus)
732 {
733 gl.Top = 25;
734 gl.Height += 75;
735 }
736 else
737 {
738 gl.Top = 0;
739 gl.Height += 75;
740 }
741 hideControlsToolStripMenuItem1.Text = "Show Controls";
742 }
743 else
744 {
745 trackBarPanel.Show();
746 if (ShowStatus)
747 {
748 gl.Top = 25;
749 gl.Height -= 75;
750 }
751 else
752 {
753 gl.Top = 0;
754 gl.Height += 75;
755 }
756
757 //panel.Anchor = AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Left;
758 hideControlsToolStripMenuItem1.Text = "Hide Controls";
759 }
760 UpdateView();
761 }
762 }
bool ShowStatus
Setting the value of the property ShowStatus. *‍/.
Definition ImageView.cs:768

◆ ShowMasks

bool BioImager.ImageView.ShowMasks = true
getset

Definition at line 4326 of file ImageView.cs.

4326{ get; set; } = true;

◆ ShowOverview

bool BioImager.ImageView.ShowOverview
getset

Definition at line 717 of file ImageView.cs.

717{ get; set; }

◆ ShowStage

bool BioImager.ImageView.ShowStage
getset

Definition at line 450 of file ImageView.cs.

450{ get; set; }

◆ ShowStatus

bool BioImager.ImageView.ShowStatus
getset

Setting the value of the property ShowStatus. *‍/.

Definition at line 767 of file ImageView.cs.

768 {
769 get { return showStatus; }
770 set
771 {
772 showStatus = true;
773 if (!value)
774 {
775 statusPanel.Hide();
776 gl.Top = 0;
777 gl.Height += 25;
778 showControlsToolStripMenuItem.Visible = true;
779 hideControlsToolStripMenuItem.Text = "Show Status";
780 }
781 else
782 {
783 statusPanel.Show();
784 statusPanel.Visible = value;
785 gl.Top = 25;
786 showControlsToolStripMenuItem.Visible = false;
787 hideControlsToolStripMenuItem.Text = "Hide Status";
788 }
789 }
790 }

◆ TimeFps

int BioImager.ImageView.TimeFps
getset

Setting the interval of the timer to the value of the timefps variable. *‍/.

Definition at line 1087 of file ImageView.cs.

1088 {
1089 get
1090 {
1091 return timefps;
1092 }
1093 set
1094 {
1095 timefps = value;
1096 float f = value;
1097 timelineTimer.Interval = (int)Math.Floor(1000 / f);
1098 }
1099 }

◆ tools

Tools BioImager.ImageView.tools
get

Definition at line 436 of file ImageView.cs.

436{ get { return App.tools; } }

◆ ViewContextMenu

ContextMenuStrip BioImager.ImageView.ViewContextMenu
get

A property that returns a ContextMenuStrip object. *‍/.

Definition at line 1039 of file ImageView.cs.

1040 {
1041 get
1042 {
1043 return contextMenuStrip;
1044 }
1045 }

◆ ViewHeight

int BioImager.ImageView.ViewHeight
get

Definition at line 930 of file ImageView.cs.

931 {
932 get
933 {
934 if (SelectedImage != null && !SelectedImage.isPyramidal && viewpanel != null && viewpanel.ClientSize.Height > 1)
935 return viewpanel.ClientSize.Height;
936 return gl.Height;
937 }
938 }

◆ ViewWidth

int BioImager.ImageView.ViewWidth
get

Definition at line 921 of file ImageView.cs.

922 {
923 get
924 {
925 if (SelectedImage != null && !SelectedImage.isPyramidal && viewpanel != null && viewpanel.ClientSize.Width > 1)
926 return viewpanel.ClientSize.Width;
927 return gl.Width;
928 }
929 }

◆ ZFps

int BioImager.ImageView.ZFps
getset

Setting the interval of the timer to the value of the fps. *‍/.

Definition at line 1071 of file ImageView.cs.

1072 {
1073 get
1074 {
1075 return zfps;
1076 }
1077 set
1078 {
1079 zfps = value;
1080 float f = value;
1081 zTimer.Interval = (int)Math.Floor(1000 / f);
1082 }
1083 }

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