In [1]:
%pylab inline
from skimage.data import camera

%load_ext autoreload
%autoreload 2
import simrecon_utils as su


Populating the interactive namespace from numpy and matplotlib
/Users/david/miniconda3/envs/sandbox/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
  return f(*args, **kwds)
/Users/david/miniconda3/envs/sandbox/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
  return f(*args, **kwds)
/Users/david/miniconda3/envs/sandbox/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
  return f(*args, **kwds)
/Users/david/miniconda3/envs/sandbox/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
  return f(*args, **kwds)
/Users/david/miniconda3/envs/sandbox/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
  return f(*args, **kwds)
/Users/david/miniconda3/envs/sandbox/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
  return f(*args, **kwds)

In [2]:
data = camera()

In [4]:
imshow(data)


Out[4]:
<matplotlib.image.AxesImage at 0x1c19b3ed68>

In [6]:
split_data = su.split_img(data, 64)
rdata = su.combine_img(split_data)
np.array_equal(data, rdata)


Out[6]:
True

In [17]:
split_data_pad = su.split_img_with_padding(data, 64, 64)
rdata_pad = su.combine_img_with_padding(np.asarray(split_data_pad), 64)
np.array_equal(data, rdata_pad)



Out[17]:
True

In [18]:
imshow(rdata_pad)


Out[18]:
<matplotlib.image.AxesImage at 0x10fdb8390>

In [45]:
rdata_pad_win = su.combine_img_with_padding_window(np.ones_like(np.asarray(split_data_pad), dtype=float), 64)




In [46]:
imshow(rdata_pad_win)
plt.colorbar()


Out[46]:
<matplotlib.colorbar.Colorbar at 0x1c1bb6fc18>

In [47]:
hist(rdata_pad_win.ravel())


Out[47]:
(array([4.9000e+01, 1.5190e+03, 2.8420e+03, 1.5022e+04, 1.7787e+04,
        1.3363e+05, 0.0000e+00, 8.3133e+04, 0.0000e+00, 8.1620e+03]),
 array([1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.]),
 <a list of 10 Patch objects>)

In [49]:
rdata_pad_win.max()


Out[49]:
1.0000000000000004

In [ ]: