_SetupFastAutoFocus, _Stg_SetupMouseJoystickZ, _StgCalibrateZ, _StgConfigZ, _StgInitiateZ, _StgSetupFocus, _StgSetupFocusPlane, RunAutoFocusLong, RunAutoFocusShort, RunFastAutoFocus, Stg_EnableMouseJoystickZ, Stg_IsMouseJoystickZ, Stg_ToggleMouseJoystickZ, StgEnableJoystickZ, StgFocus, StgFocusAdaptive, StgFocusAdaptiveTwoPasses, StgFocusCriteria, StgFocusInRange, StgFocusInRangeEx, StgFocusInRangeExTwoPasses, StgFocusInRangeTwoPasses, StgFocusPlane, StgFocusSetCriterion, StgFocusSetCriterionDialog, StgGetAbsPosZ, StgGetFocusPlaneType, StgGetPosZ, StgInitiateZ, StgIsFocusPlaneValid, StgMoveMainZ, StgMovePiezoZ, StgMovePiezoZToHomeKeepZ, StgMovePiezoZToHomePosition, StgMoveZ, StgMoveZNamed, StgSetFocusPlane, StgSetupFocus, StgSetupFocusAdaptiveTwoPasses, StgSetupFocusContinuousTwoPasses, StgSetupFocusEx, StgSetupFocusOffset, StgSetupFocusTwoPasses, StgToggleJoystickZ, StgZ_AutoFocus, StgZ_Escape, StgZ_GetActiveZ, StgZ_GetEscape, StgZ_GetJoystickSpeed, StgZ_GetJoystickSpeedSteps, StgZ_GetJoystickZStep, StgZ_GetLimits, StgZ_GetLimitsMultiple, StgZ_GetMotorSpeed, StgZ_GetMotorSpeedSteps, StgZ_GetPiezoDevice, StgZ_GetReferencePosition, StgZ_GetSpeedRamp, StgZ_GetSpeedRampSteps, StgZ_GetStepJoystickSpeed, StgZ_GetStepMotorSpeed, StgZ_IsJoystickSpeedControllable, StgZ_IsMotorSpeedControllable, StgZ_IsPresent, StgZ_IsSpeedRampControllable, StgZ_IsVirtualJoystickSupported, StgZ_MoveVirtualJoystickAtSpeed, StgZ_Refocus, StgZ_SetActiveZ, StgZ_SetJoystickSpeed, StgZ_SetJoystickZStep, StgZ_SetKeepPosition, StgZ_SetLimits, StgZ_SetMotorSpeed, StgZ_SetSpeedRamp
Description 
RunAutoFocusLong();
Starts Auto Focus on the current channel with a relatively long range (depending on the lens, up to a range of mm). It is used for initial rough sample finding and is especially useful for systems where some default Z-positions are stored for the lenses.
Description 
RunAutoFocusShort();
Starts Auto Focus on the current channel with a tiny range (maximum of hundreds of micrometers) around the current Z position. It is mainly used when switching between channels where the focus between them changes a bit or when the Z dimension drifts and you need to fine-tune it.
This function runs the Devices > Fast Auto Focus menu command.
Description 
RunFastAutoFocus();
Runs the Fast Auto Focus function.
Description 
 StgEnableJoystickZ(
   int  EnableJoystickZ
);Sets the Z device joystick status (enable/disable).
Parameters
Return Values
See Also 
StgZ_IsJoystickSpeedControllable
This function runs the Devices > Auto Focus menu command.
Description 
StgFocus();
This function runs the auto focus function.
See Also 
_StgSetupFocus
Description 
 StgFocusAdaptive(
   double  Step
);This function finds the focus using adaptive method with specified step.
Description 
StgFocusAdaptiveTwoPasses( doubleStep, doubleFinestep);
This function performs two-pass focus using adaptive method with specified step.
Description 
StgFocusCriteria();
This function starts auto focus and saves measured focus criteria to file.
Note
Measured focus criteria are saved to file FocusCriteria.txt in format: Z coordinate, Focus criterion. Previous contents of this file are overwritten.
See Also 
StgFocus
Description 
StgFocusInRange( doubleRange, doubleStep);
This function goes up Focus_Range/2 micrometers and the starts to find the focus plane. The differences between two consecutive planes are Step micrometers.
Parameters
Description 
StgFocusInRangeEx( doubleFocus_Range, doubleSpeed);
This function goes Focus_Range/2 microns up from the current z-position to the start position. Then it goes Focus_Range microns down and while moving down grabs images and calculates focus criteria function at different time. After reaching the end position focus criteria is evaluated and function moves to the z-position that corresponds to the focused plane.
Parameters
Description 
StgFocusInRangeExTwoPasses( doubleFocusRange, intSpeed);
Performs two-pass Continuous In Range autofocus with specified parameters.
Description 
int StgFocusInRangeTwoPasses( doubleFocusRange, doubleCoarseStep, doubleFinestep);
Performs two-pass Steps In Range autofocus with specified parameters.
Parameters
This function runs the Devices > Focus using Surface menu command.
Description 
StgFocusPlane();
This function finds the focus using the planar interpolation method and moves the stage to the focus surface. At least three focus surface points have to be defined.
Description 
 StgFocusSetCriterion(
   int  FocusCriterion
);Sets the criterion for focus calculation.
Parameters
FocusCriterion Use focus criterion
| bright field - standard contrast based criterion | |
| intensity - criterion independent on pixel intensity | |
| fluorescence - suitable for fluorescence microscopy | |
| noise-resistant - estimates the noise level in the image and ignores it | |
| confocal - criterion is based only on the intensity values, can be useful in confocal microscopy | 
Description 
 StgFocusSetCriterionDialog(
   int  FocusCriterionDialog
);Defines which focus criterion is used for live focus indication.
Description 
StgGetFocusPlaneType();
Returns the active interpolation method from the Focus Surface and PFS Surface tab in the  XYZ Overview panel. Smooth = 0, Nearest Neighbor = 1).
 XYZ Overview panel. Smooth = 0, Nearest Neighbor = 1).
