# HG changeset patch # User imgteam # Date 1700264097 0 # Node ID 37662cbf44b8e47d7762e4891db3e65380fb6f50 # Parent 22ff7c705a83bb4a997dc44b9a8b7bb9ff587201 planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/overlay_images/ commit 85185439087caafebf1c75dc78b61a2a1f181225 diff -r 22ff7c705a83 -r 37662cbf44b8 overlay_images.py --- a/overlay_images.py Wed Nov 08 19:57:15 2023 +0000 +++ b/overlay_images.py Fri Nov 17 23:34:57 2023 +0000 @@ -33,15 +33,17 @@ img = np.squeeze(img) assert img.ndim == 2 or (img.ndim == 3 and img.shape[-1] in (3, 4)) if str(img.dtype).startswith('float'): - img = np.round(img * 255).astype('uint8') - elif img.dtype == 'uint16': - img = img // 256 - elif img.dtype != 'uint8': + img = np.round(img * 255).astype(np.uint8) + elif img.dtype == np.uint16: + img = (img // 256).astype(np.uint8) + elif img.dtype != np.uint8: raise ValueError(f'unknown dtype: {img.dtype}') if img.ndim == 2: - return np.dstack([img] * 3).copy() + result = np.dstack([img] * 3).copy() else: - return img[:, :, :3].copy() + result = img[:, :, :3].copy() + assert result.dtype == np.uint8, result.dtype + return result def coloc_vis(in_red_fn, in_green_fn, out_fn): diff -r 22ff7c705a83 -r 37662cbf44b8 overlay_images.xml --- a/overlay_images.xml Wed Nov 08 19:57:15 2023 +0000 +++ b/overlay_images.xml Fri Nov 17 23:34:57 2023 +0000 @@ -1,5 +1,9 @@ - + + + 0.0.4 + 0 + operation_3443 @@ -81,7 +85,7 @@ - + @@ -89,8 +93,16 @@ - - + + + + + + + + + + @@ -99,9 +111,9 @@ - **What it does** - - This tool overlays two image to visualize 1) image blending, 2) colocalization, or 3) a segmentation mask over an image. + 10.1016/j.jbiotec.2017.07.019 diff -r 22ff7c705a83 -r 37662cbf44b8 test-data/sample1.tif Binary file test-data/sample1.tif has changed diff -r 22ff7c705a83 -r 37662cbf44b8 test-data/sample1_uint16.tif Binary file test-data/sample1_uint16.tif has changed diff -r 22ff7c705a83 -r 37662cbf44b8 test-data/sample1_uint8.tif Binary file test-data/sample1_uint8.tif has changed diff -r 22ff7c705a83 -r 37662cbf44b8 test-data/test4.png Binary file test-data/test4.png has changed