<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Dear all,<div class=""><br class=""></div><div class="">Could somebody please provide a correct way to save the output of vtkProbeFilter?</div><div class=""><br class=""></div><div class="">I used the following code to save it as vtkStructuredGrid (probe ist a vtkProbeFilter)</div><div class=""><font color="#2b91af" face="Consolas" size="2" class="">vtkSmartPointer</font><font face="Consolas" size="2" class=""><</font><font color="#2b91af" face="Consolas" size="2" class="">vtkProbeFilter</font><font face="Consolas" size="2" class="">> probe = </font><font color="#2b91af" face="Consolas" size="2" class="">vtkSmartPointer</font><font face="Consolas" size="2" class=""><</font><font color="#2b91af" face="Consolas" size="2" class="">vtkProbeFilter</font><font face="Consolas" size="2" class="">>::New();</font></div><div class=""><font face="Consolas" size="2" class="">…...</font></div><div class=""><br class=""></div><div class=""><div class=""><font color="#008000" face="Consolas" class="">//save the output of probefileter as .vtu file</font><br class=""></div><div class=""><p class=""><font face="Consolas" size="2" class=""><font face="Consolas" size="2" class=""></font></font><font color="#2b91af" face="Consolas" size="2" class="">vtkSmartPointer</font><font face="Consolas" size="2" class=""><</font><font color="#2b91af" face="Consolas" size="2" class="">vtkStructuredGrid</font><font face="Consolas" size="2" class="">> sgrid = </font><font color="#2b91af" face="Consolas" size="2" class="">vtkSmartPointer</font><font face="Consolas" size="2" class=""><</font><font color="#2b91af" face="Consolas" size="2" class="">vtkStructuredGrid</font><font face="Consolas" size="2" class="">>::New();</font></p><font face="Consolas" size="2" class=""><font face="Consolas" size="2" class=""></font></font><p class=""><font face="Consolas" size="2" class="">sgrid</font><font color="#008080" face="Consolas" size="2" class="">-></font><font face="Consolas" size="2" class="">SetDimensions(256, 256, 256);</font></p><font face="Consolas" size="2" class=""><font face="Consolas" size="2" class=""></font></font><p class=""><font face="Consolas" size="2" class="">sgrid</font><font color="#008080" face="Consolas" size="2" class="">-></font><font face="Consolas" size="2" class="">SetPoints(probePoints);</font></p><font face="Consolas" size="2" class=""><font face="Consolas" size="2" class=""></font></font><p class=""><font face="Consolas" size="2" class=""><font face="Consolas" size="2" class=""></font></font><font color="#0000ff" face="Consolas" size="2" class="">unsigned</font><font face="Consolas" size="2" class=""> </font><font color="#0000ff" face="Consolas" size="2" class="">int</font><font face="Consolas" size="2" class=""> numberOfArrays = probe</font><font color="#008080" face="Consolas" size="2" class="">-></font><font face="Consolas" size="2" class="">GetOutput()->GetPointData()->GetNumberOfArrays();</font></p><font face="Consolas" size="2" class=""><font face="Consolas" size="2" class=""></font></font><p class=""><font face="Consolas" size="2" class="">std::cout </font><font color="#008080" face="Consolas" size="2" class=""><<</font><font face="Consolas" size="2" class=""> </font><font color="#a31515" face="Consolas" size="2" class="">"Copying arrays:"</font><font face="Consolas" size="2" class=""> </font><font color="#008080" face="Consolas" size="2" class=""><<</font><font face="Consolas" size="2" class=""> std::endl;</font></p><font face="Consolas" size="2" class=""><font face="Consolas" size="2" class=""></font></font><p class=""><font face="Consolas" size="2" class=""><font face="Consolas" size="2" class=""></font></font><font color="#0000ff" face="Consolas" size="2" class="">for</font><font face="Consolas" size="2" class=""> (</font><font color="#0000ff" face="Consolas" size="2" class="">unsigned</font><font face="Consolas" size="2" class=""> </font><font color="#0000ff" face="Consolas" size="2" class="">int</font><font face="Consolas" size="2" class=""> i = 0; i < numberOfArrays; i++)</font></p><font face="Consolas" size="2" class=""><font face="Consolas" size="2" class=""><p class="">{</p></font></font><p class=""><font face="Consolas" size="2" class="">std::cout </font><font color="#008080" face="Consolas" size="2" class=""><<</font><font face="Consolas" size="2" class=""> </font><font color="#a31515" face="Consolas" size="2" class="">"\t"</font><font face="Consolas" size="2" class=""> </font><font color="#008080" face="Consolas" size="2" class=""><<</font><font face="Consolas" size="2" class=""> probe</font><font color="#008080" face="Consolas" size="2" class="">-></font><font face="Consolas" size="2" class="">GetOutput()->GetPointData()->GetArray(i)->GetName() </font><font color="#008080" face="Consolas" size="2" class=""><<</font><font face="Consolas" size="2" class=""> std::endl;</font></p><font face="Consolas" size="2" class=""><font face="Consolas" size="2" class=""></font></font><p class=""><font face="Consolas" size="2" class="">sgrid</font><font color="#008080" face="Consolas" size="2" class="">-></font><font face="Consolas" size="2" class="">GetPointData()->AddArray(probe</font><font color="#008080" face="Consolas" size="2" class="">-></font><font face="Consolas" size="2" class="">GetOutput()->GetPointData()->GetArray(i));</font></p><p class=""><font face="Consolas" class="">}<br class=""></font></p><font face="Consolas" class=""></font><p class=""><font face="Consolas" class=""><font face="Consolas" size="2" class=""><font face="Consolas" size="2" class="">std::cout </font></font><font color="#008080" face="Consolas" size="2" class=""><font color="#008080" face="Consolas" size="2" class=""><font color="#008080" face="Consolas" size="2" class=""><<</font></font></font><font face="Consolas" size="2" class=""><font face="Consolas" size="2" class=""> </font></font><font color="#a31515" face="Consolas" size="2" class=""><font color="#a31515" face="Consolas" size="2" class=""><font color="#a31515" face="Consolas" size="2" class="">"Writing .vts output"</font></font></font><font face="Consolas" size="2" class=""><font face="Consolas" size="2" class=""> </font></font><font color="#008080" face="Consolas" size="2" class=""><font color="#008080" face="Consolas" size="2" class=""><font color="#008080" face="Consolas" size="2" class=""><<</font></font></font><font face="Consolas" size="2" class=""><font face="Consolas" size="2" class=""> std::endl;<font face="Consolas" size="2" class=""><font face="Consolas" size="2" class=""><br class=""></font></font></font></font></font></p><p class=""><font face="Consolas" size="2" class=""><font face="Consolas" size="2" class=""></font></font><font color="#2b91af" face="Consolas" size="2" class="">vtkSmartPointer</font><font face="Consolas" size="2" class=""><</font><font color="#2b91af" face="Consolas" size="2" class="">vtkXMLStructuredGridWriter</font><font face="Consolas" size="2" class="">> sWriter = </font><font color="#2b91af" face="Consolas" size="2" class="">vtkSmartPointer</font><font face="Consolas" size="2" class=""><</font><font color="#2b91af" face="Consolas" size="2" class="">vtkXMLStructuredGridWriter</font><font face="Consolas" size="2" class=""><font face="Consolas" size="2" class="">>::New();<font face="Consolas" size="2" class=""><font face="Consolas" size="2" class=""><br class=""></font></font></font></font></p><p class=""><font face="Consolas" size="2" class="">sWriter</font><font color="#008080" face="Consolas" size="2" class="">-></font><font face="Consolas" size="2" class="">SetFileName(</font><font color="#a31515" face="Consolas" size="2" class="">"test.vts"</font><font face="Consolas" size="2" class=""><font face="Consolas" size="2" class="">);<font face="Consolas" size="2" class=""><font face="Consolas" size="2" class=""><br class=""></font></font></font></font></p><p class=""><font face="Consolas" size="2" class="">sWriter</font><font color="#008080" face="Consolas" size="2" class="">-></font><font face="Consolas" size="2" class=""><font face="Consolas" size="2" class="">SetInputData(sgrid);<font face="Consolas" size="2" class=""><font face="Consolas" size="2" class=""><br class=""></font></font></font></font></p><p class=""><font face="Consolas" size="2" class="">sWriter</font><font color="#008080" face="Consolas" size="2" class="">-></font><font face="Consolas" size="2" class="">Write();</font></p><div class=""><br class=""></div></div></div><div class="">But I got errors when I try to load the .vts file in paraview:</div><div class=""><br class=""></div><div class=""><p class=""><span style="color: rgb(128, 0, 0); font-family: Courier; font-size: 8pt;" class="">ERROR: In C:\bbd\7cc78367\build\superbuild\paraview\src\VTK\IO\XML\vtkXMLStructuredDataReader.cxx, line 360</span></p><div style="margin: 0px;" class=""><span style="color: rgb(128, 0, 0); font-family: Courier; font-size: 8pt;" class="">vtkXMLStructuredGridReader (000000000BA5C060): Error reading extent 0 255 0 255 0 255 from piece 0</span></div><div style="margin: 0px;" class=""><span style="color: rgb(128, 0, 0); font-family: Courier; font-size: 8pt;" class=""><br class=""></span></div><p style="font-family: Consolas;" class=""><span style="color: rgb(128, 0, 0); font-family: Courier; font-size: 8pt;" class="">ERROR: In C:\bbd\7cc78367\build\superbuild\paraview\src\VTK\IO\XML\vtkXMLDataReader.cxx, line 443</span></p><div style="font-family: Consolas; margin: 0px;" class=""><span style="color: rgb(128, 0, 0); font-family: Courier; font-size: 8pt;" class="">vtkXMLStructuredGridReader (000000000BA5C060): Cannot read point data array "position" from PointData in piece 0. The data array in the element may be too short.</span></div><div style="font-family: Consolas; margin: 0px;" class=""><span style="color: rgb(128, 0, 0); font-family: Courier; font-size: 8pt;" class=""><br class=""></span></div><div style="font-family: Consolas; margin: 0px;" class=""><span style="color: rgb(128, 0, 0); font-family: Courier; font-size: 8pt;" class=""><br class=""></span></div><div style="margin: 0px;" class="">What do I do wrong?</div><div style="margin: 0px;" class=""><br class=""></div><div style="margin: 0px;" class="">Thanks!</div><div style="margin: 0px;" class=""><br class=""></div><div style="margin: 0px;" class="">best,</div><div style="margin: 0px;" class="">Siming</div><div style="margin: 0px;" class=""><br class=""></div><div style="margin: 0px;" class=""><br class=""></div><div style="font-family: Consolas; margin: 0px;" class=""><br class=""></div></div></body></html>