def setupOutputs(self): # sanity checks shape = self.Prediction.meta.shape assert len(shape) == 5,\ "Prediction maps must be a full 5d volume (txyzc)" tags = self.Prediction.meta.getAxisKeys() tags = "".join(tags) assert tags == 'txyzc',\ "Prediction maps have wrong axes order"\ "(expected: txyzc, got: {})".format(tags) if self._cache is not None: self.CachedOutput.disconnect() self._cache.cleanUp() self._cache = None cache = OpCompressedCache(parent=self) cache.name = "{}._cache".format(self.name) cache.Input.connect(self.Output) self._cache = cache self.CachedOutput.connect(self._cache.Output) self.Output.meta.assignFrom(self.Prediction.meta) # output is a label image self.Output.meta.dtype = np.uint32 # cache should hold entire c-t-slices in memory shape = list(self.Prediction.meta.shape) shape[0] = 1 shape[4] = 1 self._cache.BlockShape.setValue(tuple(shape))
def setupOutputs(self): # sanity checks shape = self.Prediction.meta.shape assert len(shape) == 5,\ "Prediction maps must be a full 5d volume (tzyxc)" tags = self.Prediction.meta.getAxisKeys() tags = "".join(tags) assert tags == 'tzyxc',\ "Prediction maps have wrong axes order"\ "(expected: tzyxc, got: {})".format(tags) if self._cache is not None: self.CachedOutput.disconnect() self._cache.cleanUp() self._cache = None cache = OpCompressedCache(parent=self) cache.name = "{}._cache".format(self.name) cache.Input.connect(self.Output) self._cache = cache self.CachedOutput.connect(self._cache.Output) self.Output.meta.assignFrom(self.Prediction.meta) # output is a label image self.Output.meta.dtype = np.uint32 # cache should hold entire c-t-slices in memory shape = list(self.Prediction.meta.shape) shape[0] = 1 shape[4] = 1 self._cache.BlockShape.setValue(tuple(shape))
def __init__(self, *args, **kwargs): super(OpGraphCut, self).__init__(*args, **kwargs) cache = OpCompressedCache(parent=self) cache.name = "{}._cache".format(self.name) cache.Input.connect(self.Output) self._cache = cache self.CachedOutput.connect(self._cache.Output)
def __init__(self, parent=None, graph=None): super(OpTrackingBase, self).__init__(parent=parent, graph=graph) self.label2color = [] self.mergers = [] self.resolvedto = [] self.track_id = None self.extra_track_ids = None self.divisions = None self._opCache = OpCompressedCache(parent=self) self._opCache.InputHdf5.connect(self.InputHdf5) self._opCache.Input.connect(self.Output) self.CleanBlocks.connect(self._opCache.CleanBlocks) self.OutputHdf5.connect(self._opCache.OutputHdf5) self.CachedOutput.connect(self._opCache.Output) self.zeroProvider = OpZeroDefault(parent=self) self.zeroProvider.MetaInput.connect(self.LabelImage) # As soon as input data is available, check its constraints self.RawImage.notifyReady(self._checkConstraints) self.LabelImage.notifyReady(self._checkConstraints) self.export_progress_dialog = None self.ExportSettings.setValue((None, None))
def __init__(self, parent=None, graph=None): super(OpConservationTrackingPgmLink, self).__init__(parent=parent, graph=graph) self._mergerOpCache = OpCompressedCache(parent=self) self._mergerOpCache.InputHdf5.connect(self.MergerInputHdf5) self._mergerOpCache.Input.connect(self.MergerOutput) self.MergerCleanBlocks.connect(self._mergerOpCache.CleanBlocks) self.MergerOutputHdf5.connect(self._mergerOpCache.OutputHdf5) self.MergerCachedOutput.connect(self._mergerOpCache.Output) self._relabeledOpCache = OpCompressedCache(parent=self) self._relabeledOpCache.InputHdf5.connect(self.RelabeledInputHdf5) self._relabeledOpCache.Input.connect(self.RelabeledImage) self.RelabeledCleanBlocks.connect(self._relabeledOpCache.CleanBlocks) self.RelabeledOutputHdf5.connect(self._relabeledOpCache.OutputHdf5) self.RelabeledCachedOutput.connect(self._relabeledOpCache.Output) self.tracker = None self._ndim = 3
def __init__(self, parent=None, graph=None): super(OpConservationTracking, self).__init__(parent=parent, graph=graph) self._mergerOpCache = OpCompressedCache(parent=self) self._mergerOpCache.InputHdf5.connect(self.MergerInputHdf5) self._mergerOpCache.Input.connect(self.MergerOutput) self.MergerCleanBlocks.connect(self._mergerOpCache.CleanBlocks) self.MergerOutputHdf5.connect(self._mergerOpCache.OutputHdf5) self.MergerCachedOutput.connect(self._mergerOpCache.Output)
def __init__(self, parent=None, graph=None): super(OpStructuredTracking, self).__init__(parent=parent, graph=graph) self.labels = {} self.divisions = {} self.Annotations.setValue({}) self._mergerOpCache = OpCompressedCache(parent=self) self._mergerOpCache.InputHdf5.connect(self.MergerInputHdf5) self._mergerOpCache.Input.connect(self.MergerOutput) self.MergerCleanBlocks.connect(self._mergerOpCache.CleanBlocks) self.MergerOutputHdf5.connect(self._mergerOpCache.OutputHdf5) self.MergerCachedOutput.connect(self._mergerOpCache.Output) self._relabeledOpCache = OpCompressedCache(parent=self) self._relabeledOpCache.InputHdf5.connect(self.RelabeledInputHdf5) self._relabeledOpCache.Input.connect(self.RelabeledImage) self.RelabeledCleanBlocks.connect(self._relabeledOpCache.CleanBlocks) self.RelabeledOutputHdf5.connect(self._relabeledOpCache.OutputHdf5) self.RelabeledCachedOutput.connect(self._relabeledOpCache.Output) self._ndim = 3 self.consTracker = None self._parent = parent self.DivisionWeight.setValue(1) self.DetectionWeight.setValue(1) self.TransitionWeight.setValue(1) self.AppearanceWeight.setValue(1) self.DisappearanceWeight.setValue(1) self.MaxNumObjOut.setValue(1) self.transition_parameter = 5 self.detectionWeight = 1 self.divisionWeight = 1 self.transitionWeight = 1 self.appearanceWeight = 1 self.disappearanceWeight = 1
def setupOutputs(self): self.Output.meta.assignFrom(self.LabelImage.meta) #cache our own output, don't propagate from internal operator chunks = list(self.LabelImage.meta.shape) # FIXME: assumes t,x,y,z,c chunks[0] = 1 # 't' self._opCache = OpCompressedCache(parent=self) self._opCache.InputHdf5.connect(self.InputHdf5) self._opCache.Input.connect(self.Output) self._opCache.BlockShape.setValue(tuple(chunks)) self.CleanBlocks.connect(self._opCache.CleanBlocks) self.OutputHdf5.connect(self._opCache.OutputHdf5) self.CachedOutput.connect(self._opCache.Output) self.zeroProvider = OpZeroDefault(parent=self) self.zeroProvider.MetaInput.connect(self.LabelImage)
def __init__(self, parent=None, graph=None): super(OpTrackingBase, self).__init__(parent=parent, graph=graph) self.label2color = [] self.mergers = [] self._opCache = OpCompressedCache(parent=self) self._opCache.InputHdf5.connect(self.InputHdf5) self._opCache.Input.connect(self.Output) self.CleanBlocks.connect(self._opCache.CleanBlocks) self.OutputHdf5.connect(self._opCache.OutputHdf5) self.CachedOutput.connect(self._opCache.Output) self.zeroProvider = OpZeroDefault(parent=self) self.zeroProvider.MetaInput.connect(self.LabelImage) # As soon as input data is available, check its constraints self.RawImage.notifyReady(self._checkConstraints) self.LabelImage.notifyReady(self._checkConstraints)