[vtkusers] Unstructured grid to structured grid?
chris.marsh at usask.ca
Tue Sep 16 13:52:11 EDT 2014
Mmh thanks. I think I'll stick with the probe filter.
I've been able to get this example working
if I have a real-world pt cloud, I'm a bit unclear how I should make the
If xll and yll are the lower x and y coordinates of an axis aligned
size_t gridSize = 100;
for ( size_t x = 0; x < gridSize; x++ )
for ( size_t y = 0; y < gridSize; y++ )
gridPoints->InsertNextPoint ( x+xll, y+yll, 0);
does not seem to produce any output.
On Mon, Sep 15, 2014 at 4:39 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> Another filter that might work is vtkShepardMethod, which takes
> unstructured points (e.g. an arbitrary set of samples) as input and
> produces a vtkImageData as output.
> The difference between vtkProbeFilter and vtkShepardMethod is
> that the former performs the interpolation based on the connectivity
> of the points (i.e. based on the cells), while the latter ignores the
> connectivity and does the interpolation purely based on distance.
> - David
> On Mon, Sep 15, 2014 at 4:23 PM, Chris Marsh <chris.marsh at usask.ca> wrote:
> > Thanks David, this looks perfect.
> > On Mon, Sep 15, 2014 at 4:10 PM, David Gobbi <david.gobbi at gmail.com>
> >> Hi Chris,
> >> This sounds like a job for vtkProbeFilter. The probe filter takes two
> >> inputs,
> >> the "input" and the "source". The idea is that it resamples the scalars
> >> from
> >> the "source" onto the geometry of the "input". So, in this case, the
> >> "source"
> >> is your unstructured grid, and the "input" is any vtkImageData that has
> >> the
> >> origin, spacing, and extent that you want to use for the regridding.
> >> output of vtkProbeFilter will be an image that has the same geometry as
> >> the input, but that has pixel values that have been interpolated from
> >> unstructured grid. You should be able to find several examples on the
> >> wiki.
> >> - David
> >> On Mon, Sep 15, 2014 at 3:59 PM, chrism <chris.marsh at usask.ca> wrote:
> >> > Is it possible to (easily) convert an unstructured grid to a
> >> > grid
> >> > (Image data)?
> >> >
> >> > Is unstructured -> polydata -> image data the only way? If so, how
> >> > example
> >> > (
> >> > ??)
> >> >
> >> > Ultimately, the unstructured grid represents a topography, and I am
> >> > looking
> >> > to 'rasterize' it for use in a GIS.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers