Start this notebook with DEBUG=matrixscreener ipython notebook
for debug output.
In [2]:
import matrixscreener as ms
e = ms.experiment.Experiment('../tests/experiment--test/')
In [3]:
from PIL import Image
i = Image.open(e.images[0])
i.info
Out[3]:
In [4]:
from IPython.display import Math
# pixel size in microns
Math(str(0.254 / _3['dpi'][0] * 1e6) + '\mu m')
Out[4]:
In [5]:
!du -h -d 1 ../tests/experiment--test/
In [6]:
filename = e.images[0]
!ls -l $filename
In [8]:
import numpy as np
orig = np.array(i)
In [9]:
ms.experiment.compress(e.images, delete_tif=True)
!du -h -d 1 ../tests/experiment--test/
In [10]:
filename = e.images[0]
!ls -l $filename
In [11]:
i = Image.open(filename)
compressed = np.array(i)
In [12]:
ms.experiment.decompress(e.images, delete_png=True, delete_json=True)
!du -h -d 1 ../tests/experiment--test/
In [13]:
filename = e.images[0]
!ls -l $filename
In [14]:
i = Image.open(filename)
decompressed = np.array(i)
In [15]:
# compare data
np.all(orig == compressed)
Out[15]:
In [16]:
np.all(orig == decompressed)
Out[16]: