<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Thank you, David.<br>
<br>
I could not get your script to work.<br>
Fortunately, I found another workaround.<br>
Either change my source to provide PointData, or put a
CellDataToPointData filter between the source and the resample
filter.<br>
Hope this is helpful for you.<br>
<br>
Jiahui Luo<br>
<br>
<div class="moz-cite-prefix">在 2017年01月21日 02:04, David E DeMarle
写道:<br>
</div>
<blockquote
cite="mid:CANjZAi_RDwG3LyCeLC8drr70kRy0KS1=BEUN1gvRJhFuKaCvRw@mail.gmail.com"
type="cite">
<div dir="ltr">nvm, already reported here: <a
class="moz-txt-link-freetext"
href="https://gitlab.kitware.com/paraview/paraview/issues/17121"><a class="moz-txt-link-freetext" href="https://gitlab.kitware.com/paraview/paraview/issues/17121">https://gitlab.kitware.com/paraview/paraview/issues/17121</a></a></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 12:09 PM, David
E DeMarle <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Please file a bug report on gitlab.</div>
<div class="gmail_extra"><span class=""><br clear="all">
<div>
<div class="m_-2956356853601612447gmail_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: <a moz-do-not-send="true"
href="tel:%28518%29%20881-4909"
value="+15188814909" target="_blank">518-881-4909</a></div>
</div>
<br>
</span>
<div>
<div class="h5">
<div class="gmail_quote">On Fri, Jan 20, 2017 at 12:08
PM, David E DeMarle <span dir="ltr"><<a
class="moz-txt-link-abbreviated"
href="mailto:dave.demarle@kitware.com"><a class="moz-txt-link-abbreviated" href="mailto:dave.demarle@kitware.com">dave.demarle@kitware.com</a></a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<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<wbr>().SetActiveScalars("RTData")</div>
<div class="gmail_extra"><br clear="all">
<div>
<div
class="m_-2956356853601612447m_651862472991129945gmail_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: <a moz-do-not-send="true"
href="tel:%28518%29%20881-4909"
value="+15188814909" target="_blank">518-881-4909</a></div>
</div>
<br>
<div class="gmail_quote">
<div>
<div class="m_-2956356853601612447h5">On
Fri, Jan 20, 2017 at 2:45 AM, Jiahui Luo <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:luo229@gmail.com"
target="_blank">luo229@gmail.com</a>></span>
wrote:<br>
</div>
</div>
<blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px
#ccc solid;padding-left:1ex">
<div>
<div class="m_-2956356853601612447h5">
<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/vtkOSPRay<wbr>VolumeMapperNode.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<wbr>)<br>
output.SetYCoordinates(yCoords<wbr>)<br>
output.SetZCoordinates(zCoords<wbr>)<br>
<br>
thArray = vtk.vtkFloatArray()<br>
thArray.SetName("Temperature")<br>
thArray.SetNumberOfComponents(<wbr>1)<br>
thArray.SetNumberOfTuples(nx*n<wbr>y*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().SetScalar<wbr>s(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>
</div>
</div>
______________________________<wbr>_________________<br>
Powered by <a moz-do-not-send="true"
href="http://www.kitware.com"
rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at
<a moz-do-not-send="true"
href="http://www.kitware.com/opensource/opensource.html"
rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Please keep messages on-topic and check the
ParaView Wiki at: <a moz-do-not-send="true"
href="http://paraview.org/Wiki/ParaView"
rel="noreferrer" target="_blank">http://paraview.org/Wiki/ParaV<wbr>iew</a><br>
<br>
Search the list archives at: <a
class="moz-txt-link-freetext"
href="http://markmail.org/search/?q="><a class="moz-txt-link-freetext" href="http://markmail.org/search/?q=">http://markmail.org/search/?q=</a></a><wbr>ParaView<br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a moz-do-not-send="true"
href="http://public.kitware.com/mailman/listinfo/paraview"
rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/paraview</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>