Description 
StgGetPosZ( double *LpStgZ, intZDevice);
Retrieves the current position [microns] of the selected Z device.
Parameters
Description 
StgInitiateZ( intInitMethodZ, doubleMinimalZ, doubleInitialZ, doubleMaximalZ, intReturnBack);
This function initiates the Z drive.
Parameters
Description 
StgIsFocusPlaneValid();
This function returns a value showing if the focus plane is valid.
Description 
StgMoveMainZ( doubleStgZ, intrelative);
Moves the primary (main) Z drive to the specified position (absolute movement) or by the specified distance (relative movement).
Description 
StgMovePiezoZ( doubleStgZ, intrelative);
Moves the secondary (Piezo) Z drive to the specified position (absolute movement) or by the specified distance (relative movement).
This function runs the Devices > Keep Z position and center Piezo Z menu command.
Description 
StgMovePiezoZToHomeKeepZ();
Moves the piezo-Z device to its defined home position and compensate the shift by moving the second Z drive in opposite direction. The absolute Z position will remain unchanged.
This function runs the Devices > Move Piezo Z to Home Position menu command.
Description 
StgMovePiezoZToHomePosition();
Moves piezo-Z logical device to its defined home position (such as the center of its physical range).
Description 
StgMoveZ( doublez, intrelative);
Moves Z device to the specified position [microns].
Parameters
Return Values
See Also 
StgZ_IsMotorSpeedControllable, StgZ_IsSpeedRampControllable
This function runs the Move Z to this Position menu command.
Description 
StgMoveZNamed( doubleStgZ, intrelative, charZName, charZNameSeparator);
Moves the specified stage(s) to a Z specified position.
Description 
StgSetFocusPlane( double *StgArrayX, double *StgArrayY, double *StgArrayZ, intStgArrayCount);
Defines focus plane as set of points.
Interactive menu command to this function: Devices > Auto Focus Setup
Description 
StgSetupFocus( intMethod, intStep, intStop);
This function sets up the focus method and step for auto focus.
Method parameter defines the type of scanning topology (0 = Adaptive in Steps, 1 = Continuous in range, 2 = Step by step in range, 3 = Interpolation).
Parameters
See Also 
_StgSetupFocus
Description 
StgSetupFocusAdaptiveTwoPasses( doubleStep, doubleFinestep);
This function sets parameters for two-pass focus using adaptive method.
Description 
StgSetupFocusContinuousTwoPasses();
Turns the Two Passes option within the Auto Focus Setup dialog window ON. See  Devices > Auto Focus Setup.
 Devices > Auto Focus Setup.
