From 2972f4b4480b0263adaf2125b188d930ea767ad3 Mon Sep 17 00:00:00 2001 From: Tim-Oliver Buchholz Date: Tue, 18 Jun 2024 18:19:56 +0200 Subject: [PATCH 1/4] Set stage position to (0, 0) if it is empty in the metadata. --- src/faim_ipa/visiview/ome_companion_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/faim_ipa/visiview/ome_companion_utils.py b/src/faim_ipa/visiview/ome_companion_utils.py index 3ba509d6..054aee55 100644 --- a/src/faim_ipa/visiview/ome_companion_utils.py +++ b/src/faim_ipa/visiview/ome_companion_utils.py @@ -152,9 +152,9 @@ def get_stage_positions( y_pos = float(stage_label["Y"]) x_pos = float(stage_label["X"]) positions[str(i + 1)] = (y_pos, x_pos) - except StopIteration: - # No stage positions - pass + except (StopIteration, KeyError): + # No stage positions in metadata + positions[str(i + 1)] = (0, 0) return positions From 5efe8488cea71220e5c48e51b48696f5afbee1d9 Mon Sep 17 00:00:00 2001 From: Tim-Oliver Buchholz Date: Thu, 20 Jun 2024 13:45:56 +0200 Subject: [PATCH 2/4] Remove __init__.py from test dir. --- tests/detection/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 tests/detection/__init__.py diff --git a/tests/detection/__init__.py b/tests/detection/__init__.py deleted file mode 100644 index e69de29b..00000000 From c243ac0f311446bfdce2af56aba212d73d0ca2d3 Mon Sep 17 00:00:00 2001 From: Tim-Oliver Buchholz Date: Thu, 20 Jun 2024 13:46:17 +0200 Subject: [PATCH 3/4] Set wavelength to None if not found in metadata. --- src/faim_ipa/visiview/ome_companion_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/faim_ipa/visiview/ome_companion_utils.py b/src/faim_ipa/visiview/ome_companion_utils.py index 054aee55..46caaee2 100644 --- a/src/faim_ipa/visiview/ome_companion_utils.py +++ b/src/faim_ipa/visiview/ome_companion_utils.py @@ -106,7 +106,7 @@ def get_channels(metadata: lxml.etree.ElementTree) -> dict[str, ChannelMetadata] wavelength = int(channel["EmissionWavelength"]) display_color = rgb_to_hex(*wavelength_to_rgb(wavelength)) else: - wavelength = channel["Name"] + wavelength = None display_color = "#ffffff" ch_metadata[f"w{idx+1}"] = ChannelMetadata( channel_index=idx, From af5c816d299eef488d81297912fd4c0268b0f7cd Mon Sep 17 00:00:00 2001 From: Tim-Oliver Buchholz Date: Wed, 3 Jul 2024 09:07:05 +0200 Subject: [PATCH 4/4] Rename test file. --- tests/detection/{test_utils.py => test_detection_utils.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/detection/{test_utils.py => test_detection_utils.py} (100%) diff --git a/tests/detection/test_utils.py b/tests/detection/test_detection_utils.py similarity index 100% rename from tests/detection/test_utils.py rename to tests/detection/test_detection_utils.py