| 127 | ips.update() |
| 128 | |
| 129 | def run(self, ips, img, buf, para = None): |
| 130 | if para == None: para = self.para |
| 131 | self.count(False) |
| 132 | trans = np.array([[1/self.para['ky'],0],[0,1/self.para['kx']]]) |
| 133 | o = np.array([self.para['oy'], self.para['ox']]) |
| 134 | offset = self.orio[::-1]-trans.dot(o) |
| 135 | if self.para['img']: |
| 136 | nimg.affine_transform(img, trans, output=buf, offset=offset) |
| 137 | trans = np.array([[self.para['kx'],0],[0, self.para['ky']]]) |
| 138 | offset = o[::-1]-trans.dot(self.orio) |
| 139 | if self.para['msk'] and self.bufroi!=None:ips.roi = self.bufroi.affine(trans, offset) |
| 140 | if self.para['img'] and not ips.get_msk('out') is None: |
| 141 | buf[ips.get_msk('out')] = img[ips.get_msk('out')] |
| 142 | ips.update() |