def getBlobs(self): from PYME.Analysis.points.EdgeDB import edges tri = self.getTriangles() edb = self.getEdb() if self.blobSettings.jittering == 0: self.objIndices = edges.objectIndices(edb.segment(self.blobSettings.distThreshold), self.blobSettings.minSize) self.objects = [np.vstack((tri.x[oi], tri.y[oi])).T for oi in self.objIndices] else: from matplotlib import tri ndists = self.getNeighbourDists() x_ = np.hstack([self['x'] + 0.5*ndists*np.random.normal(size=ndists.size) for i in range(self.blobSettings.jittering)]) y_ = np.hstack([self['y'] + 0.5*ndists*np.random.normal(size=ndists.size) for i in range(self.blobSettings.jittering)]) T = tri.Triangulation(x_, y_) edb = edges.EdgeDB(T) objIndices = edges.objectIndices(edb.segment(self.blobSettings.distThreshold), self.blobSettings.minSize) self.objects = [np.vstack((T.x[oi], T.y[oi])).T for oi in objIndices] return self.objects, self.blobSettings.distThreshold
def getEdb(self): from PYME.Analysis.points.EdgeDB import edges if self.edb is None: self.edb = edges.EdgeDB(self.getTriangles()) return self.edb