[vtkusers] vtkImageData point extraction
Jafari, Kourosh
kjafari at rad.hfh.edu
Sat Dec 25 20:38:16 EST 2010
Hi David,
I have similar a question. I have a 3D image volume and would like to sample it on a structured grid. Here is how I use it:
static int dims[3]={100,100,100};
vtkStructuredGrid *sgrid = vtkStructuredGrid::New();
sgrid->SetDimensions(dims);
....
probe->SetInput(sgrid);
probe->SetSource(connector->GetOutput());
probe->SpatialMatchOn();
vtkImageData *imageP = vtkImageData::New();
imageP->DeepCopy(probe->GetImageDataOutput());
The type of connector->GetOutput() is vtkImageData which is the volume I'd like to sample. I later display imageP. There is no compilation error but it crashes when I run it. If I exchange the inputs of SetInput and SetSource, it does not crash but it does not do anything either. What am I missing?
Thanks!!
Kourosh
________________________________________
From: vtkusers-bounces at vtk.org [vtkusers-bounces at vtk.org] On Behalf Of David Gobbi [david.gobbi at gmail.com]
Sent: Friday, December 24, 2010 4:51 PM
To: Maxwell, Thomas P. (GSFC-606.2)[SCIENCE APPLICATIONS INTL CORP]
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] vtkImageData point extraction
Hi Tom,
I think you want vtkProbeFilter. It takes two inputs, one input for
volumetric data and another input for a set of points whose scalars
will be interpolated from the first input.
probeFilter->SetSourceConnection(<data-to-be-interpolated goes here>)
probeFilter->SetInputConnection(<point input goes here>)
Is this what you were looking for?
David
On Thu, Dec 23, 2010 at 9:43 AM, Maxwell, Thomas P.
(GSFC-606.2)[SCIENCE APPLICATIONS INTL CORP] <thomas.maxwell at nasa.gov>
wrote:
>
> Is there a VTK filter that will take as input a vtkImageData and a list of
> (unstructured) points and then compute (as output) the image values at the
> specified point locations?
>
> Thanks,
> Tom
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the VTK 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