def __init__(self, operator, projectFileGroupName):
        self.VERSION = 1
        self._serialClassifierSlot = SerialClassifierSlot(
            operator.Classifier,
            operator.classifier_cache,
            name="ClassifierForests")
        slots = [
            SerialListSlot(operator.LabelNames),
            SerialListSlot(operator.LabelColors,
                           transform=lambda x: tuple(x.flat)),
            SerialListSlot(operator.PmapColors,
                           transform=lambda x: tuple(x.flat)),
            SerialPickleableSlot(operator.Bookmarks, self.VERSION),
            BackwardsCompatibleLabelSerialBlockSlot(
                operator.LabelImages,
                operator.LabelInputs,
                operator.NonzeroLabelBlocks,
                name="LabelSets",
                subname="labels{:03d}",
                selfdepends=False,
                shrink_to_bb=True,
            ),
            SerialClassifierFactorySlot(operator.ClassifierFactory),
            self._serialClassifierSlot,
        ]

        super(PixelClassificationSerializer,
              self).__init__(projectFileGroupName, slots, operator)
Exemple #2
0
    def __init__(self, operator, projectFileGroupName):
        self.predictionSlot = SerialPredictionSlot(
            operator.PredictionProbabilities,
            operator,
            name='Predictions',
            subname='predictions{:04d}',
        )

        slots = [
            SerialListSlot(
                operator.LabelNames,
            ),
            SerialListSlot(
                operator.LabelColors,
                transform=lambda x: tuple(x.flat),
            ),
            SerialListSlot(
                operator.PmapColors,
                transform=lambda x: tuple(x.flat),
            ),
            SerialBlockSlot(
                operator.LabelImages,
                operator.LabelInputs,
                operator.NonzeroLabelBlocks,
                name='LabelSets',
                subname='labels{:0}',
                selfdepends=False,
            ),
            self.predictionSlot,
            SerialBoxSlot(
                operator.opTrain.BoxConstraintRois,
                operator.opTrain,
                name='Rois',
                subname='rois{:04d}',
            ),
            SerialBoxSlot(
                operator.opTrain.BoxConstraintValues,
                operator.opTrain,
                name='Values',
                subname='values{:04d}',
            ),
            SerialSlot(
                operator.opTrain.Sigma,
                name='Sigma',
            ),
            SerialBoxSlot(
                operator.boxViewer.rois,
                operator.boxViewer,
                name='ViewRois',
                subname='viewrois{:04d}',
            ),
            SerialCountingSlot(
                operator.Classifier,
                operator.classifier_cache,
                name='CountingWrappers',
            ),
        ]

        super(CountingSerializer, self).__init__(projectFileGroupName, slots=slots)
        self.predictionSlot.progressSignal.subscribe(self.progressSignal)
Exemple #3
0
 def __init__(self, operator, projectFileGroupName):
     super(NanshePreprocessingSerializer, self).__init__(
         projectFileGroupName,
         slots=[
             SerialSlot(operator.ToRemoveZeroedLines, selfdepends=True),
             SerialListSlot(operator.ErosionShape, selfdepends=True),
             SerialListSlot(operator.DilationShape, selfdepends=True),
             SerialSlot(operator.ToExtractF0, selfdepends=True),
             SerialSlot(operator.HalfWindowSize, selfdepends=True),
             SerialSlot(operator.WhichQuantile, selfdepends=True),
             SerialSlot(operator.TemporalSmoothingGaussianFilterStdev,
                        selfdepends=True),
             SerialSlot(operator.SpatialSmoothingGaussianFilterStdev,
                        selfdepends=True),
             SerialSlot(operator.TemporalSmoothingGaussianFilterWindowSize,
                        selfdepends=True),
             SerialSlot(operator.SpatialSmoothingGaussianFilterWindowSize,
                        selfdepends=True),
             SerialSlot(operator.BiasEnabled, selfdepends=True),
             SerialSlot(operator.Bias, selfdepends=True),
             SerialSlot(operator.ToWaveletTransform, selfdepends=True),
             SerialListSlot(operator.Scale, selfdepends=True),
             SerialBlockSlot(operator.CacheOutput,
                             operator.CacheInput,
                             operator.CleanBlocks,
                             selfdepends=True)
         ])
    def _serialize(self, group, name, multislot):
        #create subgroups, one for every imagelane
        BoxDir = group.create_group(self.name)
        self.deserialize(group)
        for i, slot in enumerate(multislot):
            g = BoxDir.create_group(self.subname.format(i))

            s = SerialListSlot(slot)
            s.serialize(g)
