Skip to content

Commit 517689e

Browse files
committed
feature: export eit movie to tiff
1 parent e98ba42 commit 517689e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

eitprocessing/datahandling/eitdata.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import numpy as np
99
from strenum import LowercaseStrEnum
10+
from tifffile import imwrite
1011
from typing_extensions import Self
1112

1213
from eitprocessing.datahandling.mixins.equality import Equivalence
@@ -117,6 +118,21 @@ def _sliced_copy(
117118
def __len__(self):
118119
return self.pixel_impedance.shape[0]
119120

121+
def export_pixel_data(
122+
self,
123+
fname: str | Path,
124+
) -> None:
125+
"""Save pixel impedance data as 3D tiff stack.
126+
127+
Args:
128+
fname: Output file name.
129+
"""
130+
# TODO: add metadata (at the very least time)
131+
# TODO: add standardization for output paths
132+
# TODO: allow different file formats??
133+
# output_path = Path((self.path[0]).parent() / fname) if isinstance(fname, str) else fname #noqa: ERA001
134+
imwrite(fname, self.pixel_impedance)
135+
120136
@property
121137
def global_baseline(self) -> np.ndarray:
122138
"""Return the global baseline, i.e. the minimum pixel impedance across all pixels."""

0 commit comments

Comments
 (0)