pingwyn.file.Image
- class pingwyn.file.Image(arr, metadata={})
Bases:
ndarrayA container for an image.
This class extends numpy.ndarray, meaning that the image data can be accessed as if it were a numpy array. The metadata attribute houses additional information for the physical experiment that was performed.
An Image object has a NxM shape, where N is the amount of rows (i.e. y-axis) and M is the amount of columns (i.e. x-axis) the image is made up of. Please take care of the difference between x,y-indexing generally used in computer graphics and the matrix i,j-indexing we use here.
- metadata
A dictionary containing relevant metadata, such as setpoints, channel name, units and scan direction.
- Type:
dict
- __init__(*args: Any, **kwargs: Any) None
Methods
filter_referenced_curves(curves)Filter curves that refer to this image.
Attributes
heightHeight of image in units of image.metadata["size"].
metadatasize_per_pixelpixel width and pixel height of this image.
widthWidth of image in units of image.metadata["size"].
- filter_referenced_curves(curves)
Filter curves that refer to this image.
- Parameters:
curves (list of pingwyn.Curve or tuple of pingwyn.Curve)
- Returns:
Curves that refer to this image in their metadata.
- Return type:
list of pingwyn.Curve
- property height
Height of image in units of image.metadata[“size”].
- Type:
float
- property size_per_pixel
pixel width and pixel height of this image. Has units of image.metadata[“size”].
- Type:
float, float
- property width
Width of image in units of image.metadata[“size”].
- Type:
float