[vtkusers] vtkProbeFilter can't convert unstructuredgrid data to Imagedata

Amy Squillacote amy.squillacote at kitware.com
Wed Apr 19 12:59:29 EDT 2006


The output of vtkProbeFilter is the same type as 
the input.  First make sure that the data you're 
using as input to vtkProbeFilter is of type 
vtkImageData.  Then when you're getting the 
output, call GetStructuredPointsOutput() on the 
probe filter.  (vtkStructuredPoints is a subclass of vtkImageData.)

- Amy

At 12:49 PM 4/19/2006, goldenrodxiao wrote:
>Hi all,
>
>I just learned VTK by vtk user guide(4.2). I 
>have read the charpter 6, it is said that 
>vtkProbeFilter can resample an unstructuredGrid 
>data into a regular image data. But when I 
>follow the user guide and try it(sample the 
>structuredgrid into image data, I found I 
>couldn't get imagedata, I just get Dataset data.  please help me.
>
>By the way,I have a large number od point 
>data(x,y,z),so I considered I can convert them 
>into the image data, then carry on Raycasting 
>method. can you give some suggestion about it?
>
>Best Regards,
>
>
>//my code below
>
>fp=fopen("test1.vtk","r");
>         float x,y,z;
>     while(!feof(fp))
>         {
>                 fscanf(fp,"%f%f%f\n",&x,&y,&z);
>             points->InsertNextPoint(x,y,z);
>                 //cout<<x<<y<<z<<endl;
>         }
>         vtkCubeSource *cube=vtkCubeSource::New();
>         cube->SetCenter(0.0,0.0,0.0);
>
>         vtkPolyData *profile=vtkPolyData::New();
>         profile->SetPoints(points);
>     vtkProbeFilter *probe=vtkProbeFilter::New();
>     probe->SetInput(cube->GetOutput());
>         probe->SetSource(profile);
>
>
>
>
>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡goldenrodxiao
>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡goldenrod at 263.net
>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2006-04-20
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
>http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers





More information about the vtkusers mailing list