예제 #1
0
	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)
예제 #2
0
	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)
예제 #3
0
	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")
예제 #4
0
	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)
예제 #5
0
	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)