Skip to content

Commit 85f2ab0

Browse files
committed
Admin clone/transform too: fix transform-in-project-space setting
1 parent c748e4d commit 85f2ab0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

django/applications/catmaid/control/importer.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,13 +1761,13 @@ def transform_single_location(self, location, clamped_locations):
17611761

17621762
xyz_shift = self.transform[z_index]
17631763
if self.transform_in_project_space:
1764-
location.location_x += xyz_shift[0] * self.reference_stack.resolution.x
1765-
location.location_y += xyz_shift[1] * self.reference_stack.resolution.y
1766-
location.location_z += xyz_shift[2] * self.reference_stack.resolution.z
1767-
else:
17681764
location.location_x += xyz_shift[0]
17691765
location.location_y += xyz_shift[1]
17701766
location.location_z += xyz_shift[2]
1767+
else:
1768+
location.location_x += xyz_shift[0] * self.reference_stack.resolution.x
1769+
location.location_y += xyz_shift[1] * self.reference_stack.resolution.y
1770+
location.location_z += xyz_shift[2] * self.reference_stack.resolution.z
17711771

17721772
return location
17731773

@@ -1799,13 +1799,13 @@ def transform_volume(self, volume, clamped_locations):
17991799

18001800
xyz_shift = self.transform[z_index]
18011801
if self.transform_in_project_space:
1802-
c[0] += xyz_shift[0] * self.reference_stack.resolution.x
1803-
c[1] += xyz_shift[1] * self.reference_stack.resolution.y
1804-
c[2] += xyz_shift[2] * self.reference_stack.resolution.z
1805-
else:
18061802
c[0] += xyz_shift[0]
18071803
c[1] += xyz_shift[1]
18081804
c[2] += xyz_shift[2]
1805+
else:
1806+
c[0] += xyz_shift[0] * self.reference_stack.resolution.x
1807+
c[1] += xyz_shift[1] * self.reference_stack.resolution.y
1808+
c[2] += xyz_shift[2] * self.reference_stack.resolution.z
18091809

18101810
# Convert array to TIN WKT again
18111811
wkt_data = 'TIN Z (' + ','.join(map(lambda t: '((' + ','.join(list(map(lambda c: ' '.join(list(map(str, c))), t))) + '))', triangles)) + ')'

0 commit comments

Comments
 (0)