comparison convert_objects_to_image.xml @ 3:2690da374874 draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
author bgruening
date Mon, 11 May 2020 07:44:29 -0400
parents 1221c018f7be
children cdf8e3c57dae
comparison
equal deleted inserted replaced
2:1221c018f7be 3:2690da374874
2 <description>convert the identified objects into an image</description> 2 <description>convert the identified objects into an image</description>
3 <macros> 3 <macros>
4 <import>macros.xml</import> 4 <import>macros.xml</import>
5 </macros> 5 </macros>
6 <expand macro="py_requirements"/> 6 <expand macro="py_requirements"/>
7 <expand macro="cmd_modules" /> 7 <expand macro="cmd_modules" />
8 <configfiles> 8 <configfiles>
9 <inputs name="inputs" /> 9 <inputs name="inputs" />
10 <configfile name="script_file"> 10 <configfile name="script_file">
11 import json 11 import json
12 import sys 12 import sys
43 k, v = lines[4].strip().split(':') 43 k, v = lines[4].strip().split(':')
44 44
45 module_count = int(v) 45 module_count = int(v)
46 new_count = module_count + 1 46 new_count = module_count + 1
47 lines[4] = k + ":%d\n" % new_count 47 lines[4] = k + ":%d\n" % new_count
48 with open("output", "w") as f: 48 with open("output.cppipe", "w") as f:
49 f.writelines(lines) 49 f.writelines(lines)
50 f.write(writecoti()) 50 f.write(writecoti())
51 51
52 f.close() 52 f.close()
53 </configfile> 53 </configfile>
54 </configfiles> 54 </configfiles>
55 55
56 <inputs> 56 <inputs>
57 <expand macro="input_pipeline_macro" /> 57 <expand macro="input_pipeline_param" />
58 <param name="input_object" type="text" label="Select the input objects" /> 58 <param name="input_object" type="text" label="Enter the name of the input objects you want to convert to an image" />
59 <param name="name_output_image" type="text" label="Name the output image"> 59 <param name="name_output_image" type="text" label="Enter the name of the resulting image">
60 <expand macro="text_validator" /> 60 <expand macro="text_validator" />
61 </param> 61 </param>
62 62
63 <conditional name="con_color_format"> 63 <conditional name="con_color_format">
64 <param name="color_format" type="select" label="Select the color format"> 64 <param name="color_format" type="select" label="Select the color format">
65 <option value="Color">Color</option> 65 <option value="Color">Color</option>
66 <option value="Binary (black &amp; white)">Binary (black &amp; white)</option> 66 <option value="Binary (black &amp; white)">Binary (black &amp; white)</option>
70 </param> 70 </param>
71 <when value="Binary (black &amp; white)" /> 71 <when value="Binary (black &amp; white)" />
72 <when value="Grayscale" /> 72 <when value="Grayscale" />
73 <when value="unit16" /> 73 <when value="unit16" />
74 <when value="Color"> 74 <when value="Color">
75 <param name="color_map" type="select" label="Select the colormap"> 75 <param name="color_map" type="select" label="Select the colormap" help="The colormap affects how the objects are colored." >
76 <option value="Default">Default</option> 76 <option value="Default">Default</option>
77 <option value="Accent">Accent</option> 77 <option value="Accent">Accent</option>
78 <option value="Blues">Blues</option> 78 <option value="Blues">Blues</option>
79 <option value="BrBG">BrBG</option> 79 <option value="BrBG">BrBG</option>
80 <option value="BuGn">BuGn</option> 80 <option value="BuGn">BuGn</option>
136 </when> 136 </when>
137 </conditional> 137 </conditional>
138 </inputs> 138 </inputs>
139 139
140 <outputs> 140 <outputs>
141 <expand macro="output_pipeline_macro" /> 141 <expand macro="output_pipeline_param" />
142 </outputs> 142 </outputs>
143 143
144 <tests> 144 <tests>
145 <test> 145 <test>
146 <expand macro="test_input_pipeline_param" /> 146 <expand macro="test_input_pipeline_param" />
147 <param name="input_object" value="Nuclei" /> 147 <param name="input_object" value="Nuclei" />
148 <param name="name_output_image" value="MaskNuclei" /> 148 <param name="name_output_image" value="MaskNuclei" />
149 <conditional name="con_color_format"> 149 <conditional name="con_color_format">
150 <param name="color_format" value="Binary (black &amp; white)" /> 150 <param name="color_format" value="Binary (black &amp; white)" />
151 </conditional> 151 </conditional>
152 <expand macro="test_out_file" file="convert_objects_to_image.txt" /> 152 <expand macro="test_out_file" file="convert_objects_to_image.cppipe" />
153 </test> 153 </test>
154 </tests> 154 </tests>
155 <expand macro="help" module="ConvertObjectsToImage" /> 155
156 <help>
157 <![CDATA[
158 .. class:: infomark
159
160 **What it does**
161
162 This module allows you to take previously identified objects and convert them into an image according to a colormap you select, which can then be saved with the *SaveImages* module.
163
164 For the *colormap*, you have the following options:
165
166 - *Color*: Allows you to choose a colormap that will produce jumbled colors for your objects.
167
168 - *Binary (black & white)*: All object pixels will be assigned 1 and all background pixels will be assigned 0, creating a binary image.
169
170 - *Grayscale*: Assigns all background pixels to 0 and each object a different number from 1 to 255 (the maximum value that you can put in an 8-bit integer) and numbers all pixels in each object with the object’s number. This creates an image where objects in the top left corner of the image are very dark and where the colors progress to white toward the bottom right corner of the image.
171
172 - *uint16*: Assigns all background pixels to 0 and each object a different number from 1 to 65535 (the maximum value that you can put in a 16-bit integer) and numbers all pixels in each object with the object’s number. This creates an image where objects in the top left corner of the image are very dark and where the colors progress to white toward the bottom right corner of the image (though this can usually only be seen in a scientific image viewer since standard image viewers only handle 8-bit images).
173
174 You can choose Color with a Gray colormap to produce jumbled gray objects.
175
176 @COMMON_HELP@
177 ]]>
178 </help>
156 <expand macro="citations" /> 179 <expand macro="citations" />
157 </tool> 180 </tool>