diff repeat_channels.py @ 0:7cdb50fee601 draft default tip

planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/repeat_channels/ commit 60cf803236ef94f414056823688e6fd008b7a1b6
author imgteam
date Thu, 25 Apr 2024 10:57:53 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/repeat_channels.py	Thu Apr 25 10:57:53 2024 +0000
@@ -0,0 +1,19 @@
+import argparse
+
+import giatools.io
+import numpy as np
+import skimage.io
+
+
+if __name__ == '__main__':
+
+    parser = argparse.ArgumentParser()
+    parser.add_argument('input', type=str)
+    parser.add_argument('count', type=int)
+    parser.add_argument('output', type=str)
+    args = parser.parse_args()
+
+    im = giatools.io.imread(args.input)
+    im = np.squeeze(im)
+    im = np.dstack([im] * args.count)
+    skimage.io.imsave(args.output, im)