function jimage(data, label, nx, ny) [numTrain, numPixel] = size(data); for m=1:numTrain, im0 = reshape(data(m,:), nx, ny)'; imwrite(im0, ['mnist_' num2str(label) '_' num2str(m) '.tif']); [im_on, im_off] = retina(im0, 7, 0.3); imwrite(0.5*(im_on - im_off) + 0.5, ['mnist_retina_' num2str(label) '_' num2str(m) '.tif']); end %imwrite(im_on, [dst_dir 'images\' filename '.on.tif']); %imwrite(im_off, [dst_dir 'images\' filename '.off.tif']); %imwrite(0.5*(im_on - im_off) + 0.5, [dst_dir 'images\' filename '.on_off.tif']);