diff --git a/skimage/transform/geometric.py b/skimage/transform/geometric.py index 06b0839e..6dffeb8a 100644 --- a/skimage/transform/geometric.py +++ b/skimage/transform/geometric.py @@ -105,18 +105,15 @@ class GeometricTransformation(object): self.inverse_matrix = np.linalg.inv(self.matrix) return geometric_transform(coords, self.inverse_matrix) - def union(self, other): + def __mul__(self, other): if type(self) == type(other): transformation = self.__class__ else: transformation = GeometricTransformation return transformation(self.matrix.dot(other.matrix)) - def __mul__(self, other): - return self.union(other) - def __add__(self, other): - return self.union(other) + return self.__mul__(other) class SimilarityTransformation(GeometricTransformation): @@ -424,15 +421,6 @@ class PolynomialTransformation(GeometricTransformation): 'parameters by exchanging source and destination coordinates.' 'Then apply the forward transformation.') - def union(self, other): - raise Exception('Cannot unite polynomial transformations.') - - def __mul__(self, other): - return self.union(self, other) - - def __add__(self, other): - return self.union(self, other) - TRANSFORMATIONS = { 'similarity': SimilarityTransformation, diff --git a/skimage/transform/tests/test_geometric.py b/skimage/transform/tests/test_geometric.py index 14e839f0..b797942e 100644 --- a/skimage/transform/tests/test_geometric.py +++ b/skimage/transform/tests/test_geometric.py @@ -135,7 +135,6 @@ def test_union(): translation2 = (0, 0) tform2.from_params(scale2, rotation2, translation2) - tform = tform1.union(tform2) tform = tform1 + tform2 tform = tform1 * tform2