def initialize(self, dataunit, channels, timepoints): """ Method: initialize(dataunit, channels, timepoints) Set initial values for settings based on number of channels and timepoints """ DataUnitSettings.initialize(self, dataunit, channels, timepoints)
def writeTo(self, parser): """ Attempt to write all keys to a parser """ DataUnitSettings.writeTo(self, parser) filterList = self.get("FilterList") if filterList: filterList.writeOut(parser)
def __init__(self, n = -1): """ Constructor """ DataUnitSettings.__init__(self, n) self.set("Type", "No Type Set") self.registerPrivate("ColorTransferFunction", 1) self.registerCounted("Source") self.register("FilterList", serialize = 1) self.register("VoxelSize") self.register("Spacing") #self.register("Origin") self.register("Dimensions") self.register("Type") self.register("Name") self.register("BitDepth")
def deserialize(self, name, value): """ Returns the value of a given key """ if name == "FilterList": filterList = lib.FilterBasedModule.FilterList() filterNames = eval(value) filterList.populate(filterNames) return filterList else: return DataUnitSettings.deserialize(name, value)
def serialize(self, name, value): """ Returns the value of a given key in a format that can be written to disk. """ if name == "FilterList": if value: return str(value.getFilterNames()) else: return "[]" else: return DataUnitSettings.serialize( name, value)