wip
This commit is contained in:
@@ -149,8 +149,25 @@ class Grid(pg.ROI):
|
||||
self.addScaleHandle([0, 0], [1, 1])
|
||||
self.addScaleRotateHandle([1, 0], [0, 0])
|
||||
|
||||
def get_points(self):
|
||||
return np.array(((1,2),(3,4),(5,6)),dtype=np.float)
|
||||
def get_points(self,mode=0x2):
|
||||
'generates points of the roi for scanning with deltatau'
|
||||
#pos=np.array(self.pos())
|
||||
cnt=np.array(self._cnt,np.int32)
|
||||
sz=np.array(self.size())
|
||||
pitch=sz/cnt
|
||||
xx, yy=np.meshgrid(range(cnt[0]), range(cnt[1]))
|
||||
if mode&0x01: #modify x scaning forward backward each line
|
||||
for i in range(1,cnt[1],2):
|
||||
xx[i]=xx[i][::-1]
|
||||
if mode&0x02: # modify y scaning forward backward each line
|
||||
xx=xx.T
|
||||
yy=yy.T
|
||||
for i in range(1, cnt[0], 2):
|
||||
yy[i]=yy[i][::-1]
|
||||
|
||||
pts=np.array([xx.reshape(-1), yy.reshape(-1)], dtype=np.float).transpose()*pitch
|
||||
#pts+=pos
|
||||
return pts
|
||||
|
||||
def paint(self, p, *args):
|
||||
#pg.ROI.paint(self, p, *args)
|
||||
@@ -210,6 +227,7 @@ class Path(pg.ROI):
|
||||
for pt in path:
|
||||
qPth.append(QPointF(*pt))
|
||||
|
||||
self.addFreeHandle([.1, .1])
|
||||
self.addScaleHandle([1, 1], [0, 0])
|
||||
self.addScaleHandle([0, 0], [1, 1])
|
||||
self.addScaleRotateHandle([1, 0], [0, 0])
|
||||
@@ -259,16 +277,30 @@ class FixTargetFrame(pg.ROI):
|
||||
'count':(8, 6)
|
||||
}
|
||||
},
|
||||
'125x125':{
|
||||
'12.5x12.5':{
|
||||
'size':(12500+120*4, 12500+120*4),
|
||||
'fiducial':{
|
||||
'type':0,
|
||||
'pos':((240, 240), (240+12500, 240), (240, 240+12500), (240+12500, 240+12500))
|
||||
},
|
||||
'grid':{
|
||||
'pos':(1050, 1050),
|
||||
# 240+(12500-78*120)/2=1810
|
||||
'pos':(1810, 1810),
|
||||
'pitch':(120, 120),
|
||||
'count':(90, 90)
|
||||
'count':(78, 78) #(84,84)... but sone covered
|
||||
}
|
||||
},
|
||||
'23.0x23.0':{
|
||||
'size':(23000+120*4, 23000+120*4),
|
||||
'fiducial':{
|
||||
'type':0,
|
||||
'pos':((240, 240), (240+23000, 240), (240, 240+23000), (240+23000, 240+23000))
|
||||
},
|
||||
'grid':{
|
||||
# 240+(23000-162*120)/2+60?=2020+60?
|
||||
'pos':(2080, 2080),
|
||||
'pitch':(120, 120),
|
||||
'count':(162, 162) #(172,172)... but sone covered
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -489,7 +521,7 @@ if __name__=='__main__':
|
||||
|
||||
vi=FixTargetFrame((100,300),(100,100),tpl='test')
|
||||
vb.addItem(vi)
|
||||
vi=FixTargetFrame((400,-200),(400,400),tpl='125x125')
|
||||
vi=FixTargetFrame((400,-200),(400,400),tpl='12.5x12.5')
|
||||
vb.addItem(vi)
|
||||
|
||||
childTree(vb)
|
||||
|
||||
Reference in New Issue
Block a user