[vtkusers] Voxelizing geometry

Reinhold Füreder R.Fureder at exeter.ac.uk
Fri Jun 13 05:56:23 EDT 2003


Hi Stefan,

vtkVoxelModeller is, as far as I know, the only filter which uses the
bit scalar type internally. And I think no other filter can deal with it
(not even vtkImageCast). So, the next filter in the pipeline tends to
report to have no input data. In the example of vtkVoxelModeller a
workaround seems to be necessary:


vtkVoxelModeller *voxelModel = vtkVoxelModeller::New ();
...

vtkDataSetWriter *writer = vtkDataSetWriter::New ();
writer->SetFileName ("voxelModel.vtk");
writer->SetInput (voxelModel->GetOutput ());
writer->Update ();

reader = vtkDataSetReader::New ();
reader->SetFileName ("voxelModel.vtk");


And yes, it is very slow (but generic). Furthermore, after applying a
surface rendering to the resulting data I could look inside the
visualized object - but maybe this was caused by my data???

Experienced VTK gurus, please correct me, if anything stated here is
wrong.

Reinhold

> -----Original Message-----
> From: vtkusers-admin at public.kitware.com 
> [mailto:vtkusers-admin at public.kitware.com] On Behalf Of 
> Stefan Bruckner
> Sent: Thursday, June 12, 2003 7:24 PM
> To: vtkusers at public.kitware.com
> Subject: [vtkusers] Voxelizing geometry
> 
> 
> Hi!
> 
> I am trying to voxelize a geometric object and then perform 
> volume rendering, however, I can't seem to get it working:
> 
> vtkSphereSource *sphere = vtkSphereSource::New();
> sphere->SetThetaResolution(30);
> sphere->SetPhiResolution(30);
> 
> vtkVoxelModeller *modeller = vtkVoxelModeller::New();
> modeller->SetSampleDimensions(64,64,64);
> modeller->SetInput(sphere->GetOutput());
> 
> vtkCastToConcrete *caster = vtkCastToConcrete::New();
> caster->SetInput(modeller->GetOutput());
> 
> I pass the result of "caster->GetStructuredPointsOutput()" to 
> the volume mapper.
> 
> After rather lengthy processing I get the following error 
> message in the output window, and the rendering shows nothing.
> 
> "ERROR: In C:\martink\vtk42\VTK\Filtering\vtkImageToImageFilter.cxx,
> line 94
> vtkImageClip (0x054BD9A8): ExecuteInformation: Input is not set."
> 
> What am I doing wrong? Can anyone please assist me with some 
> sample code or point me to an example (I didn't mange to find 
> examples for voxelization).
> 
> Thanks, 
> Stefan Bruckner
> 
> 
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: 
<http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers




More information about the vtkusers mailing list