Skip to content
Closed
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
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ authors:

date-released: 2023-03-23
doi: 10.5281/zenodo.7869553
version: "1.8.3"
version: "1.8.4"
repository-code: "https://github.com/EIT-ALIVE/eitprocessing"
keywords:
- Mechanical lung ventilation
Expand Down
2 changes: 1 addition & 1 deletion eitprocessing/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.8.3"
__version__ = "1.8.4"
33 changes: 24 additions & 9 deletions eitprocessing/datahandling/eitdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

import warnings
from dataclasses import InitVar, dataclass, field
from enum import auto
from enum import Enum
from pathlib import Path
from typing import TYPE_CHECKING, Any, TypeVar

import numpy as np
from strenum import LowercaseStrEnum # TODO: EOL 3.10: replace with native StrEnum

from eitprocessing.datahandling import DataContainer
from eitprocessing.datahandling.continuousdata import ContinuousData
Expand Down Expand Up @@ -173,12 +172,28 @@ def calculate_global_impedance(self) -> np.ndarray:
return np.nansum(self.pixel_impedance, axis=(1, 2))


class Vendor(LowercaseStrEnum):
"""Enum indicating the vendor (manufacturer) of the source EIT device."""
class Vendor(Enum):
"""Enum indicating the vendor (manufacturer) of the source EIT device.

The enum values are all lowercase strings. For some manufacturers, multiple ways of wrinting are provided mapping to
the same value, to prevent confusion over conversion of special characters. The "simulated" vendor is provided to
indicate simulated data.
"""

DRAEGER = "draeger"
"""Dräger (PulmoVista V500)"""

TIMPEL = "timpel"
"""Timpel (Enlight 2100)"""

SENTEC = "sentec"
"""Sentec (Lumon)"""

DRAEGER = auto()
TIMPEL = auto()
SENTEC = auto()
DRAGER = DRAEGER
DRÄGER = DRAEGER # noqa: PLC2401
SIMULATED = auto()
"""Synonym of DRAEGER"""

DRÄGER = DRAEGER # noqa: PIE796, PLC2401
"""Synonym of DRAEGER"""

SIMULATED = "simulated"
"""Simulated data"""
2 changes: 1 addition & 1 deletion eitprocessing/roi/watershed.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def apply( # noqa: PLR0915

included_marker_indices = np.isin(peaks_loc_int, markers_inside_tiv_mask)
included_peaks = np.argwhere(included_marker_indices)
excluded_peaks = np.argwhere(~included_marker_indices)
excluded_peaks = np.argwhere(peaks_loc_bool & ~included_marker_indices)

included_watershed_regions = np.where(included_region, watershed_regions, np.nan)

Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "eitprocessing"
version = "1.8.3"
version = "1.8.4"
description = "Processing of lung image data from electrical impedance tomography."
readme = "README.md"
requires-python = ">=3.10"
Expand Down Expand Up @@ -40,7 +40,6 @@ dependencies = [
"matplotlib>=3.10",
"numpy >= 1.24.2",
"scipy >= 1.10.1",
"strenum >= 0.4.10",
"anytree >= 2.12.1 ",
"typing_extensions",
"pyyaml",
Expand Down Expand Up @@ -174,7 +173,7 @@ isort.known-first-party = ["eitprocessing"]
"docs/*" = ["ALL"]

[tool.bumpversion]
current_version = "1.8.3"
current_version = "1.8.4"

[[tool.bumpversion.files]]
filename = "pyproject.toml"
Expand Down
2 changes: 2 additions & 0 deletions tests/test_watershed.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ def test_watershed_captures(draeger1: Sequence):
]:
assert key in captures, f"captures should have a '{key}' entry"

assert len(captures["local peaks"]) == len(captures["included peaks"]) + len(captures["excluded peaks"])


def test_watershed_no_amplitude():
eit_data = EITData(
Expand Down