1r3.out.vtk(1)                 Grass User's Manual                r3.out.vtk(1)
2
3
4

NAME

6       r3.out.vtk  - Converts 3D raster maps (G3D) into the VTK-Ascii format
7

KEYWORDS

9       raster3d, voxel
10

SYNOPSIS

12       r3.out.vtk
13       r3.out.vtk help
14       r3.out.vtk             [-mposc]             [input=string[,string,...]]
15       [rgbmaps=string[,string,...]]          [vectormaps=string[,string,...]]
16       [top=string]      [bottom=string]      [output=string]     [null=float]
17       [elevscale=float]   [dp=integer]
18
19   Flags:
20       -m  Use g3d mask (if exists) with input maps
21
22       -p  Create VTK pointdata instead of VTK celldata (celldata is default)
23
24       -o  Scale factor effects the origin
25
26       -s  Create 3d elevation output with a top and a  bottom  surface,  both
27           raster maps are required.
28
29       -c  Correct the coordinates to fit the VTK-OpenGL precision
30
31   Parameters:
32       input=string[,string,...]
33           G3D map(s) to be converted to VTK-ASCII data format
34
35       rgbmaps=string[,string,...]
36           Three  (r,g,b)  g3d raster maps which are used to create rgb values
37           [redmap,greenmap,bluemap]
38
39       vectormaps=string[,string,...]
40           Three (x,y,z) g3d raster maps which are used to create vector  val‐
41           ues [xmap,ymap,zmap]
42
43       top=string
44           top surface 2D raster map
45
46       bottom=string
47           bottom surface 2D raster map
48
49       output=string
50           Name for VTK-ASCII output file
51
52       null=float
53           Float value to represent no data cell/points Default: -99999.99
54
55       elevscale=float
56           Scale factor for elevation Default: 1.0
57
58       dp=integer
59           Number  of  significant  digits (floating point only) Options: 0-20
60           Default: 12
61

DESCRIPTION

63       Outputs G3D maps in VTK-ASCII format.  Map's are valid G3D map's in the
64       current  mapset.  output is the name of an VTK-ASCII file which will be
65       written in the current working directory.  If output is  not  specified
66       then  stdout  is used.  The module is sensitive to region settings (set
67       with g.region).
68

NOTES

70       This filter generates structured points   with  celldata  (default)  or
71       pointdata.   If  top   and bottom surfaces are requested a unstructured
72       grid with celldata  or a structured grid with pointdata  is  generated.
73       This  data  is put in a simple VTK-ASCII file. Nor XML or binary output
74       are supported. It is possible to choose more then one  G3D  map  to  be
75       written  in the VTK-ASCII file. Each celldata is named like the G3D map
76       it represents.  You can visualize this file with the VTK Toolkit,  Par‐
77       aview  and  MayaVi  which are based on VTK.  If you have a G3D map with
78       partly no data, use the threshold filter in paraview to  visualize  the
79       valid  data.  Just  filter  all  data  which is greater/lesser than the
80       choosen null value in the VTK-ASCII file.
81       The input, rgbmaps and vectormaps are optional, so  only  the  geometry
82       can be exported.
83       If you use top and bottom and the 2d and 3d region settings are differ‐
84       ent, the 2d resolution will be adjust to the 3d resolution.
85       The RGB voxel data can be created  from  2d  raster  maps  (Landsat  TM
86       images)  with  r.to.rast3.  The values of the RGB maps must be within 0
87       and 255. Whether not, the values are set automaticly to 0 and  warnings
88       will be printed to stderr.
89       The  vector  data is created from three g3d maps. Each map represents a
90       vector component.  So x, y and z components are required in this order!
91       This data can be visualized with Glyph3d or StreamTracer filters within
92       Paraview.
93       If the "-c" flag is used and the data  should  be  visualised  together
94       with  other  data exported via *.out.vtk modules, be sure the "-c" flag
95       was also set in these modules.  But this will only work with data  from
96       the  SAME location (The reference point for the coordinates transforma‐
97       tion is based on the default region).
98
99   Difference between point- and celldata
100       r3.out.vtk can export G3D cells with different representations.
101
102                     pointdata -- the cells/values are represented by the cen‐
103                     ter  of  the cell.  Instead of cells, points are created.
104                     Each point can hold different values, but  the  user  can
105                     only visualize one value at a time.
106
107                     celldata The cells are created with the same hight, width
108                     and depth as in GRASS. Each cell can hold different  val‐
109                     ues, but the user can only visualize one value at a time.
110

