[vtkusers] Why vtkShepardMethod & vtkGaussianSplatter changed origin data into 0?

tan3long tan3long at gmail.com
Mon Sep 26 06:00:39 EDT 2011


Hi buddies,

I use vtkShepardMethod & vtkGaussianSplatter to interpolate my data model.As
below codes described:

package require vtk
package require vtkinteraction

vtkPoints points
	points InsertPoint  0 0 0 0
	points InsertPoint  1 31 0 0
	points InsertPoint  2 31 31 0
	points InsertPoint  3 0 31 0
	points InsertPoint  4 0 0 31
	points InsertPoint  5 31 0 31
	points InsertPoint  6 31 31 31
	points InsertPoint  7 0 31 31
	points InsertPoint  8 5 0 0

vtkFloatArray scalars
	scalars InsertValue 0 99
	scalars InsertValue 1 20
	scalars InsertValue 2 70
	scalars InsertValue 3 10
	scalars InsertValue 4 5
	scalars InsertValue 5 80 
	scalars InsertValue 6 15
	scalars InsertValue 7 100
	scalars InsertValue 8 5

vtkPolyData profile
    profile SetPoints points
    [profile GetPointData] SetScalars scalars
 
vtkShepardMethod shepard
    shepard SetInput profile
    shepard SetModelBounds 0 31 0 31 0 31
    shepard SetMaximumDistance 1
    shepard SetSampleDimensions 32 32 32
    shepard Update

#vtkGaussianSplatter popSplatter
#	popSplatter SetInput profile
#	popSplatter SetRadius 0.05
#	popSplatter SetModelBounds 0 31 0 31 0 31
#	popSplatter SetSampleDimensions 32 32 32
#	popSplatter ScalarWarpingOff

vtkStructuredPointsWriter writer
	writer SetInput [ shepard GetOutput ]
	writer SetFileName output.vtk
	writer Write

the result is interpolation succeeded,but origin data changed into 0.See the
first data below.Other data are the same.Why? How can I solve it ? 

# vtk DataFile Version 3.0
vtk output
ASCII
DATASET STRUCTURED_POINTS
DIMENSIONS 32 32 32
SPACING 1 1 1
ORIGIN 0 0 0
POINT_DATA 32768
SCALARS scalars float
LOOKUP_TABLE default
0 93.1853 69.5633 33.9287 10.652 0 7.69058 12.5729 17.4056 
21.5753 24.9975 27.736 29.8815 31.517 32.7093 33.5094 33.9549 34.0733 
33.8852 33.4074 32.6567 31.6537 30.4271 29.0178 27.4814 25.89 24.3295 
22.8942 21.6766 20.7563 20.1892 0 95.2162 88.5941 67.0797 36.2971.........



--
View this message in context: http://vtk.1045678.n5.nabble.com/Why-vtkShepardMethod-vtkGaussianSplatter-changed-origin-data-into-0-tp4840826p4840826.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list