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

Public Member Functions

void SetFocus (double f)
 
double GetFocus ()
 
double GetFocus (bool update)
 
PointD GetSWLimit ()
 
void SetSWLimit (double xd, double yd)
 

Static Public Attributes

static double upperLimit
 
static double lowerLimit
 

Detailed Description

Definition at line 243 of file Microscope.cs.

Constructor & Destructor Documentation

◆ Focus()

BioImager.Focus.Focus ( )

Definition at line 248 of file Microscope.cs.

249 {
250
251 }

Member Function Documentation

◆ GetFocus() [1/2]

double BioImager.Focus.GetFocus ( )

This function returns the z-axis position

Returns
The z-axis position of the microscope.

Definition at line 291 of file Microscope.cs.

292 {
293 return GetFocus(false);
294 }
double GetFocus()
Definition: Microscope.cs:291

References BioImager.Focus.GetFocus().

Referenced by BioImager.Focus.GetFocus().

◆ GetFocus() [2/2]

double BioImager.Focus.GetFocus ( bool  update)

If the microscope is a Prior, get the Z position from the SDK. If it's a MTB, get the Z position from the MTB SDK. If it's a PMicroscope, get the Z position from the PMicroscope SDK. If it's a custom microscope, get the Z position from the custom SDK

Parameters
updateboolean, if true, the focus is updated from the microscope
Returns
The z position of the microscope.

Definition at line 303 of file Microscope.cs.

304 {
305 if (Properties.Settings.Default.PMicroscope)
306 {
307 Point3D p;
308 Microscope.pMicroscope.GetPosition3D(out p, update);
309 return p.Z;
310 }
311 else if(Properties.Settings.Default.PycroManager)
312 {
313 Point3D p;
314 PycroManager.GetPosition3D(out p, update);
315 return p.Z;
316 }
317 if (Properties.Settings.Default.LibPath.Contains("MTB"))
318 {
319 BioImager.MicroscopeConsole.Command com = BioImager.MicroscopeConsole.RunCommand
321 return com.doubles[0];
322 }
323 if (Properties.Settings.Default.LibPath.Contains("Prio"))
324 {
325 return Microscope.sdk.GetZ();
326 }
327 if(Automation.Properties.ContainsKey("GetFocus"))
328 {
329 return (double)Automation.GetProperty("GetFocus");
330 }
331 return z;
332 }

References BioImager.Automation.GetProperty().

◆ GetSWLimit()

PointD BioImager.Focus.GetSWLimit ( )

It gets the lower and upper limits of the focus axis

Returns
The return value is a PointD object.

Definition at line 337 of file Microscope.cs.

338 {
339 if (Properties.Settings.Default.LibPath.Contains("MTB"))
340 {
342 new BioImager.MicroscopeConsole.Command(BioImager.MicroscopeConsole.Command.Type.GetStageSWLimit, null));
343 upperLimit = com.doubles[0];
344 lowerLimit = com.doubles[1];
345 return new PointD(upperLimit,lowerLimit);
346 }
347 return new PointD(lowerLimit, upperLimit);
348 }

◆ SetFocus()

void BioImager.Focus.SetFocus ( double  f)

Sets the z-axis based on microscope configuration.

Parameters
fthe focus value

Definition at line 256 of file Microscope.cs.

257 {
258 if (Recorder.recordMicroscope)
259 Recorder.AddLine("Microscope.Focus.SetFocus(" + f + ");");
260 if (Properties.Settings.Default.PMicroscope)
261 {
262 PointD p = Microscope.Stage.GetPosition(true);
263 Microscope.pMicroscope.SetPosition(new Point3D(p.X,p.Y,f));
264 }
265 else
266 if (Properties.Settings.Default.PycroManager)
267 {
268 PointD p = Microscope.Stage.GetPosition(true);
269 PycroManager.SetPosition(new Point3D(p.X, p.Y, f));
270 }
271 else
272 if (Properties.Settings.Default.LibPath.Contains("MTB"))
273 {
274 BioImager.MicroscopeConsole.RunCommand(
275 new BioImager.MicroscopeConsole.Command(BioImager.MicroscopeConsole.Command.Type.SetFocus,new double[] { f}));
276 z = f;
277 }
278 else if (Properties.Settings.Default.LibPath.Contains("Prio"))
279 {
280 Microscope.sdk.SetZ(f);
281 }
282 if (Automation.Properties.ContainsKey("SetFocus"))
283 {
284 Automation.SetProperty("SetFocus", f.ToString());
285 }
286 }

References BioImager.Automation.SetProperty().

◆ SetSWLimit()

void BioImager.Focus.SetSWLimit ( double  xd,
double  yd 
)

The function takes two double values, xd and yd, and sets the upper and lower limits of the focus axis

Parameters
xdthe upper limit of the focus
ydthe lower limit of the focus

Definition at line 355 of file Microscope.cs.

356 {
357 if (Properties.Settings.Default.LibPath.Contains("MTB"))
358 {
359 BioImager.MicroscopeConsole.RunCommand(
361 new double[] { xd, yd }));
362 }
363 upperLimit = xd;
364 lowerLimit = yd;
365 if (Recorder.recordMicroscope)
366 Recorder.AddLine("Microscope.Focus.SetSWLimit(" + xd + "," + yd + ");");
367 }

Member Data Documentation

◆ lowerLimit

double BioImager.Focus.lowerLimit
static

Definition at line 246 of file Microscope.cs.

◆ upperLimit

double BioImager.Focus.upperLimit
static

Definition at line 245 of file Microscope.cs.


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