EXAMPLE

112   Simple Spearfish example
113
114       g.region -d
115       g.region res=150 res3=150 t=80 b=0 tbres=10
116       r.mapcalc "bottom=1800. - elevation.10m"
117       # synthetic data, could be geological structures:
118       r3.mapcalc "map3d=row()+col()+depth()"
119       #export of volume to VTK:
120       r3.out.vtk   -s   input=map3d   top=elevation.10m   bottom=bottom  out‐
121       put=/tmp/out.vtk
122       # visualize in paraview or other VTK viewer:
123       paraview --data=/tmp/out.vtk
124
125
126   Spearfish example with RGB data
127
128       #set the region
129       g.region -d
130       g.region n=4926970 s=4914857 w=591583 e=607793 res=50 res3=50 t=80  b=0
131       tbres=10
132       #create a bottom surface
133       r.mapcalc "bottom=1800. - elevation.10m"
134       # synthetic data, could be geological structures:
135       r3.mapcalc "map3d=row()+col()+depth()"
136       #get some satellite images with r.in.onearth
137       r.in.onearth -l output=Sat tmband=Red
138       r.in.onearth -l output=Sat tmband=IR1
139       r.in.onearth -l output=Sat tmband=IR2
140       #Convert the 2d maps to g3d maps with r.to.rast3
141       r.to.rast3 input=SatLandsatTM_Red output=SatLandsatTM_Red
142       r.to.rast3 input=SatLandsatTM_IR1 output=SatLandsatTM_IR1
143       r.to.rast3 input=SatLandsatTM_IR2 output=SatLandsatTM_IR2
144       #export of volume to VTK:
145       r3.out.vtk     -s    rgbmaps=SatLandsatTM_IR1,SatLandsatTM_IR2,SatLand‐
146       satTM_Red    input=map3d    top=elevation.10m    bottom=bottom     out‐
147       put=/tmp/out.vtk
148       # visualize in paraview or other VTK viewer:
149       paraview --data=/tmp/out.vtk
150
151
152   Spearfish example with vector data
153
154       # set the region
155       g.region -d
156       g.region  n=4926970 s=4914857 w=591583 e=607793 res=50 res3=50 t=80 b=0
157       tbres=10
158       # create a bottom surface
159       r.mapcalc "bottom=1800. - elevation.10m"
160       # synthetic data, could be geological structures:
161       r3.mapcalc "map3d=row()+col()+depth()"
162       # synthetic vector data, could be groundwater stream vectors
163       r3.mapcalc "x_part =sin(row())"
164       r3.mapcalc "y_part =cos(col())"
165       r3.mapcalc "z_part =sin(depth())"
166       # export the stuff data to VTK:
167       r3.out.vtk -s  vectormaps=x_part,y_part,z_part  input=map3d  top=eleva‐
168       tion.10m bottom=bottom output=/tmp/out.vtk
169       # visualize in paraview or other VTK viewer:
170       paraview --data=/tmp/out.vtk
171       #  Now  use  the  Glyph and Stream-Trace Filter to get nice vectors and
172       streamlines
173
174
175   Slovakia3d example
176
177       #reduce resolution:
178       g.region -dp3 res=1000 res3=1000
179       r.mapcalc "bottom=100"
180       #export of volume to VTK:
181       r3.out.vtk -s in=precip3d.500z50 top=dem500 bottom=bottom out=/tmp/slo‐
182       vakia3d.vtk
183       # visualize in paraview or other VTK viewer:
184       paraview --data=/tmp/slovakia3d.vtk
185       # set Display style to 'surface#
186       # set Actor Control z to 10
187
188

SEE ALSO

190       r.out.vtk
191       r3.out.ascii
192       g.region
193

AUTHOR

195       Soeren Gebbert
196
197       Last changed: $Date: 2006/06/16 18:10:54 $
198
199       Full index
200
201
202
203GRASS 6.2.2                                                      r3.out.vtk(1)
Impressum