# HG changeset patch # User imgteam # Date 1646069783 0 # Node ID 37b079c98c383087fa5905232963d28452d9e102 # Parent be9a815e22401471ebca8a532949401100ee425c "planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/projective_transformation/ commit ded1703bcd6e295b26201505edb58381991b265e" 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): 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 @@ -1,4 +1,4 @@ - + of 2D images scikit-image 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 @@ -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