Skip to content

Commit 570bbc3

Browse files
committed
Merge branch 'develop'
2 parents d8c7edd + 58f11b0 commit 570bbc3

File tree

4 files changed

+27
-11
lines changed

4 files changed

+27
-11
lines changed

eitprocessing/datahandling/eitdata.py

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33
import warnings
44
from dataclasses import InitVar, dataclass, field
5-
from enum import auto
5+
from enum import Enum
66
from pathlib import Path
77
from typing import TYPE_CHECKING, Any, TypeVar
88

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

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

175174

176-
class Vendor(LowercaseStrEnum):
177-
"""Enum indicating the vendor (manufacturer) of the source EIT device."""
175+
class Vendor(Enum):
176+
"""Enum indicating the vendor (manufacturer) of the source EIT device.
177+
178+
The enum values are all lowercase strings. For some manufacturers, multiple ways of wrinting are provided mapping to
179+
the same value, to prevent confusion over conversion of special characters. The "simulated" vendor is provided to
180+
indicate simulated data.
181+
"""
182+
183+
DRAEGER = "draeger"
184+
"""Dräger (PulmoVista V500)"""
185+
186+
TIMPEL = "timpel"
187+
"""Timpel (Enlight 2100)"""
188+
189+
SENTEC = "sentec"
190+
"""Sentec (Lumon)"""
178191

179-
DRAEGER = auto()
180-
TIMPEL = auto()
181-
SENTEC = auto()
182192
DRAGER = DRAEGER
183-
DRÄGER = DRAEGER # noqa: PLC2401
184-
SIMULATED = auto()
193+
"""Synonym of DRAEGER"""
194+
195+
DRÄGER = DRAEGER # noqa: PIE796, PLC2401
196+
"""Synonym of DRAEGER"""
197+
198+
SIMULATED = "simulated"
199+
"""Simulated data"""

eitprocessing/roi/watershed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def apply( # noqa: PLR0915
168168

169169
included_marker_indices = np.isin(peaks_loc_int, markers_inside_tiv_mask)
170170
included_peaks = np.argwhere(included_marker_indices)
171-
excluded_peaks = np.argwhere(~included_marker_indices)
171+
excluded_peaks = np.argwhere(peaks_loc_bool & ~included_marker_indices)
172172

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

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ dependencies = [
4040
"matplotlib>=3.10",
4141
"numpy >= 1.24.2",
4242
"scipy >= 1.10.1",
43-
"strenum >= 0.4.10",
4443
"anytree >= 2.12.1 ",
4544
"typing_extensions",
4645
"pyyaml",

tests/test_watershed.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ def test_watershed_captures(draeger1: Sequence):
159159
]:
160160
assert key in captures, f"captures should have a '{key}' entry"
161161

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

163165
def test_watershed_no_amplitude():
164166
eit_data = EITData(

0 commit comments

Comments
 (0)