Exemple #5
0
    def _serialize(self, group, name, multislot):
        #create subgroups, one for every imagelane
        BoxDir = group.create_group(self.name)
        self.deserialize(group)
        for i, slot in enumerate(multislot):
            g = BoxDir.create_group(self.subname.format(i))

            s = SerialListSlot(slot)
            s.serialize(g)
Exemple #6
0
 def __init__(self, operator, groupName):
     self.TestSerialSlot = SerialSlot(operator.TestSlot)
     self.TestMultiSerialSlot = SerialSlot(operator.TestMultiSlot)
     self.TestSerialListSlot = SerialListSlot(operator.TestListSlot,
                                              selfdepends=True)
     slots = (self.TestSerialSlot, self.TestMultiSerialSlot,
              self.TestSerialListSlot)
     super(OpMockSerializer, self).__init__(groupName, slots)
 def __init__(self, operator, projectFileGroupName):
     slots = [SerialListSlot(operator.InputChannelIndexes, selfdepends=True),
              SerialSlot(operator.WatershedPadding, selfdepends=True),
              SerialSlot(operator.CacheBlockShape, selfdepends=True),
              SerialSlot(operator.SeedThresholdValue, selfdepends=True),
              SerialSlot(operator.MinSeedSize, selfdepends=True) ]
     
     super(VigraWatershedViewerSerializer, self).__init__(projectFileGroupName,
                                                          slots=slots)
Exemple #8
0
    def __init__(self, operator, projectFileGroupName):
        self._serialClassifierSlot =  SerialClassifierSlot(operator.Classifier,
                                                           operator.classifier_cache,
                                                           name="ClassifierForests")
        slots = [SerialListSlot(operator.LabelNames,
                                transform=str),
                 SerialListSlot(operator.LabelColors, transform=lambda x: tuple(x.flat)),
                 SerialListSlot(operator.PmapColors, transform=lambda x: tuple(x.flat)),
                 SerialBlockSlot(operator.LabelImages,
                                 operator.LabelInputs,
                                 operator.NonzeroLabelBlocks,
                                 name='LabelSets',
                                 subname='labels{:03d}',
                                 selfdepends=False,
                                 shrink_to_bb=True),
                 SerialClassifierFactorySlot(operator.ClassifierFactory),
                 self._serialClassifierSlot ]

        super(PixelClassificationSerializer, self).__init__(projectFileGroupName, slots, operator)
Exemple #9
0
    def __init__(self, operator, projectFileGroupName):
        self.VERSION = 1  # Make sure to bump the version in case you make any changes in the serialization
        self._serialClassifierSlot = SerialClassifierSlot(
            operator.Classifier,
            operator.classifier_cache,
            name="ClassifierForests")
        slots = [
            SerialListSlot(operator.LabelNames),
            SerialListSlot(operator.LabelColors,
                           transform=lambda x: tuple(x.flat)),
            SerialListSlot(operator.PmapColors,
                           transform=lambda x: tuple(x.flat)),
            SerialPickleableSlot(operator.Bookmarks, self.VERSION),
            SerialBlockSlot(
                operator.LabelImages,
                operator.LabelInputs,
                operator.NonzeroLabelBlocks,
                name="LabelSets",
                subname="labels{:03d}",
                selfdepends=False,
                shrink_to_bb=True,
            ),
            SerialClassifierFactorySlot(operator.ClassifierFactory),
            self._serialClassifierSlot,
            SerialBlockSlot(
                operator.opSupervoxelFeaturesAndLabels.SupervoxelFeatures,
                operator.opSupervoxelFeaturesAndLabels.
                CacheSupervoxelFeaturesInput,
                operator.opSupervoxelFeaturesAndLabels.
                SupervoxelFeaturesCleanBlocks,
            ),
            SerialBlockSlot(
                operator.opSupervoxelFeaturesAndLabels.SupervoxelLabels,
                operator.opSupervoxelFeaturesAndLabels.
                CacheSupervoxelLabelsInput,
                operator.opSupervoxelFeaturesAndLabels.
                SupervoxelLabelsCleanBlocks,
            ),
        ]

        super(VoxelSegmentationSerializer,
              self).__init__(projectFileGroupName, slots, operator)
    def __init__(self, topGroupName, operator):
        serialSlots = [
            SerialDictSlot(operator.SelectedFeatures, transform=str),
            SerialListSlot(operator.LabelNames,
                           transform=str),
            SerialListSlot(operator.LabelColors, transform=lambda x: tuple(x.flat)),
            SerialListSlot(operator.PmapColors, transform=lambda x: tuple(x.flat)),
            SerialDictSlot(operator.LabelInputs, transform=int),
            SerialClassifierSlot(operator.Classifier,
                                 operator.classifier_cache,
                                 name="ClassifierForests",
                                 subname="Forest{:04d}"),
            SerialDictSlot(operator.CachedProbabilities,
                           operator.InputProbabilities,
                           transform=int),
        ]

        super(ObjectClassificationSerializer, self ).__init__(topGroupName,
                                                              slots=serialSlots,
                                                              operator=operator)
    def __init__(self, topLevelOperator, projectFileGroupName):
        self.VERSION = 1

        slots = [
            SerialListSlot(topLevelOperator.LabelNames),
            SerialListSlot(topLevelOperator.LabelColors, transform=lambda x: tuple(x.flat)),
            SerialListSlot(topLevelOperator.PmapColors, transform=lambda x: tuple(x.flat)),
            SerialBlockSlot(
                topLevelOperator.LabelImages,
                topLevelOperator.LabelInputs,
                topLevelOperator.NonzeroLabelBlocks,
                name="LabelSets",
                subname="labels{:03d}",
                selfdepends=False,
                shrink_to_bb=True,
            ),
            BinarySlot(topLevelOperator.ModelBinary),
        ]

        super().__init__(projectFileGroupName, slots)
