Exemple #1
0
	def swapBias(self, event):
		self.biasmode='conditioned'
		bd=self._getBiasData(True)
		g=self.alg.elements[0]
		d=g.getElements('Data', depth=1)[0]
		#print bd.data.shape, bd.attributes
		#print d.data.shape, d.attributes
		d.mirror(bd, False)
		#print d.data.shape, d.attributes

		editBlock(self.alg.elements[2], self, args={'width':0, 'hexagonal':False, 'maptorange':(), 'invert':False, 'power':0, 'minBelow':0, 'maxAbove':0.0})
		self.biasmode='raw'
		bd=self._getBiasData(True)
		base=bd.getSubData('/base')
		if base:
			base.sever()
		self.drawBias()
Exemple #2
0
	def setBias(self, event):
		if not self.alg:
			self.setModel()
		g=self.alg.elements[0]
		d = self.load(returndoc=True)
		d=d.getElements('Data', depth=1)[0]
		if d.stype()=='image':
			self.report('converting image to 2D bias')
			dat = d.getData()
			dat = dat.mean(3)
			dat = dat.mean(2)
			h = d.header()
			h['SampleType']='sfield'
			d.datinit(dat, h)
		de=g.getElements('Data')
		if de:
			de[0].mirror(d, True)
		else:
			g.newElement(d)
		dp=g.getElements('Data')[0].upath()
		editBlock(g, self, args={'upath':dp, 'dpath':'/', 'recurse':False})
		self.biasmode='raw'
		self.drawBias()
Exemple #3
0
	def confBias(self, event):
		editBlock(self.alg.elements[2], self)
		self.condBias(None)
Exemple #4
0
	def config(self, event):
		editBlock(self.alg.elements[3], self)
		self.report('edit finished')