Hi,<div><br></div><div>What are those scalar values supposed to denote?</div><div><br clear="all">Haluk Noyan Tokgozoglu<div><br></div><div>Johns Hopkins University</div><div>Computer Science PhD Student</div><div>Computational Interaction and Robotics Library</div>
<div>Secretary of the GRO</div><div>Treasurer of UPE</div><br>
<br><br><div class="gmail_quote">On Wed, Sep 14, 2011 at 12:21, rakesh patil <span dir="ltr"><<a href="mailto:prakeshofficial@gmail.com">prakeshofficial@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br><br>As mentioned in the pdf file<div class="im"><br><br><a href="http://www.vtk.org/VTK/img/file-formats.pdf" target="_blank">http://www.vtk.org/VTK/img/file-formats.pdf</a><br><br></div>There must be some scalar values for the POINT_DATA. Check for the example on page number 8 in that file. Your code only writes the x,y,z points in the file. Scalar values should follow after POINT_DATA.<br>
<br>Hope that helps.<br><br>Regards<br>Rakesh Patil<br><br><div class="gmail_quote"><div><div></div><div class="h5">On Wed, Sep 14, 2011 at 9:08 PM, Haluk Noyan Tokgozoglu <span dir="ltr"><<a href="mailto:htokgoz1@jhu.edu" target="_blank">htokgoz1@jhu.edu</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"><div><div></div><div class="h5"><div class="gmail_quote">Hi,<br><div><br></div><div>I have point cloud data in the form of 3 vectors, x y z which are n-by-1 and contain the 3 coordinates of the points. I am trying to swiftly generate a .vtk file in MATLAB so I can view it in Paraview, but I am having trouble understanding the documentation at <a href="http://www.vtk.org/VTK/img/file-formats.pdf" target="_blank">http://www.vtk.org/VTK/img/file-formats.pdf</a></div>
<div><br></div><div>I have written some code, where I write the points as an unstructred grid, but paraview doesn't show anything when I try to view the file.</div><div><br></div><div>Here's my code:</div><div><br>
</div><div><div>function [] = write_vtk(x,y,z)</div><div><br></div><div> n=size(x);</div><div> delete('data.vtk');</div><div> fid=fopen('data.vtk','w');</div><div> fprintf(fid,'# vtk DataFile Version 2.0\n');</div>
<div> fprintf(fid,'blah\n');</div><div> fprintf(fid,'ASCII\n');</div><div> fprintf(fid,'DATASET UNSTRUCTURED_GRID\n');</div><div> fprintf(fid,'POINTS %d float\n',n);</div><div>
for i=1:n</div>
<div> fprintf(fid,'%f %f %f\n',x(i),y(i),z(i));</div><div> end</div><div> fprintf(fid,'POINT_DATA %d\n',n);</div><div> fclose(fid);</div><div> </div><div><br></div><div>end</div></div>
<div>
<br></div><div>What am I doing wrong?</div><div><br></div><br clear="all">Haluk Noyan Tokgozoglu<div><br></div><div>Johns Hopkins University</div><div>Computer Science PhD Student</div><div>Computational Interaction and Robotics Library</div>
<div>Secretary of the GRO</div><div>Treasurer of UPE</div><br>
</div><br>
<br></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br>
</blockquote></div><br></div>