Skip to content

Commit

Permalink
Better merge source channel names in multi source
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Aug 15, 2024
1 parent 1afac27 commit 107c5ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
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

0 comments on commit 107c5ef

Please sign in to comment.