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.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. More...
 
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 20 of file Microscope.cs.

Constructor & Destructor Documentation

◆ Stage() [1/2]

BioImager.Stage.Stage ( object  st)

Definition at line 27 of file Microscope.cs.

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

◆ Stage() [2/2]

BioImager.Stage.Stage ( )

Definition at line 37 of file Microscope.cs.

38 {
39
40 }

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 144 of file Microscope.cs.

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

Referenced by BioImager.Stage.GetPositionX(), and BioImager.Stage.GetPositionY().

◆ 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 119 of file Microscope.cs.

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

References BioImager.Stage.GetPosition().

Referenced by BioImager.Stage.MoveLeft(), and BioImager.Stage.MoveRight().

◆ 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 130 of file Microscope.cs.

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

References BioImager.Stage.GetPosition().

Referenced by BioImager.Stage.MoveDown(), and BioImager.Stage.MoveUp().

◆ 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 185 of file Microscope.cs.

186 {
187 double y = GetPositionY(true) + m;
188 SetPositionY(y);
189 }
double GetPositionY(bool update)
Definition: Microscope.cs:130
void SetPositionY(double py)
Definition: Microscope.cs:108

References BioImager.Stage.GetPositionY(), and BioImager.Stage.SetPositionY().

◆ 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 203 of file Microscope.cs.

204 {
205 double x = GetPositionX(true) - m;
206 SetPositionX(x);
207 }
double GetPositionX(bool update)
Definition: Microscope.cs:119
void SetPositionX(double px)
Definition: Microscope.cs:99

References BioImager.Stage.GetPositionX(), and BioImager.Stage.SetPositionX().

◆ 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 194 of file Microscope.cs.

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

References BioImager.Stage.GetPositionX(), and BioImager.Stage.SetPositionX().

◆ 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 176 of file Microscope.cs.

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

References BioImager.Stage.GetPositionY(), and BioImager.Stage.SetPositionY().

◆ 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 68 of file Microscope.cs.

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

References BioImager.ImageView.UpdateView().

Referenced by BioImager.Stage.SetPositionX(), and BioImager.Stage.SetPositionY().

◆ 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 99 of file Microscope.cs.

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

References BioImager.Stage.SetPosition().

Referenced by BioImager.Stage.MoveLeft(), and BioImager.Stage.MoveRight().

◆ 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 108 of file Microscope.cs.

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

References BioImager.Stage.SetPosition().

Referenced by BioImager.Stage.MoveDown(), and BioImager.Stage.MoveUp().

◆ 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 229 of file Microscope.cs.

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

◆ UpdateSWLimit()

void BioImager.Stage.UpdateSWLimit ( )

It gets the software limits of the microscope stage.

Definition at line 210 of file Microscope.cs.

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

Member Data Documentation

◆ maxX

double BioImager.Stage.maxX
static

Definition at line 23 of file Microscope.cs.

◆ maxY

double BioImager.Stage.maxY
static

Definition at line 25 of file Microscope.cs.

◆ minX

double BioImager.Stage.minX
static

Definition at line 22 of file Microscope.cs.

◆ minY

double BioImager.Stage.minY
static

Definition at line 24 of file Microscope.cs.

◆ moveWait

int BioImager.Stage.moveWait = 250

Definition at line 58 of file Microscope.cs.

Property Documentation

◆ X

double BioImager.Stage.X
get

Definition at line 44 of file Microscope.cs.

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

◆ Y

double BioImager.Stage.Y
get

Definition at line 51 of file Microscope.cs.

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

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