<br><font size=2 face="sans-serif">Marc, first it looks like you have 8bit data so don't use </font><font size=2 face="Courier New">vtkVolume16Reader</font><font size=2 face="sans-serif">. Second, if you use vtkImageReader you can read your file as a raw 3D volume and not have to slice it up. Also look into vtkImageImport to get the data directly from your buffer into vtk....john</font>
<br>
<br>
<br>
<table>
<tr valign=top>
<td><font size=6 color=red face="Times New Roman"><b>Internet Mail Message</b></font>
<br><font size=2 color=red face="sans-serif">Received from host: &nbsp; &nbsp; &nbsp; &nbsp;</font><font size=2 face="sans-serif"><b>public.kitware.com [24.97.130.19]</b></font>
<td></table>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>&quot;Marwan Adada&quot; &lt;adada_marwan@hotmail.com&gt;</b></font>
<br><font size=1 face="sans-serif">Sent by: vtkusers-admin@public.kitware.com</font>
<p><font size=1 face="sans-serif">04/22/2003 07:42 PM</font>
<br>
<td><font size=1 face="Arial">&nbsp; &nbsp; &nbsp; &nbsp; </font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; To: &nbsp; &nbsp; &nbsp; &nbsp;vtkusers@public.kitware.com</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; cc: &nbsp; &nbsp; &nbsp; &nbsp;(bcc: John Anast-JM/PGI)</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Subject: &nbsp; &nbsp; &nbsp; &nbsp;[vtkusers] vtkVolume16Reader</font></table>
<br>
<br>
<br><font size=2 face="Courier New">Hello,<br>
I have a raw data file of dimensions 205x233x251, I am trying to cut this <br>
file into slices to pass it to C, and the to <br>
vtkMarchingCubes; &nbsp;When I make 251 slices each containg 47765(205x233)bytes <br>
the vtkVolume16Reader can't read the data. When I double the size of the <br>
slice, v16 will read the data, but the output will include 4 objects instead <br>
of one. &nbsp;There seems to be &nbsp;something wrong with me trying to divide may <br>
data into slices. &nbsp;Any Ideas??<br>
Thanks in advance<br>
<br>
This is my code for dividing my data(which is in buffer) into slices:<br>
<br>
for(int k=0;k&lt;251;k++)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sprintf (fname, &quot;slice.%d&quot;, k+1);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fp = fopen (fname, &quot;wb&quot;);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for(int i = 0;i&lt;47765;i++){<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fwrite(&amp;(buffer[i+(k*47765)]),1,1,fp);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fclose(fp);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
<br>
<br>
Marc<br>
<br>
<br>
<br>
<br>
_________________________________________________________________<br>
The new MSN 8: advanced junk mail protection and 2 months FREE* <br>
http://join.msn.com/?page=features/junkmail<br>
<br>
_______________________________________________<br>
This is the private VTK discussion list. <br>
Please keep messages on-topic. Check the FAQ at: &lt;http://public.kitware.com/cgi-bin/vtkfaq&gt;<br>
Follow this link to subscribe/unsubscribe:<br>
http://public.kitware.com/mailman/listinfo/vtkusers<br>
</font>
<br>
<br>