[vtkusers] VTK class to do interpolation of scalar values

Jesse Kim jinryongkim at gmail.com
Mon Dec 7 15:49:50 EST 2009


Bill,

Thanks so much for your help.

I think this what I wanted to get. However, I have one more question for 
you. Is there any way I can express them in 3D like isosurface? Should I 
change it to delaunay3D?

Thanks,

Jesse

Bill Lorensen wrote:
> Jesse,
>
> I loaded your data into paraview (paraview.org), applied the
> Delaunay2D filter->ContourFilter and produced the attached image. Is
> this what you would expect?
>
> Bill
>
>
> On Mon, Dec 7, 2009 at 1:55 PM, Jesse Kim <jinryongkim at gmail.com> wrote:
>   
>> Hi Bill and David,
>>
>> Thanks for the reply.
>> For the clarification, let me provide my sample data set. What I would like
>> to do here is to do the interpolations among these scalar values associated
>> with some geographical locations (75 locations) so that I can have smooth
>> iso-contour or iso-surface. This the dataset of some geographical locations
>> (75 locations) and their scalar values.
>>
>> # vtk DataFile Version 2.0
>> Weather observing stations
>> ASCII
>> DATASET POLYDATA
>> POINTS 75 float
>> 660.905194 527.736720 0.0
>> 536.263098 683.230547 0.0
>> 702.452710 1112.016367 0.0
>> 710.006701 838.724374 0.0
>> 354.965505 414.650300 0.0
>> 660.905194 862.283951 0.0
>> 694.898493 485.329312 0.0
>> 657.128312 612.551535 0.0
>> 589.141714 975.370370 0.0
>> 490.938700 424.074074 0.0
>> 260.539826 640.823140 0.0
>> 317.195324 805.740741 0.0
>> 260.539826 376.954638 0.0
>> 366.296604 164.917601 0.0
>> 113.235531 75.391041 0.0
>> 128.343513 98.950617 0.0
>> 664.682303 720.925926 0.0
>> 653.351203 932.962963 0.0
>> 358.742613 735.061728 0.0
>> 173.667911 329.835485 0.0
>> 158.559929 1107.3046210 0.0
>> 498.492917 1088.4567900 0.0
>> 294.533125 546.584268 0.0
>> 524.931999 588.991675 0.0
>> 589.141714 466.481481 0.0
>> 524.931999 245.020670 0.0
>> 181.222129 1088.4567900 0.0
>> 256.762717 160.205856 0.0
>> 585.364606 890.555556 0.0
>> 407.844121 574.855873 0.0
>> 528.709108 164.917601 0.0
>> 430.506320 782.181164 0.0
>> 385.181921 862.283951 0.0
>> 608.026805 292.139823 0.0
>> 547.594198 815.164515 0.0
>> 370.073713 480.617284 0.0
>> 298.310007 862.283951 0.0
>> 41.471825 65.966984 0.0
>> 604.249696 711.502152 0.0
>> 162.336811 65.966984 0.0
>> 460.722510 669.094744 0.0
>> 562.702406 367.530864 0.0
>> 347.411514 334.547231 0.0
>> 362.519722 240.308642 0.0
>> 132.120621 669.094744 0.0
>> 177.445020 226.172840 0.0
>> 396.513021 1027.2015520 0.0
>> 67.911133 131.934251 0.0
>> 113.235531 183.765432 0.0
>> 211.438319 914.115132 0.0
>> 725.114910 617.263280 0.0
>> 422.952102 951.810794 0.0
>> 192.553228 584.279930 0.0
>> 596.695705 537.160494 0.0
>> 728.891792 758.621305 0.0
>> 453.168519 259.156473 0.0
>> 521.155117 278.004021 0.0
>> 475.830718 362.818836 0.0
>> 517.378008 518.312663 0.0
>> 290.756016 273.292275 0.0
>> 396.513021 1130.864198 0.0
>> 298.310007 70.679012 0.0
>> 154.782821 499.465115 0.0
>> 237.877627 1079.033016 0.0
>> 679.790511 296.851852 0.0
>> 135.897730 292.139823 0.0
>> 513.600899 871.707725 0.0
>> 502.269800 998.929947 0.0
>> 215.215427 259.156473 0.0
>> 260.539826 768.045362 0.0
>> 245.431617 786.892910 0.0
>> 218.992309 989.506173 0.0
>> 392.735912 650.246914 0.0
>> 324.749315 310.987654 0.0
>> 339.857523 942.386737 0.0
>> POINT_DATA 75
>> SCALARS req_prep_0 float
>> LOOKUP_TABLE default
>> 184.949631
>> 125.071189
>> 114.655333
>> 142.508891
>> 250.255094
>> 132.980147
>> 132.369983
>> 104.52796
>> 331.737495
>> 336.049583
>> 214.249765
>> 117.033152
>> 329.449907
>> 266.396892
>> 147.324093
>> 293.163118
>> 104.33426
>> 313.719804
>> 207.564979
>> 109.947172
>> 143.08005
>> 143.859373
>> 189.977409
>> 126.483623
>> 217.989847
>> 372.728658
>> 343.744282
>> 94.816421
>> 187.774541
>> 186.499795
>> 337.102472
>> 182.862572
>> 125.000005
>> 520.225266
>> 267.150263
>> 104.699336
>> 187.176938
>> 111.811702
>> 314.11783
>> 463.261076
>> 131.671659
>> 361.803069
>> 272.000024
>> 178.927209
>> 274.940403
>> 176.914528
>> 249.996726
>> 225.34729
>> 220.164636
>> 192.443055
>> 274.59666
>> 242.720081
>> 163.316313
>> 214.000012
>> 150.596283
>> 274.416211
>> 532.135911
>> 453.662097
>> 229.363398
>> 733.273974
>> 151.398179
>> 162.908337
>> 244.352757
>> 332.847796
>> 480.445379
>> 541.82268
>> 384.111595
>> 201.312356
>> 234.118599
>> 185.278497
>> 159.692496
>> 281.602642
>> 356.659038
>> 377.949511
>> 469.000015
>>
>> Bill Lorensen wrote:
>>     
>>> The data for the example should be some points scattered in space. I
>>> assume that is what Jin has, not just three points on a line. I'll dig
>>> up some meaningful data, uless Jin can share a small sample of his
>>> data.
>>>
>>> Bill
>>>
>>> Bill
>>>
>>> On Mon, Dec 7, 2009 at 1:11 PM, David Doria <daviddoria+vtk at gmail.com>
>>> wrote:
>>>
>>>       
>>>> On Mon, Dec 7, 2009 at 12:20 PM, David Gobbi <david.gobbi at gmail.com>
>>>> wrote:
>>>>
>>>>         
>>>>> On Mon, Dec 7, 2009 at 9:51 AM, David Doria <daviddoria+vtk at gmail.com>
>>>>> wrote:
>>>>>
>>>>>           
>>>>>> On Mon, Dec 7, 2009 at 11:43 AM, Jin Ryong Kim <jinryongkim at gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>             
>>>>>>> I have a question about interpolation method in VTK.
>>>>>>> Currently, I'm trying to interpolate scalar values between data points
>>>>>>> to
>>>>>>> create a contour map.
>>>>>>> I have some data points set (x, y, z) and scalar values related with
>>>>>>> each
>>>>>>> data point.
>>>>>>> So far, I found out vtkProbeFilter but when I tried, nothing came up.
>>>>>>> My questions are as follow.
>>>>>>> 1. Is vtkProbeFilter the right choice in this case?
>>>>>>> 2. If not, what are the right vtk classes to accomplish such a goal?
>>>>>>> If anyone has the solution for this, please let me know.
>>>>>>> Thanks in advance!
>>>>>>>
>>>>>>>               
>>>>>> Jin,
>>>>>>
>>>>>> If I'm not mistaken you sent this same question yesterday. I am
>>>>>> interesting in making an example of this so I have started poking
>>>>>> around. I understand that you may be in a hurry, but asking twice is
>>>>>> just going to annoy people on the list, making your answer come
>>>>>> slower, not faster.
>>>>>>
>>>>>> Can anyone confirm or deny that ProbeFilter is the right way to go?
>>>>>>
>>>>>>             
>>>>> The probe needs cells to interpolate the data.  If all you have is
>>>>> points, then you have to apply delaunay first to make the cells, and
>>>>> then use probe to interpolate the data onto a grid (i.e. make an
>>>>> image), and then contour the grid.  It might also be possible to
>>>>> contour directly from the output of delaunay, but I'm not sure whether
>>>>> VTK can do that.  I'm no expert in this area, but hopefully I've
>>>>> answered your question.
>>>>>
>>>>>  David
>>>>>
>>>>>
>>>>>           
>>>> From Bill's suggestion I have tried to make an example:
>>>> http://www.vtk.org/Wiki/VTK_Examples_Interpolation
>>>>
>>>> the problem is that the Shepard filter outputs an ImageData and the
>>>> ContourFilter seems to expect a DataObject.
>>>>
>>>> Jin, this is a simple version of what you are trying to do, correct?
>>>> If so, let try to get this little demo working.
>>>>
>>>> Thanks,
>>>>
>>>> David
>>>> _______________________________________________
>>>> 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
>>>>
>>>>
>>>>         
>>> _______________________________________________
>>> 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
>>>
>>>
>>>       
>>     
>>
>> ------------------------------------------------------------------------
>>




More information about the vtkusers mailing list