def rescaleForDisplay(self): # Delete the previous array del self.image.display del self.image.frame # Apply the contrast correction self.image.display = contrastCorrection(self.image.display_base, 1.0, limits=self.contrast_limits) self.image.display = self.image.display.astype(np.uint8) # Set the current frame self.image.frame = Image.fromarray(self.image.display[self.frame])
def dark2BrightDisplay(self, median=True): # Delete the previous array del self.image.display del self.image.frame # Correct the stack self.image.display_base = convertDark2Bright(self.image.source, median=median) # Apply the contrast correction self.image.display = contrastCorrection(self.image.display_base, 1.0) self.image.display = self.image.display.astype(np.uint8) # Set the current frame self.image.frame = Image.fromarray(self.image.display[self.frame])
def rescaleTest(self, pv_limits=None): # Delete the previous array del self.image.frame # Use the current settings if pv_limits is None: pv_limits = self.contrast_limits # Apply the contrast correction preview_display = contrastCorrection( self.image.display_base[self.frame], 1.0, limits=pv_limits) preview_display = preview_display.astype(np.uint8) # Set the current frame self.image.frame = Image.fromarray(preview_display)
def dark2BrightTest(self, correction=False, median=True): # Delete the previous array del self.image.frame # Apply the correction if correction: preview_display = convertDark2Bright(self.image.source[self.frame], median=median) # Reinitialise the display else: preview_display = self.image.source[self.frame] preview_display = contrastCorrection(preview_display, 1.0) preview_display = preview_display.astype(np.uint8) # Set the current frame self.image.frame = Image.fromarray(preview_display)