comparison measure_granularity.xml @ 3:382413f8ec1d draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit c3917e27eb1c1deeb381aa0dc8161c07699562fb"
author bgruening
date Mon, 11 May 2020 07:50:47 -0400
parents 88dd3674c4d0
children ac5bea85a391
comparison
equal deleted inserted replaced
2:88dd3674c4d0 3:382413f8ec1d
2 <description>output spectra of size measurements of the textures</description> 2 <description>output spectra of size measurements of the textures</description>
3 3
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
15 import sys 15 import sys
54 k, v = lines[4].strip().split(':') 54 k, v = lines[4].strip().split(':')
55 55
56 module_count = int(v) 56 module_count = int(v)
57 new_count = module_count + 1 57 new_count = module_count + 1
58 lines[4] = k + ":%d\n" % new_count 58 lines[4] = k + ":%d\n" % new_count
59 with open("output", "w") as f: 59 with open("output.cppipe", "w") as f:
60 f.writelines(lines) 60 f.writelines(lines)
61 f.write(writemg()) 61 f.write(writemg())
62 62
63 f.close() 63 f.close()
64 </configfile> 64 </configfile>
65 </configfiles> 65 </configfiles>
66 66
67 <inputs> 67 <inputs>
68 <expand macro="input_pipeline_macro" /> 68 <expand macro="input_pipeline_param" />
69 <repeat name="rpt_image" title="Add another image"> 69 <repeat name="rpt_image" title="new image" min="1">
70 <param name="image_to_measure" type="text" label="Select an image to measure"> 70 <param name="image_to_measure" type="text" label="Enter the name of a greyscale image to measure">
71 <expand macro="text_validator" /> 71 <expand macro="text_validator" />
72 </param> 72 </param>
73 73
74 <param name="subsampling_factor_granularity" type="float" value="0.25" label="Subsampling factor for granularity measurements" /> 74 <param name="subsampling_factor_granularity" type="float" value="0.25" label="Subsampling factor for granularity measurements" help="A factor lower than 1 if the textures of interest are larger than a few pixels. A factor greater than 1 might increase the accuracy but also require more processing time. Images are typically of higher resolution than is required for granularity measurements, so the default value is 0.25."/>
75 75
76 <param name="subsampling_factor_background_reduction" type="float" value="0.25" min="0.125" max="0.25" label="Subsampling factor for background reduction" /> 76 <param name="subsampling_factor_background_reduction" type="float" value="0.25" min="0.125" max="0.25" label="Subsampling factor for background reduction" help="A small factor should be used if the structures of interest are large." />
77
78 <param name="radius" type="integer" value="10" label="Radius of structuring element" />
79
80 <param name="range_granular_spectrum" type="integer" value="16" label="Range of the granular spectrum" />
81 77
82 <repeat name="rpt_object" title="Add another object"> 78 <param name="radius" type="integer" value="10" label="Radius of structuring element" help="This radius should correspond to the radius of the textures of interest after subsampling." />
83 <param name="object_to_measure" type="text" label="Select object to measure" > 79
80 <param name="range_granular_spectrum" type="integer" value="16" label="Range of the granular spectrum" help="You may need a trial run to see which granular spectrum range yields informative measurements. Start by using a wide spectrum and narrow it down to the informative range to save time." />
81
82 <repeat name="rpt_object" title="new object">
83 <param name="object_to_measure" type="text" label="Enter the name of the object whose granularity will be measured" help="You can select objects from prior modules that identify objects, such as IdentifyPrimaryObjects. If you only want to measure the granularity for the image overall, you can remove all objects.">
84 <expand macro="text_validator" /> 84 <expand macro="text_validator" />
85 </param> 85 </param>
86 </repeat> 86 </repeat>
87 </repeat> 87 </repeat>
88 </inputs> 88 </inputs>
89 89
90 <outputs> 90 <outputs>
91 <expand macro="output_pipeline_macro" /> 91 <expand macro="output_pipeline_param" />
92 </outputs> 92 </outputs>
93 93
94 <tests> 94 <tests>
95 <test> 95 <test>
96 <expand macro="test_input_pipeline_param" /> 96 <expand macro="test_input_pipeline_param" />
99 <param name="subsampling_factor_granularity" value="0.25" /> 99 <param name="subsampling_factor_granularity" value="0.25" />
100 <param name="subsampling_factor_background_reduction" value="0.25" /> 100 <param name="subsampling_factor_background_reduction" value="0.25" />
101 <param name="radius" value="10" /> 101 <param name="radius" value="10" />
102 <param name="range_granular_spectrum" value="16" /> 102 <param name="range_granular_spectrum" value="16" />
103 </repeat> 103 </repeat>
104 <expand macro="test_out_file" file="measure_granularity.txt" /> 104 <expand macro="test_out_file" file="measure_granularity.cppipe" />
105 </test> 105 </test>
106 </tests> 106 </tests>
107 107
108 <expand macro="help" module="MeasureGranularity" /> 108 <help>
109 <![CDATA[
110
111 .. class:: infomark
112
113 **What it does**
114
115 Image granularity is a texture measurement that tries to fit a series of structure elements of increasing size into the texture of the image and outputs a spectrum of measures based on how well they fit. Granularity is measured as described by Ilya Ravkin (in the paper *Bit representation techniques and image processing*). The size of the starting structure element as well as the range of the spectrum is given as input.
116
117 @COMMON_HELP@
118 ]]>
119 </help>
109 <expand macro="citations" /> 120 <expand macro="citations" />
110 </tool> 121 </tool>