Class PositionList
java.lang.Object
org.micromanager.PositionList
- All Implemented Interfaces:
Iterable<MultiStagePosition>
Navigation list of positions for the Stages.
Used for multi site acquisition support.
Consists of a list of MultiStagePositions and an Optional instance of MultiWellPlate.
TODO: Change into an interface and make a default implementation
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classProvides an iterator for a PositionList. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor of navigation list of positions for the Stages.PositionList(MultiWellPlate plate) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChangeListener(ChangeListener listener) Adds a changeListener to this PositionList.voidaddPosition(int in0, MultiStagePosition pos) Insert a position into the list.voidAdds a new position to the list.voidEmpties the list.Helper method to generate unique label when inserting a new position.generateLabel(String proposal) Generates a label for a new Position.intReturns the number of positions contained within the list.getPlate()getPosition(int idx) Returns multi-stage position associated with the position index.getPositionCopy(int idx) Returns a copy of the multi-stage position associated with the position index.intgetPositionIndex(String posLabel) Returns position index associated with the position name.Returns an array of positions contained in the list.booleanisLabelUnique(String label) Verify that the new label is unique.iterator()voidLoad position list from a file.voidLoad position list from a file.static PositionListnewInstance(PositionList aPl) Static copy constructor.voidNotifies all changeListeners to the list that something changed.voidremoveChangeListener(ChangeListener listener) Removes the given listener.voidremovePosition(int idx) Removes a specific position based on the index.voidreplacePosition(int index, MultiStagePosition pos) Replaces position in the list with the new position.voidreplaces the content of this PositionList with the content of the given PropertyMap.voidSave list to a file.voidSave list to a file.voidAssigns a label to the position index.voidsetPlate(MultiWellPlate plate) voidsetPositions(MultiStagePosition[] posArray) Initialize the entire array by passing an array of multi-stage positions.Creates a PropertyMap from this PositionList.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
PositionList
public PositionList()Constructor of navigation list of positions for the Stages. -
PositionList
-
-
Method Details
-
newInstance
Static copy constructor.- Parameters:
aPl- input PositionList; if null an empty PositionList is returned- Returns:
- new instance of a PositionList with identical positions to the input
-
addChangeListener
Adds a changeListener to this PositionList.- Parameters:
listener- Will fire when the list changes
-
removeChangeListener
Removes the given listener. Nothing will happen if listener was not added first.- Parameters:
listener- Removes the specified listener.
-
notifyChangeListeners
public void notifyChangeListeners()Notifies all changeListeners to the list that something changed. -
getPosition
Returns multi-stage position associated with the position index.- Parameters:
idx- - position index- Returns:
- multi-stage position
-
getPositionCopy
Returns a copy of the multi-stage position associated with the position index.- Parameters:
idx- - position index- Returns:
- multi-stage position
-
getPositionIndex
Returns position index associated with the position name.- Parameters:
posLabel- - label (name) of the position- Returns:
- index, or -1 when the name was not found
-
addPosition
Adds a new position to the list.- Parameters:
pos- - multi-stage position
-
addPosition
Insert a position into the list.- Parameters:
in0- - place in the list where the position should be insertedpos- - multi-stage position
-
replacePosition
Replaces position in the list with the new position.- Parameters:
index- index of the position to be replacedpos- - multi-stage position
-
getNumberOfPositions
public int getNumberOfPositions()Returns the number of positions contained within the list.- Returns:
- number of positions contained in the position list
-
clearAllPositions
public void clearAllPositions()Empties the list. -
removePosition
public void removePosition(int idx) Removes a specific position based on the index.- Parameters:
idx- - position index
-
setPositions
Initialize the entire array by passing an array of multi-stage positions.- Parameters:
posArray- - array of multi-stage positions
-
getPositions
Returns an array of positions contained in the list.- Returns:
- position array
-
setLabel
Assigns a label to the position index.- Parameters:
idx- - position indexlabel- - new label (name)
-
toPropertyMap
Creates a PropertyMap from this PositionList.- Returns:
- PropertyMap representing this PositionList
-
replaceWithPropertyMap
replaces the content of this PositionList with the content of the given PropertyMap.- Parameters:
map- PropertyMap whose content will replace this PositionList- Throws:
IOException- appears to be never thrown. TODO: Remove?
-
generateLabel
Helper method to generate unique label when inserting a new position. Not recommended for use - planned to become obsolete.- Returns:
- Unique label
-
generateLabel
-
isLabelUnique
Verify that the new label is unique.- Parameters:
label- - proposed label- Returns:
- true if label does not exist
-
save
Save list to a file.- Parameters:
file- destination; recommended suffix is ".json".- Throws:
IOException- can happen while saving to disk
-
save
Save list to a file.- Parameters:
path- destination; recommended suffix is ".json".- Throws:
IOException- can happen while saving to disk
-
load
Load position list from a file.- Parameters:
file- source JSON file, usually ".txt" or ".json".- Throws:
IOException- can happen while saving to disk
-
load
Load position list from a file.- Parameters:
path- source JSON file, usually ".txt" or ".json".- Throws:
IOException- can happen while reading from disk
-
iterator
- Specified by:
iteratorin interfaceIterable<MultiStagePosition>
-
setPlate
-
getPlate
-