In [32]:
from neon.data import HDF5Iterator # Neon's HDF5 data loader
from neon.backends import gen_backend
import numpy as np
In [5]:
be = gen_backend(backend='cpu', batch_size=1)
In [6]:
outFilename = 'mnist_test.h5' # The name of our HDF5 data file
In [7]:
train_set = HDF5Iterator(outFilename)
In [8]:
train_set.get_description()
Out[8]:
In [10]:
train_set.ndata # Number of patients in our dataset
Out[10]:
In [11]:
train_set.lshape # DICOM image tensor (C x H x W x D)
Out[11]:
In [17]:
from matplotlib import pyplot as plt
%matplotlib inline
In [37]:
plt.imshow(train_set.inp[0,:].reshape(28,28), cmap=cm.gray);
In [29]:
i = 0
for x, t in train_set:
print(i)
print(x)
plt.imshow(x.get().reshape(28,28), cmap=cm.gray);
i += 1
break
In [ ]: