Dear Haluk,<br><br>As far as my knowledge is concerned, these scalars may be either depth values, temperature, pressure etc defined at those point locations. That&#39;s why it is called POINT_DATA. It can be also used to specify colors for individual cells in which case, scalars will be assigned to CELL_DATA instead of POINT_DATA.<br>
<br>Please see this example:<br><br><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/VTKConcepts/Scalars">http://www.vtk.org/Wiki/VTK/Examples/Cxx/VTKConcepts/Scalars</a><br><br>Seniors correct me if I am wrong.<br><br>Thanks<br>
<br>Regards<br>Rakesh Patil<br><br><div class="gmail_quote">On Wed, Sep 14, 2011 at 10:29 PM, Haluk Noyan Tokgozoglu <span dir="ltr">&lt;<a href="mailto:htokgoz1@jhu.edu">htokgoz1@jhu.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<div><br></div><div>What are those scalar values supposed to denote?</div><div><div class="im"><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><div><div></div><div class="h5"><div class="gmail_quote">On Wed, Sep 14, 2011 at 12:21, rakesh patil <span dir="ltr">&lt;<a href="mailto:prakeshofficial@gmail.com" target="_blank">prakeshofficial@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Hi,<br><br>As mentioned in the pdf file<div><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>On Wed, Sep 14, 2011 at 9:08 PM, Haluk Noyan Tokgozoglu <span dir="ltr">&lt;<a href="mailto:htokgoz1@jhu.edu" target="_blank">htokgoz1@jhu.edu</a>&gt;</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><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&#39;t show anything when I try to view the file.</div><div><br></div><div>Here&#39;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(&#39;data.vtk&#39;);</div><div>    fid=fopen(&#39;data.vtk&#39;,&#39;w&#39;);</div><div>    fprintf(fid,&#39;# vtk DataFile Version 2.0\n&#39;);</div>






<div>    fprintf(fid,&#39;blah\n&#39;);</div><div>    fprintf(fid,&#39;ASCII\n&#39;);</div><div>    fprintf(fid,&#39;DATASET UNSTRUCTURED_GRID\n&#39;);</div><div>    fprintf(fid,&#39;POINTS %d float\n&#39;,n);</div><div>





    for i=1:n</div>
<div>        fprintf(fid,&#39;%f %f %f\n&#39;,x(i),y(i),z(i));</div><div>    end</div><div>    fprintf(fid,&#39;POINT_DATA %d\n&#39;,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></div></div>
</blockquote></div><br>