# HG changeset patch # User imgteam # Date 1765985657 0 # Node ID ce64e2e4afd2c43a50e03ae93153e2db8e132494 # Parent 21168547d5724adcc1f7dd7971cfeece882e5ea8 planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/permutate_axis/ commit 4afe0015d92913952714d0695b0fb46ea004171f diff -r 21168547d572 -r ce64e2e4afd2 permutate_axis.py --- a/permutate_axis.py Wed Dec 18 09:58:57 2019 +0000 +++ b/permutate_axis.py Wed Dec 17 15:34:17 2025 +0000 @@ -1,32 +1,34 @@ import argparse -import sys import warnings + import numpy as np import skimage.io -import skimage.util +import skimage.util + def permutate_axis(input_image_path, output_image_path, axis, permutate): images = [] raw_image = skimage.io.imread(input_image_path, plugin='tifffile') for i in permutate: - # TODO generalise + # TODO generalise if axis == 0: a_slice = raw_image[i] elif axis == 1: - a_slice = raw_image[:,i] + a_slice = raw_image[:, i] elif axis == 2: - a_slice = raw_image[:,:,i] + a_slice = raw_image[:, :, i] elif axis == 3: - a_slice = raw_image[:,:,:,i] + a_slice = raw_image[:, :, :, i] elif axis == 4: - a_slice = raw_image[:,:,:,:,i] + a_slice = raw_image[:, :, :, :, i] images.append(np.expand_dims(a_slice, axis)) res = np.concatenate(images, axis) with warnings.catch_warnings(): - warnings.simplefilter("ignore") - res = skimage.util.img_as_uint(res) #Attention: precision loss - skimage.io.imsave(output_image_path, res, plugin='tifffile') + warnings.simplefilter("ignore") + res = skimage.util.img_as_uint(res) # Attention: precision loss + skimage.io.imsave(output_image_path, res, plugin='tifffile') + if __name__ == "__main__": parser = argparse.ArgumentParser() diff -r 21168547d572 -r ce64e2e4afd2 permutate_axis.xml --- a/permutate_axis.xml Wed Dec 18 09:58:57 2019 +0000 +++ b/permutate_axis.xml Wed Dec 17 15:34:17 2025 +0000 @@ -1,5 +1,11 @@ - - along an axis + + + + operation_3443 + + + galaxy_image_analysis + scikit-image numpy @@ -9,7 +15,7 @@ - + @@ -22,8 +28,8 @@ - - + + @@ -32,6 +38,6 @@ Permutates the image along a specified axis. - 10.1016/j.jbiotec.2017.07.019 + 10.1016/j.jbiotec.2017.07.019 diff -r 21168547d572 -r ce64e2e4afd2 test-data/galaxyIcon_noText.tif Binary file test-data/galaxyIcon_noText.tif has changed diff -r 21168547d572 -r ce64e2e4afd2 test-data/galaxyIcon_noText.tiff Binary file test-data/galaxyIcon_noText.tiff has changed diff -r 21168547d572 -r ce64e2e4afd2 test-data/res.tif Binary file test-data/res.tif has changed diff -r 21168547d572 -r ce64e2e4afd2 test-data/res.tiff Binary file test-data/res.tiff has changed