Exemple #12
0
    def __init__(self, topGroupName, operator):
        serialSlots = [
            SerialDictSlot(operator.SelectedFeatures, transform=str),
            SerialListSlot(operator.LabelNames, transform=str),
            SerialListSlot(operator.LabelColors,
                           transform=lambda x: tuple(x.flat)),
            SerialListSlot(operator.PmapColors,
                           transform=lambda x: tuple(x.flat)),
            SerialDictSlot(operator.LabelInputs, transform=int),
            SerialClassifierSlot(operator.Classifier,
                                 operator.classifier_cache,
                                 name="ClassifierForests"),
            SerialDictSlot(operator.CachedProbabilities,
                           operator.InputProbabilities,
                           transform=int),
            #SerialDictSlotWithoutDeserialization(operator.Probabilities, operator, transform=str)
            SerialPickledValueSlot(operator.ExportSettings)
        ]

        super(ObjectClassificationSerializer, self).__init__(topGroupName,
                                                             slots=serialSlots,
                                                             operator=operator)
    def __init__(self, topGroupName, operator):
        self.VERSION = 1  # Make sure to bump the version in case you make any changes in the serialization
        serialSlots = [
            SerialDictSlot(operator.SelectedFeatures),
            SerialListSlot(operator.LabelNames),
            SerialListSlot(operator.LabelColors,
                           transform=lambda x: tuple(x.flat)),
            SerialListSlot(operator.PmapColors,
                           transform=lambda x: tuple(x.flat)),
            SerialDictSlot(operator.LabelInputs, transform=int),
            SerialClassifierSlot(operator.Classifier,
                                 operator.classifier_cache,
                                 name="ClassifierForests"),
            SerialDictSlot(operator.CachedProbabilities,
                           operator.InputProbabilities,
                           transform=int),
            SerialSlot(operator.MaxNumObj),
            SerialPickleableSlot(operator.ExportSettings, self.VERSION, None)
        ]

        super(ObjectClassificationSerializer, self).__init__(topGroupName,
                                                             slots=serialSlots,
                                                             operator=operator)
Exemple #14
0
    def __init__(self, operator, projectFileGroupName):
        self.predictionSlot = SerialPredictionSlot(
            operator.PredictionProbabilities,
            operator,
            name='Predictions',
            subname='predictions{:04d}',
        )
        slots = [
            SerialListSlot(operator.LabelNames, transform=str),
            SerialListSlot(operator.LabelColors,
                           transform=lambda x: tuple(x.flat)),
            SerialListSlot(operator.PmapColors,
                           transform=lambda x: tuple(x.flat)),
            SerialBlockSlot(operator.LabelImages,
                            operator.LabelInputs,
                            operator.NonzeroLabelBlocks,
                            name='LabelSets',
                            subname='labels{:0}',
                            selfdepends=False),
            SerialCountingSlot(operator.Classifier,
                               operator.classifier_cache,
                               name="CountingWrappers",
                               subname="wrapper{:04d}"), self.predictionSlot,
            SerialBoxSlot(operator.opTrain.BoxConstraintRois,
                          operator.opTrain,
                          name="Rois",
                          subname="rois{:04d}"),
            SerialBoxSlot(operator.opTrain.BoxConstraintValues,
                          operator.opTrain,
                          name="Values",
                          subname="values{:04d}")
        ]

        super(CountingSerializer, self).__init__(projectFileGroupName,
                                                 slots=slots)

        self.predictionSlot.progressSignal.connect(self.progressSignal.emit)
