IonImage#

class pyopenms.IonImage(*args, **kwargs)#

Bases: object

Dense W x H grid of ion intensities with a per-pixel mask.

Storage is row-major: index = y * W + x. Use get_data() for a zero-copy 2D numpy view of the intensity grid (shape (H, W), dtype float64). Pixels are masked-out by default; setIntensity marks them present.

__init__(self) → None#
__init__(self, width: int, height: int) → None
__init__(self, arg: pyopenms._pyopenms_experiment.IonImage, /) → None

Attributes

getHeight

Image height (rows).

getIntensity

Intensity at (x, y); 0.0 if never set.

getMzRange

m/z window the image was extracted from.

getWidth

Image width (columns).

get_data

Zero-copy 2D numpy view (shape (H, W), dtype float64) of the intensity grid.

get_mask

Returns a 2D uint8 numpy array (H, W) of the pixel mask (1 = present).

hasPixel

True once setIntensity has been called for (x, y).

resize

Resize and zero-initialize; all pixels become invalid.

setIntensity

Stores intensity at (x, y) and marks the cell valid.

setMzRange

Records the m/z window the image was extracted from.

getHeight#

Image height (rows).

getIntensity#

Intensity at (x, y); 0.0 if never set. Raises on out-of-bounds.

getMzRange#

m/z window the image was extracted from.

getWidth#

Image width (columns).

get_data#

Zero-copy 2D numpy view (shape (H, W), dtype float64) of the intensity grid.

Writes through the view modify the underlying buffer but do NOT flip the mask. Use setIntensity(x, y, val) when correctness of the mask matters.

get_mask#

Returns a 2D uint8 numpy array (H, W) of the pixel mask (1 = present). Copy, not zero-copy.

hasPixel#

True once setIntensity has been called for (x, y).

resize#

Resize and zero-initialize; all pixels become invalid.

setIntensity#

Stores intensity at (x, y) and marks the cell valid.

setMzRange#

Records the m/z window the image was extracted from.