[Paraview] Question about programmable data source

Wu, James James.Wu at kla-tencor.com
Wed May 13 13:19:44 EDT 2015


I add a programmable data source using vtkImageData. The following is the script.
There is nothing displayed after click "Apply". I am new user to paraview. Can any point me what's wrong with the script?

Thanks,
James

dim = 10
pdo = self.GetImageDataOutput()
pdo.SetDimensions(dim, dim, dim)
pdo.SetOrigin(0, 0, 0)
pdo.SetSpacing(1, 1, 1)
pdo.SetExtent(0, dim - 1, 0, dim - 1, 0, dim - 1)
pdo.AllocateScalars(vtk.VTK_FLOAT, 1)

for x in range(0, dim):
    for y in range(0, dim):
        for z in range(0, dim):
            pdo.SetScalarComponentFromFloat(x, y, z, 0, 0.2)


More information about the ParaView mailing list