pwspy.utility.micromanager.PositionList¶
- class pwspy.utility.micromanager.PositionList(positions)[source]¶
Bases:
object
Represents a micromanager positionList. can be loaded from and saved to a micromanager .pos file.
- Parameters
positions (
List
[MultiStagePosition
]) – A list of MultiStagePosition objects
- positions¶
A list of MultiStagePosition objects
- applyAffineTransform(t)[source]¶
Given an affine transformation array this method will transform all positions in this position list. :type t:
ndarray
:param t: A 2x3 array representing the partial affine transform (rotation, scaling, and translation, but no skew) :type t: np.ndarray
- classmethod fromNanoMatFile(path, xyStageName)[source]¶
Load an instance of the PositionList from a file saved by NC MATLAB acquisition software.
- Parameters
path (
str
) – The file path to the .mat file.xyStageName (
str
) – To adapt the MATLAB file format to the Micro-Manager we need to manually supply a name for thestage (XY) –
- Returns
A new instance of PositionList
- static fromPropertyMap(pmap)[source]¶
Attempt to load a PositionList from a PropertyMap. May throw an exception.
- Return type
- getAffineTransform(otherList)[source]¶
Calculate the partial affine transformation between this position list and another position list. Both position lists must have the same length
- Parameters
otherList (PositionList) – A position list of the same length as this position list. Each position is assumed to correspond to the position of the same index in this list.
- Returns
A 2x3 array representing the partial affine transform (rotation, scaling, and translation, but no skew)
- Return type
np.ndarray
Examples
a = PositionList.fromNanoMatFile(r’F:/Data/AirDryingSystemComparison/NanoPreDry/corners/positions.mat’, “TIXYDRIVE”) b = PositionList.fromNanoMatFile(r’F:/Data/AirDryingSystemComparison/NanoPostDry/corners/positions.mat’,”TIXYDRIVE”) t = a.getAffineTransform(b) origPos = PositionList.fromNanoMatFile(r’F:/Data/AirDryingSystemComparison/NanoPreDry/0_8NA/position_list1.mat’,”TIXYDRIVE”) newPos = origPos.applyAffineTransform(t)
- renameStage(label)[source]¶
Change the name of the xy stage.
- Parameters
label – The new name for the xy Stage
- Return type
- Returns
A reference to this object
- toNanoMatFile(path)[source]¶
Save this object to a .mat file in the format saved by NC MATLAB acquistion software.
- Parameters
path (
str
) – The file path for the new .mat file.