Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ env3
venv
venv3

# temporary test data
# test data

**/test_data/*
.helpers/dock_test_data/*
.helpers/dock_test_add/*
tests/images
16 changes: 16 additions & 0 deletions eitprocessing/datahandling/eitdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import numpy as np
from strenum import LowercaseStrEnum
from tifffile import imwrite
from typing_extensions import Self

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

def export_pixel_data(
self,
fname: str | Path,
) -> None:
"""Save pixel impedance data as 3D tiff stack.

Args:
fname: Output file name.
"""
# TODO: add metadata (at the very least time)
# TODO: add standardization for output paths
# TODO: allow different file formats??
# output_path = Path((self.path[0]).parent() / fname) if isinstance(fname, str) else fname #noqa: ERA001
imwrite(fname, self.pixel_impedance)

@property
def global_baseline(self) -> np.ndarray:
"""Return the global baseline, i.e. the minimum pixel impedance across all pixels."""
Expand Down