Skip to content

Commit fa1bdc1

Browse files
author
Lee Kamentsky
committed
Bio-formats 5.0.5 will load the alpha channel of an interleaved RGBA format breaking the reader's assumption that C=3
1 parent 0f395dc commit fa1bdc1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

bioformats/formatreader.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,9 @@ def read(self, c = None, z = 0, t = 0, series = None, index = None,
793793
elif self.rdr.isRGB() and self.rdr.isInterleaved():
794794
index = self.rdr.getIndex(z,0,t)
795795
image = np.frombuffer(self.rdr.openBytes(index), dtype)
796-
image.shape = (height, width, 3)
796+
image.shape = (height, width, getSizeC())
797+
if image.shape[2] > 3:
798+
image = image[:, :, :3]
797799
elif c is not None and self.rdr.getRGBChannelCount() == 1:
798800
index = self.rdr.getIndex(z,c,t)
799801
image = np.frombuffer(self.rdr.openBytes(index), dtype)

0 commit comments

Comments
 (0)