def request( self, slicing ): if cfg.getboolean('pixelpipeline', 'verbose'): volumina.printLock.acquire() print " LazyflowSource '%s' requests %s" % (self.objectName(), volumina.strSlicing(slicing)) volumina.printLock.release() if not is_pure_slicing(slicing): raise Exception('LazyflowSource: slicing is not pure') return LazyflowRequest( self._op5, slicing, self._priority, objectName=self.objectName() )
def request( self, slicing ): if cfg.getboolean('pixelpipeline', 'verbose'): volumina.printLock.acquire() print " LazyflowSource '%s' requests %s" % (self.objectName(), volumina.strSlicing(slicing)) volumina.printLock.release() if not is_pure_slicing(slicing): raise Exception('LazyflowSource: slicing is not pure') assert self._op5 is not None, "Underlying operator is None. Are you requesting from a datasource that has been cleaned up already?" return LazyflowRequest( self._op5, slicing, self._priority, objectName=self.objectName() )
def request( self, slicing ): if cfg.getboolean('pixelpipeline', 'verbose'): volumina.printLock.acquire() print " LazyflowSource '%s' requests %s" % (self.objectName(), volumina.strSlicing(slicing)) volumina.printLock.release() if not is_pure_slicing(slicing): raise Exception('LazyflowSource: slicing is not pure') if self._outslot.meta.shape is not None: reqobj = self._outslot[slicing].allocate(priority = self._priority) else: reqobj = ArrayRequest( np.zeros(slicing2shape(slicing), dtype=np.uint8 ), slicing ) return LazyflowRequest( reqobj )
def request( self, qrect, along_through=None ): if cfg.getboolean('pixelpipeline', 'verbose'): volumina.printLock.acquire() print Fore.RED + " GrayscaleImageSource '%s' requests (x=%d, y=%d, w=%d, h=%d)" \ % (self.objectName(), qrect.x(), qrect.y(), qrect.width(), qrect.height()) \ + Fore.RESET volumina.printLock.release() assert isinstance(qrect, QRect) s = rect2slicing(qrect) req = self._arraySource2D.request(s, along_through) return GrayscaleImageRequest( req, self._layer.normalize[0], direct=self.direct )
def request( self, qrect, through=None ): if cfg.getboolean('pixelpipeline', 'verbose'): volumina.printLock.acquire() print Fore.RED + " ColortableImageSource '%s' requests (x=%d, y=%d, w=%d, h=%d) = %r" \ % (self.objectName(), qrect.x(), qrect.y(), qrect.width(), qrect.height(), rect2slicing(qrect)) \ + Fore.RESET volumina.printLock.release() assert isinstance(qrect, QRect) s = rect2slicing(qrect) req = self._arraySource2D.request(s, through) return ColortableImageRequest( req, self._colorTable, self.direct )
def request( self, qrect, along_through=None ): if cfg.getboolean('pixelpipeline', 'verbose'): volumina.printLock.acquire() print Fore.RED + " ColortableImageSource '%s' requests (x=%d, y=%d, w=%d, h=%d) = %r" \ % (self.objectName(), qrect.x(), qrect.y(), qrect.width(), qrect.height(), rect2slicing(qrect)) \ + Fore.RESET volumina.printLock.release() assert isinstance(qrect, QRect) s = rect2slicing(qrect) req = self._arraySource2D.request(s, along_through) return ColortableImageRequest( req, self._colorTable, self._layer.normalize[0], self.direct )
def request( self, qrect ): if cfg.getboolean('pixelpipeline', 'verbose'): volumina.printLock.acquire() print Fore.RED + " AlphaModulatedImageSource '%s' requests (x=%d, y=%d, w=%d, h=%d)" \ % (self.objectName(), qrect.x(), qrect.y(), qrect.width(), qrect.height()) \ + Fore.RESET volumina.printLock.release() assert isinstance(qrect, QRect) s = rect2slicing(qrect) req = self._arraySource2D.request(s) return AlphaModulatedImageRequest( req, self._layer.tintColor, self._layer.normalize[0] )
def request(self, slicing): if cfg.getboolean('pixelpipeline', 'verbose'): volumina.printLock.acquire() print " LazyflowSource '%s' requests %s" % ( self.objectName(), volumina.strSlicing(slicing)) volumina.printLock.release() if not is_pure_slicing(slicing): raise Exception('LazyflowSource: slicing is not pure') return LazyflowRequest(self._op5, slicing, self._priority, objectName=self.objectName())
def request(self, slicing): if cfg.getboolean('pixelpipeline', 'verbose'): volumina.printLock.acquire() print " LazyflowSource '%s' requests %s" % ( self.objectName(), volumina.strSlicing(slicing)) volumina.printLock.release() if not is_pure_slicing(slicing): raise Exception('LazyflowSource: slicing is not pure') assert self._op5 is not None, "Underlying operator is None. Are you requesting from a datasource that has been cleaned up already?" return LazyflowRequest(self._op5, slicing, self._priority, objectName=self.objectName())
def request( self, slicing ): if cfg.getboolean('pixelpipeline', 'verbose'): volumina.printLock.acquire() print " LazyflowSource '%s' requests %s" % (self.objectName(), volumina.strSlicing(slicing)) volumina.printLock.release() if not is_pure_slicing(slicing): raise Exception('LazyflowSource: slicing is not pure') assert self._op5 is not None, "Underlying operator is None. Are you requesting from a datasource that has been cleaned up already?" start, stop = sliceToRoi(slicing, self._op5.Output.meta.shape) clipped_roi = np.maximum(start, (0,0,0,0,0)), np.minimum(stop, self._op5.Output.meta.shape) clipped_slicing = roiToSlice(*clipped_roi) return LazyflowRequest( self._op5, clipped_slicing, self._priority, objectName=self.objectName() )
def request( self, qrect, along_through=None ): if cfg.getboolean('pixelpipeline', 'verbose'): volumina.printLock.acquire() print Fore.RED + " RGBAImageSource '%s' requests (x=%d, y=%d, w=%d, h=%d)" \ % (self.objectName(), qrect.x(), qrect.y(), qrect.width(), qrect.height()) \ + Fore.RESET volumina.printLock.release() assert isinstance(qrect, QRect) s = rect2slicing( qrect ) r = self._channels[0].request(s, along_through) g = self._channels[1].request(s, along_through) b = self._channels[2].request(s, along_through) a = self._channels[3].request(s, along_through) shape = list( slicing2shape(s) ) assert len(shape) == 2 assert all([x > 0 for x in shape]) return RGBAImageRequest( r, g, b, a, shape, *self._layer._normalize )
def request( self, qrect ): if cfg.getboolean('pixelpipeline', 'verbose'): volumina.printLock.acquire() print Fore.RED + " RGBAImageSource '%s' requests (x=%d, y=%d, w=%d, h=%d)" \ % (self.objectName(), qrect.x(), qrect.y(), qrect.width(), qrect.height()) \ + Fore.RESET volumina.printLock.release() assert isinstance(qrect, QRect) s = rect2slicing( qrect ) r = self._channels[0].request(s) g = self._channels[1].request(s) b = self._channels[2].request(s) a = self._channels[3].request(s) shape = [] for t in slicing2shape(s): if t > 1: shape.append(t) assert len(shape) == 2 return RGBAImageRequest( r, g, b, a, shape, *self._layer._normalize )