Mercurial > repos > imgteam > 2d_auto_threshold
annotate auto_threshold.py @ 10:2ee04d2ebdcf draft default tip
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
| author | imgteam |
|---|---|
| date | Sat, 03 Jan 2026 14:43:10 +0000 |
| parents | 50fa6150e340 |
| children |
| rev | line source |
|---|---|
|
3
0c777d708acc
"planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/2d_auto_threshold/ commit b1b3c63ab021aa77875c3b04127f6836024812f9"
imgteam
parents:
2
diff
changeset
|
1 """ |
|
10
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
2 Copyright 2017-2025 Biomedical Computer Vision Group, Heidelberg University. |
|
3
0c777d708acc
"planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/2d_auto_threshold/ commit b1b3c63ab021aa77875c3b04127f6836024812f9"
imgteam
parents:
2
diff
changeset
|
3 |
|
0c777d708acc
"planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/2d_auto_threshold/ commit b1b3c63ab021aa77875c3b04127f6836024812f9"
imgteam
parents:
2
diff
changeset
|
4 Distributed under the MIT license. |
|
0c777d708acc
"planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/2d_auto_threshold/ commit b1b3c63ab021aa77875c3b04127f6836024812f9"
imgteam
parents:
2
diff
changeset
|
5 See file LICENSE for detail or copy at https://opensource.org/licenses/MIT |
|
0c777d708acc
"planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/2d_auto_threshold/ commit b1b3c63ab021aa77875c3b04127f6836024812f9"
imgteam
parents:
2
diff
changeset
|
6 """ |
|
0c777d708acc
"planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/2d_auto_threshold/ commit b1b3c63ab021aa77875c3b04127f6836024812f9"
imgteam
parents:
2
diff
changeset
|
7 |
|
10
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
8 import giatools |
|
5
7db4fc31dbee
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 8b9f24cbfaf54f140705f0bf4b6732269bd401da
imgteam
parents:
3
diff
changeset
|
9 import numpy as np |
|
3
0c777d708acc
"planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/2d_auto_threshold/ commit b1b3c63ab021aa77875c3b04127f6836024812f9"
imgteam
parents:
2
diff
changeset
|
10 import skimage.filters |
|
0
d4da97f51700
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/2d_auto_threshold/ commit c3f4b766f03770f094fda6bda0a5882c0ebd4581
imgteam
parents:
diff
changeset
|
11 import skimage.util |
|
10
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
12 |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
13 # Fail early if an optional backend is not available |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
14 giatools.require_backend('omezarr') |
|
9
50fa6150e340
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 01343602708de3cc7fa4986af9000adc36dd0651
imgteam
parents:
8
diff
changeset
|
15 |
|
50fa6150e340
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 01343602708de3cc7fa4986af9000adc36dd0651
imgteam
parents:
8
diff
changeset
|
16 |
|
50fa6150e340
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 01343602708de3cc7fa4986af9000adc36dd0651
imgteam
parents:
8
diff
changeset
|
17 class DefaultThresholdingMethod: |
|
50fa6150e340
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 01343602708de3cc7fa4986af9000adc36dd0651
imgteam
parents:
8
diff
changeset
|
18 |
|
10
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
19 def __init__(self, thres, **kwargs): |
|
9
50fa6150e340
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 01343602708de3cc7fa4986af9000adc36dd0651
imgteam
parents:
8
diff
changeset
|
20 self.thres = thres |
|
50fa6150e340
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 01343602708de3cc7fa4986af9000adc36dd0651
imgteam
parents:
8
diff
changeset
|
21 self.kwargs = kwargs |
|
50fa6150e340
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 01343602708de3cc7fa4986af9000adc36dd0651
imgteam
parents:
8
diff
changeset
|
22 |
|
50fa6150e340
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 01343602708de3cc7fa4986af9000adc36dd0651
imgteam
parents:
8
diff
changeset
|
23 def __call__(self, image, *args, offset=0, **kwargs): |
|
10
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
24 thres = self.thres(image, *args, **(self.kwargs | kwargs)) |
|
9
50fa6150e340
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 01343602708de3cc7fa4986af9000adc36dd0651
imgteam
parents:
8
diff
changeset
|
25 return image > thres + offset |
|
50fa6150e340
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 01343602708de3cc7fa4986af9000adc36dd0651
imgteam
parents:
8
diff
changeset
|
26 |
|
10
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
27 def __str__(self): |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
28 return self.thres.__name__ |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
29 |
|
9
50fa6150e340
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 01343602708de3cc7fa4986af9000adc36dd0651
imgteam
parents:
8
diff
changeset
|
30 |
|
50fa6150e340
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 01343602708de3cc7fa4986af9000adc36dd0651
imgteam
parents:
8
diff
changeset
|
31 class ManualThresholding: |
|
50fa6150e340
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 01343602708de3cc7fa4986af9000adc36dd0651
imgteam
parents:
8
diff
changeset
|
32 |
|
10
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
33 def __call__(self, image, threshold1: float, threshold2: float | None, **kwargs): |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
34 if threshold2 is None: |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
35 return image > threshold1 |
|
9
50fa6150e340
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 01343602708de3cc7fa4986af9000adc36dd0651
imgteam
parents:
8
diff
changeset
|
36 else: |
|
10
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
37 threshold1, threshold2 = sorted((threshold1, threshold2)) |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
38 return skimage.filters.apply_hysteresis_threshold(image, threshold1, threshold2) |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
39 |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
40 def __str__(self): |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
41 return 'Manual' |
|
0
d4da97f51700
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/2d_auto_threshold/ commit c3f4b766f03770f094fda6bda0a5882c0ebd4581
imgteam
parents:
diff
changeset
|
42 |
|
8
699a5e9146b3
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit c86a1b93cb7732f7331a981d13465653cc1a2790
imgteam
parents:
7
diff
changeset
|
43 |
|
10
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
44 methods = { |
|
9
50fa6150e340
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 01343602708de3cc7fa4986af9000adc36dd0651
imgteam
parents:
8
diff
changeset
|
45 'manual': ManualThresholding(), |
|
3
0c777d708acc
"planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/2d_auto_threshold/ commit b1b3c63ab021aa77875c3b04127f6836024812f9"
imgteam
parents:
2
diff
changeset
|
46 |
|
9
50fa6150e340
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 01343602708de3cc7fa4986af9000adc36dd0651
imgteam
parents:
8
diff
changeset
|
47 'otsu': DefaultThresholdingMethod(skimage.filters.threshold_otsu), |
|
50fa6150e340
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 01343602708de3cc7fa4986af9000adc36dd0651
imgteam
parents:
8
diff
changeset
|
48 'li': DefaultThresholdingMethod(skimage.filters.threshold_li), |
|
50fa6150e340
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 01343602708de3cc7fa4986af9000adc36dd0651
imgteam
parents:
8
diff
changeset
|
49 'yen': DefaultThresholdingMethod(skimage.filters.threshold_yen), |
|
50fa6150e340
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 01343602708de3cc7fa4986af9000adc36dd0651
imgteam
parents:
8
diff
changeset
|
50 'isodata': DefaultThresholdingMethod(skimage.filters.threshold_isodata), |
|
5
7db4fc31dbee
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 8b9f24cbfaf54f140705f0bf4b6732269bd401da
imgteam
parents:
3
diff
changeset
|
51 |
|
10
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
52 'loc_gaussian': DefaultThresholdingMethod(skimage.filters.threshold_local, method='gaussian'), |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
53 'loc_median': DefaultThresholdingMethod(skimage.filters.threshold_local, method='median'), |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
54 'loc_mean': DefaultThresholdingMethod(skimage.filters.threshold_local, method='mean'), |
|
0
d4da97f51700
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/2d_auto_threshold/ commit c3f4b766f03770f094fda6bda0a5882c0ebd4581
imgteam
parents:
diff
changeset
|
55 } |
|
d4da97f51700
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/2d_auto_threshold/ commit c3f4b766f03770f094fda6bda0a5882c0ebd4581
imgteam
parents:
diff
changeset
|
56 |
|
3
0c777d708acc
"planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/2d_auto_threshold/ commit b1b3c63ab021aa77875c3b04127f6836024812f9"
imgteam
parents:
2
diff
changeset
|
57 |
|
10
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
58 if __name__ == "__main__": |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
59 tool = giatools.ToolBaseplate() |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
60 tool.add_input_image('input') |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
61 tool.add_output_image('output') |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
62 tool.parse_args() |
|
9
50fa6150e340
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 01343602708de3cc7fa4986af9000adc36dd0651
imgteam
parents:
8
diff
changeset
|
63 |
|
10
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
64 # Retrieve general parameters |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
65 method = tool.args.params.pop('method') |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
66 invert = tool.args.params.pop('invert') |
|
7
e5c8e7e72373
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit c045f067a57e8308308cf6329060c7ccd3fc372f
imgteam
parents:
6
diff
changeset
|
67 |
|
9
50fa6150e340
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 01343602708de3cc7fa4986af9000adc36dd0651
imgteam
parents:
8
diff
changeset
|
68 # Perform thresholding |
|
10
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
69 method_impl = methods[method] |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
70 print( |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
71 'Thresholding:', |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
72 str(method_impl), |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
73 'with', |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
74 ', '.join( |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
75 f'{key}={repr(value)}' for key, value in (tool.args.params | dict(invert=invert)).items() |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
76 ), |
|
9
50fa6150e340
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 01343602708de3cc7fa4986af9000adc36dd0651
imgteam
parents:
8
diff
changeset
|
77 ) |
|
10
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
78 for section in tool.run('ZYX', output_dtype_hint='binary'): |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
79 section_output = method_impl( |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
80 image=np.asarray(section['input'].data), # some implementations have issues with Dask arrays |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
81 **tool.args.params, |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
82 ) |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
83 if invert: |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
84 section_output = np.logical_not(section_output) |
|
2ee04d2ebdcf
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_auto_threshold/ commit 71f7ecabba78de48147d4a5e6ea380b6b70b16e8
imgteam
parents:
9
diff
changeset
|
85 section['output'] = section_output |
