MCPcopy Create free account
hub / github.com/Image-Py/imagepy / run

Method run

imagepy/tools/Transform/scale_tol.py:129–142  ·  view source on GitHub ↗
(self, ips, img, buf, para = None)

Source from the content-addressed store, hash-verified

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()

Callers

nothing calls this directly

Calls 4

countMethod · 0.95
affineMethod · 0.80
get_mskMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected