Exemplo n.º 1
0
    def params(self, parent):

        # have a named tuple for all parameters
        nmin, nmax = parent.norm.span()

        return PrimaryMask.params(
            (
                PrimaryMask.AdaptiveThreshold,
                self.medianRadius.value(),
                self.windowSize.value(),
                self.minContrast.value(),
                parent.removeBorderObjects.isChecked(),
                parent.fillHoles.isChecked(),
                nmin,
                nmax,
                parent.sizeMin.value(),
                parent.sizeMax.value(),
                parent.intensityMin.value(),
                parent.intensityMax.value(),
                parent.galSize.value(),
                self.watershed.isChecked(),
                self.seedingSize.value(),
                parent.zsliceMethod.currentIndex(),
                parent.zslice.value(),
                parent.outlineSmoothing.value(),
            )
        )
Exemplo n.º 2
0
Arquivo: xmlconf.py Projeto: rhoef/afw
    def primarySettings(self):
        primary = self.root.attrib[self.PRIMARY]
        settings = dict()

        # segmentation
        segm = self.root.xpath("%s/%s" %(primary, self.SEGMENTATION))[0]

        # XXX - stay compatible with old settings files, use adapitve threshold
        # as default
        if not segm.attrib.has_key('mask'):
            values = [PM.AdaptiveThreshold]
            values.extend(attrib2values(segm.attrib))
        else:
            values = attrib2values(segm.attrib)

        settings[segm.tag] = PM.params(values)

        # feature groups
        fgrp = self.root.xpath("%s/%s" %(primary, self.FEATUREGROUPS))[0]
        settings[fgrp.tag] = self._attrib2dict(fgrp.attrib)
        return validate_tagname(primary, reverse=True), settings