Mercurial > repos > imgteam > projective_transformation
diff projective_transformation.py @ 4:07108b674c90 draft default tip
"planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/projective_transformation/ commit ded1703bcd6e295b26201505edb58381991b265e"
| author | imgteam |
|---|---|
| date | Mon, 28 Feb 2022 17:35:21 +0000 |
| parents | f1ef9c8f188a |
| children |
line wrap: on
line diff
--- a/projective_transformation.py Thu Jan 20 17:14:10 2022 +0000 +++ b/projective_transformation.py Mon Feb 28 17:35:21 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):
