-
Notifications
You must be signed in to change notification settings - Fork 7
Description
When using Stitcher with do_intensity_rescale='full_image', stitching crashes with 'KeyError: 0' during mosaic assembly.
'/src/scportrait/tools/stitch/_stitch.py'
The error occurs in assemble_mosaic() in the following block:
if self.rescale_full_image:
print(
"Rescaling entire input image to 0-1 range using percentiles specified in rescale_range."
)
self.assembled_mosaic[i, :, :] = rescale_image(
self.assembled_mosaic[i, :, :], self.rescale_range[channel]
)
Channel is an integer channel id, but self.rescale_range is keyed by channel names, so idexing self.rescale_range with an integer therefore raises KeyError: 0.
Changing self.rescale_range[channel]) to self.reader.rescale_range[channel]) fixes the issue, since self.reader.rescale_range is indexed by channel ids.