Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better merge source channel names in multi source #1605

Merged
merged 1 commit into from
Aug 15, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Show a frame slider when appropriate in jupyter widgets ([#1595](../../pull/1595))
- Improve options for creating or check large images for each item in a folder ([#1586](../../pull/1586))
- Add a lock to avoid mongo excessively computing random numbers ([#1601](../../pull/1601))
- Better merge source channel names in multi source ([#1605](../../pull/1605))

### Bug Fixes

Expand Down
8 changes: 7 additions & 1 deletion sources/multi/large_image_source_multi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,9 +684,15 @@ def _addSourceToFrames(self, tsMeta, source, sourceIdx, frameDict):
aKey = tuple(self._axisKey(source, frame.get(f'Index{axis.upper()}') or 0, axis)
for axis in self._axesList)
channel = channels[cIdx] if cIdx < len(channels) else None
# We add the channel name to our channel list if the individual
# source lists the channel name or a set of channels OR the source
# appends channels to an existing set.
if channel and channel not in self._channels and (
'channel' in source or 'channels' in source):
'channel' in source or 'channels' in source or
len(self._channels) == aKey[0]):
self._channels.append(channel)
# Adjust the channel number if the source named the channel; do not
# do so in other cases
if (channel and channel in self._channels and
'c' not in source and 'cValues' not in source):
aKey = tuple([self._channels.index(channel)] + list(aKey[1:]))
Expand Down