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.Stage Class Reference

Public Member Functions

 Stage (object st)
 
void SetPosition (double px, double py)
 
void SetPositionX (double px)
 
void SetPositionY (double py)
 
double GetPositionX (bool update)
 
double GetPositionY (bool update)
 
PointD GetPosition (bool update)
 
void MoveUp (double m)
 
void MoveDown (double m)
 
void MoveRight (double m)
 
void MoveLeft (double m)
 
void UpdateSWLimit ()
 It gets the software limits of the microscope stage.
 
void SetSWLimit (double xmin, double xmax, double ymin, double ymax)
 

Public Attributes

int moveWait = 250
 

Static Public Attributes

static double minX
 
static double maxX
 
static double minY
 
static double maxY
 

Properties

double X [get]
 
double Y [get]
 

Detailed Description

Definition at line 21 of file Microscope.cs.

Constructor & Destructor Documentation

◆ Stage() [1/2]

BioImager.Stage.Stage ( object st)

Definition at line 28 of file Microscope.cs.

29 {
30 if (Properties.Settings.Default.LibPath.Contains("MTB"))
31 {
32 PointD d = GetPosition(true);
33 x = d.X;
34 y = d.Y;
36 }
37 }
PointD GetPosition(bool update)
void UpdateSWLimit()
It gets the software limits of the microscope stage.

◆ Stage() [2/2]

BioImager.Stage.Stage ( )

Definition at line 38 of file Microscope.cs.

39 {
40
41 }

Member Function Documentation

◆ GetPosition()

PointD BioImager.Stage.GetPosition ( bool update)

If the microscope is a Prior, get the position from the Prior SDK. If the microscope is a MTB, get the position from the MTB SDK. If the microscope is a Piezosystem, get the position from the Piezosystem SDK

Parameters
updatetrue if the position should be updated from the microscope, false if the position should be returned from the cache.
Returns
A PointD object.

Definition at line 145 of file Microscope.cs.

146 {
147 if (Properties.Settings.Default.PMicroscope)
148 {
149 PointD pd;
150 Microscope.pMicroscope.GetPosition(out pd,false);
151 return pd;
152 }
153 else
154 if (Properties.Settings.Default.PycroManager)
155 {
156 PointD pd;
157 MicroManager.GetPosition(out pd, false);
158 return pd;
159 }
160 else
161 if (Properties.Settings.Default.LibPath.Contains("MTB"))
162 {
163 BioImager.MicroscopeConsole.Command com = BioImager.MicroscopeConsole.RunCommand
165 return new PointD(com.doubles[0], com.doubles[1]);
166 }
167 else if (Properties.Settings.Default.LibPath.Contains("Prio"))
168 {
169 return Microscope.sdk.GetPosition();
170 }
171 return new PointD(x, y);
172 }

◆ GetPositionX()

double BioImager.Stage.GetPositionX ( bool update)

This function returns the X position of the mouse cursor

Parameters
updateIf true, the position will be updated before returning the value.
Returns
The position of the object in the X axis.

Definition at line 120 of file Microscope.cs.

121 {
122 x = GetPosition(update).X;
123 return x;
124 }

◆ GetPositionY()

double BioImager.Stage.GetPositionY ( bool update)

GetPositionY() returns the Y coordinate of the current position of the mouse cursor

Parameters
updateIf true, the position will be updated before returning the value.
Returns
The position of the object in the Y axis.

Definition at line 131 of file Microscope.cs.

132 {
133 y = GetPosition(update).Y;
134 return y;
135 }

◆ MoveDown()

void BioImager.Stage.MoveDown ( double m)

Move the stage down by the specified amount of microns

Parameters
mThe amount to move the object by.

Definition at line 186 of file Microscope.cs.

187 {
188 double y = GetPositionY(true) + m;
189 SetPositionY(y);
190 }
double GetPositionY(bool update)
void SetPositionY(double py)

◆ MoveLeft()

void BioImager.Stage.MoveLeft ( double m)

Move the stage left by the specified amount of microns

Parameters
mThe amount to move the object by.

Definition at line 204 of file Microscope.cs.

205 {
206 double x = GetPositionX(true) - m;
207 SetPositionX(x);
208 }
double GetPositionX(bool update)
void SetPositionX(double px)

◆ MoveRight()

void BioImager.Stage.MoveRight ( double m)

Move the stage right by the specified amount of microns

Parameters
mThe amount to move the object by.

Definition at line 195 of file Microscope.cs.

196 {
197 double x = GetPositionX(true) + m;
198 SetPositionX(x);
199 }

◆ MoveUp()

void BioImager.Stage.MoveUp ( double m)

Move the stage up by the specified amount of microns

Parameters
mThe amount of pixels to move the object up by.

Definition at line 177 of file Microscope.cs.

178 {
179 double y = GetPositionY(true) - m;
180 SetPositionY(y);
181 }

◆ SetPosition()

void BioImager.Stage.SetPosition ( double px,
double py )

The function sets the position of the stage to the given coordinates

Parameters
pxx position in microns
pyy-coordinate

Definition at line 69 of file Microscope.cs.

70 {
71 if (Recorder.recordMicroscope)
72 Recorder.AddLine("Microscope.Stage.SetPosition(" + px + "," + py + ");");
73 x = px;
74 y = py;
75 if(Properties.Settings.Default.PMicroscope)
76 {
77 Microscope.pMicroscope.SetPosition(new PointD(px, py));
78 }
79 else
80 if (Properties.Settings.Default.PycroManager)
81 {
82 MicroManager.SetPosition(new PointD(px, py));
83 }
84 else
85 if (Properties.Settings.Default.LibPath.Contains("MTB"))
86 {
87 BioImager.MicroscopeConsole.RunCommand(new BioImager.MicroscopeConsole.Command(BioImager.MicroscopeConsole.Command.Type.SetStage, new double[]{px,py }));
88 }
89 else if (Properties.Settings.Default.LibPath.Contains("Prio"))
90 {
91 Microscope.sdk.SetPosition(new PointD(px, py));
92 }
93 if (App.viewer != null)
94 App.viewer.UpdateView(true);
95 }

◆ SetPositionX()

void BioImager.Stage.SetPositionX ( double px)

This function sets the position of the object to the given x and y coordinates

Parameters
pxThe new x position of the object

Definition at line 100 of file Microscope.cs.

101 {
102 x = px;
103 SetPosition(px, y);
104 }
void SetPosition(double px, double py)
Definition Microscope.cs:69

◆ SetPositionY()

void BioImager.Stage.SetPositionY ( double py)

This function sets the position of the object to the given x and y coordinates

Parameters
pyThe y position of the object

Definition at line 109 of file Microscope.cs.

110 {
111 y = py;
112 SetPosition(x, py);
113 }

◆ SetSWLimit()

void BioImager.Stage.SetSWLimit ( double xmin,
double xmax,
double ymin,
double ymax )

It sets the limits of the stage movement

Parameters
xminminimum x value
xmaxthe maximum x value
ymin-0.0025
ymax-0.0015

Definition at line 230 of file Microscope.cs.

231 {
232 if (Properties.Settings.Default.LibPath.Contains("MTB"))
233 {
234 BioImager.MicroscopeConsole.RunCommand(
236 new double[] {xmin,xmax,ymin,ymax}));
237 }
238 if (Recorder.recordMicroscope)
239 Recorder.AddLine("Microscope.Focus.SetSWLimit(" + xmin + "," + xmax + "," + ymin + "," + ymax + ");");
240 }

◆ UpdateSWLimit()

void BioImager.Stage.UpdateSWLimit ( )

It gets the software limits of the microscope stage.

Definition at line 211 of file Microscope.cs.

212 {
213 if (Properties.Settings.Default.LibPath.Contains("MTB"))
214 {
216 new BioImager.MicroscopeConsole.Command(BioImager.MicroscopeConsole.Command.Type.GetStageSWLimit, null));
217 minX = com.doubles[0];
218 minY = com.doubles[1];
219 maxX = com.doubles[2];
220 maxY = com.doubles[3];
221 }
222 }

Member Data Documentation

◆ maxX

double BioImager.Stage.maxX
static

Definition at line 24 of file Microscope.cs.

◆ maxY

double BioImager.Stage.maxY
static

Definition at line 26 of file Microscope.cs.

◆ minX

double BioImager.Stage.minX
static

Definition at line 23 of file Microscope.cs.

◆ minY

double BioImager.Stage.minY
static

Definition at line 25 of file Microscope.cs.

◆ moveWait

int BioImager.Stage.moveWait = 250

Definition at line 59 of file Microscope.cs.

Property Documentation

◆ X

double BioImager.Stage.X
get

Definition at line 45 of file Microscope.cs.

46 {
47 get
48 {
49 return x;
50 }
51 }

◆ Y

double BioImager.Stage.Y
get

Definition at line 52 of file Microscope.cs.

53 {
54 get
55 {
56 return y;
57 }
58 }

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