# HG changeset patch # User imgteam # Date 1642698895 0 # Node ID be9a815e22401471ebca8a532949401100ee425c # Parent 1ffdb07020ee2af2ecfa66c1b35dba7c6bb1e0c8 "planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/projective_transformation/ commit ee372547082b693ef1bbe10b5b7ea8660b9779df" diff -r 1ffdb07020ee -r be9a815e2240 projective_transformation.py --- a/projective_transformation.py Fri Jan 14 03:07:08 2022 +0000 +++ b/projective_transformation.py Thu Jan 20 17:14:55 2022 +0000 @@ -7,7 +7,6 @@ """ import argparse -import imghdr import warnings import numpy as np @@ -50,7 +49,6 @@ def transform(moving_fn, fixed_fn, warp_mat, output_fn): moving = skimage.io.imread(moving_fn) - extension = imghdr.what(moving_fn) nDims = len(moving.shape) assert nDims in [2, 3, 4, 5, 6], 'this tool only supports up to 6 dimensions' @@ -96,9 +94,9 @@ with warnings.catch_warnings(): warnings.simplefilter("ignore") if isMulCh: - tifffile.imwrite(output_fn + '.tif', warped_moving, imagej=True, metadata={'mode': 'composite'}) + tifffile.imwrite(output_fn, warped_moving, imagej=True, metadata={'mode': 'composite'}) else: - skimage.io.imsave(output_fn + '.' + extension, warped_moving) + skimage.io.imsave(output_fn, warped_moving) if __name__ == "__main__": diff -r 1ffdb07020ee -r be9a815e2240 projective_transformation.xml --- a/projective_transformation.xml Fri Jan 14 03:07:08 2022 +0000 +++ b/projective_transformation.xml Thu Jan 20 17:14:55 2022 +0000 @@ -1,5 +1,5 @@ - - 2D Projective Transformation + + of 2D images scikit-image pandas @@ -9,31 +9,46 @@ - - - + + + - + - - - - - + + + + + + + + + + + + + + + + + - **What it does** + +**What it does** This tool performs a projective transformation of the moving image so that it fits the fixed image. Multi-channel and RGB images are supported. diff -r 1ffdb07020ee -r be9a815e2240 test-data/fixed.png Binary file test-data/fixed.png has changed diff -r 1ffdb07020ee -r be9a815e2240 test-data/fixed_rgb.png Binary file test-data/fixed_rgb.png has changed diff -r 1ffdb07020ee -r be9a815e2240 test-data/moving.png Binary file test-data/moving.png has changed diff -r 1ffdb07020ee -r be9a815e2240 test-data/moving_rgb.png Binary file test-data/moving_rgb.png has changed diff -r 1ffdb07020ee -r be9a815e2240 test-data/moving_rgb_warped.png Binary file test-data/moving_rgb_warped.png has changed diff -r 1ffdb07020ee -r be9a815e2240 test-data/moving_warped.png Binary file test-data/moving_warped.png has changed diff -r 1ffdb07020ee -r be9a815e2240 test-data/multi_f.tif Binary file test-data/multi_f.tif has changed diff -r 1ffdb07020ee -r be9a815e2240 test-data/multi_m.tif Binary file test-data/multi_m.tif has changed diff -r 1ffdb07020ee -r be9a815e2240 test-data/multi_m_warped.tif Binary file test-data/multi_m_warped.tif has changed diff -r 1ffdb07020ee -r be9a815e2240 test-data/sample1.png Binary file test-data/sample1.png has changed diff -r 1ffdb07020ee -r be9a815e2240 test-data/sample2.png Binary file test-data/sample2.png has changed diff -r 1ffdb07020ee -r be9a815e2240 test-data/tmat.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/tmat.tsv Thu Jan 20 17:14:55 2022 +0000 @@ -0,0 +1,3 @@ +0.9406756518941536 -0.2954926628589712 45.11224440565029 +0.3009254584199789 0.949530052611427 -32.079361599470666 +0.0 0.0 1.0 diff -r 1ffdb07020ee -r be9a815e2240 test-data/warp_matrix.tsv --- a/test-data/warp_matrix.tsv Fri Jan 14 03:07:08 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -1 0 10 -0 1 20 -0 0 1 diff -r 1ffdb07020ee -r be9a815e2240 test-data/yam.png Binary file test-data/yam.png has changed