[vtkusers] problem with vtkVoxelModeller

Audrey Lemoussu audrey.lemoussu at nist.gov
Thu Apr 24 10:54:19 EDT 2008


Hi

I have started to work with vtk for 2 weeks, and I need some help from 
vtk Users. I saw on the Internet that other people had had the same 
problem, but I didn't find any answer. In fact, when I write the output 
of my vtkVoxelModeller Object, I only get zeros.
I don't know where it comes from!

This is a part of my program :
  vtkPolyDataReader *holeReader = vtkPolyDataReader::New();
  holeReader->SetFileName( holeFileName );
  holeReader->Update();

  vtkPolyData *holePolyData = vtkPolyData::New();
  holePolyData->SetPoints( holeReader->GetOutput()->GetPoints() );
  holePolyData->SetPolys( holeReader->GetOutput()->GetLines() );

  int sampleDimensions[3] = { 10, 10, 10 };
  double modelBounds[6] = { 0.0, 1.0, 0.0, 1.0, 0.0, 1.0 };

  vtkVoxelModeller *voxelModeller = vtkVoxelModeller::New();
  voxelModeller->SetInput( holePolyData );
  //voxelModeller->SetSampleDimensions( sampleDimensions );
  // voxelModeller->SetModelBounds( modelBounds );
  voxelModeller->Update();

  vtkDataSetWriter *writer = vtkDataSetWriter::New();
  writer->SetFileName( outputFileName );
  writer->SetInputConnection (voxelModeller->GetOutputPort() );
  writer->Write();

  holeReader->Delete();
  holePolyData->Delete();
  voxelModeller->Delete();
  writer->Delete();

Can anyone tell me if I have done some mistakes in my program or where 
my problem comes from ?

Audrey Lemoussu




More information about the vtkusers mailing list