Exemplo n.º 1
0
 def addImage(self, filename, color=(1, 1, 0)):
     """load a file and add it to the list of QImages"""
     npimg, cc, dims = worker.loadImage(filename, color, self.m_factor)
     self.m_npimages.append(npimg)
     self.m_coords.append(cc)
     self.m_colors.append(color)
     self.m_dims.append(dims)
Exemplo n.º 2
0
 def addImage(self, filename, color=(1,0,0), extension = "txt"):
     '''load a file and add it to the list of QImages'''
     if (extension == "txt"):
         npimg, cc, dims = worker.loadImage(filename, color, self.m_factor)
         self.scene.setCursorRadius(dims[0]/50.)
     if (extension == "tif"):
         im = Image.open(str(filename))
         imarray = np.array(im)
         npimg, cc, dims = coords.Image2coords(imarray, color)
         self.scene.setCursorRadius(dims[0]/50./self.m_factor)
         #self.loadtif(filename, color, self.m_factor)
     self.Images[self.m_numberImages].npimage = npimg
     self.Images[self.m_numberImages].coords = cc
     self.Images[self.m_numberImages].color = color
     self.Images[self.m_numberImages].dims = dims
     print 'image loaded'
     self.m_numberImages = self.m_numberImages + 1