Skip to content
Merged
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 lambda/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.2.0"
requires-python = ">=3.12"
dependencies = [
"data-hub-shared",
"arcadia-microscopy-tools>=0.3.2",
"arcadia-microscopy-tools>=0.4.1",
"aws-lambda-typing>=2.20.0",
"click>=8.1",
"matplotlib>=3.8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def _render_rgb(self) -> NDArray[np.float64]:
"""Produce the RGB overlay for the loaded image."""
per_channel_2d: dict[Channel, NDArray[np.float64]] = {}
for channel in self.image.channels:
intensities = self.image.get_intensities_from_channel(channel)
intensities = self.image.get_channel_intensities(channel)
reduced = self._reduce_to_2d(intensities, self._non_channel_axes())
per_channel_2d[channel] = _rescale_percentile(reduced, CONTRAST_PERCENTILES)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def parse_metadata(image: MicroscopyImage) -> dict[str, Any]:


def _channel_to_dict(channel: Channel) -> dict[str, Any]:
color = channel.color.hex_code if channel.color is not None else None
color = channel.color.lower()
return {
"name": channel.name,
"excitation_nm": channel.excitation_nm,
Expand Down
8 changes: 4 additions & 4 deletions lambda/tests/hina_microscope/test_parse_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,18 @@ def test_channel_without_wavelengths(self) -> None:
assert result["emission_nm"] is None
assert result["color"] == "#ffffff"

def test_channel_with_none_color(self) -> None:
def test_channel_color_normalized_to_lowercase(self) -> None:
from arcadia_microscopy_tools.channels import Channel

bare = Channel(name="CUSTOM", excitation_nm=500, emission_nm=520, color=None)
custom = Channel(name="CUSTOM", excitation_nm=500, emission_nm=520, color="#AABBCC")

result = _channel_to_dict(bare)
result = _channel_to_dict(custom)

assert result == {
"name": "CUSTOM",
"excitation_nm": 500,
"emission_nm": 520,
"color": None,
"color": "#aabbcc",
}


Expand Down
11 changes: 6 additions & 5 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading