public final class MultiStagePosition
extends java.lang.Object
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 and Description |
---|
MultiStagePosition()
Default constructor.
|
MultiStagePosition(java.lang.String xyStage,
double x,
double y,
java.lang.String zStage,
double z)
Convenient constructor where the motion system consists of one XY stage and one focus stage.
|
Modifier and Type | Method and Description |
---|---|
void |
add(StagePosition sp)
Add one stage position point.
|
boolean |
equals(java.lang.Object alt)
Compares this MultiStagePosition to another, and returns true if they
are equal in all aspects.
|
static MultiStagePosition |
fromPropertyMap(PropertyMap pmap)
Generates a multistagePosition from the given PropertyMap.
|
StagePosition |
get(int idx)
Return stage position based on index.
|
StagePosition |
get(java.lang.String stageName)
Returns position for a specific stage.
|
java.lang.String |
getDefaultXYStage()
Return the default XY stage, i,e, the one used if no stage is named explicitly.
|
java.lang.String |
getDefaultZStage()
Returns the Default Z stage, i.e.
|
int |
getGridColumn()
Returns rectangular grid column.
|
int |
getGridRow()
Returns rectangular grid row.
|
java.lang.String |
getLabel()
Returns position label.
|
java.lang.String |
getProperty(java.lang.String key)
Returns property value for a given key (name).
|
java.lang.String[] |
getPropertyNames()
Return the array of property keys (names) associated with this position.
|
double |
getX()
Returns "X" coordinate of the position.
|
double |
getY()
Returns "Y" coordinate of the position.
|
double |
getZ()
Returns "Z" - focus coordinate of the position.
|
static void |
goToPosition(MultiStagePosition msp,
mmcorej.CMMCore core)
Moves all stages to the specified positions.
|
int |
hashCode() |
boolean |
hasProperty(java.lang.String key)
Checks if the position has a particular property.
|
static MultiStagePosition |
newInstance(MultiStagePosition aMps)
Copy constructor.
|
void |
remove(StagePosition sp)
Removed one stage position point.
|
void |
setDefaultXYStage(java.lang.String stage)
Defines which stage serves as the default XY motion control device.
|
void |
setDefaultZStage(java.lang.String stage)
Defines which stage serves as focus control.
|
void |
setGridCoordinates(int row,
int col)
Sets grid parameters for the rectangular grid.
|
void |
setLabel(java.lang.String lab)
Sets position label (such as well name, etc.).
|
void |
setProperty(java.lang.String key,
java.lang.String value)
Add a generalized property-value par to the position.
|
int |
size()
Number of stages.
|
PropertyMap |
toPropertyMap()
Returns a propertymap describing this MultiStagePosition.
|
java.lang.String |
toString() |
public MultiStagePosition()
public MultiStagePosition(java.lang.String xyStage, double x, double y, java.lang.String zStage, double z)
xyStage
- namex
- - coordinate in micronsy
- - coordinate in micronszStage
- namez
- - focus position in micronspublic static MultiStagePosition newInstance(MultiStagePosition aMps)
aMps
- - another instance of the MultiStagePoswition classpublic void add(StagePosition sp)
sp
- Stageposition to be addedpublic void remove(StagePosition sp)
sp
- stage position point to be removedpublic int size()
public StagePosition get(int idx)
idx
- - position indexpublic StagePosition get(java.lang.String stageName)
stageName
- Name of the stagepublic void setProperty(java.lang.String key, java.lang.String value)
key
- Key of the propertyvalue
- Value of the propertypublic java.lang.String[] getPropertyNames()
public boolean hasProperty(java.lang.String key)
key
- Key or propertypublic java.lang.String getProperty(java.lang.String key)
key
- Key of the propertypublic java.lang.String getLabel()
public void setLabel(java.lang.String lab)
lab
- new MultiStagePosition Labelpublic void setDefaultZStage(java.lang.String stage)
stage
- new focus stagepublic java.lang.String getDefaultZStage()
public java.lang.String getDefaultXYStage()
public void setDefaultXYStage(java.lang.String stage)
stage
- new default XY stagepublic static void goToPosition(MultiStagePosition msp, mmcorej.CMMCore core) throws java.lang.Exception
msp
- position to move tocore
- - microscope APIjava.lang.Exception
- If there is an error moving the stage.public double getX()
public double getY()
public double getZ()
public void setGridCoordinates(int row, int col)
row
- Row number of the grid coordinatecol
- Column number of the grid coordinatepublic int getGridRow()
public int getGridColumn()
public boolean equals(java.lang.Object alt)
equals
in class java.lang.Object
alt
- The MultiStagePosition to compare against.public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public PropertyMap toPropertyMap()
public static MultiStagePosition fromPropertyMap(PropertyMap pmap)
pmap
- PropertyMap