首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >禁用控制台中的zarr.open()输出

禁用控制台中的zarr.open()输出
EN

Stack Overflow用户
提问于 2022-10-31 10:23:00
回答 1查看 13关注 0票数 0

我在控制台中有来自zarr.open()方法的不需要的输出。它没有“冗长的”参数。我如何摆脱那些输入控制台?

我目前正在尝试打开.ims文件(Imaris图片),从而通过本教程使用扎尔库。这是我的代码:

代码语言:javascript
复制
from imaris_ims_file_reader.ims import ims
import zarr

store = ims(img_path, ResolutionLevelLock=2, aszarr=True)
# <imaris_ims_file_reader.ims_zarr_store.ims_zarr_store object at 0x7f48965f9ac0>

zarray = zarr.open(store, mode='r')

# print("shape ", zarray[0, 0, 0].shape)
cv2.imshow("image", zarray[0, 0, 0])
cv2.waitKey(0)

我正确地将它作为图片打开,但是我从zarr.open()获得了下面的输出,我想去掉它。

代码语言:javascript
复制
Backend TkAgg is interactive backend. Turning interactive mode on.
GET : .zarray
GET : 0.0.0.0.0
[(0, 1), (0, 1), (0, 8), (0, 128), (0, 128)]
(1, 1, 8, 128, 128)
True
GET : 0.0.0.0.1
[(0, 1), (0, 1), (0, 8), (0, 128), (128, 256)]
(1, 1, 8, 128, 128)
True
GET : 0.0.0.1.0
[(0, 1), (0, 1), (0, 8), (128, 256), (0, 128)]
(1, 1, 8, 128, 128)
True
GET : 0.0.0.1.1
[(0, 1), (0, 1), (0, 8), (128, 256), (128, 256)]
(1, 1, 8, 128, 128)
True
shape  (256, 256)
GET : 0.0.0.0.0
[(0, 1), (0, 1), (0, 8), (0, 128), (0, 128)]
(1, 1, 8, 128, 128)
True
GET : 0.0.0.0.1
[(0, 1), (0, 1), (0, 8), (0, 128), (128, 256)]
(1, 1, 8, 128, 128)
True
GET : 0.0.0.1.0
[(0, 1), (0, 1), (0, 8), (128, 256), (0, 128)]
(1, 1, 8, 128, 128)
True
GET : 0.0.0.1.1
[(0, 1), (0, 1), (0, 8), (128, 256), (128, 256)]
(1, 1, 8, 128, 128)
True

我稍微研究了一下,这个方法似乎没有任何“冗长的”参数。我如何才能使它不打印在我的控制台所有这一切?

谢谢。

EN

回答 1

Stack Overflow用户

发布于 2022-11-01 09:21:51

读取器代码本身正在打印这些值。来自store.py#L131

代码语言:javascript
复制
    def _fromfile(self,index):
        print(index)
        array = self.ims[
            self.ResolutionLevelLock,
            index[0][0]:index[0][1],
            index[1][0]:index[1][1],
            index[2][0]:index[2][1],
            index[3][0]:index[3][1],
            index[4][0]:index[4][1]
            ]
        print(array.shape)
        if array.shape == self.chunks:
            print(True)
            return array

您需要与维护人员联系,最好是在读者/问题上打开一个问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74261848

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档