From 91ab58337152b29e49acfd35722338babae5b44a Mon Sep 17 00:00:00 2001 From: Leonardo Schwarz Date: Wed, 16 Oct 2024 16:16:40 +0200 Subject: [PATCH] add missing counterpart --- src/depiction/persistence/types.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/depiction/persistence/types.py b/src/depiction/persistence/types.py index 2bb8cb8..c2699d8 100644 --- a/src/depiction/persistence/types.py +++ b/src/depiction/persistence/types.py @@ -58,6 +58,11 @@ def coordinates_2d(self) -> NDArray[int]: """Returns the coordinates of the spectra in the imzML file, shape (n_spectra, 2).""" return self.coordinates[:, :2] + @property + def coordinates_array_2d(self) -> DataArray: + # TODO this should replace the old coordinates_2d later + return DataArray(self.coordinates_2d.astype(int), dims=("i", "d"), coords={"d": ["x", "y"]}) + def get_spectrum(self, i_spectrum: int) -> tuple[NDArray[float], NDArray[float]]: """Returns the m/z and intensity arrays of the i-th spectrum.""" return self.get_spectrum_mz(i_spectrum=i_spectrum), self.get_spectrum_int(i_spectrum=i_spectrum)