[vtkusers] Geometry Voxelization

Stefan Gächter stefan.gaechter at mavt.ethz.ch
Thu Jan 25 13:10:31 EST 2007


Hi,
 
This problem has already been discussed in the past, but the solution
proposed seems no to work for me. Actually, I try to implement the tcl
example code voxelModel.tcl in C++, but the program does not compile
properly.
 
The code snippet is:
 
1  vtkSphereSource *sphere = vtkSphereSource::New();
2  sphere->SetThetaResolution(10);
3  sphere->SetPhiResolution(10);
 
4  vtkVoxelModeller *modeller = vtkVoxelModeller::New();
5  modeller->SetInput(sphere->GetOutput());
6  modeller->SetSampleDimensions(21,21,21);
7  modeller->SetModelBounds(-1.5,1.5,-1.5,1.5,-1.5,1.5);
 
8  vtkDataSetWriter *writer = vtkDataSetWriter::New();
9  writer->SetFileName("voxelModel.vtk");
10  writer->SetInput(modeller->GetOutput());
11  writer->Update();
  
12  vtkDataSetReader *reader = vtkDataSetReader::New();
13  reader->SetFileName("voxelModel.vtk");
 
14  vtkContourFilter *contour = vtkContourFilter::New();
15  contour->SetInput(reader->GetOutput());
16  contour->SetValue(0,0.999);
  
17  vtkPolyDataMapper *polyDataMapper = vtkPolyDataMapper::New();
18  polyDataMapper->SetInput(contour->GetOutput());

 
The compiler error is at line 10:
 
mexVTKVoxelRenderer.cpp:110: error: no matching function for call to
`vtkDataSetWriter::SetInput(vtkImageData*)' 
C:/Engineering/VTK5p0p2/include/vtk-5.0/vtkWriter.h:63: note: candidates
are: void vtkWriter::SetInput(vtkDataObject*) 
C:/Engineering/VTK5p0p2/include/vtk-5.0/vtkWriter.h:64: note:
void vtkWriter::SetInput(int, vtkDataObject*) 

 
Since I am vtk newbie, it might be only a simple error. Anyway, I would
appreciate any kind of help.
 
Thanks,
 
Stefan
 
--------------------------------
Stefan Gächter                  
PhD Student/Research Assistant
Swiss Federal Institute of Technology (ETHZ)
Autonomous Systems Lab (ASL)
Office CLA E11.2
Tannenstrasse 3
8092 Zürich, Switzerland
44-632-73-95
stefan.gaechter at mavt.ethz.ch
 <http://www.asl.ethz.ch/> http://www.asl.ethz.ch
--------------------------------
Please consider the environment before printing this email.
--------------------------------

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070125/a2e314c5/attachment.htm>


More information about the vtkusers mailing list