[Paraview] OSPray rendering: ERROR: VolumeMapper's Input has no scalar array!

David E DeMarle dave.demarle at kitware.com
Fri Jan 20 12:08:52 EST 2017


 That's a bug in either the OSPRay mapper or the ResampleToImage filter,
depending on your point of view. To workaround, put a python programmable
filter into the pipeline to annotate the array as being the "Active
Scalars".

In it, choose:
Output Data Set Type = "Same as Input" //the default
check "Copy Arrays" //not the default
for script use :self.GetOutput().GetPointData().SetActiveScalars("RTData")

David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909

On Fri, Jan 20, 2017 at 2:45 AM, Jiahui Luo <luo229 at gmail.com> wrote:

> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20170120/6421201f/attachment.html>


More information about the ParaView mailing list