[vtkusers] converting vtkImageData to vtkUnstructuredGrid

Bill Lorensen bill.lorensen at gmail.com
Sun Apr 10 11:59:54 EDT 2011


A Quad is 2D while a Tetra is 3D. A Quad can be turned into a triangle with
vtkTriangleFilter.

On Sun, Apr 10, 2011 at 11:21 AM, Liam Kurmos <quantum.leaf at gmail.com>wrote:

> Does vtk provide a way to turn quads into tetras?
>
> Liam
>
>
> On Sat, Apr 9, 2011 at 11:52 AM, Liam Kurmos <quantum.leaf at gmail.com>
> wrote:
> > Thanks David!
> >
> > On Sat, Apr 9, 2011 at 11:27 AM, David E DeMarle
> > <dave.demarle at kitware.com> wrote:
> >> It produces voxel cells not tetrahedral cells, so the mapping is one to
> one.
> >>
> >> David E DeMarle
> >> Kitware, Inc.
> >> R&D Engineer
> >> 28 Corporate Drive
> >> Clifton Park, NY 12065-8662
> >> Phone: 518-371-3971 x109
> >>
> >>
> >>
> >> On Sat, Apr 9, 2011 at 3:59 AM, Liam Kurmos <quantum.leaf at gmail.com>
> wrote:
> >>> I've attempted to convert imagedata to unstructured data as you
> >>> suggested some time back using vtkthreshold.
> >>> In the code below vtkVol is a vtkImageData with scalar point data.
> >>> However when i query the number of cells in the output unstructured
> >>> grid i get the same as in the structured data. I would image there
> >>> should be twice as many unstructured tetrahedra as cells in the
> >>> structured data, can you comment on this?
> >>>
> >>> Liam
> >>>
> >>>
> >>>    vtkSmartPointer<vtkThreshold>
> >>> threshold=vtkSmartPointer<vtkThreshold>::New();
> >>>    threshold->SetInput(vtkVol);
> >>>    threshold->ThresholdByUpper(0);//scalars are all postive so
> threshold all
> >>>    vtkSmartPointer<vtkUnstructuredGrid>
> volumeMesh=threshold->GetOutput();
> >>>    threshold->Update();
> >>>    cout<<" vtkug num cells "<<volumeMesh->GetNumberOfCells()<<endl;
> >>>    cout<<" imagedata num cells "<<vtkVol->GetNumberOfCells()<<endl;
> >>>
> >>>
> >>>
> >>> On Wed, Feb 9, 2011 at 3:34 PM, David E DeMarle
> >>> <dave.demarle at kitware.com> wrote:
> >>>> Threshold and many other subsetting filters produce arbitrary sets of
> >>>> cells, thus by definition they can not produce structured data.
> >>>>
> >>>> David E DeMarle
> >>>> Kitware, Inc.
> >>>> R&D Engineer
> >>>> 28 Corporate Drive
> >>>> Clifton Park, NY 12065-8662
> >>>> Phone: 518-371-3971 x109
> >>>>
> >>>>
> >>>>
> >>>> On Wed, Feb 9, 2011 at 10:05 AM, Liam Kurmos <quantum.leaf at gmail.com>
> wrote:
> >>>>> Hi David,
> >>>>>
> >>>>> Thanks for replying.
> >>>>>
> >>>>>> One way is to apply the threshold filter and set the threshold so
> that
> >>>>>> it includes the entire scalar range.
> >>>>>
> >>>>> is it a side affect of the threshold filter that it will also produce
> >>>>> an unstructured grid from a structured one?
> >>>>>
> >>>>> cheers,
> >>>>>
> >>>>> Liam
> >>>>>
> >>>>
> >>>
> >>
> >
> _______________________________________________
> 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/20110410/1d106e99/attachment.htm>


More information about the vtkusers mailing list