Exemple #15
0
 def __init__(self, operator, projectFileGroupName):
     slots = [
         SerialListSlot(operator.ChannelSelections),
         SerialSlot(operator.Threshold),
         SerialSlot(operator.MinSize),
         SerialSlot(operator.Sigma),
         SerialSlot(operator.Alpha),
         SerialSlot(operator.PixelPitch),
         SerialBlockSlot(
             operator.Superpixels,
             operator.SuperpixelCacheInput,
             operator.CleanBlocks,
             name="Superpixels",
             subname="superpixels{:03d}",
             selfdepends=False,
             shrink_to_bb=False,
             compression_level=1,
         ),
     ]
     super(WsdtSerializer, self).__init__(projectFileGroupName, slots=slots, operator=operator)
 def __init__(self, operator, projectFileGroupName):
     slots = [
         SerialListSlot(operator.ChannelSelections),
         SerialSlot(operator.Pmin),
         SerialSlot(operator.MinMembraneSize),
         SerialSlot(operator.MinSegmentSize),
         SerialSlot(operator.SigmaMinima),
         SerialSlot(operator.SigmaWeights),
         SerialSlot(operator.GroupSeeds),
         SerialSlot(operator.PreserveMembranePmaps),
         SerialBlockSlot(operator.Superpixels,
                         operator.SuperpixelCacheInput,
                         operator.CleanBlocks,
                         name='Superpixels',
                         subname='superpixels{:03d}',
                         selfdepends=False,
                         shrink_to_bb=False,
                         compression_level=1)
     ]
     super(WsdtSerializer, self).__init__(projectFileGroupName,
                                          slots=slots,
                                          operator=operator)
Exemple #17
0
 def __init__(self, operator, projectFileGroupName):
     super(NanshePostprocessingSerializer, self).__init__(projectFileGroupName,
                                                         slots=[SerialSlot(operator.SignificanceThreshold, selfdepends=True),
                                                                SerialListSlot(operator.WaveletTransformScale, selfdepends=True),
                                                                SerialSlot(operator.NoiseThreshold, selfdepends=True),
                                                                SerialSlot(operator.AcceptedRegionShapeConstraints_MajorAxisLength_Min, selfdepends=True),
                                                                SerialSlot(operator.AcceptedRegionShapeConstraints_MajorAxisLength_Min_Enabled, selfdepends=True),
                                                                SerialSlot(operator.AcceptedRegionShapeConstraints_MajorAxisLength_Max, selfdepends=True),
                                                                SerialSlot(operator.AcceptedRegionShapeConstraints_MajorAxisLength_Max_Enabled, selfdepends=True),
                                                                SerialSlot(operator.MinLocalMaxDistance, selfdepends=True),
                                                                SerialSlot(operator.AcceptedNeuronShapeConstraints_Area_Min, selfdepends=True),
                                                                SerialSlot(operator.AcceptedNeuronShapeConstraints_Area_Min_Enabled, selfdepends=True),
                                                                SerialSlot(operator.AcceptedNeuronShapeConstraints_Area_Max, selfdepends=True),
                                                                SerialSlot(operator.AcceptedNeuronShapeConstraints_Area_Max_Enabled, selfdepends=True),
                                                                SerialSlot(operator.AcceptedNeuronShapeConstraints_Eccentricity_Min, selfdepends=True),
                                                                SerialSlot(operator.AcceptedNeuronShapeConstraints_Eccentricity_Min_Enabled, selfdepends=True),
                                                                SerialSlot(operator.AcceptedNeuronShapeConstraints_Eccentricity_Max, selfdepends=True),
                                                                SerialSlot(operator.AcceptedNeuronShapeConstraints_Eccentricity_Max_Enabled, selfdepends=True),
                                                                SerialSlot(operator.AlignmentMinThreshold, selfdepends=True),
                                                                SerialSlot(operator.OverlapMinThreshold, selfdepends=True),
                                                                SerialSlot(operator.Fuse_FractionMeanNeuronMaxThreshold, selfdepends=True),
                                                                SerialBlockSlot(operator.Output,
                                                                                operator.CacheInput,
                                                                                operator.CleanBlocks, selfdepends=True)])