From 28768d94dddea4161cdd275f48bdea82b8195e2a Mon Sep 17 00:00:00 2001 From: Peter Somhorst Date: Tue, 9 Sep 2025 16:32:53 +0200 Subject: [PATCH 1/6] Fix definition of excluded peaks in WatershedLungspace --- eitprocessing/roi/watershed.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eitprocessing/roi/watershed.py b/eitprocessing/roi/watershed.py index 6b27769c6..3820bbed5 100644 --- a/eitprocessing/roi/watershed.py +++ b/eitprocessing/roi/watershed.py @@ -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) From 3ae408a3f9dc2ca1bb0869fc188500da45a05343 Mon Sep 17 00:00:00 2001 From: Peter Somhorst Date: Tue, 9 Sep 2025 16:33:10 +0200 Subject: [PATCH 2/6] Add test asserting the number of included and excluded peaks sums to num of all peaks --- tests/test_watershed.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_watershed.py b/tests/test_watershed.py index abf76b3fb..ec7680bce 100644 --- a/tests/test_watershed.py +++ b/tests/test_watershed.py @@ -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( From bb74a086c93b2e97b6bf5036d143188cff4eaed5 Mon Sep 17 00:00:00 2001 From: Peter Somhorst Date: Mon, 22 Sep 2025 12:56:59 +0200 Subject: [PATCH 3/6] Extend the documentation of the Vendor enum Also, replace LowercaseStrEnum with Enum and remove the auto() calls for better readibility of the documentation. --- eitprocessing/datahandling/eitdata.py | 33 +++++++++++++++++++-------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/eitprocessing/datahandling/eitdata.py b/eitprocessing/datahandling/eitdata.py index 0af2f2133..1a2ce81dc 100644 --- a/eitprocessing/datahandling/eitdata.py +++ b/eitprocessing/datahandling/eitdata.py @@ -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 @@ -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 DREAGER""" + + DRÄGER = DRAEGER # noqa: PIE796, PLC2401 + """Synonym of DREAGER""" + + SIMULATED = "simulated" + """Simulated data""" From a56e07d687e6ce4b554e5420d6345f1b3e41000f Mon Sep 17 00:00:00 2001 From: Peter Somhorst Date: Thu, 25 Sep 2025 11:51:38 +0200 Subject: [PATCH 4/6] Remove strenum dependency --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f807f3562..d47ef0436 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", From 2139473d42b50f477791fd81ba460df4467fef73 Mon Sep 17 00:00:00 2001 From: Peter Somhorst Date: Thu, 25 Sep 2025 12:13:31 +0200 Subject: [PATCH 5/6] Fix typo's --- eitprocessing/datahandling/eitdata.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eitprocessing/datahandling/eitdata.py b/eitprocessing/datahandling/eitdata.py index 1a2ce81dc..6b4930ab6 100644 --- a/eitprocessing/datahandling/eitdata.py +++ b/eitprocessing/datahandling/eitdata.py @@ -190,10 +190,10 @@ class Vendor(Enum): """Sentec (Lumon)""" DRAGER = DRAEGER - """Synonym of DREAGER""" + """Synonym of DRAEGER""" DRÄGER = DRAEGER # noqa: PIE796, PLC2401 - """Synonym of DREAGER""" + """Synonym of DRAEGER""" SIMULATED = "simulated" """Simulated data""" From 08a6c14a173fb1c04f6cfa31b81fea94a25ca951 Mon Sep 17 00:00:00 2001 From: GitHub Actions <127968566+psomhorst@users.noreply.github.com> Date: Thu, 25 Sep 2025 10:26:39 +0000 Subject: [PATCH 6/6] =?UTF-8?q?Bump=20version:=201.8.3=20=E2=86=92=201.8.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CITATION.cff | 2 +- eitprocessing/__init__.py | 2 +- pyproject.toml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index 434fb880b..ad7f47b22 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -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 diff --git a/eitprocessing/__init__.py b/eitprocessing/__init__.py index a44132de1..22944760c 100644 --- a/eitprocessing/__init__.py +++ b/eitprocessing/__init__.py @@ -1 +1 @@ -__version__ = "1.8.3" +__version__ = "1.8.4" diff --git a/pyproject.toml b/pyproject.toml index d47ef0436..30bfdc7a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" @@ -173,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"