You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To clean up some fusion something, I created the tform() method for InterpolatedTransform, you can see it below.In this particular case, the InterpolatedTransforms had lists with ReferenceTransforms in them, and rather than de-reference them, I added this kwarg into the call. This breaks the symmetry with all other tform methods, which kind of sucks, but... I was thinking that if all transform.tform() methods had sharedTransforms=[] then we could update ReferenceTransform and TransformList to actually have a tform method. The leaf transforms would need to be able to accept the keyword so the user would not have to worry about what kind of transform he/she is calling.
def tform(self, points, sharedTransforms=[]):
"""transform a set of points through this transformation
Parameters
----------
points : numpy.array
a Nx2 array of x,y points
Returns
-------
numpy.array
a Nx2 array of x,y points after transformation
"""
dst = []
refids = np.array([r.transformId for r in sharedTransforms])
for ab in [self.a, self.b]:
dst.append(np.copy(points))
for tf in ab.tforms:
if isinstance(tf, ReferenceTransform):
rind = np.argwhere(refids == tf.refId).flatten()
if rind.size != 1:
raise RenderError("Could not find unique "
"sharedTransform for refId %s" %
tf.refId)
tf = sharedTransforms[rind[0]]
dst[-1] = tf.tform(dst[-1])
return (1.0 - self.lambda_) * dst[0] + self.lambda_ * dst[1]
The text was updated successfully, but these errors were encountered:
To clean up some fusion something, I created the tform() method for InterpolatedTransform, you can see it below.In this particular case, the InterpolatedTransforms had lists with ReferenceTransforms in them, and rather than de-reference them, I added this kwarg into the call. This breaks the symmetry with all other tform methods, which kind of sucks, but... I was thinking that if all transform.tform() methods had
sharedTransforms=[]
then we could update ReferenceTransform and TransformList to actually have a tform method. The leaf transforms would need to be able to accept the keyword so the user would not have to worry about what kind of transform he/she is calling.The text was updated successfully, but these errors were encountered: