diff projective_transformation.py @ 3:be9a815e2240 draft

"planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/projective_transformation/ commit ee372547082b693ef1bbe10b5b7ea8660b9779df"
author imgteam
date Thu, 20 Jan 2022 17:14:55 +0000
parents 1ffdb07020ee
children 37b079c98c38
line wrap: on
line diff
--- 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__":