Okay. Thank you very much. i will look into it<br><br>
<div><span class="gmail_quote">2007/1/10, Dominik Szczerba <<a href="mailto:domi@vision.ee.ethz.ch">domi@vision.ee.ethz.ch</a>>:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Discussion belongs to the list please.<br><br>You can export your matrix into a legacy ascii file (codelet below, you
<br>will need to add some obvious things) or visualize it directly from<br>matlab (search for vtk matlab wiki)<br><br>--DS<br><br><br>fwid = fopen(set.vtkname,'w','b'); % IMPORTANT: big endian<br>count = fprintf(fwid,'# vtk DataFile Version
2.0\n');<br>count = fprintf(fwid,[set.remark,'\n']);<br>if set.ascii<br> count = fprintf(fwid,'ASCII\n');<br>else<br> count = fprintf(fwid,'BINARY\n');<br>end<br>count = fprintf(fwid,'DATASET STRUCTURED_POINTS\n');
<br>count = fprintf(fwid,'DIMENSIONS %u %u %u\n',set.dim);<br>count = fprintf(fwid,'ORIGIN %u %u %u\n',set.origin);<br>count = fprintf(fwid,'SPACING %3.2f %3.2f %3.2f\n',set.spacing);<br>count = fprintf(fwid,'POINT_DATA %u\n',np);
<br>count = fprintf(fwid,['SCALARS ',set.varname,' ',vtkprecision,' 1\n']);<br>count = fprintf(fwid,'LOOKUP_TABLE default\n');<br><br>% write data to vtk file<br>tic<br>fprintf(1,['writing ',
set.vtkname,' ... ']);<br>if ~set.ascii<br> count = fwrite(fwid, M, set.precision);<br>else<br> fprintf(fwid, '%g \n', M);<br>end<br>fclose(fwid);<br>fprintf(1,'done in %5.3f s\n',toc);<br><br>
<br>Arne Hansen wrote:<br>> Its a volume. Actually I have several volumes i need to save.<br>><br>> Do you know how i can do this? :)<br>> thanks bro<br>><br>><br>> 2007/1/10, Dominik Szczerba <<a href="mailto:domi@vision.ee.ethz.ch">
domi@vision.ee.ethz.ch</a><br>> <mailto:<a href="mailto:domi@vision.ee.ethz.ch">domi@vision.ee.ethz.ch</a>>>:<br>><br>> Of course. What data? mesh, volume?<br>> --ds<br>><br>> Arne Hansen wrote:
<br>> > Hello. Is there any way that i can save my matlab data in a file<br>> > readable by vtk? If possible it would be great if this data could be<br>> > saved in a *.vtk file from within matlab.
<br>> ><br>> > Is this possible, if yes, how can i do it?<br>> ><br>> > Thank you.<br>> ><br>> ><br>> ><br>> ------------------------------------------------------------------------
<br>> ><br>> > _______________________________________________<br>> > This is the private VTK discussion list.<br>> > Please keep messages on-topic. Check the FAQ at:<br>> <a href="http://www.vtk.org/Wiki/VTK_FAQ">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>> > Follow this link to subscribe/unsubscribe:<br>> > <a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>> <
<a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a>><br>><br>><br></blockquote></div><br>