comparison neper_visualization.xml @ 0:03bbcfd3d708 draft default tip

"planemo upload for repository https://github.com/ximg-chess/galaxytools/tree/master/tools/neper commit 9f77ab5ee7831c00b3a27e02ec8e59d95e6fb9cf"
author ximgchess
date Thu, 07 Jul 2022 12:31:10 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:03bbcfd3d708
1 <tool id="neper_visualization" name="Neper Visualization" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@" python_template_version="3.5">
2 <description></description>
3 <macros>
4 <import>macros.xml</import>
5 <import>color_macros.xml</import>
6 <token name="@VERSION_SUFFIX@">0</token>
7
8 <!-- Mesh Keys
9 id#identifier#node, @var{n}D elt, @var{n}D elset
10 x#x coordinate#node, @var{n}D elt, @var{n}D elset
11 y#y coordinate#node, @var{n}D elt, @var{n}D elset
12 z#z coordinate#node, @var{n}D elt, @var{n}D elset
13 coo#x, y and z coordinates#node, @var{n}D elt, @var{n}D elset
14 dim#dimension (= lowest parent elt dimension)#node
15 elset0d#0D elset#0D elt
16 elset1d#1D elset#1D elt
17 elset2d#2D elset#2D elt
18 elset3d#3D elset#3D elt
19 part#partition#@var{n}D elt, node
20 group#group#@var{n}D elt, @var{n}D elset
21 cyl#whether or not is used to describe the circular part of a cylinder domain#1D elt, 1D elset
22 vol#volume#3D elt, 3D elset
23 area#surface area#2D elt
24 diameq#equivalent diameter@footnote{Equivalent diameter = diameter of the circle of equivalent area/volume in 2D/3D.#2D elt, 3D elt, 2D elset, 3D elset
25 radeq#equivalent radius@footnote{Equivalent radius = radius of the circle of equivalent area/volume in 2D/3D.}#2D elt, 3D elt, 2D elset, 3D elset
26 length#average edge length#@math{n}D elt, 1D elset
27 lengths#edge lengths#2D elt, 3D elt
28 elsetvol#elset volume#3D elt
29 elsetarea#elset area#2D elt
30 elsetlength#elset length#1D elt
31 rr#radius ratio#3D elt
32 rrav}, @code{rrmin}, @code{rrmax}
33 #average, min and max radius ratios @tab 3D elset
34 Osize#Osize#3D elset
35 eltnb#number of elements#@var{n}D elset
36 true#true level#@var{n}D elt, @var{n}D elset
37 body#body level#@var{n}D elt, @var{n}D elset
38 domtype#type of domain (0 if on a domain vertex, 1 if on a domain edge and 2 if on a domain face)#@w{2D elset}, @w{1D elset}, @w{0D elset}, @w{2D elt}, @w{1D elt}, @w{0D elt}
39 2dmeshp#coordinates of the closest point of the 2D mesh#node, 3D elt
40 2dmeshd#distance to @samp{2dmeshp}#node, 3D elt
41 2dmeshv#vector to @samp{2dmeshp}#node, 3D elt
42 2dmeshn#outgoing normal vector of the 2D mesh at @samp{2dmeshp#node, 3D elt
43 per#periodic (1 if periodic, 0 otherwise)#0D elt, 1D elt, 2D elt (in 3D), 0D elset, 1D elset, 2D elset (in 3D)
44 col_rodrigues#color according to the Rodrigues vector color convention@footnote{Applies to a mesh of Rodrigues space.}#node
45 col_stdtriangle#color according to the stereographic triangle (IPF) color convention@footnote{Applies to a mesh of the stereographic triangle.}#node
46 -->
47
48 <xml name="set_elt" token_name="option">
49 <conditional name="@NAME@">
50 <param name="set_@NAME@" type="select" label="Set @NAME@">
51 <option value="default">use default</option>
52 <option value="by_value">by value </option>
53 <option value="from_file">from file</option>
54 </param>
55 <when value="default"/>
56 <when value="by_value">
57 <param name="@NAME@" argument="-@NAME@" type="text" label="@NAME@">
58 <option value="all">all</option>
59 <option value="none">none</option>
60 <yield/>
61 </param>
62 </when>
63 <when value="from_file">
64 <param name="elements_file" argument="-@NAME@" type="data" format="txt" label="Elements file"/>
65 </when>
66 </conditional>
67 </xml>
68
69 <xml name="elt_elset">
70 <param name="by_set" type="boolean" truevalue="elset" falsevalue="elt" checked="false" label="apply to element set"/>
71 </xml>
72 <xml name="set_el_color" token_name="option">
73 <conditional name="@NAME@">
74 <param name="set_@NAME@" type="select" label="Set @NAME@ by">
75 <option value="default" selected="true">Use default</option>
76 <option value="data_value">data value</option>
77 <option value="color">color</option>
78 <option value="from_file">from file</option>
79 </param>
80 <when value="default"/>
81 <when value="data_value">
82 <param argument="-@NAME@" type="text" label="Set @NAME@ by element or element set">
83 <yield/>
84 </param>
85 <expand macro="elt_elset"/>
86 </when>
87 <when value="color">
88 <expand macro="color_selector" argument="-@NAME@" label="Set @NAME@ color"/>
89 <expand macro="elt_elset"/>
90 </when>
91 <when value="from_file">
92 <param name="color_file" argument="-@NAME@" type="data" format="txt" label="Color file"/>
93 </when>
94 </conditional>
95 </xml>
96
97 <xml name="tess_data">
98 <section name="tess" expanded="false" title="Tessellation Rendering">
99 <conditional name="datacellcol">
100 <param name="set_datacellcol" argument="-datacellcol" type="select" label="Set datacell color">
101 <option value="none">None</option>
102 <option value="id" selected="true">id</option>
103 <option value="mode">mode</option>
104 <option value="by_value">By value</option>
105 </param>
106 <when value="none"/>
107 <when value="id"/>
108 <when value="mode"/>
109 <when value="by_value">
110 <expand macro="color_selector" name="datacellcolor" label="Select datacell color"/>
111 </when>
112 <when value="by_value">
113 </when>
114 </conditional>
115 </section>
116 </xml>
117 <token name="@TESS_DATA@">
118 #if $tess.datacellcol.set_datacellcol in ['id','mode']
119 -datacellcol $tess.datacellcol.set_datacellcol
120 #elif $tess.datacellcol.set_datacellcol == 'by_value'
121 -datacellcol $tess.datacellcol.datacellcolor
122 #end if
123 </token>
124
125 <!--
126 neper -V example_mesh.msh -showelt1d all -dataelset3dcol id -dataelt1drad 0.0025 -dataelt3dedgerad 0.0025
127 -->
128
129 <xml name="mesh_data">
130 <section name="mesh_data" expanded="false" title="Mesh Data Loading">
131 <!-- NOTE: elt or elset -->
132 <!-- datanodecoo -->
133 <!-- datanodecoofact -->
134 <!-- datanoderad -->
135 <!-- datanodecol -->
136 <!-- datanodecolscheme -->
137 <!-- datanodescale -->
138 <!-- datanodescaletitle -->
139 </section>
140 </xml>
141 <token name="@MESH_DATA@">
142 </token>
143
144 <xml name="mesh_color">
145 <section name="mesh_color" expanded="false" title="Mesh Data Rendering">
146 <!-- NOTE: elt or elset -->
147 <!-- dataelt3dcol -->
148 <expand macro="set_el_color" name="dataelt3dcol">
149 </expand>
150 <!-- dataelt3dcolscheme -->
151 <!-- dataelt3dcolscale -->
152 <!-- dataelt3dcolscaletitle -->
153 <!-- dataelt3dedgerad -->
154 <param argument="-dataelt3dedgerad" type="float" value="" min="0.0" optional="true" label="data element 3d edge radius"/>
155 <!-- dataelt3dedgecol -->
156
157 <!-- dataelt2dcol -->
158 <expand macro="set_el_color" name="dataelt2dcol">
159 </expand>
160 <!-- dataelt2dcolscheme -->
161 <!-- dataelt2dcolscale -->
162 <!-- dataelt2dcolscaletitle -->
163 <!-- dataelt2dedgerad -->
164 <param argument="-dataelt2dedgerad" type="float" value="" min="0.0" optional="true" label="data element 2d edge radius"/>
165 <!-- dataelt2dedgecol -->
166
167 <!-- dataelt1dcol -->
168 <expand macro="set_el_color" name="dataelt1dcol">
169 </expand>
170 <!-- dataelt1dcolscheme -->
171 <!-- dataelt1dcolscale -->
172 <!-- dataelt1dcolscaletitle -->
173 <!-- dataelt1drad -->
174 <param argument="-dataelt1drad" type="float" value="" min="0.0" optional="true" label="data element 1d radius"/>
175
176 <!-- dataelt0dcol -->
177 <expand macro="set_el_color" name="dataelt0dcol">
178 </expand>
179 <!-- dataelt0dcolscheme -->
180 <!-- dataelt0dcolscale -->
181 <!-- dataelt0dcolscaletitle -->
182 <!-- dataelt0drad -->
183 <param argument="-dataelt0drad" type="float" value="" min="0.0" optional="true" label="data element 1d radius"/>
184 </section>
185 </xml>
186 <token name="@MESH_COLOR@">
187 #if $mesh_color.dataelt3dcol.set_dataelt3dcol == 'from_file'
188 #pass
189 #elif $mesh_color.dataelt3dcol.set_dataelt3dcol != 'default'
190 #set opt = '-dataelt3dcol'.replace('elt',str($mesh_color.dataelt3dcol.by_set))
191 $opt '$mesh_color.dataelt3dcol.dataelt3dcol'
192 #end if
193 #if $mesh_color.dataelt2dcol.set_dataelt2dcol == 'from_file'
194 #pass
195 #elif $mesh_color.dataelt2dcol.set_dataelt2dcol != 'default'
196 #set opt = '-dataelt2dcol'.replace('elt',str($mesh_color.dataelt2dcol.by_set))
197 $opt '$mesh_color.dataelt2dcol.dataelt2dcol'
198 #end if
199 #if $mesh_color.dataelt1dcol.set_dataelt1dcol == 'from_file'
200 #pass
201 #elif $mesh_color.dataelt1dcol.set_dataelt1dcol != 'default'
202 #set opt = '-dataelt1dcol'.replace('elt',str($mesh_color.dataelt1dcol.by_set))
203 $opt '$mesh_color.dataelt1dcol.dataelt1dcol'
204 #end if
205 #if $mesh_color.dataelt0dcol.set_dataelt0dcol == 'from_file'
206 #pass
207 #elif $mesh_color.dataelt0dcol.set_dataelt0dcol != 'default'
208 #set opt = '-dataelt0dcol'.replace('elt',str($mesh_color.dataelt0dcol.by_set))
209 $opt '$mesh_color.dataelt0dcol.dataelt3dcol'
210 #end if
211
212 #if $mesh_color.dataelt3dedgerad
213 -dataelt3dedgerad $mesh_color.dataelt3dedgerad
214 #end if
215 #if $mesh_color.dataelt2dedgerad
216 -dataelt2dedgerad $mesh_color.dataelt2dedgerad
217 #end if
218 #if $mesh_color.dataelt1drad
219 -dataelt1drad $mesh_color.dataelt1drad
220 #end if
221 #if $mesh_color.dataelt0drad
222 -dataelt0drad $mesh_color.dataelt0drad
223 #end if
224 </token>
225
226 <xml name="show_settings">
227 <section name="show" expanded="false" title="Show Settings">
228 <expand macro="optional_yn" arg="-showtess" label="Show tess" help="test"/>
229 <expand macro="optional_yn" arg="-showtesr" label="Show tesr" help="test"/>
230 <expand macro="optional_yn" arg="-showmesh" label="Show mesh" help="test"/>
231 <expand macro="optional_yn" arg="-showmeshslice" label="Show mesh slice" help="test"/>
232 <!-- showpoint -->
233 </section>
234 </xml>
235 <token name="@SHOW_SETTINGS@">
236 #if $show.showtess
237 -showtess $show.showtess
238 #end if
239 #if $show.showtesr
240 -showtesr $show.showtesr
241 #end if
242 #if $show.showmesh
243 -showmesh $show.showmesh
244 #end if
245 #if $show.showmeshslice
246 -showmeshslice $show.showmeshslice
247 #end if
248 ## -showpoint
249 </token>
250
251 <xml name="show_tess_settings">
252 <section name="show_tess" expanded="false" title="Show Tessellation Settings">
253 <!-- showcell -->
254 <!-- showpoly -->
255 <!-- showface -->
256 <!-- showedge -->
257 <!-- showver -->
258 <!-- showseed -->
259 <!-- showfaceinter -->
260 <expand macro="optional_yn" arg="-showfaceinter" label="Show the interpolations of the tessellation faces" help=""/>
261 <!-- RASTER tesr -->
262 <!-- showvoidvox -->
263 </section>
264 </xml>
265 <token name="@SHOW_TESS_SETTINGS@">
266 #if $show_tess.showfaceinter
267 -showfaceinter $show_tess.showfaceinter
268 #end if
269 </token>
270
271 <xml name="show_mesh_settings">
272 <section name="show_mesh" expanded="false" title="Show Mesh Settings">
273 <expand macro="set_elt" name="showelt3d"/>
274 <expand macro="set_elt" name="showelt2d">
275 <option value="elt3d_shown">elt3d_shown</option>
276 </expand>
277 <expand macro="set_elt" name="showelt1d">
278 <option value="elt2d_shown">elt2d_shown</option>
279 <option value="elt3d_shown">elt3d_shown</option>
280 </expand>
281 <expand macro="set_elt" name="showelt0d">
282 <option value="elt1d_shown">elt1d_shown</option>
283 <option value="elt2d_shown">elt2d_shown</option>
284 <option value="elt3d_shown">elt3d_shown</option>
285 </expand>
286 <!-- shownode -->
287 <expand macro="optional_yn" arg="-showcys" label="Show the coordinate system" help=""/>
288 <expand macro="optional_yn" arg="-showshadow" label="Show the shadows" help=""/>
289 </section>
290 </xml>
291 <token name="@SHOW_MESH_SETTINGS@">
292 #if $show_mesh.showelt3d.set_showelt3d == 'by_value'
293 -showelt3d '$show_mesh.showelt3d.showelt3d'
294 #elif $show_mesh.showelt3d.set_showelt3d == 'from_file'
295 -showelt3d 'file($show_mesh.showelt3d.elements_file)'
296 #end if
297 #if $show_mesh.showelt2d.set_showelt2d == 'by_value'
298 -showelt2d '$show_mesh.showelt2d.showelt2d'
299 #elif $show_mesh.showelt2d.set_showelt2d == 'from_file'
300 -showelt2d 'file($show_mesh.showelt2d.elements_file)'
301 #end if
302 #if $show_mesh.showelt1d.set_showelt1d == 'by_value'
303 -showelt1d '$show_mesh.showelt1d.showelt1d'
304 #elif $show_mesh.showelt1d.set_showelt1d == 'from_file'
305 -showelt1d 'file($show_mesh.showelt1d.elements_file)'
306 #end if
307 #if $show_mesh.showelt0d.set_showelt0d == 'by_value'
308 -showelt0d '$show_mesh.showelt0d.showelt0d'
309 #elif $show_mesh.showelt0d.set_showelt0d == 'from_file'
310 -showelt0d 'file($show_mesh.showelt0d.elements_file)'
311 #end if
312 ## shownode
313 #if $show_mesh.showcys
314 -showcys $show_mesh.showcys
315 #end if
316 #if $show_mesh.showshadow
317 -showshadow $show_mesh.showshadow
318 #end if
319 </token>
320
321 <xml name="camera_settings">
322 <section name="camera" expanded="false" title="Camera Settings">
323 <expand macro="set_nv" name="cameracoo" label="Specify the camera coordinates">
324 <expand macro="tx3d" label="Camera position" lx="x" ly="y" lz="z"/>
325 </expand>
326 <expand macro="set_nv" name="cameralookat" label="Specify the camera look-at point">
327 <expand macro="tx3d" label="Camera lookat" lx="x" ly="y" lz="z"/>
328 </expand>
329 <param name="cameraangle" type="float" value="" min="1" max="179" optional="true" label="Set the opening angle of the camera along the horizontal direction (in degrees)"/>
330 <expand macro="set_nv" name="camerasky" label="Specify the sky vector of the camera (vertical direction)">
331 <expand macro="tx3d" label="Camera Sky vector" lx="x" ly="y" lz="z" x="0" y="0" z="1"/>
332 </expand>
333 <param name="cameraprojection" type="select" optional="true" label="Camera Projection">
334 <help>Default value: perspective for 3D and orthographic for 2D</help>
335 <option value="perspective">perspective</option>
336 <option value="orthographic">orthographic</option>
337 </param>
338 </section>
339 </xml>
340 <token name="@CAMERA_SETTINGS@">
341 #if $camera.cameracoo.set_cameracoo == 'by_value'
342 -cameracoo "${camera.cameracoo.x}:${camera.cameracoo.y}:${camera.cameracoo.z}"
343 #end if
344 #if $camera.cameralookat.set_cameralookat == 'by_value'
345 -cameralookat "${camera.cameralookat.x}:${camera.cameralookat.y}:${camera.cameralookat.z}"
346 #end if
347 #if $camera.cameraangle
348 -cameraangle $camera.cameraangle
349 #end if
350 #if $camera.camerasky.set_camerasky == 'by_value'
351 -camerasky "${camera.camerasky.x}:${camera.camerasky.y}:${camera.camerasky.z}"
352 #end if
353 #if $camera.cameraprojection
354 -cameraprojection $camera.cameraprojection
355 #end if
356 </token>
357
358 <xml name="image_settings">
359 <section name="image" expanded="false" title="Image Settings">
360 <expand macro="set_ny" name="imagesize" label="Set the image size">
361 <expand macro="size2d" label="Image size" lx="width" ly="height"/>
362 </expand>
363 <expand macro="color_selector" name="imagebackground" label="Image background color"/>
364 <param name="imageantialias" type="boolean" truevalue="" falsevalue="-imageantialias 0" checked="true" label="Use antialiasing"
365 help="Use antialiasing to produce a smoother image. Switch antialiasing off for faster image gener- ation or smaller image file"/>
366 </section>
367 </xml>
368 <token name="@IMAGE_SETTINGS@">
369 #if $image.imagesize.set_imagesize == 'yes'
370 -imagesize "${image.imagesize.x}:${image.imagesize.y}"
371 #end if
372 #if $image.imagebackground
373 -imagebackground "$image.imagebackground"
374 #end if
375 $image.imageantialias
376 </token>
377
378 </macros>
379 <expand macro="requirements" />
380 <expand macro="version_command" />
381 <command detect_errors="exit_code"><![CDATA[
382 #*
383 #set $tessfiles = []
384 #set $mshfiles = []
385 #for $input in $inputs
386 #if $input.is_of_type('neper.msh')
387 #silent $mshfiles.append(str($input))
388 #else
389 #silent $tessfiles.append(str($input))
390 #end if
391 #end for
392 #set $ds = ','.join($tessfiles + $mshfiles)
393 neper -V
394 '$ds'
395 *#
396 neper -V
397 '$inputs'
398 @TESS_DATA@
399 @TRANSFORM@
400 @MESH_COLOR@
401 @SHOW_SETTINGS@
402 @SHOW_TESS_SETTINGS@
403 @SHOW_MESH_SETTINGS@
404 @CAMERA_SETTINGS@
405 @IMAGE_SETTINGS@
406 -imageformat "$imageformat"
407 -print output
408 | grep -v '%$' | tee 'neper.log'
409 #if 'png' in $imageformat
410 && test -s output.png
411 #end if
412 #if 'vtk' in $imageformat
413 && test -s output.vtk
414 #end if
415 ]]></command>
416 <inputs>
417 <param name="inputs" type="data" format="neper.tesr,neper.tess,gmsh.msh" multiple="true" label="Input to visualize"/>
418 <expand macro="tess_data"/>
419 <expand macro="transform"/>
420 <expand macro="mesh_color"/>
421 <expand macro="show_settings"/>
422 <expand macro="show_tess_settings"/>
423 <expand macro="show_mesh_settings"/>
424 <expand macro="camera_settings"/>
425 <expand macro="image_settings"/>
426 <param name="imageformat" argument="-imageformat" type="select" multiple="true" optional="false" label="Image formats">
427 <option value="png" selected="true">PNG</option>
428 <option value="vtk">VTK</option>
429 <option value="pov">POV</option>
430 </param>
431 </inputs>
432 <outputs>
433 <data name="log" format="txt" label="${tool.name} on ${on_string} log" from_work_dir="neper.log"/>
434 <data name="output_png" format="png" label="${tool.name} on ${on_string} png" from_work_dir="output.png">
435 <filter>'png' in imageformat</filter>
436 </data>
437 <data name="output_vtk" format="vtkascii" label="${tool.name} on ${on_string} vtk" from_work_dir="output.vtk">
438 <filter>'vtk' in imageformat</filter>
439 </data>
440 <data name="output_pov" format="pov" label="${tool.name} on ${on_string} pov" from_work_dir="output.pov">
441 <filter>'pov' in imageformat</filter>
442 </data>
443 </outputs>
444 <tests>
445 <!-- Test-1 neper -V neper.tess -datacellcol id -imageformat "png" -->
446 <test>
447 <param name="inputs" ftype="neper.tess" value="neper.tess"/>
448 <output name="log">
449 <assert_contents>
450 <has_text text="Wrote file `output.png'." />
451 </assert_contents>
452 </output>
453 </test>
454 <!-- Test-2 neper -V gmsh.msh -datacellcol id -imageformat "png,vtk" -->
455 <test>
456 <param name="inputs" ftype="neper.tess" value="gmsh.msh"/>
457 <param name="imageformat" value="png,vtk"/>
458 <output name="log">
459 <assert_contents>
460 <has_text text="Wrote file `output.png'." />
461 <has_text text="Wrote file `output.vtk'." />
462 </assert_contents>
463 </output>
464 <output name="output_vtk">
465 <assert_contents>
466 <has_text text="vtk DataFile" />
467 <has_text text="DATASET UNSTRUCTURED_GRID" />
468 </assert_contents>
469 </output>
470 </test>
471
472 </tests>
473 <help><![CDATA[
474 **Neper Visualization**
475
476 @NEPER_HELP@
477
478 Module -V is the module for visualizing tessellations, meshes and simulation results as publication-quality PNG images1 or as VTK files, for interactive visualization. Results can be defined from internal data, data loaded from external files or a simulation directory as generated by module -S. For the PNG images, it is possible to set different attributes of the tessellations and meshes such as the node coordinates, or the colors and transparencies of the different entities. Point data can also be represented, using symbols of specified sizes and colors. Slice views can also be generated.
479
480 ]]></help>
481 <expand macro="citations" />
482 </tool>