我在控制台中有来自zarr.open()方法的不需要的输出。它没有“冗长的”参数。我如何摆脱那些输入控制台?
我目前正在尝试打开.ims文件(Imaris图片),从而通过本教程使用扎尔库。这是我的代码:
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()获得了下面的输出,我想去掉它。
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我稍微研究了一下,这个方法似乎没有任何“冗长的”参数。我如何才能使它不打印在我的控制台所有这一切?
谢谢。
发布于 2022-11-01 09:21:51
读取器代码本身正在打印这些值。来自store.py#L131
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您需要与维护人员联系,最好是在读者/问题上打开一个问题。
https://stackoverflow.com/questions/74261848
复制相似问题