[vtkusers] Different visualizations of 3D Data

Curator curator at gmx.de
Wed Mar 27 11:20:11 EDT 2013


Hi,

that you very much for the excellent tip with paraview. I exportet my 
data to a .vtk file with your hint of vtkDataSetWriter and opened this 
file with paraview.

I played around and I am now more sure than before, that i would like to 
produce a visualization as occurs when I choose "Clip" in ParaView.

However, I already got my vtk stuff working with vtkContour just like
     // Assume m_vtkStructuredPoints is filled already and set correctly
     // Futhermore, m_vtkMapper is an vtkPolyDataMapper already 
connected to the rendering pipeline
     m_vtkContourFilter = vtkContourFilter::New();
     m_vtkContourFilter->SetInput(m_vtkStructuredPoints);
     m_vtkMapper->SetInput(m_vtkContourFilter->GetOutput());
     m_vtkContourFilter->GenerateValues(1,0,0);
     m_vtkMapper->SetScalarRange(Min,Max);

     // during update
     m_vtkContourFilter->SetValue(0,Value);


So, basically I need a similar code to bring same input data 
(m_vtkStructuredPoints) to a visualization like "Clip" in ParaView, lets 
say by a plane with surface normal (1,0,0) in the origin (0,0,0).

I tried somethink like that, but that does simply nothing:
     vtkClipDataSet *m_vtkClipDataSet = vtkClipDataSet::New();
     m_vtkClipDataSet->SetInput(m_vtkStructuredPoints);

     vtkPlane *m_vtkPlane = vtkPlane::New();
     m_vtkPlane->SetNormal(1,0,0);
     vtkGeometryFilter *m_vtkGeometryFilter = vtkGeometryFilter::New();

     m_vtkClipDataSet->SetClipFunction(m_vtkPlane);
m_vtkGeometryFilter->SetInputConnection(m_vtkClipDataSet->GetOutputPort());

     m_vtkMapper->SetInput(m_vtkGeometryFilter->GetOutput());

What did I do wrong?

Thank you,
curator

Am 27.03.2013 14:58, schrieb David E DeMarle:
> vtkContourFilter can produce multiple isocontours via the 
> setnumberofContours and setValues methods.
>
> vtkClipDataSet will produce slices.
>
> google search them to find the doxygen, read that and then look for 
> the examples and tests lists to see them in use.
>
> Let me suggest some approaches first though.
>
> Once you've made the structured points from your data, use 
> vtkDataSetWriter to write that data to a file. Then open it up with 
> ParaView and use the GUI to create visualizations. This will get you 
> going very quickly.
>
> The next easiest thing to do is get a hold of python wrapped vtk and 
> set up your paths such that it is useable within Idle. A python IDE 
> with tab completion is the next easiest way I know of to learn VTK 
> since introspection brings all of the doxygen help for every object to 
> your fingertips and experimentation takes place as quickly as you can 
> type.
>
> good luck and welcome to VTK!
>
> David E DeMarle
> Kitware, Inc.
> R&D Engineer
> 21 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-881-4909
>
>
> On Tue, Mar 26, 2013 at 12:05 PM, Curator <curator at gmx.de 
> <mailto:curator at gmx.de>> wrote:
>
>     Hi all,
>
>     I'm kind of new to the data visualization of complex 3D data. Up
>     to now, I only used simple shapes as cubes and spheres etc., which
>     worked perfectly. However, now I am running into visualizing my
>     simulation results, which is simply a three dimensional, equally
>     distanced grid with single numeric values at each grid point.
>
>     So far, I managed to a plot multiple iso surfaces by storing the
>     data in a vtkFloatArray und aligning them by vtkStructuredPoints.
>     Furthermore, I used the vtkContourFilter.
>
>     Now, from the same data, I would like to add variable data slices
>     in the xy, yz, and xz plane. Also, I think my implementation of a
>     (single) iso surface is not efficient, because I generate the
>     values for the contour filter by setting identical maximum and
>     minimum values.
>
>     In general, I am interested in a visualization like in
>     http://vis.lbl.gov/Research/ChomboVis99/vtk-initial.html, but
>     there I do not find further information.
>
>     So,
>
>     1) Is it clever to store my data in a vtkFloatArray and align them
>     by vtkStructuredPoints?
>     2) Is a vtkContourFilter the right tool show _one_ isosurface for
>     a specified value?
>     3) Which Filter should be used for the data slices?
>     4) Which Filter do I have to use for something like
>     http://vis.lbl.gov/Research/ChomboVis99/misc-art/vtk-volume.gif ?
>
>     Thank you for any help,
>
>     regards,
>     curator
>     _______________________________________________
>     Powered by www.kitware.com <http://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/20130327/386184c3/attachment.htm>


More information about the vtkusers mailing list