Seems the stage device API has a travel-limits concept (MM::Stage::GetLimits, MM::XYStage::GetLimitsUm), but these are not exposed by MMCore. XY stage position is not a device property, so the usual hasPropertyLimits / getPropertyLowerLimit / getPropertyUpperLimit don't apply. MMCore already wraps the device methods internally (XYStageInstance::GetLimitsUm, StageInstance::GetLimits in mmcore::internal), they are just not reachable from CMMCore.
Proposal would be something like:
getXYStageLimits(* xyStageLabel, & xMin, & xMax, & yMin, & yMax)
getStageLimits(* stageLabel, & lower, & upper)
(similar to getGalvoXRange, getGalvoXMinimum, ...)
Ran into this working on a widget that shows the live stage position, where I wanted to draw the max stage range as an outline. I think it could also be a useful safety layer for programmatic control, e.g. validating acquisition events before starting an experiment.
A quick search shows several adapters return DEVICE_UNSUPPORTED_COMMAND (ASIStage, Ludl) or DEVICE_OK (OpenFlexure) for GetLimitsUm (case for GetLimits is similar), so clients would need an unambiguous way to deal with stages that don't implement limits. Maybe would require a hasXYStageLimits(label)?
Let me know if I'm missing something, and there is a way to do this already! Also happy to work towards a PR if this is something of interest.
Seems the stage device API has a travel-limits concept (
MM::Stage::GetLimits,MM::XYStage::GetLimitsUm), but these are not exposed by MMCore. XY stage position is not a device property, so the usualhasPropertyLimits/getPropertyLowerLimit/getPropertyUpperLimitdon't apply. MMCore already wraps the device methods internally (XYStageInstance::GetLimitsUm,StageInstance::GetLimitsinmmcore::internal), they are just not reachable from CMMCore.Proposal would be something like:
getXYStageLimits(* xyStageLabel, & xMin, & xMax, & yMin, & yMax)getStageLimits(* stageLabel, & lower, & upper)(similar to
getGalvoXRange,getGalvoXMinimum, ...)Ran into this working on a widget that shows the live stage position, where I wanted to draw the max stage range as an outline. I think it could also be a useful safety layer for programmatic control, e.g. validating acquisition events before starting an experiment.
A quick search shows several adapters return
DEVICE_UNSUPPORTED_COMMAND(ASIStage, Ludl) orDEVICE_OK(OpenFlexure) forGetLimitsUm(case forGetLimitsis similar), so clients would need an unambiguous way to deal with stages that don't implement limits. Maybe would require ahasXYStageLimits(label)?Let me know if I'm missing something, and there is a way to do this already! Also happy to work towards a PR if this is something of interest.