<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi ,<br>
I got an error message when trying to do volume rendering on the
output of the ResampleToImage filter:<br>
<blockquote><font size="-1">ERROR: In
/home/user/apps/paraview5.2.0-build/superbuild/paraview/src/VTK/Rendering/OSPRay/vtkOSPRayVolumeMapperNode.cxx,
line 107<br>
vtkOSPRayVolumeMapperNode (0x68c2ad0): VolumeMapper's Input has
no scalar array!</font><br>
<br>
</blockquote>
Here is how it happened.<br>
First, I added a ProgrammableSource with Output DataSet Type set to
vtkRectilinearGrid and apply something like this,<br>
<br>
<blockquote><font size="-1">import numpy as np<br>
<br>
# Read x,y,z,th from file<br>
<br>
xCoords = vtk.vtkDoubleArray()<br>
for i in x:<br>
xCoords.InsertNextValue(i)<br>
<br>
yCoords = vtk.vtkDoubleArray()<br>
for i in y:<br>
yCoords.InsertNextValue(i)<br>
<br>
zCoords = vtk.vtkDoubleArray()<br>
for i in z:<br>
zCoords.InsertNextValue(i)<br>
<br>
output.SetDimensions(len(x), len(y), len(z))<br>
output.SetXCoordinates(xCoords)<br>
output.SetYCoordinates(yCoords)<br>
output.SetZCoordinates(zCoords)<br>
<br>
thArray = vtk.vtkFloatArray()<br>
thArray.SetName("Temperature")<br>
thArray.SetNumberOfComponents(1)<br>
thArray.SetNumberOfTuples(nx*ny*nz)<br>
for k in range(nz):<br>
for j in range(ny):<br>
for i in range(nx):<br>
index = i+j*nx+k*ny*nx<br>
thArray.SetValue(index, th[k,j,i])<br>
output.GetCellData().SetScalars(thArray)<br>
return output<br>
</font></blockquote>
Since volume rendering can not be done on rectilinear grid. I added
a ResampleToImage filter on this source.<br>
<br>
Then I could do volume rendering using Ray cast or GPU based, but
not OSPray and the above message popped up.<br>
<br>
How to make this work? Thanks.<br>
<br>
Jiahui Luo<br>
<br>
<br>
<blockquote><br>
<br>
</blockquote>
</body>
</html>