diff --git a/ashlar/reg.py b/ashlar/reg.py index 351edfa..1276c96 100644 --- a/ashlar/reg.py +++ b/ashlar/reg.py @@ -404,7 +404,8 @@ def read(self, series, c): self.metadata._reader.setSeries(self.metadata.active_series[series]) index = self.metadata._reader.getIndex(0, c, 0) byte_array = self.metadata._reader.openBytes(index) - dtype = self.metadata.pixel_dtype + endian = "<" if self.metadata._reader.isLittleEndian() else ">" + dtype = self.metadata.pixel_dtype.newbyteorder(endian) shape = self.metadata.tile_size(series) img = np.frombuffer(byte_array.tostring(), dtype=dtype).reshape(shape) return img