In [1]:
%pylab inline


Populating the interactive namespace from numpy and matplotlib

In [2]:
from glob import glob
files = glob('/Users/arve/Dokumenter/TFY4500/unstained/experiment--row 3-5/*.tif')

In [8]:
import tifffile
import os
from scipy.misc import imsave
!mkdir unstained


mkdir: unstained: File exists

In [9]:
for f in files:
    img = tifffile.imread(f)
    name = os.path.basename(f).split('.tif')[0] + '.png'
    imsave('unstained/' + name, img)

In [11]:
png_files = !ls unstained
len(png_files) == len(files)


Out[11]:
True