__init__.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:ome-files-py 作者: ome 项目源码 文件源码
def open_bytes_simple(self, plane):
        """\
        Obtain the image plane for the given index as a numpy array, or a
        list of numpy arrays in the RGB case.
        """

        # Fetch 9D array
        a = self.open_bytes(plane)
        # Drop all unused dimensions
        s = np.squeeze(a, axis=(2, 3, 4, 6, 7, 8))
        # Swap x,y to y,x
        s = np.swapaxes(s, 0, 1)
        # Split RGB samples into separate arrays
        if s.shape[2] == 1:
            return np.squeeze(s, axis=2)
        else:
            return [s[:, :, i] for i in range(0, s.shape[2])]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号