Commit 15378346 authored by Saad Jbabdi's avatar Saad Jbabdi
Browse files

Delete utils.py

parent 31eac793
import glymur
import PIL
from PIL import Image
import matplotlib.pyplot as plt
fname = "/Users/saad/Desktop/FromJulia/mn96FS_c10_s4.jp2"
fname = "/Users/saad/grot/mn38c23LY_Neu13_10d_L.tif"
jp2 = glymur.Jp2k(fname)
step = 2**3
thumbnail = jp2[::step,::step]
plt.show(thumbnail)
# Convert previous Matlab database to new format
import scipy.io as sio
db = sio.loadmat("/Users/saad/data/Haber_CellCounting/celldb.mat",struct_as_record=False, squeeze_me=True)
images = db['celldb'].images.data
labels = -db['celldb'].images.label + 2
import numpy as np
images = data.transpose(3,0,1,2)
outfile="/Users/saad/data/Haber_CellCounting/celldb.npz"
shape = images.shape[1:]
np.savez(outfile,counts=np.array(labels).flatten(),
images=np.array(images).reshape(-1,*shape))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment