Repository 'projective_transformation'
hg clone https://toolshed.g2.bx.psu.edu/repos/imgteam/projective_transformation

Changeset 4:37b079c98c38 (2022-02-28)
Previous changeset 3:be9a815e2240 (2022-01-20) Next changeset 5:f5744f0e5a81 (2023-11-13)
Commit message:
"planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/projective_transformation/ commit ded1703bcd6e295b26201505edb58381991b265e"
modified:
projective_transformation.py
projective_transformation.xml
test-data/tmat.tsv
b
diff -r be9a815e2240 -r 37b079c98c38 projective_transformation.py
--- a/projective_transformation.py Thu Jan 20 17:14:55 2022 +0000
+++ b/projective_transformation.py Mon Feb 28 17:36:23 2022 +0000
[
@@ -47,7 +47,6 @@
 
 
 def transform(moving_fn, fixed_fn, warp_mat, output_fn):
-
     moving = skimage.io.imread(moving_fn)
     nDims = len(moving.shape)
     assert nDims in [2, 3, 4, 5, 6], 'this tool only supports up to 6 dimensions'
@@ -79,8 +78,8 @@
     warp_mat = np.array(warp_mat)
     assert warp_mat.shape[0] in [3], 'only 2D image transformaton is supported'
 
-    trans = ProjectiveTransform(matrix=warp_mat)
-    warped_coords = warp_coords_batch(trans, hw_fixed)
+    transI = ProjectiveTransform(matrix=np.linalg.inv(warp_mat))
+    warped_coords = warp_coords_batch(transI, hw_fixed)
 
     if isMulCh or isRGB:
         for i in range(nCh):
b
diff -r be9a815e2240 -r 37b079c98c38 projective_transformation.xml
--- a/projective_transformation.xml Thu Jan 20 17:14:55 2022 +0000
+++ b/projective_transformation.xml Mon Feb 28 17:36:23 2022 +0000
b
@@ -1,4 +1,4 @@
-<tool id="ip_projective_transformation" name="Projective Transformation" version="0.1.1" profile="20.05"> 
+<tool id="ip_projective_transformation" name="Projective Transformation" version="0.1.2" profile="20.05"> 
     <description>of 2D images</description>
     <requirements>
         <requirement type="package" version="0.18.1">scikit-image</requirement>
b
diff -r be9a815e2240 -r 37b079c98c38 test-data/tmat.tsv
--- a/test-data/tmat.tsv Thu Jan 20 17:14:55 2022 +0000
+++ b/test-data/tmat.tsv Mon Feb 28 17:36:23 2022 +0000
b
@@ -1,3 +1,3 @@
-0.9406756518941536 -0.2954926628589712 45.11224440565029
-0.3009254584199789 0.949530052611427 -32.079361599470666
+0.9473192798662091 0.2999824649666423 -31.90319646127108
+-0.28701210871295463 0.9448018442119746 43.47552520776674
 0.0 0.0 1.0