pwspy.dataTypes.Acquisition

class pwspy.dataTypes.Acquisition(directory)[source]

Bases: object

This class handles the file structure of a single acquisition. this can include a PWS acquisition as well as colocalized Dynamics and fluorescence.

Parameters

directory (Union[str, PathLike]) – the file path the root directory of the acquisition

editNotes()[source]

Create a notes.txt file if it doesn’t already exists and open it in a text editor.

getNotes()[source]

Return the contents of notes.txt as a string.

Return type

str

getRois()[source]

Return information about the Rois found in the acquisition’s file path. See documentation for Roi.getValidRoisInPath()

Return type

List[Tuple[str, int, FileFormats]]

getThumbnail()[source]

Return a thumbnail from any of the available acquisitions. Should be an 8bit normalized image.

Return type

ndarray

hasNotes()[source]

Indicates whether or not a notes.txt file was found.

Return type

bool

loadRoi(name, num, fformat=None)[source]

Load a Roi that has been saved to file in the acquisition’s file path.

Return type

RoiFile

saveRoi(roiName, roiNumber, roi, overwrite=False)[source]

Save a Roi to file in the acquisition’s file path.

Parameters
  • roiName (str) – The name to identify this ROI

  • roiNumber (int) – The number to identify this ROI

  • roi (Roi) – The ROI object defining the ROI geometry

  • overwrite (bool) – If True then any existing ROIFile matching this name and number will be overwritten. Otherwise an OSError is raised.

Return type

RoiFile

Returns

A reference to the new ROIFile

Raises

OSError – If overwrite is False and an ROI of the same name and number

already exists then an OSError will be raised.

dynamics

Returns None if no dynamics acquisition was found.

Type

DynMetaData

fluorescence

Newer acquisitions allow for multiple fluorescence images saved to numbered subfolders

Type

List[FluorMetaData]

pws

Returns None if no PWS acquisition was found.

Type

PwsMetaData