Ejemplo n.º 1
0
 def getLabelAt(self, position5d):
     labelSlot = self.topLevelOperatorView.WatershedLabels
     if labelSlot.ready():
         labelData = labelSlot[index2slice(position5d)].wait()
         return labelData.squeeze()[()]
     else:
         return None
 def getLabelAt(self, position5d):
     labelSlot = self.topLevelOperatorView.WatershedLabels
     if labelSlot.ready():
         labelData = labelSlot[index2slice(position5d)].wait()
         return labelData.squeeze()[()]
     else:
         return None
Ejemplo n.º 3
0
 def getLabelAt(self, currentImageIndex, position5d):
     labelSlot = self.mainOperator.WatershedLabels[currentImageIndex]
     if labelSlot.ready():
         labelData = labelSlot[ index2slice(position5d) ].wait()
         return labelData.squeeze()[()]
     else:
         return None
Ejemplo n.º 4
0
    def put( self, slicing, subarray, neutral = 0 ):
        '''Make an update of the wrapped arrays content.

        Elements with neutral value in the subarray are not written into the
        wrapped array, but the original values are kept.

        '''
        assert(len(slicing) == len(self._array.shape)), \
            "slicing into an array of shape=%r requested, but the slicing object is %r" % (slicing, self._array.shape)  
        self._array[slicing] = np.where(subarray!=neutral, subarray, self._array[slicing])
        pure = index2slice(slicing)
        self.setDirty(pure)
Ejemplo n.º 5
0
    def put( self, slicing, subarray, neutral = 0 ):
        '''Make an update of the wrapped arrays content.

        Elements with neutral value in the subarray are not written into the
        wrapped array, but the original values are kept.

        '''
        assert(len(slicing) == len(self._array.shape)), \
            "slicing into an array of shape=%r requested, but the slicing object is %r" % (slicing, self._array.shape)  
        self._array[slicing] = np.where(subarray!=neutral, subarray, self._array[slicing])
        pure = index2slice(slicing)
        self.setDirty(pure)
Ejemplo n.º 6
0
    def put(self, slicing, subarray):
        """Make an update of the wrapped arrays content.

        Elements with neutral value in the subarray are not written into the
        wrapped array, but the original values are kept.

        """
        assert len(slicing) == len(
            self._array.shape
        ), "slicing into an array of shape=%r requested, but the slicing object is %r" % (
            slicing, self._array.shape)
        self._array[slicing] = subarray
        pure = index2slice(slicing)
        self.setDirty(pure)