<div dir="ltr">
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".<br><br>In it, choose:<br>Output Data Set Type = "Same as Input" //the default<br>check "Copy Arrays" //not the default<br>for script use :self.GetOutput().GetPointData().SetActiveScalars("RTData")</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature">David E DeMarle<br>Kitware, Inc.<br>R&D Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4909</div></div>
<br><div class="gmail_quote">On Fri, Jan 20, 2017 at 2:45 AM, Jiahui Luo <span dir="ltr"><<a href="mailto:luo229@gmail.com" target="_blank">luo229@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div 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-<wbr>build/superbuild/paraview/src/<wbr>VTK/Rendering/OSPRay/<wbr>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(<wbr>xCoords)<br>
output.SetYCoordinates(<wbr>yCoords)<br>
output.SetZCoordinates(<wbr>zCoords)<br>
<br>
thArray = vtk.vtkFloatArray()<br>
thArray.SetName("Temperature")<br>
thArray.SetNumberOfComponents(<wbr>1)<br>
thArray.SetNumberOfTuples(nx*<wbr>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().<wbr>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>
</div>
<br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" rel="noreferrer" target="_blank">http://paraview.org/Wiki/<wbr>ParaView</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/paraview</a><br>
<br></blockquote></div><br></div>