Skip to content

Commit

Permalink
fix rescaling in thumbnail
Browse files Browse the repository at this point in the history
rescaling now can also be turned off for thumbnail generation
  • Loading branch information
sophiamaedler committed Nov 20, 2024
1 parent c4e3789 commit 1901324
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/scportrait/tools/stitch/_stitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,17 @@ def generate_thumbnail(self, scale=0.05):
# if all channels should be rescaled to the same range, initialize dictionary with all channels
if type(self.rescale_range) is tuple:
rescale_range = {k: self.rescale_range for k in self.channel_names}
else:
rescale = True
elif type(self.rescale_range) is dict:
rescale_range = self.rescale_range[self.stitching_channel]
rescale = True
else:
if not self.do_intensity_rescale:
rescale = False #turn off rescaling

# rescale generated thumbnail
self.thumbnail = rescale_image(self.thumbnail, rescale_range)
if rescale:
self.thumbnail = rescale_image(self.thumbnail, rescale_range)

def initialize_aligner(self):
"""
Expand Down

0 comments on commit 1901324

Please sign in to comment.