Mercurial > repos > bgruening > cp_mask_image
comparison mask_image.xml @ 3:ca1421f7e3ed draft
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
author | bgruening |
---|---|
date | Mon, 11 May 2020 07:57:09 -0400 |
parents | baa3e6d4d99d |
children | b178453ea8d1 |
comparison
equal
deleted
inserted
replaced
2:baa3e6d4d99d | 3:ca1421f7e3ed |
---|---|
4 <macros> | 4 <macros> |
5 <import>macros.xml</import> | 5 <import>macros.xml</import> |
6 </macros> | 6 </macros> |
7 | 7 |
8 <expand macro="py_requirements"/> | 8 <expand macro="py_requirements"/> |
9 <expand macro="cmd_modules" /> | 9 <expand macro="cmd_modules" /> |
10 | 10 |
11 <configfiles> | 11 <configfiles> |
12 <inputs name="inputs"/> | 12 <inputs name="inputs"/> |
13 <configfile name="script_file"> | 13 <configfile name="script_file"> |
14 import json | 14 import json |
50 | 50 |
51 module_count = int(v) | 51 module_count = int(v) |
52 new_count = module_count + 1 | 52 new_count = module_count + 1 |
53 lines[4] = k + ":%d\n" % new_count | 53 lines[4] = k + ":%d\n" % new_count |
54 | 54 |
55 with open("output", "w") as f: | 55 with open("output.cppipe", "w") as f: |
56 f.writelines(lines) | 56 f.writelines(lines) |
57 f.write(writemi()) | 57 f.write(writemi()) |
58 | 58 |
59 f.close() | 59 f.close() |
60 </configfile> | 60 </configfile> |
61 </configfiles> | 61 </configfiles> |
62 | 62 |
63 <inputs> | 63 <inputs> |
64 | 64 |
65 <expand macro="input_pipeline_macro" /> | 65 <expand macro="input_pipeline_param" /> |
66 <param name="input_image" label="Select input image" type="text"> | 66 <param name="input_image" label="Enter the name of the input image" type="text"> |
67 <expand macro="text_validator" /> | 67 <expand macro="text_validator" /> |
68 </param> | 68 </param> |
69 | 69 |
70 <param name="name_output_image" type="text" label="Name the output image"> | 70 <param name="name_output_image" type="text" label="Enter the name of the resulting image"> |
71 <expand macro="text_validator" /> | 71 <expand macro="text_validator" /> |
72 </param> | 72 </param> |
73 | 73 |
74 <conditional name="con_img_obj"> | 74 <conditional name="con_img_obj"> |
75 <param name="img_obj" label="Use objects or an image as a mask?" type="select"> | 75 <param name="img_obj" label="Use objects or an image as a mask?" type="select"> |
76 <help> | |
77 <![CDATA[ | |
78 You can mask an image in two ways: | |
79 <br> - Objects: Using objects created by another module (for instance IdentifyPrimaryObjects). | |
80 The module will mask out all parts of the image that are not within one of the objects (unless you invert the mask). | |
81 <br> - Image: Using a binary image as the mask, where black portions of the image (false or zero-value pixels) will be masked out. | |
82 If the image is not binary, the module will use all pixels whose intensity is greater than 0.5 as the mask’s foreground (white area). | |
83 You can use Threshold instead to create a binary image with finer control over the intensity choice. | |
84 ]]> | |
85 </help> | |
76 <option value="Objects">Objects</option> | 86 <option value="Objects">Objects</option> |
77 <option value="Image">Image</option> | 87 <option value="Image">Image</option> |
78 </param> | 88 </param> |
79 <when value="Objects"> | 89 <when value="Objects"> |
80 <param name="select_obj" label="Select object for mask" type="text"/> | 90 <param name="select_obj" label="Enter the name objects to mask the input image" type="text"/> |
81 </when> | 91 </when> |
82 <when value="Image"> | 92 <when value="Image"> |
83 <param name="select_img" label="Select image for mask" type="text"/> | 93 <param name="select_img" label="Select image for mask" type="text"/> |
84 </when> | 94 </when> |
85 </conditional> | 95 </conditional> |
86 <param name="invert_mask" label="Invert the mask?" type="select" display="radio"> | 96 <param name="invert_mask" label="Invert the mask?" type="select" display="radio"> |
97 <help> | |
98 <![CDATA[ | |
99 This option reverses the foreground/background relationship of the mask. | |
100 <br> - Select "No" to produce the mask from the foreground (white portion) of the masking image or the area within the masking objects. | |
101 <br> - Select "Yes" to instead produce the mask from the background (black portions) of the masking image or the area outside the masking objects. | |
102 ]]> | |
103 </help> | |
87 <option value="Yes">Yes</option> | 104 <option value="Yes">Yes</option> |
88 <option value="No">No</option> | 105 <option value="No">No</option> |
89 </param> | 106 </param> |
90 </inputs> | 107 </inputs> |
91 | 108 |
92 <outputs> | 109 <outputs> |
93 <expand macro="output_pipeline_macro" /> | 110 <expand macro="output_pipeline_param" /> |
94 </outputs> | 111 </outputs> |
95 | 112 |
96 <tests> | 113 <tests> |
97 <test> | 114 <test> |
98 <expand macro="test_input_pipeline_param"/> | 115 <expand macro="test_input_pipeline_param"/> |
101 <conditional name="con_img_obj"> | 118 <conditional name="con_img_obj"> |
102 <param name="img_obj" value="Objects" /> | 119 <param name="img_obj" value="Objects" /> |
103 <param name="select_obj" value="Nuclei" /> | 120 <param name="select_obj" value="Nuclei" /> |
104 </conditional> | 121 </conditional> |
105 <param name="invert_mask" value="No" /> | 122 <param name="invert_mask" value="No" /> |
106 <expand macro="test_out_file" file="mask_image.txt" /> | 123 <expand macro="test_out_file" file="mask_image.cppipe" /> |
107 </test> | 124 </test> |
108 </tests> | 125 </tests> |
109 | 126 |
110 <expand macro="help" module="GrayToColor" /> | 127 <help> |
128 <![CDATA[ | |
129 .. class:: infomark | |
130 | |
131 **What it does** | |
132 | |
133 This tool masks an image so you can use the mask downstream in the pipeline. | |
134 The masked image is based on the original image and the masking object or image that is selected. | |
135 If using a masking image, the mask is composed of the foreground (white portions); | |
136 if using a masking object, the mask is composed of the area within the object. | |
137 Note that the image created by this tool for further processing downstream is grayscale. | |
138 If a binary mask is desired in subsequent tools, use the Threshold tool instead of MaskImage. | |
139 | |
140 @COMMON_HELP@ | |
141 ]]> | |
142 </help> | |
143 | |
111 <expand macro="citations" /> | 144 <expand macro="citations" /> |
112 | 145 |
113 </tool> | 146 </tool> |