comparison measure_image_area_occupied.xml @ 3:7a08edbc790e draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
author bgruening
date Mon, 11 May 2020 07:56:06 -0400
parents 534ed7b8ca34
children 91e03287f285
comparison
equal deleted inserted replaced
2:534ed7b8ca34 3:7a08edbc790e
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
15 import sys 15 import sys
16 import os 16 import os
17 17
18 FOURSPACES=@SPACES@ 18 FOURSPACES=@SPACES@
38 _str += FOURSPACES + "Select objects to measure:%s\n" % area['con_area']['objects_to_measure'] 38 _str += FOURSPACES + "Select objects to measure:%s\n" % area['con_area']['objects_to_measure']
39 _str += FOURSPACES + "Select a binary image to measure:None\n" 39 _str += FOURSPACES + "Select a binary image to measure:None\n"
40 else: 40 else:
41 _str += FOURSPACES + "Select objects to measure:None\n" 41 _str += FOURSPACES + "Select objects to measure:None\n"
42 _str += FOURSPACES + "Select a binary image to measure:%s\n" % area['con_area']['image_to_measure'] 42 _str += FOURSPACES + "Select a binary image to measure:%s\n" % area['con_area']['image_to_measure']
43 43
44 return _str 44 return _str
45 45
46 46
47 with open(input_pipeline) as fin: 47 with open(input_pipeline) as fin:
48 lines = fin.readlines() 48 lines = fin.readlines()
50 k, v = lines[4].strip().split(':') 50 k, v = lines[4].strip().split(':')
51 51
52 module_count = int(v) 52 module_count = int(v)
53 new_count = module_count + 1 53 new_count = module_count + 1
54 lines[4] = k + ":%d\n" % new_count 54 lines[4] = k + ":%d\n" % new_count
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(writemiao()) 57 f.write(writemiao())
58 58
59 f.close() 59 f.close()
60 </configfile> 60 </configfile>
61 </configfiles> 61 </configfiles>
62 62
63 <inputs> 63 <inputs>
64 <expand macro="input_pipeline_macro" /> 64 <expand macro="input_pipeline_param" />
65 <repeat name="rpt_area" title="Add another area"> 65 <repeat name="rpt_area" title="new area" min="1">
66 <conditional name="con_area"> 66 <conditional name="con_area">
67 <param name="objects_or_image" label="Measure the area occupied in a binary image, or in objects?" type="select"> 67 <param name="objects_or_image" label="Measure the area occupied in a binary image, or in objects?" type="select">
68 <help>
69 <![CDATA[
70 The area can be measured in two ways:
71 <br> - Binary Image: The area occupied by the foreground in a binary (black and white) image.
72 <br> - Objects: The area occupied by previously-identified objects.
73 ]]>
74 </help>
68 <option value="Binary image">Binary image</option> 75 <option value="Binary image">Binary image</option>
69 <option value="Objects">Objects</option> 76 <option value="Objects">Objects</option>
70 </param> 77 </param>
71 <when value="Objects"> 78 <when value="Objects">
72 <param name="objects_to_measure" label="Select objects to measure" type="text"> 79 <param name="objects_to_measure" label="Enter the name of the objects to measure" type="text">
73 <expand macro="text_validator" /> 80 <expand macro="text_validator" />
74 </param> 81 </param>
75 </when> 82 </when>
76 <when value="Binary image"> 83 <when value="Binary image">
77 <param name="image_to_measure" label="Select a binary image to measure" type="text"> 84 <param name="image_to_measure" label="Enter the name of a binary image to measure" type="text">
78 <expand macro="text_validator" /> 85 <expand macro="text_validator" />
79 </param> 86 </param>
80 </when> 87 </when>
81 </conditional> 88 </conditional>
82 </repeat> 89 </repeat>
83 </inputs> 90 </inputs>
84 91
85 <outputs> 92 <outputs>
86 <expand macro="output_pipeline_macro" /> 93 <expand macro="output_pipeline_param" />
87 </outputs> 94 </outputs>
88 95
89 <tests> 96 <tests>
90 <test> 97 <test>
91 <expand macro="test_input_pipeline_param" /> 98 <expand macro="test_input_pipeline_param" />
99 <conditional name="con_area"> 106 <conditional name="con_area">
100 <param name="objects_or_image" value="Objects" /> 107 <param name="objects_or_image" value="Objects" />
101 <param name="objects_to_measure" value="Nucleoli" /> 108 <param name="objects_to_measure" value="Nucleoli" />
102 </conditional> 109 </conditional>
103 </repeat> 110 </repeat>
104 <expand macro="test_out_file" file="measure_image_area_occupied.txt" /> 111 <expand macro="test_out_file" file="measure_image_area_occupied.cppipe" />
105 </test> 112 </test>
106 </tests> 113 </tests>
107 114
108 <expand macro="help" module="MeasureImageAreaOccupied" /> 115 <help>
116 <![CDATA[
117
118 .. class:: infomark
119
120 **What it does**
121 This tool reports the sum of the areas and perimeters of the objects defined by one of the Identify modules, or the area of the foreground in a binary image.
122 If the input image has a mask (for example, created by the MaskImage module), the measurements made by this module will take the mask into account by ignoring the pixels outside the mask.
123 You can use this tool to measure the number of pixels above a given threshold if you precede it with thresholding performed by Threshold, and then select the binary image output by Threshold to be measured by this module.
124
125 @COMMON_HELP@
126 ]]>
127 </help>
128
109 <expand macro="citations" /> 129 <expand macro="citations" />
110 </tool> 130 </tool>