[vtkusers] Create Structured Point Set?

David Doria daviddoria at gmail.com
Wed Mar 4 09:26:55 EST 2009


So I'd have to snap my data to the grid manually? There is no way to convert
a unstructured grid of points to a structured grid? (where it automatically
sets the spacing to the largest spacing that will make each point fall on
the grid?)

Thanks,

David


On Wed, Mar 4, 2009 at 9:24 AM, Bryn Lloyd <blloyd at vision.ee.ethz.ch> wrote:

> this is a image with all zeros:
>
> vtkImageData *output = vtkImageData::New();
>  output->SetScalarTypeToDouble();
>  output->SetDimensions(this->Dimensions);
>  output->SetOrigin(this->Origin);
>  output->SetSpacing(this->Spacing);
>  output->AllocateScalars();
>  output->GetPointData()->GetScalars()->SetName("scalars");
>  output->GetPointData()->GetScalars()->FillComponent(0,0.0);
>
>
> You could assign the pixel values by whatever method you want. A simple
> test case can be generated by using the calculator on above image in
> paraview. (write it with a vtkDataSetWriter...)
>
>
> --Bryn
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090304/21ad6292/attachment.htm>


More information about the vtkusers mailing list