Class MultiStagePosition
java.lang.Object
org.micromanager.MultiStagePosition
Definition of a position in space in terms of available stages/drives.
The current implementation uses the concept of "DefaultXYStage", and "DefaultZStage". This is problematic. The concept of "default" stages originates in the Micro-Manager core, that always has only 1 stage that is the "active" one. However, MultiStagePosition devices can record the position of multiple stages, sometimes even lacking those of the "default" stages, so it can not rely on the Micro-manager "Default" stages being in the list.
It would be nice to be able to rely on the getX, getY, and getZ functions, but these will return bogus values if the system's default stages are not included. To avoid surprises, you may need to parse the MultiStagePosition yourself.
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.MultiStagePosition(String xyStage, double x, double y, String zStage, double z) Convenient constructor where the motion system consists of one XY stage and one focus stage. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(StagePosition sp) Add one stage position point.booleanCompares this MultiStagePosition to another, and returns true if they are equal in all aspects.static MultiStagePositionfromPropertyMap(PropertyMap pmap) Generates a multistagePosition from the given PropertyMap.get(int idx) Return stage position based on index.Returns position for a specific stage.Return the default XY stage, i,e, the one used if no stage is named explicitly.Returns the Default Z stage, i.e.intReturns rectangular grid column.intReturns rectangular grid row.getLabel()Returns position label.getProperty(String key) Returns property value for a given key (name).String[]Return the array of property keys (names) associated with this position.doublegetX()Returns "X" coordinate of the position.doublegetY()Returns "Y" coordinate of the position.doublegetZ()Returns "Z" - focus coordinate of the position.static voidgoToPosition(MultiStagePosition msp, mmcorej.CMMCore core) Moves all stages to the specified positions.inthashCode()booleanhasProperty(String key) Checks if the position has a particular property.static MultiStagePositionCopy constructor.voidremove(StagePosition sp) Removed one stage position point.voidsetDefaultXYStage(String stage) Defines which stage serves as the default XY motion control device.voidsetDefaultZStage(String stage) Defines which stage serves as focus control.voidsetGridCoordinates(int row, int col) Sets grid parameters for the rectangular grid.voidSets position label (such as well name, etc.).voidsetProperty(String key, String value) Add a generalized property-value par to the position.intsize()Number of stages.Returns a propertymap describing this MultiStagePosition.toString()
-
Constructor Details
-
MultiStagePosition
public MultiStagePosition()Default constructor. -
MultiStagePosition
Convenient constructor where the motion system consists of one XY stage and one focus stage.- Parameters:
xyStage- namex- - coordinate in micronsy- - coordinate in micronszStage- namez- - focus position in microns
-
-
Method Details
-
newInstance
Copy constructor.- Parameters:
aMps- - another instance of the MultiStagePoswition class- Returns:
- multistageposition
-
add
Add one stage position point.- Parameters:
sp- Stageposition to be added
-
remove
Removed one stage position point.- Parameters:
sp- stage position point to be removed
-
size
public int size()Number of stages.- Returns:
- number of stages in this MultiStagePosition object
-
get
Return stage position based on index.- Parameters:
idx- - position index- Returns:
- stageposition
-
get
Returns position for a specific stage.- Parameters:
stageName- Name of the stage- Returns:
- position of the specified stage
-
setProperty
-
getPropertyNames
Return the array of property keys (names) associated with this position.- Returns:
- array with property names
-
hasProperty
Checks if the position has a particular property.- Parameters:
key- Key or property- Returns:
- true if the position has this key
-
getProperty
-
getLabel
Returns position label.- Returns:
- label associated with this MultiStagePosition
-
setLabel
Sets position label (such as well name, etc.).- Parameters:
lab- new MultiStagePosition Label
-
setDefaultZStage
Defines which stage serves as focus control.- Parameters:
stage- new focus stage
-
getDefaultZStage
Returns the Default Z stage, i.e. the one that will be used if not named explicitly.- Returns:
- Default Z stage (defined by the user in MMCore)
-
getDefaultXYStage
Return the default XY stage, i,e, the one used if no stage is named explicitly.- Returns:
- Default XY stage (defined by the user in MMCore)
-
setDefaultXYStage
Defines which stage serves as the default XY motion control device.- Parameters:
stage- new default XY stage
-
goToPosition
Moves all stages to the specified positions.- Parameters:
msp- position to move tocore- - microscope API- Throws:
Exception- If there is an error moving the stage.
-
getX
public double getX()Returns "X" coordinate of the position.- Returns:
- X position of the default XY stage
-
getY
public double getY()Returns "Y" coordinate of the position.- Returns:
- Y position of the default XY stage
-
getZ
public double getZ()Returns "Z" - focus coordinate of the position.- Returns:
- Position of the default Focus stage
-
setGridCoordinates
public void setGridCoordinates(int row, int col) Sets grid parameters for the rectangular grid.- Parameters:
row- Row number of the grid coordinatecol- Column number of the grid coordinate
-
getGridRow
public int getGridRow()Returns rectangular grid row.- Returns:
- row
-
getGridColumn
public int getGridColumn()Returns rectangular grid column.- Returns:
- column
-
equals
Compares this MultiStagePosition to another, and returns true if they are equal in all aspects. -
hashCode
-
toString
-
toPropertyMap
Returns a propertymap describing this MultiStagePosition.- Returns:
- PropertyMap describing this MultiStagePosition
-
fromPropertyMap
Generates a multistagePosition from the given PropertyMap.- Parameters:
pmap- PropertyMap- Returns:
- MultiStagePosition
-