Hi ,
I got an error message when trying to do volume rendering on the output of the ResampleToImage filter:

   ERROR: In
   
/home/user/apps/paraview5.2.0-build/superbuild/paraview/src/VTK/Rendering/OSPRay/vtkOSPRayVolumeMapperNode.cxx,
   line 107
   vtkOSPRayVolumeMapperNode (0x68c2ad0): VolumeMapper's Input has no
   scalar array!

Here is how it happened.
First, I added a ProgrammableSource with Output DataSet Type set to vtkRectilinearGrid and apply something like this,

   import numpy as np

   # Read x,y,z,th from file

   xCoords = vtk.vtkDoubleArray()
   for i in x:
        xCoords.InsertNextValue(i)

   yCoords = vtk.vtkDoubleArray()
   for i in y:
        yCoords.InsertNextValue(i)

   zCoords = vtk.vtkDoubleArray()
   for i in z:
        zCoords.InsertNextValue(i)

   output.SetDimensions(len(x), len(y), len(z))
   output.SetXCoordinates(xCoords)
   output.SetYCoordinates(yCoords)
   output.SetZCoordinates(zCoords)

   thArray = vtk.vtkFloatArray()
   thArray.SetName("Temperature")
   thArray.SetNumberOfComponents(1)
   thArray.SetNumberOfTuples(nx*ny*nz)
   for k in range(nz):
        for j in range(ny):
            for i in range(nx):
                index = i+j*nx+k*ny*nx
                thArray.SetValue(index, th[k,j,i])
   output.GetCellData().SetScalars(thArray)
   return output

Since volume rendering can not be done on rectilinear grid. I added a ResampleToImage filter on this source.

Then I could do volume rendering using Ray cast or GPU based, but not OSPray and the above message popped up.

How to make this work? Thanks.

Jiahui Luo




_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview

Reply via email to