Skip to content

Commit fea85b8

Browse files
committed
simpler transforms; 3d image test is bad so far
1 parent 0a7a2a3 commit fea85b8

File tree

2 files changed

+67
-22
lines changed

2 files changed

+67
-22
lines changed

coorx/image.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
import scipy
4444

4545
from .coordinates import Point, PointArray
46-
from .linear import AffineTransform
46+
from .linear import AffineTransform, TTransform, STTransform
4747
from .systems import CoordinateSystemGraph, CoordinateSystem
4848

4949

@@ -157,13 +157,13 @@ def zoom(self, factors, **kwds):
157157
scaled_img = scipy.ndimage.zoom(self.image, actual, **kwds)
158158

159159
img2 = self.copy(image=scaled_img)
160-
tr = AffineTransform(
160+
tr = STTransform(
161161
dims=(self.ndim, self.ndim),
162162
from_cs=self.system,
163163
to_cs=img2.system,
164164
cs_graph=self.graph,
165165
)
166-
tr.scale(factors)
166+
tr.scale = factors
167167
img2._parent_tr = tr
168168
return img2
169169

@@ -193,6 +193,6 @@ def make_rotation_transform(self, angle, axes, from_shape, to_shape, **kwds):
193193
return tr
194194

195195
def make_crop_transform(self, crop, img, **kwds):
196-
tr = AffineTransform(dims=(self.ndim, self.ndim), cs_graph=self.graph, **kwds)
196+
tr = TTransform(dims=(self.ndim, self.ndim), cs_graph=self.graph, **kwds)
197197
tr.translate([-crop[i].indices(img.shape[i])[0] for i in range(self.ndim)])
198198
return tr

coorx/tests/test_image.ipynb

Lines changed: 63 additions & 18 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)