[Paraview] 3D vector & contour plots from a set of scattered point

Eric E. Monson emonson at cs.duke.edu
Tue Dec 1 09:40:19 EST 2009


Hey Nima,

Be sure to keep your replies on the list so people who know more about  
this than I do can help out, too. :)

Are you sure that the accuracy is not good enough, or do the contours  
just not look smooth enough? There are, of course, other types of  
spatial interpolation you could do, so maybe you just prefer a more  
sophisticated algorithm, but this is a linear interpolation based on  
the locations of your original data points...

In ParaView you can create a regular grid with a Python Programmable  
Source (here I'll show an example, but there are a few ways of doing  
this...):

Output Data Set Type: vtkImageData

Script:
ido = self.GetImageDataOutput()
exts = ido.GetUpdateExtent()
ido.SetExtent(exts)
org = -10
sp = 0.5
ido.SetOrigin(org, org, org)
ido.SetSpacing(sp, sp, sp)

Script (RequestInformation):
pdo = self.GetImageDataOutput()
N = 41
pdo.SetWholeExtent(0,N-1,0,N-1,0,N-1)

Then, if you have data like the output of the Delaunay3D, you can  
apply the Resample With Dataset filter using the Delaunay output as  
the "Input", and the Programmable Source ImageData as the "Source".  
This relies, though, on having something like the Delaunay results to  
define how the spatial interpolation will be done. (Here, by having  
your data at the vertices of tetrahedral cells, between which the  
scalars will be linearly interpolated.)

VTK also has some other methods for getting from unstructured grids  
(or point sets) to ImageData by "splatting" -- vtkShepardMethod,  
vtkGaussianSplatter & vtkFastSplatter -- which can be incorporated  
into ParaView as plugins fairly easily.

Otherwise, maybe someone else can help figure out how to get your  
usual method of spatial interpolation into ParaView (or, something  
like it could be in there, but I'm just not aware of it because I  
don't usually do that sort of transformation...)

Good luck
-Eric


On Dec 1, 2009, at 6:51 AM, Nima Emadi wrote:

> Hi Eric,
> Thanks a lot,
> Your sugestion is working for my problem, However it's accuracy is  
> not good enough. (I must say that I haven't played much with the  
> parameters).
> I used a code to intorpolate my field on a regular grid and then  
> imported the output to paraview. the code is called easygrid.
> I've attached two figres for comparison.
> Best,
> Nima.
>
> On Mon, Nov 30, 2009 at 10:36 PM, Eric E. Monson  
> <emonson at cs.duke.edu> wrote:
> Hey Nima,
>
> I don't know if this will be a useable solution for you, but based  
> on your notes I tried generating a point cloud (centered on the  
> origin, 100 points with radius 10) in ParaView, then using the  
> calculator filter I generated a scalar value on each node which is  
> the magnitude of the x, y, z coordinate vector: mag(coords). Instead  
> of trying to sample the data points onto a regular grid, I used the  
> Delaunay3D filter (with default parameters) to generate tetrahedra,  
> which can be used for volume visualization, contouring, etc. Here is  
> a screen shot of the point cloud colored by that vector magnitude  
> (blue-white-red colormap), and six contours which have been clipped  
> to show the insides.
>
> Again, not sure if this is the type of solution you were looking  
> for, but it interpolates the vector magnitude values and allows you  
> to generate contours.
>
> Talk to you later,
> -Eric
>
> ------------------------------------------------------
> Eric E Monson
> Duke Visualization Technology Group
>
> <ScatterPointsContours.png>
>
> On Nov 28, 2009, at 3:25 PM, Nima Emadi wrote:
>
>> Thanks a lot Sven,
>> I could generate vector plots. Still trying to find a way to do 3D  
>> contour plots for my scattered points. As you said I need to have a  
>> mesh and to interpolate my scalar value to nodes of that mesh. Does  
>> anyone have an idea to do that?
>>
>> Best,
>> Nima.
>>
>> On Sat, Nov 28, 2009 at 1:07 PM, Sven Buijssen <sven.buijssen at tu-dortmund.de 
>> > wrote:
>> Nima,
>>
>> Your first question has been discussed last month on this list,  
>> have a look at
>> http://markmail.org/message/36223zg4uleibiyj. David found the time  
>> to put the
>> question in FAQ style into the ParaView wiki. So, you can also look  
>> at
>> http://www.paraview.org/Wiki/Display_points_and_normals_from_a_plain_text_(x_y_z_nx_ny_nz)_file
>>
>> I haven't faced the problem yet you describe in your second  
>> question. I'm
>> guessing you'll have to import your scattered data into ParaView  
>> (e.g. as CSV
>> data) and somehow come up with a regular grid in ParaView. This  
>> might be
>> possible using a Programmable Source or Sources - Data Object  
>> Generator, but I'm
>> not sure of that. Maybe someone else can point this out. Once you  
>> have a regular
>> grid, use the Resample with Dataset filter to interpolate your  
>> point data set(s)
>> to the regular grid and apply the Contour filter.
>>
>> Hope this helps.
>>
>> Sven
>>
>>
>> Nima Emadi wrote, On 11/28/2009 12:01 PM:
>> > Dear all,
>> > I would like to generate 3D vector plots from a set of scattered  
>> data in
>> > space (an ASCII file with x,y,z,u,v,w). I guess this should be  
>> rather
>> > simple, but later on I want to generate 3D contour plots out of  
>> my data
>> > (e.g. having contours based on the value of u^2+v^2+w^2 at each  
>> point).
>> > Since I just have the value on scattered points in space, making  
>> those
>> > contours will probably require extrapolation of my data to nodes  
>> of a
>> > (regular) mesh. My question is that, how can I do those plots? with
>> > which format should I import my data? Is paraview able to make  
>> contour
>> > plots with scattered data points in 3D?
>> >
>> > Thanks,
>> > Nima
>> >
>> >
>> >  
>> ------------------------------------------------------------------------
>> >
>> > _______________________________________________
>> > 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 ParaView Wiki at: http://paraview.org/Wiki/ParaView
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://www.paraview.org/mailman/listinfo/paraview
>>
>>
>>  _______________________________________________
>> 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 ParaView Wiki at: http://paraview.org/Wiki/ParaView
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.paraview.org/mailman/listinfo/paraview
>
>
> <1.jpg><dCG_small.pdf>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20091201/6a7f7ea7/attachment-0001.htm>


More information about the ParaView mailing list