Description 
StgSetupFocusEx( doubleFocus_Range, intSpeed);
This function is declared only for compatibility reasons. Use StgFocusInRangeEx(Focus_Range, Speed) for auto-focus.
Description 
 StgSetupFocusOffset(
   double  FocusOffset
);Sets the Offset Z after AF value within the  Devices > Auto Focus Setup dialog window.
 Devices > Auto Focus Setup dialog window.
Description 
StgSetupFocusTwoPasses( doubleFocusRange, doubleCoarseStep, doubleFinestep);
Sets parameters for two-pass autofocus.
Parameters
Description 
StgToggleJoystickZ();
Switches the Z device joystick status (enable->disable or disable->enable).
Return Values
See Also 
StgEnableJoystickZ
Description 
 StgZ_AutoFocus(
   int  CoarseAF
);This function automatically focuses on the specimen inserted into the Coolscope.
Description 
StgZ_Escape();
This function moves the Z drive (objective/nosepiece) out of the way of an XY stage.
Description 
int StgZ_GetActiveZ();
This function returns the index of the Z device which is currently selected as Devices > Mouse Joystick and Auto Focus Z.
Return Values
Note
Two Z devices shall be connected, otherwise this function looses its purpose.
Description 
StgZ_GetEscape();
This function moves parts of the microscope to safe distance which enables maintenance of the device.
Description 
StgZ_GetJoystickSpeed();
Returns current Z device joystick speed [microns/s]. This command should only be called if StgZ_IsJoystickSpeedControllable returns TRUE.
Return Values
See Also 
StgZ_IsJoystickSpeedControllable, StgZ_GetJoystickSpeedSteps, StgZ_GetStepJoystickSpeed, StgZ_SetJoystickSpeed
Description 
StgZ_GetJoystickSpeedSteps();
Returns the number of available Z device joystick speed steps. This command should only be called if StgZ_IsJoystickSpeedControllable returns TRUE.
Return Values
See Also 
StgZ_IsJoystickSpeedControllable, StgZ_GetStepJoystickSpeed, StgZ_SetJoystickSpeed, StgZ_GetJoystickSpeed
Description 
StgZ_GetJoystickZStep();
This function retrieves the current value of the Mouse Joystick setup.
See Also 
StgZ_SetJoystickZStep
Description 
StgZ_GetLimits( double *LpMinZ, double *LpMaxZ);
This function returns limits of the Z device selected in Devices > Mouse Joystick and Auto Focus Z.
Description 
StgZ_GetLimitsMultiple( double *LpMinZ, double *LpMaxZ);
This function returns the full range of all connected Z devices.
Description 
StgZ_GetMotorSpeed();
Returns current Z device motor speed [microns/s]. This command should only be called if StgZ_IsMotorSpeedControllable returns TRUE.
Return Values
See Also 
StgZ_IsMotorSpeedControllable, StgZ_GetMotorSpeedSteps, StgZ_GetStepMotorSpeed, StgZ_SetMotorSpeed
Description 
StgZ_GetMotorSpeedSteps();
Returns the number of available Z device motor speed steps. This command should only be called if StgZ_IsMotorSpeedControllable returns TRUE.
Return Values
See Also 
StgZ_IsMotorSpeedControllable, StgZ_GetStepMotorSpeed, StgZ_SetMotorSpeed, StgZ_GetMotorSpeed
Description 
int StgZ_GetPiezoDevice();
If two Z devices are connected, this function returns index number of the connected Piezo Z stage.
Description 
 StgZ_GetReferencePosition(
   double *LpPositionZ
);Returns the reference Z position.
Description 
StgZ_GetSpeedRamp();
Returns current Z device speed ramp [step]. This command should only be called if StgZ_IsSpeedRampControllable returns TRUE.
Return Values
See Also 
StgZ_IsSpeedRampControllable, StgZ_GetSpeedRampSteps, StgZ_SetSpeedRamp
Description 
StgZ_GetSpeedRampSteps();
Returns the number of available Z device speed ramp steps. This command should only be called if StgZ_IsSpeedRampControllable returns TRUE.
Return Values
See Also 
StgZ_IsSpeedRampControllable, StgZ_SetSpeedRamp, StgZ_GetSpeedRamp
Description 
 StgZ_GetStepJoystickSpeed(
   int  step
);Returns Z device joystick speed [microns/s] for a given step. This command should only be called if StgZ_IsJoystickSpeedControllable returns TRUE.
Parameters
Return Values
See Also 
StgZ_IsJoystickSpeedControllable, StgZ_GetJoystickSpeedSteps, StgZ_SetJoystickSpeed, StgZ_GetJoystickSpeed
Description 
 StgZ_GetStepMotorSpeed(
   int  step
);Returns Z device motor speed [microns/s] for a given step. This command should only be called if StgZ_IsMotorSpeedControllable returns TRUE.
Parameters
Return Values
See Also 
StgZ_IsMotorSpeedControllable, StgZ_GetMotorSpeedSteps, StgZ_SetMotorSpeed, StgZ_GetMotorSpeed
Description 
StgZ_IsJoystickSpeedControllable();
Detects if the joystick speed of the Z device can be controlled.
Return Values
See Also 
StgZ_GetJoystickSpeedSteps, StgZ_GetStepJoystickSpeed, StgZ_SetJoystickSpeed, StgZ_GetJoystickSpeed
Description 
StgZ_IsMotorSpeedControllable();
Detects if the motor speed of the Z device can be controlled.
Return Values
See Also 
StgZ_GetMotorSpeedSteps, StgZ_GetStepMotorSpeed, StgZ_SetMotorSpeed, StgZ_GetMotorSpeed
Description 
 StgZ_IsPresent(
   lx_int32  iNumber
);Checks if a logical device of a “Z” type exists and is currently connected.
Description 
StgZ_IsSpeedRampControllable();
Detects if the speed ramp of Z device can be controlled.
Return Values
See Also 
StgZ_GetSpeedRampSteps, StgZ_SetSpeedRamp, StgZ_GetSpeedRamp
Description 
StgZ_IsVirtualJoystickSupported();
This function tests whether the virtual joystick functionality is supported by the current Z drive.
Description 
 StgZ_MoveVirtualJoystickAtSpeed(
   double  MotorSpeedZ
);This function moves the active Z drive according to the defined vector.
Note
Using this function carelessly might cause some hardware damage. The function moves the Z drive continuously. The direction and the speed can be changed by calling it again with a different parameter. The movement can be stopped by giving the function a zero parameter - StgZ_MoveVirtualJoystickAtSpeed(0.000);.
Description 
StgZ_Refocus();
This function moves parts of the microscope back from the safe distance which enables maintenance of the device.
This function runs the Devices > Mouse Joystick and Auto Focus Z menu command.
Description 
 StgZ_SetActiveZ(
   int  ActiveZ
);This function sets the active Z-Drive. There can be two Z-Drive connected, but only one can be active at a time.
Description 
 StgZ_SetJoystickSpeed(
   double  speed
);Sets the Z device joystick speed [microns/s]. If the speed is not valid, the closest valid speed will be chosen. This command should only be called if StgZ_IsJoystickSpeedControllable returns TRUE.
Return Values
See Also 
StgZ_IsJoystickSpeedControllable, StgZ_GetJoystickSpeedSteps, StgZ_GetStepJoystickSpeed, StgZ_GetJoystickSpeed
Description 
 StgZ_SetJoystickZStep(
   double  JoystickZStep
);This function adjusts the step size for the cases when mouse wheel is used for focusing (Mouse Joystick Setup).
Description 
 StgZ_SetKeepPosition(
   int  KeepZPosition
);This function places the table to the set position. It works only with Ti microscope.
Description 
StgZ_SetLimits( doubleMinZ, doubleMaxZ);
This function retrieves the limits of the Z position.
Description 
 StgZ_SetMotorSpeed(
   double  speed
);Sets the Z device motor speed [microns/s]. If the speed is not valid, the closest valid speed will be chosen. This command should only be called if StgZ_IsMotorSpeedControllable returns TRUE.
Return Values
See Also 
StgZ_IsMotorSpeedControllable, StgZ_GetMotorSpeedSteps, StgZ_GetStepMotorSpeed, StgZ_GetMotorSpeed
Description 
 StgZ_SetSpeedRamp(
   int  step
);Sets the Z device speed ramp [step]. This command should only be called if StgZ_IsSpeedRampControllable returns TRUE.
Parameters
Return Values
See Also 
StgZ_IsSpeedRampControllable, StgZ_GetSpeedRampSteps, StgZ_GetSpeedRamp
Description 
 Stg_EnableMouseJoystickZ(
   int  EnableMouseJoyZ
);Sets the mouse joystick status (enable/disable).
Parameters
Return Values
See Also 
Stg_IsMouseJoystickZ, Stg_ToggleMouseJoystickZ
Description 
Stg_IsMouseJoystickZ();
Detects if the mouse joystick is enabled. When is mouse joystick enabled, you can change Z position using mouse wheel.
Return Values
See Also 
Stg_EnableMouseJoystickZ, Stg_ToggleMouseJoystickZ, _Stg_SetupMouseJoystickZ
This function runs the Devices > Enable Mouse Joystick Z in Live menu command.
Description 
Stg_ToggleMouseJoystickZ();
Switches the mouse joystick status (enable->disable or disable->enable).
Return Values
See Also 
Stg_IsMouseJoystickZ, Stg_EnableMouseJoystickZ
This function runs the Devices > Fast Auto Focus Setup menu command.
Description 
_SetupFastAutoFocus();
Opens the Fast Auto Focus Setup dialog window.
See Also 
RunFastAutoFocus
This function runs the Devices > Calibrate Z menu command.
Description 
_StgCalibrateZ();
Displays a dialog box allowing the user to calibrate Z device.
Description 
_StgConfigZ();
Displays a dialog box allowing the user to configure Z device parameters.
Description 
_StgInitiateZ();
This function initiates the Z drive. A confirmation to move the stage to its physical limits appears.
This function runs the Devices > Auto Focus Setup menu command.
Description 
_StgSetupFocus();
The function displays Setup Auto Focus dialog box.
See Also 
StgSetupFocus
This function runs the Devices > Focus Surface Setup menu command.
Description 
_StgSetupFocusPlane();
This function displays the Auto Focus Setup window.
This function runs the Devices > Mouse Joystick Setup menu command.
Description 
_Stg_SetupMouseJoystickZ();
Displays a dialog box allowing the user to set mouse joystick speed.
Return Values
See Also 
Stg_IsMouseJoystickZ
