annotate colorize_labels.py @ 0:6f09b367cd9a draft default tip

planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
author imgteam
date Tue, 24 Sep 2024 17:30:11 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
1 import argparse
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
2
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
3 import giatools.io
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
4 import matplotlib.pyplot as plt
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
5 import networkx as nx
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
6 import numpy as np
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
7 import scipy.ndimage as ndi
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
8 import skimage.io
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
9 import skimage.util
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
10
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
11
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
12 def color_hex_to_rgb_tuple(hex):
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
13 if hex.startswith('#'):
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
14 hex = hex[1:]
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
15 return (
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
16 int(hex[0:2], 16),
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
17 int(hex[2:4], 16),
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
18 int(hex[4:6], 16),
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
19 )
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
20
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
21
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
22 def build_label_adjacency_graph(im, radius, bg_label):
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
23 G = nx.Graph()
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
24 for label in np.unique(im):
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
25
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
26 if label == bg_label:
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
27 continue
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
28
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
29 G.add_node(label)
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
30
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
31 cc = (im == label)
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
32 neighborhood = (ndi.distance_transform_edt(~cc) <= radius)
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
33 adjacent_labels = np.unique(im[neighborhood])
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
34
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
35 for adjacent_label in adjacent_labels:
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
36
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
37 if adjacent_label == bg_label or adjacent_label <= label:
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
38 continue
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
39
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
40 G.add_edge(label, adjacent_label)
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
41 G.add_edge(adjacent_label, label)
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
42
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
43 return G
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
44
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
45
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
46 def get_n_unique_mpl_colors(n, colormap='jet', cyclic=False):
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
47 """
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
48 Yields `n` unique colors from the given `colormap`.
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
49
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
50 Set `cyclic` to `True` if the `colormap` is cyclic.
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
51 """
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
52 cmap = plt.get_cmap(colormap)
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
53 m = n if cyclic else n - 1
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
54 for i in range(n):
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
55 yield np.multiply(255, cmap(i / m))
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
56
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
57
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
58 if __name__ == '__main__':
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
59
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
60 parser = argparse.ArgumentParser()
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
61 parser.add_argument('input', type=str)
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
62 parser.add_argument('--bg_label', type=int)
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
63 parser.add_argument('--bg_color', type=str)
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
64 parser.add_argument('--radius', type=int)
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
65 parser.add_argument('--output', type=str)
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
66 args = parser.parse_args()
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
67
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
68 # Load image and normalize
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
69 im = giatools.io.imread(args.input)
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
70 im = np.squeeze(im)
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
71 assert im.ndim == 2
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
72
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
73 # Build adjacency graph of the labels
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
74 G = build_label_adjacency_graph(im, args.radius, args.bg_label)
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
75
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
76 # Apply greedy coloring
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
77 graph_coloring = nx.greedy_color(G)
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
78 unique_colors = frozenset(graph_coloring.values())
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
79
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
80 # Assign colors to nodes based on the greedy coloring
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
81 graph_color_to_mpl_color = dict(zip(unique_colors, get_n_unique_mpl_colors(len(unique_colors))))
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
82 node_colors = [graph_color_to_mpl_color[graph_coloring[n]] for n in G.nodes()]
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
83
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
84 # Render result
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
85 bg_color_rgb = color_hex_to_rgb_tuple(args.bg_color)
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
86 result = np.dstack([np.full(im.shape, bg_color_rgb[ch], np.uint8) for ch in range(3)])
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
87 for label, label_color in zip(G.nodes(), node_colors):
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
88
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
89 cc = (im == label)
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
90 for ch in range(3):
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
91 result[:, :, ch][cc] = label_color[ch]
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
92
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
93 # Write result image
6f09b367cd9a planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/colorize_labels commit 4344f548f365dba87c20188d6e3c2df8630d2313
imgteam
parents:
diff changeset
94 skimage.io.imsave(args.output, result)