-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move functions to avoid circular import
- Loading branch information
1 parent
d7269bc
commit c845331
Showing
4 changed files
with
24 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from control._def import CHANNEL_COLORS_MAP | ||
|
||
def extract_wavelength_from_config_name(name): | ||
# Split the string and find the wavelength number immediately after "Fluorescence" | ||
parts = name.split() | ||
if "Fluorescence" in parts: | ||
index = parts.index("Fluorescence") + 1 | ||
if index < len(parts): | ||
return parts[index].split()[0] # Assuming 'Fluorescence 488 nm Ex' and taking '488' | ||
for color in ["R", "G", "B"]: | ||
if color in parts or "full_" + color in parts: | ||
return color | ||
return None | ||
|
||
|
||
def get_channel_color(channel): | ||
channel_info = CHANNEL_COLORS_MAP.get(extract_wavelength_from_config_name(channel), {"hex": 0xFFFFFF, "name": "gray"}) | ||
return channel_info["hex"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters