import numpy as numpy
import skimage as io
from matplotlib import pyplot as plt
class BD:
  def __init__(self,ind):
    self.ind=ind

  def __iter__(self):  
    self.ind=0
    return self

  def next(self):
    if self.ind==10:
      raise StopIteration
    im=io.imread('/opt/samples/S4_1/pics/'+str(self.ind)+'.bmp')  	
    self.ind+=1
    return im

  def __Gettitem__(self,ind):
    im=io.imread('/opt/samples/S4_1/pics/'+str(ind)+'.bmp') 	
    return im

x=BD(0)
for imga in x:
	io.imshow(imga)
	plt.show()

for i in range(10):
  	io.imshow(i)
	plt.show()