[GRASS-dev] 3D Vector to Voxel

Hi all,

I just saw a little GPL'd sofwtare that may provide a base for
a v.to.r3 module that could actually cast arbitrary vector geometries
to a voxel grid:

http://www.cs.princeton.edu/~min/binvox/

maybe someone would like to look at possibilities for integrating
this into GRASS?

Best,

Ben

------
Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.

Has anybody tested the Location Wizard ?
I tried it (GRASS64 William's binary on Mac)
and it is really nice, seems to work well for existing georef. files options
but it got stuck when I tried to define the location coordinate system
myself and I had some problems with the EPSG search.

Is this ready for GRASS64 release or should we do more testing on it
and file bug reports if something does not work?

Helena

Hi,

2009/9/24 Helena Mitasova <hmitaso@unity.ncsu.edu>:

Has anybody tested the Location Wizard ?
I tried it (GRASS64 William's binary on Mac)
and it is really nice, seems to work well for existing georef. files options
but it got stuck when I tried to define the location coordinate system
myself and I had some problems with the EPSG search.

Exactly?

Is this ready for GRASS64 release or should we do more testing on it
and file bug reports if something does not work?

Please report any bug you find in wxGUI in trac system. I will be back
in few months, probably Michael is going to have more time for wxGUI
development (and I still hope there will be more wxGUI developers
soon;-)

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa

Hello Ben,

2009/9/21 Benjamin Ducke <benjamin.ducke@oxfordarch.co.uk>:

Hi all,

I just saw a little GPL'd sofwtare that may provide a base for
a v.to.r3 module that could actually cast arbitrary vector geometries
to a voxel grid:

Have a look at the vtkVoxelModeller class :
http://www.vtk.org/doc/release/5.4/html/a01861.html

or the vtkImplicitModeller class:
http://www.vtk.org/doc/release/5.4/html/a00859.html

Booth classes convert arbitrary datasets to a voxel representations.

I have just committed a grass vector topology reader to the vtkGRASSBridge
repository.
Maybe you can now create voxel representations of 3d grass vector
data, using GRAS, VTK and vtkGRASSBridge?

Best regards
Soeren

http://www.cs.princeton.edu/~min/binvox/

maybe someone would like to look at possibilities for integrating
this into GRASS?

Best,

Ben

------
Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

That looks really useful. There is probably a myriad of other
classes in VTK that could be used by GRASS modules, too.

I guess the best way would be to write some add-on
modules that depend on VTK and the GRASS bridge and
expose some VTK classes to the GRASS CLI.

However, then I would have to learn C++ :wink:

How about the OpenGL coordinate precision problem?

Beń

----- Original Message -----
From: "Soeren Gebbert" <soerengebbert@googlemail.com>
To: "Benjamin Ducke" <benjamin.ducke@oxfordarch.co.uk>
Cc: "GRASS developers list" <grass-dev@lists.osgeo.org>
Sent: Tuesday, September 29, 2009 2:49:53 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna
Subject: Re: [GRASS-dev] 3D Vector to Voxel

Hello Ben,

2009/9/21 Benjamin Ducke <benjamin.ducke@oxfordarch.co.uk>:

Hi all,

I just saw a little GPL'd sofwtare that may provide a base for
a v.to.r3 module that could actually cast arbitrary vector geometries
to a voxel grid:

Have a look at the vtkVoxelModeller class :
http://www.vtk.org/doc/release/5.4/html/a01861.html

or the vtkImplicitModeller class:
http://www.vtk.org/doc/release/5.4/html/a00859.html

Booth classes convert arbitrary datasets to a voxel representations.

I have just committed a grass vector topology reader to the vtkGRASSBridge
repository.
Maybe you can now create voxel representations of 3d grass vector
data, using GRAS, VTK and vtkGRASSBridge?

Best regards
Soeren

http://www.cs.princeton.edu/~min/binvox/

maybe someone would like to look at possibilities for integrating
this into GRASS?

Best,

Ben

------
Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

------
Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.

Hello Ben,

2009/9/29 Benjamin Ducke <benjamin.ducke@oxfordarch.co.uk>:

That looks really useful. There is probably a myriad of other
classes in VTK that could be used by GRASS modules, too.

Indeed.

I guess the best way would be to write some add-on
modules that depend on VTK and the GRASS bridge and
expose some VTK classes to the GRASS CLI.

However, then I would have to learn C++ :wink:

You don't need to learn C++. You can use Python or Java to connect
grass, vtkGRASSBridge and VTK.
And even TCL/TK if im going crazy and support the vtkTckTkWrapper. :wink:

A simple Python example which will work right out of the box:

http://code.google.com/p/vtk-grass-bridge/source/browse/trunk/Examples/r.gauss.smooth

On command line call within the nc dataset:

python r.gauss.smooth input=lsat5_1987_10 output=test --o

Thats all :slight_smile:

How about the OpenGL coordinate precision problem?

I guess the problem is still there, i haven't tested it recently.

Best regards
Soeren

Beń

----- Original Message -----
From: "Soeren Gebbert" <soerengebbert@googlemail.com>
To: "Benjamin Ducke" <benjamin.ducke@oxfordarch.co.uk>
Cc: "GRASS developers list" <grass-dev@lists.osgeo.org>
Sent: Tuesday, September 29, 2009 2:49:53 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna
Subject: Re: [GRASS-dev] 3D Vector to Voxel

Hello Ben,

2009/9/21 Benjamin Ducke <benjamin.ducke@oxfordarch.co.uk>:

Hi all,

I just saw a little GPL'd sofwtare that may provide a base for
a v.to.r3 module that could actually cast arbitrary vector geometries
to a voxel grid:

Have a look at the vtkVoxelModeller class :
http://www.vtk.org/doc/release/5.4/html/a01861.html

or the vtkImplicitModeller class:
http://www.vtk.org/doc/release/5.4/html/a00859.html

Booth classes convert arbitrary datasets to a voxel representations.

I have just committed a grass vector topology reader to the vtkGRASSBridge
repository.
Maybe you can now create voxel representations of 3d grass vector
data, using GRAS, VTK and vtkGRASSBridge?

Best regards
Soeren

http://www.cs.princeton.edu/~min/binvox/

maybe someone would like to look at possibilities for integrating
this into GRASS?

Best,

Ben

------
Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

------
Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

That looks very straight-forward. I don't know Python
either, though.
Could you write a little example script that runs the
VTK Delaunay 2D filter on a GRASS points map, as well? :wink:

Ben

----- Original Message -----
From: "Soeren Gebbert" <soerengebbert@googlemail.com>
To: "Benjamin Ducke" <benjamin.ducke@oxfordarch.co.uk>
Cc: "GRASS developers list" <grass-dev@lists.osgeo.org>
Sent: Tuesday, September 29, 2009 5:38:12 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna
Subject: Re: [GRASS-dev] 3D Vector to Voxel

You don't need to learn C++. You can use Python or Java to connect
grass, vtkGRASSBridge and VTK.
And even TCL/TK if im going crazy and support the vtkTckTkWrapper. :wink:

A simple Python example which will work right out of the box:

http://code.google.com/p/vtk-grass-bridge/source/browse/trunk/Examples/r.gauss.smooth

On command line call within the nc dataset:

python r.gauss.smooth input=lsat5_1987_10 output=test --o

Thats all :slight_smile:

Beń

----- Original Message -----
From: "Soeren Gebbert" <soerengebbert@googlemail.com>
To: "Benjamin Ducke" <benjamin.ducke@oxfordarch.co.uk>
Cc: "GRASS developers list" <grass-dev@lists.osgeo.org>
Sent: Tuesday, September 29, 2009 2:49:53 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna
Subject: Re: [GRASS-dev] 3D Vector to Voxel

Hello Ben,

2009/9/21 Benjamin Ducke <benjamin.ducke@oxfordarch.co.uk>:

Hi all,

I just saw a little GPL'd sofwtare that may provide a base for
a v.to.r3 module that could actually cast arbitrary vector geometries
to a voxel grid:

Have a look at the vtkVoxelModeller class :
http://www.vtk.org/doc/release/5.4/html/a01861.html

or the vtkImplicitModeller class:
http://www.vtk.org/doc/release/5.4/html/a00859.html

Booth classes convert arbitrary datasets to a voxel representations.

I have just committed a grass vector topology reader to the vtkGRASSBridge
repository.
Maybe you can now create voxel representations of 3d grass vector
data, using GRAS, VTK and vtkGRASSBridge?

Best regards
Soeren

http://www.cs.princeton.edu/~min/binvox/

maybe someone would like to look at possibilities for integrating
this into GRASS?

Best,

Ben

------
Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

------
Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

------
Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.

Hello Ben,

2009/9/30 Benjamin Ducke <benjamin.ducke@oxfordarch.co.uk>:

That looks very straight-forward. I don't know Python
either, though.
Could you write a little example script that runs the
VTK Delaunay 2D filter on a GRASS points map, as well? :wink:

The grass vector to VTK polydata writer is right on its way.
There is already a brand new grass vector writer class in
vtk-grass-bridge svn. :slight_smile:

When the writer is ready i will provide a VTK Delaunay 2D filter module
for grass vector maps.

And if you ask for, i can provide the VTK and vtkGRASSBridge shared
libraries (compiled on SUSE Linux 11.1),
so you can test the module without compiling VTK and vtkGRASSBridge on
your machine.

Best regards
Soeren

btw:
I can bring an USB stick on 15 Oct. 2009. :smiley:

Ben

----- Original Message -----
From: "Soeren Gebbert" <soerengebbert@googlemail.com>
To: "Benjamin Ducke" <benjamin.ducke@oxfordarch.co.uk>
Cc: "GRASS developers list" <grass-dev@lists.osgeo.org>
Sent: Tuesday, September 29, 2009 5:38:12 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna
Subject: Re: [GRASS-dev] 3D Vector to Voxel

You don't need to learn C++. You can use Python or Java to connect
grass, vtkGRASSBridge and VTK.
And even TCL/TK if im going crazy and support the vtkTckTkWrapper. :wink:

A simple Python example which will work right out of the box:

http://code.google.com/p/vtk-grass-bridge/source/browse/trunk/Examples/r.gauss.smooth

On command line call within the nc dataset:

python r.gauss.smooth input=lsat5_1987_10 output=test --o

Thats all :slight_smile:

Beń

----- Original Message -----
From: "Soeren Gebbert" <soerengebbert@googlemail.com>
To: "Benjamin Ducke" <benjamin.ducke@oxfordarch.co.uk>
Cc: "GRASS developers list" <grass-dev@lists.osgeo.org>
Sent: Tuesday, September 29, 2009 2:49:53 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna
Subject: Re: [GRASS-dev] 3D Vector to Voxel

Hello Ben,

2009/9/21 Benjamin Ducke <benjamin.ducke@oxfordarch.co.uk>:

Hi all,

I just saw a little GPL'd sofwtare that may provide a base for
a v.to.r3 module that could actually cast arbitrary vector geometries
to a voxel grid:

Have a look at the vtkVoxelModeller class :
http://www.vtk.org/doc/release/5.4/html/a01861.html

or the vtkImplicitModeller class:
http://www.vtk.org/doc/release/5.4/html/a00859.html

Booth classes convert arbitrary datasets to a voxel representations.

I have just committed a grass vector topology reader to the vtkGRASSBridge
repository.
Maybe you can now create voxel representations of 3d grass vector
data, using GRAS, VTK and vtkGRASSBridge?

Best regards
Soeren

http://www.cs.princeton.edu/~min/binvox/

maybe someone would like to look at possibilities for integrating
this into GRASS?

Best,

Ben

------
Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

------
Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

------
Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

That looks very straight-forward. I don't know Python
either, though.

time well spent:

10 minutes Python tutorial for programmers of other languages
   http://www.poromenos.org/tutorials/python

Hamish

Hi Ben,

2009/9/30 Benjamin Ducke <benjamin.ducke@oxfordarch.co.uk>:

That looks very straight-forward. I don't know Python
either, though.
Could you write a little example script that runs the
VTK Delaunay 2D filter on a GRASS points map, as well? :wink:

Here we are:
http://code.google.com/p/vtk-grass-bridge/source/browse/trunk/Examples/v.delaunay2d.py?spec=svn24&r=24

Best reagards
Soeren

btw:
Some additional informations:

The help:

GRASS 7.0.svn (nc_spm_08):~/src/vtkGRASSBridge/vtk-grass-bridge/Examples

python v.delaunay2d.py --help

Description:
Delaunay 2d triangulation using the vtkDelaunay2D class. The created
triangles will be converted into the grass vector feature face.

Keywords:
vector, delaunay

Usage:
v.delaunay2d.py [-tw] input=name output=name [alpha=alpha]
   [tolerance=tolerance] [--overwrite] [--verbose] [--quiet]

Flags:
  -t Build vector topology
  -w Write the triangulated map as vtk xml file to the current
working directoy named <output>.vtk
--o Allow output files to overwrite existing files
--v Verbose module output
--q Quiet module output

Parameters:
      input Name of input vector map
     output Name for output vector map
      alpha Specify alpha (or distance) value to control output of
this filter. For a non-zero alpha value, only edges or triangles
contained within a sphere centered at mesh vertices will be output.
Otherwise, only triangles will be output.
              default: 0
  tolerance Specify a tolerance to control discarding of closely
spaced points. This tolerance is specified as a fraction of the
diagonal length of the bounding box of the points.
              default: 0

Now some Computation.

VTK version with topo and vtk xml output:

GRASS 7.0.svn (nc_spm_08):~/src/vtkGRASSBridge/vtk-grass-bridge/Examples

time python v.delaunay2d.py input=elev_lid792_randpts@user1

output=delaunay2d --o -tw
Vector map <delaunay2d> already exists and will be overwritten
Building topology for vector map <delaunay2d>...
Registering primitives...
11912 primitives registered
35736 vertices registered
Building areas...
100%
0 areas built
0 isles built
Attaching islands...
Attaching centroids...
100%
Number of nodes: 5773
Number of primitives: 11912
Number of points: 0
Number of lines: 0
Number of boundaries: 0
Number of centroids: 0
Number of faces: 11912
Number of areas: 0
Number of isles: 0

real 0m1.750s
user 0m1.564s
sys 0m0.144s

VTK version without topo and vtk xml output:

GRASS 7.0.svn (nc_spm_08):~/src/vtkGRASSBridge/vtk-grass-bridge/Examples

time python v.delaunay2d.py input=elev_lid792_randpts@user1

output=delaunay2d --o
Vector map <delaunay2d> already exists and will be overwritten

real 0m1.167s
user 0m1.004s
sys 0m0.144s

Comparsion to v.delaunay with huge map, notice its a 3d vector map:

VTK version without grass topology build:

GRASS 7.0.svn (nc_spm_08):~/src/vtkGRASSBridge/vtk-grass-bridge/Examples

time python v.delaunay2d.py input=elev_ned10m_cont10m

output=delaunay2d --o
Vector map <delaunay2d> already exists and will be overwritten

real 0m27.422s
user 0m25.230s
sys 0m1.904s

VTK version with grass topology build:

GRASS 7.0.svn (nc_spm_08):~/src/vtkGRASSBridge/vtk-grass-bridge/Examples

time python v.delaunay2d.py input=elev_ned10m_cont10m

output=delaunay2d --o -t
Vector map <delaunay2d> already exists and will be overwritten
Building topology for vector map <delaunay2d>...
Registering primitives...
369281 primitives registered
1107843 vertices registered
Building areas...
100%
0 areas built
0 isles built
Attaching islands...
Attaching centroids...
100%
Number of nodes: 151776
Number of primitives: 369281
Number of points: 0
Number of lines: 0
Number of boundaries: 0
Number of centroids: 0
Number of faces: 369281
Number of areas: 0
Number of isles: 0

real 0m45.035s
user 0m42.243s
sys 0m2.464s

Now the grass version:

GRASS 7.0.svn (nc_spm_08):~/src/vtkGRASSBridge/vtk-grass-bridge/Examples

time v.delaunay input=elev_ned10m_cont10m@user1 output=delaunay2d

--o
WARNING: Vector map <delaunay2d> already exists and will be overwritten
Building topology for vector map <delaunay2d>...
Registering primitives...
0 primitives registered
0 vertices registered
Building areas...
0 areas built
0 isles built
Number of nodes: 0
Number of primitives: 0
Number of points: 0
Number of lines: 0
Number of boundaries: 0
Number of centroids: 0
Number of areas: 0
Number of isles: 0
Building topology for vector map <delaunay2d>...
Attaching islands...
Attaching centroids...
Number of nodes: 0
Number of primitives: 0
Number of points: 0
Number of lines: 0
Number of boundaries: 0
Number of centroids: 0
Number of areas: 0
Number of isles: 0

real 0m0.053s
user 0m0.028s
sys 0m0.020s

That was fast! Well looks like v.delaunay only works with 2d vector maps???

Ben

----- Original Message -----
From: "Soeren Gebbert" <soerengebbert@googlemail.com>
To: "Benjamin Ducke" <benjamin.ducke@oxfordarch.co.uk>
Cc: "GRASS developers list" <grass-dev@lists.osgeo.org>
Sent: Tuesday, September 29, 2009 5:38:12 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna
Subject: Re: [GRASS-dev] 3D Vector to Voxel

You don't need to learn C++. You can use Python or Java to connect
grass, vtkGRASSBridge and VTK.
And even TCL/TK if im going crazy and support the vtkTckTkWrapper. :wink:

A simple Python example which will work right out of the box:

http://code.google.com/p/vtk-grass-bridge/source/browse/trunk/Examples/r.gauss.smooth

On command line call within the nc dataset:

python r.gauss.smooth input=lsat5_1987_10 output=test --o

Thats all :slight_smile:

Beń

----- Original Message -----
From: "Soeren Gebbert" <soerengebbert@googlemail.com>
To: "Benjamin Ducke" <benjamin.ducke@oxfordarch.co.uk>
Cc: "GRASS developers list" <grass-dev@lists.osgeo.org>
Sent: Tuesday, September 29, 2009 2:49:53 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna
Subject: Re: [GRASS-dev] 3D Vector to Voxel

Hello Ben,

2009/9/21 Benjamin Ducke <benjamin.ducke@oxfordarch.co.uk>:

Hi all,

I just saw a little GPL'd sofwtare that may provide a base for
a v.to.r3 module that could actually cast arbitrary vector geometries
to a voxel grid:

Have a look at the vtkVoxelModeller class :
http://www.vtk.org/doc/release/5.4/html/a01861.html

or the vtkImplicitModeller class:
http://www.vtk.org/doc/release/5.4/html/a00859.html

Booth classes convert arbitrary datasets to a voxel representations.

I have just committed a grass vector topology reader to the vtkGRASSBridge
repository.
Maybe you can now create voxel representations of 3d grass vector
data, using GRAS, VTK and vtkGRASSBridge?

Best regards
Soeren

http://www.cs.princeton.edu/~min/binvox/

maybe someone would like to look at possibilities for integrating
this into GRASS?

Best,

Ben

------
Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

------
Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

------
Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Sorry, i posted a wrong version. Here is the correct link:

http://code.google.com/p/vtk-grass-bridge/source/browse/trunk/Examples/v.delaunay2d.py

best regards
Soeren

Wow, that was fast. Thanks a lot for this!
I suppose it's time to learn some Python...

Best,

Ben

----- Original Message -----
From: "Soeren Gebbert" <soerengebbert@googlemail.com>
To: "Benjamin Ducke" <benjamin.ducke@oxfordarch.co.uk>
Cc: "GRASS developers list" <grass-dev@lists.osgeo.org>
Sent: Sunday, October 4, 2009 4:35:55 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna
Subject: Re: [GRASS-dev] 3D Vector to Voxel

Sorry, i posted a wrong version. Here is the correct link:

http://code.google.com/p/vtk-grass-bridge/source/browse/trunk/Examples/v.delaunay2d.py

best regards
Soeren

------
Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.