def ingest( self ):

    channel = 0
    NAME = [ "Red", "Green", "Blue" ]
    import pdb; pdb.set_trace()

    # for each channel
    for x in range(self.channel):
      
      # label by RGB Channel
      self.label ( x, NAME[x] )
         
      # for each slice
      for sl in range(self.startslice,self.endslice+1,self.batchsz):
      
        imarray = np.zeros ( [self.batchsz,self._yimgsz,self._ximgsz], dtype=np.uint8 )

        for b in range ( self.batchsz ):

          if ( sl + b <= self.endslice ):

            # raw data
            filenm = self.path + '{:0>4}'.format(sl+b) + '.tiff'

            # load the image and check the dimension
            try:
              print "Opening filename: " + filenm
              img = Image.open(filenm, 'r')
              imgdata = np.asarray ( img )
              imarray[self.batchsz%(sl+b-self.startslice),0:imgdata.shape[0],0:imgdata.shape[1]] = imgdata[:,:,x]
            except IOError, e:
              print e
          
        # ingset any remaining slices
        self.upload( channel, sl, imarray )
dataset/ETHPy150Open neurodata/ndstore/ingest/mitra/mitrachannel.py/MitraIngest.ingest/swapped operands of `%`