GRASS and Paraview: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
 
(12 intermediate revisions by 5 users not shown)
Line 2: Line 2:


Download Paraview at http://www.paraview.org (available for Linux, MacOSX and MS-Windows) ([http://www.paraview.org/paraview/project/imagegallery.php screenshot gallery])
Download Paraview at http://www.paraview.org (available for Linux, MacOSX and MS-Windows) ([http://www.paraview.org/paraview/project/imagegallery.php screenshot gallery])
* See also the [[GRASS and VTK]] wiki page.


== 2D/3D Raster/voxel export ==
== 2D/3D Raster/voxel export ==
GRASS GIS is one of the few GIS with volume data support. Here data are stored as a 3D raster with a unit volume called a voxel (volume pixel). [[Voxel]]s are designed to support for example representations of trivariate continuous fields. The latest version of GRASS7 supports space time voxel cubes that have time as the third dimension.


* 2D raster maps: {{cmd|r.out.vtk}}
* 2D raster maps: {{cmd|r.out.vtk}}
* 3D raster maps: {{cmd|r3.out.vtk}}
* 3D raster (voxel) maps: {{cmd|r3.out.vtk}}
* Raster color table export: {{AddonCmd|r.colors.out_vtk}}
* 3D raster (voxel) and space time voxel maps as netCDF: r3.out.netcdf


== 2D/3D Vector export ==
== 2D/3D Vector export ==
Line 14: Line 20:
== Visualization ==
== Visualization ==


Start Paraview, load the VTK data,... it is fairly intuitive to use. ''(don't hesitate to expand this part)''
Start Paraview, load VTK data, and choose the correct readers : for example "Legacy VTK file"....it is fairly intuitive to use.
In the Properties section click the Apply button, next in the Display section set "Surface" in Representation menu, and set the name of the file that you had load on the Color menu. Then with Edit menu you can set the color scale.
In Paraview you have many filtes to process the data. A useful filter is "Cell data to point data". In the "Filters" drop-down menu you can find it in the "Alphabetical" list.
''(don't hesitate to expand this part)''


  paraview --data=/tmp/threelayer.vtk
  paraview --data=/tmp/threelayer.vtk


[[Image:LausanneDemoDataset3dParaview_4.png|thumb|center|300px|3D groundwater flow]]
[[Image:LausanneDemoDataset3dParaview_4.png|thumb|center|400px|3D groundwater flow]]
 
[[Image:LausanneDemoDataset3dParaview_10.png|thumb|center|400px|3D groundwater flow]]


[[Image:LausanneDemoDataset3dParaview_10.png|thumb|center|300px|3D groundwater flow]]
== RGB visualization ==
 
Data export with {{cmd|r.out.vtk}}:
r.out.vtk input=dsm_s_michele elevation=dsm_s_michele \
          rgbmaps=ofd_s_michele.red,ofd_s_michele.green,ofd_s_michele.blue \
          out=s_michele_color.vtk
 
Load into Paraview:
paraview --data=s_michele_color.vtk
 
* In Paraview, click "Apply"
* Select the "Display" tab and choose "Color by" to switch from input scalars to rgb scalars
* Disable the "Map Scalars" check button in the display tab to avoid the use of a lookup table
 
[[Image:Paraview fondazione mach 3D.png|thumb|center|400px|Fondazione Mach - S. Michele (Italy) area shown in ParaView]]
 
== Shown as stereo anaglyphs ==
 
paraview --stereo --data=s_michele_color.vtk
 
* In Paraview, click "Apply"
* Select the "Display" tab and choose "Color by" to switch from input scalars to rgb scalars
* Disable the "Map Scalars" check button in the display tab to avoid the use of a lookup table
 
[[Image:Paraview fondazione mach ortho 3D.png|thumb|center|400px|Fondazione Mach - S. Michele (Italy) area shown in ParaView's stereo mode]]


== Creating Stereo anaglyphs ==
== Creating Stereo anaglyphs ==


* see [[Stereo anaglyphs]]
* see [[Stereo anaglyphs]]
= See also =
* GRASS 3D Workshop -- 3D data visualization with VTK: [http://www-pool.math.tu-berlin.de/~soeren/grass/files/3DWorkshop_soeren_handouts.pdf PDF handouts] (S. Gebbert)
* Video tutorials: [http://www-pool.math.tu-berlin.de/~soeren/grass/modules/ r3.out.vtk Tutorial] in four parts (S. Gebbert)
* GRASS and VTK related [http://www-pool.math.tu-berlin.de/~soeren/grass/modules/screenshots/ screenshots] (S. Gebbert)


[[Category: Visualization]]
[[Category: Visualization]]
Line 37: Line 66:
[[Category: Linking to other languages]]
[[Category: Linking to other languages]]
[[Category: Tutorial]]
[[Category: Tutorial]]
[[Category: 3D]]
[[Category: VTK]]

Latest revision as of 00:36, 19 June 2013

3D visualization of GRASS data with Paraview

Download Paraview at http://www.paraview.org (available for Linux, MacOSX and MS-Windows) (screenshot gallery)

2D/3D Raster/voxel export

GRASS GIS is one of the few GIS with volume data support. Here data are stored as a 3D raster with a unit volume called a voxel (volume pixel). Voxels are designed to support for example representations of trivariate continuous fields. The latest version of GRASS7 supports space time voxel cubes that have time as the third dimension.

2D/3D Vector export

Visualization

Start Paraview, load VTK data, and choose the correct readers : for example "Legacy VTK file"....it is fairly intuitive to use. In the Properties section click the Apply button, next in the Display section set "Surface" in Representation menu, and set the name of the file that you had load on the Color menu. Then with Edit menu you can set the color scale. In Paraview you have many filtes to process the data. A useful filter is "Cell data to point data". In the "Filters" drop-down menu you can find it in the "Alphabetical" list. (don't hesitate to expand this part)

paraview --data=/tmp/threelayer.vtk
3D groundwater flow
3D groundwater flow

RGB visualization

Data export with r.out.vtk:

r.out.vtk input=dsm_s_michele elevation=dsm_s_michele \
          rgbmaps=ofd_s_michele.red,ofd_s_michele.green,ofd_s_michele.blue \
          out=s_michele_color.vtk

Load into Paraview:

paraview --data=s_michele_color.vtk
  • In Paraview, click "Apply"
  • Select the "Display" tab and choose "Color by" to switch from input scalars to rgb scalars
  • Disable the "Map Scalars" check button in the display tab to avoid the use of a lookup table
Fondazione Mach - S. Michele (Italy) area shown in ParaView

Shown as stereo anaglyphs

paraview --stereo --data=s_michele_color.vtk
  • In Paraview, click "Apply"
  • Select the "Display" tab and choose "Color by" to switch from input scalars to rgb scalars
  • Disable the "Map Scalars" check button in the display tab to avoid the use of a lookup table
Fondazione Mach - S. Michele (Italy) area shown in ParaView's stereo mode

Creating Stereo anaglyphs