Permalink
Browse files

adapt to setDirty change in lazyflow

  • Loading branch information...
cstraehl committed Apr 25, 2012
1 parent 215f114 commit 5a7eda1cae7c0504d0dcf9e1feb78b3a480b162e
Showing with 9 additions and 5 deletions.
  1. +9 −5 volumina/pixelpipeline/datasources.py
@@ -48,7 +48,8 @@ def request( self, slicing ):
"slicing into an array of shape=%r requested, but the slicing object is %r" % (slicing, self._array.shape)
return ArrayRequest(self._array[slicing])
- def setDirty( self, slicing ):
+ def setDirty( self, slot, roi ):
+ slicing = roi.toSlice()
if not is_pure_slicing(slicing):
raise Exception('dirty region: slicing is not pure')
self.isDirty.emit( slicing )
@@ -103,7 +104,8 @@ def request( self, slicing ):
a = self._relabeling[a]
return ArrayRequest(a)
- def setDirty( self, slicing ):
+ def setDirty( self, slot, roi ):
+ slicing = roi.toSlice()
if not is_pure_slicing(slicing):
raise Exception('dirty region: slicing is not pure')
self.isDirty.emit( slicing )
@@ -146,7 +148,7 @@ def __init__( self, outslot, priority = 0 ):
super(LazyflowSource, self).__init__()
self._outslot = outslot
self._priority = priority
- self._outslot.registerDirtyCallback(self.setDirty)
+ self._outslot.notifyDirty(self.setDirty)
def request( self, slicing ):
if cfg.getboolean('pixelpipeline', 'verbose'):
@@ -162,7 +164,8 @@ def request( self, slicing ):
reqobj = ArrayRequest( np.zeros(slicing2shape(slicing), dtype=np.uint8 ) )
return LazyflowRequest( reqobj )
- def setDirty( self, slicing ):
+ def setDirty( self, slot, roi ):
+ slicing = roi.toSlice()
if not is_pure_slicing(slicing):
raise Exception('dirty region: slicing is not pure')
self.isDirty.emit( slicing )
@@ -239,7 +242,8 @@ def request( self, slicing ):
result[:] = self._constant
return ConstantRequest( result )
- def setDirty( self, slicing ):
+ def setDirty( self, slot, roi ):
+ slicing = roi.toSlice()
if not is_pure_slicing(slicing):
raise Exception('dirty region: slicing is not pure')
self.isDirty.emit( slicing )

0 comments on commit 5a7eda1

Please sign in to comment.