Menu

Python Sparse data Analysis Package

Note

This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the gallery for the big picture.

class pysap.base.image.Image(shape=None, spacing=None, data_type='scalar', metadata=None, **kwargs)[source]

Class that defines an image.

An image contains:
  • data: an array of data stored in a numpy.ndarray

  • data_type: whether the data is scalar, vector or matrix.

  • a dictionary of metadata

If data_type is ‘vector’ or ‘matrix’, an array of dimension N will have a spacing of size N-1, respectivelly N-2.

The following event is allowed:
  • modified

property dtype

Get the image data type.

modified()[source]

Send a modified signal to the observers.

property ndim

Get the image dimension. This function accounts for non-scalar data, i.e. ‘vector’ or ‘matrix’ vs ‘scalar’ data types.

property scroll_axis

Get the scroll axis.

Returns

scroll_axis : int

the scroll axis for 3d data.

property shape

Get the shape of the image. This function accounts for non-scalar data, i.e. ‘vector’ or ‘matrix’ vs ‘scalar’ data types.

show()[source]

Display the image data.

property spacing

Get the image spacing.

Follow us

© 2019, Antoine Grigis Samuel Farrens Jean-Luc Starck Philippe Ciuciu