convert images to uint8 for visualisation

This commit is contained in:
2021-07-19 10:00:49 +02:00
parent 5583cb622d
commit c2b092e6ec

View File

@@ -143,7 +143,8 @@ class SituImage:
Returns: Returns:
Image: The image of the specified focus level and channel Image: The image of the specified focus level and channel
""" """
img = Image.fromarray(self.get_data()[channel, focus_level, :, :]) img = Image.fromarray(
self.get_data()[channel, focus_level, :, :].astype(np.uint8))
img.show() img.show()
return img return img
@@ -172,7 +173,8 @@ class SituImage:
peaks = self.get_channel_peaks( peaks = self.get_channel_peaks(
channel, focus_level) channel, focus_level)
img = Image.fromarray(self.get_data()[channel, focus_level, :, :]) img = Image.fromarray(
self.get_data()[channel, focus_level, :, :].astype(np.uint8))
draw = ImageDraw.Draw(img) draw = ImageDraw.Draw(img)
for x, y in zip(peaks[:, 0], peaks[:, 1]): for x, y in zip(peaks[:, 0], peaks[:, 1]):
draw.ellipse((x - 5, y - 5, x + 5, y + 5), draw.ellipse((x - 5, y - 5, x + 5, y + 5),