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 NanoCytomics 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 the

  • stage (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

PositionList

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)

mirrorX()[source]

Invert all x coordinates

Return type

PositionList

Returns

A reference to this object.

mirrorY()[source]

Invert all y coordinates

Return type

PositionList

Returns

A reference to this object.

plot()[source]

Open a matplotlib plot showing the positions contained in this list.

renameStage(label)[source]

Change the name of the xy stage.

Parameters

label – The new name for the xy Stage

Return type

PositionList

Returns

A reference to this object

toNanoMatFile(path)[source]

Save this object to a .mat file in the format saved by NanoCytomics MATLAB acquistion software.

Parameters

path (str) – The file path for the new .mat file.

toPropertyMap()[source]

Returns the position list as a PropertyMap that is formatted just like a PropertyMap from Micro-Manager.

Return type

PropertyMap