0

I have unwanted outputs in the console from zarr.open() method. It does not have 'verbose-like' parameter. How can I get rid of those input console ?

I'm currently trying to open .ims files (Imaris pictures) thus using the zarr library through this tutorial . Here is my code:

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)

I correctly open it as a picture, but I have the following output coming from zarr.open() that I want to get rid of.

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

I looked a bit into it and this method does not seem to have any 'verbose-like' parameter. How can I make it so that it does not print in my console all of this ?

Thanks.

Willy Lutz
  • 134
  • 1
  • 1
  • 9

1 Answers1

0

The reader code itself is printing these values. From https://github.com/CBI-PITT/imaris_ims_file_reader/blob/master/imaris_ims_file_reader/ims_zarr_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

You will need to contact the maintainers, probably best by opening an issue at https://github.com/CBI-PITT/imaris_ims_file_reader/issues

Josh
  • 201
  • 2
  • 5