def imggen(path, ext, nb_restart_cycle=None):
    '\n        TODO: should really use the volume generators for this\n        '
    files = _get_file_list(path, ext, vol_rand_seed)
    if (nb_restart_cycle is None):
        nb_restart_cycle = len(files)
    idx = (- 1)
    while 1:
        idx = np.mod((idx + 1), nb_restart_cycle)
        im = scipy.misc.imread(os.path.join(path, files[idx]))[:, :, 0]
        (yield im.reshape(((1,) + im.shape)))
TODO: should really use the volume generators for this
def imggen(path, ext, nb_restart_cycle=None):
    '\n        \n        '
    files = _get_file_list(path, ext, vol_rand_seed)
    if (nb_restart_cycle is None):
        nb_restart_cycle = len(files)
    idx = (- 1)
    while 1:
        idx = np.mod((idx + 1), nb_restart_cycle)
        im = scipy.misc.imread(os.path.join(path, files[idx]))[:, :, 0]
        (yield im.reshape(((1,) + im.shape)))