c8105b3974fba93097bd28e5ae14a27e5f56c857,ilastik/applets/objectExtraction/objectExtractionSerializer.py,SerialLabelImageSlot,serialize,#SerialLabelImageSlot#Any#,10

Before Change


        deleteIfPresent(group, self.name)
        group = getOrCreateGroup(group, self.name)
        mainOperator = self.slot.getRealOperator()
        for i, op in enumerate(mainOperator.innerOperators):
            oplabel = op._opLabelImage
            warnings.warn("FIXME: Not serializing label images")
//            assert False, "FIXME: OpLabelImage implementation has changed, no longer has _processedTimeSteps member"
//            ts = oplabel._processedTimeSteps
//            if len(ts) > 0:
//                subgroup = getOrCreateGroup(group, str(i))
//                subgroup.create_dataset(name="timesteps", data=list(ts))
//
//                if oplabel.compressed:
//                    src = oplabel._mem_h5
//                    subgroup.copy(src["/LabelImage"], subgroup, name="data")
//                else:
//                    src = oplabel._labeled_image
//                    subgroup.create_dataset(name="data", data=src)
        self.dirty = False

    def deserialize(self, group):
        if not self.name in group:

After Change


        deleteIfPresent(group, self.name)
        group = getOrCreateGroup(group, self.name)
        mainOperator = self.slot.getRealOperator()
        for i in range(len(mainOperator)):
            opLabel = mainOperator.getLane(i)._opLabelImage
            subgroup = getOrCreateGroup(group, str(i))

            cleanBlockRois = opLabel.CleanBlocks.value
            for roi in cleanBlockRois:
                logger.debug("Saving labels into dataset: "{}/{}"".format( subgroup.name, str(roi) ))
                // This will be a little slow because the data is passing through a numpy array
                //  instead of somehow directly copying the h5py datasets in their compressed form.
                // We could maybe speed this up, but we"ll lose some abstraction in the cache interface.
                data = opLabel.Output( *roi ).wait()
                subgroup.create_dataset(name=str(roi), data=data)

        self.dirty = False

    def deserialize(self, group):
        if not self.name in group:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 13

Instances


Project Name: ilastik/ilastik
Commit Name: c8105b3974fba93097bd28e5ae14a27e5f56c857
Time: 2013-03-14
Author: bergs@janelia.hhmi.org
File Name: ilastik/applets/objectExtraction/objectExtractionSerializer.py
Class Name: SerialLabelImageSlot
Method Name: serialize


Project Name: ilastik/ilastik
Commit Name: c8105b3974fba93097bd28e5ae14a27e5f56c857
Time: 2013-03-14
Author: bergs@janelia.hhmi.org
File Name: ilastik/applets/objectExtraction/objectExtractionSerializer.py
Class Name: SerialLabelImageSlot
Method Name: deserialize


Project Name: ilastik/ilastik
Commit Name: c8105b3974fba93097bd28e5ae14a27e5f56c857
Time: 2013-03-14
Author: bergs@janelia.hhmi.org
File Name: ilastik/applets/objectExtraction/objectExtractionSerializer.py
Class Name: SerialObjectFeaturesSlot
Method Name: deserialize