<html><div style='background-color:'><P>Hello, so I'm trying to display an&nbsp;image.. I read numbers from an instream&nbsp;'inFile' line by line and insert the tuples of the floatArray also line by line as the file is being read... </P>
<P>then i create the imageviewer to render the image...</P>
<P>but i dont see anything? just a black screen, even when i change the colorlevel and colorwindow values, its still black..</P>
<P>this is the first program i'm creating, so i must not be understanding something and have left something out...</P>
<P>any help is very much appreciated!</P>
<P>thank u again&nbsp;vtk-users!!!!!!!! u guys are great!!!!</P>
<P>-bob&nbsp;</P>
<P><FONT color=#006633>size[0] = numColumns;&nbsp;&nbsp;<BR>size[1] = 0;<BR>size[2]=numRows; </FONT></P>
<P><FONT color=#006633>vtkFloatArray *fltarray = vtkFloatArray::New();<BR>&nbsp;fltarray-&gt;SetNumberOfComponents(size[0]); <BR>fltarray-&gt;SetNumberOfTuples(size[2]); </FONT></P>
<P><FONT color=#006633><FONT color=#0033ff>for </FONT>(<FONT color=#0066ff>int </FONT>tupleCnt = 0; tupleCnt&lt;numRows; tupleCnt++)<BR>{<BR>&nbsp;&nbsp; &nbsp; <FONT color=#0066ff>for</FONT>(<FONT color=#0066ff>int </FONT>i=0; i&lt;numColumns; i++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inFile&gt;&gt;f[i];</FONT></P>
<P><FONT color=#006633>&nbsp;&nbsp;&nbsp; &nbsp;fltarray-&gt;InsertTuple(tupleCnt, f);&nbsp; //insert data at tuple location i&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>}</FONT></P>
<P><FONT color=#006633>vtkImageData *imageData = vtkImageData::New();</FONT></P>
<P><FONT color=#006633>&nbsp;imageData-&gt;SetDimensions(size);<BR>&nbsp;imageData-&gt;SetSpacing(1.0, 1.0, 1.0);<BR>&nbsp;imageData-&gt;SetOrigin(0.0, 0.0, 0.0);<BR>&nbsp;imageData-&gt;SetScalarType(VTK_FLOAT);<BR>&nbsp;imageData-&gt;AllocateScalars();<BR>&nbsp;imageData-&gt;GetPointData()-&gt;SetScalars(fltarray);<BR>&nbsp;&nbsp;<BR>&nbsp;vtkImageViewer *viewer = vtkImageViewer::New();<BR>&nbsp;viewer-&gt;SetInput(imageData);<BR>&nbsp;viewer-&gt;SetColorWindow(255.0);<BR>&nbsp;viewer-&gt;SetColorLevel(156.0);<BR>&nbsp;&nbsp;<BR>&nbsp;<FONT color=#0066ff>while</FONT>(1)<BR>&nbsp;&nbsp;&nbsp; &nbsp;viewer-&gt;Render();</FONT></P></div><br clear=all><hr> <a href="http://g.msn.com/8HMAENUS/2746??PS=">Add MSN 8 Internet Software to your current Internet access and enjoy patented spam control and more.  Get two months FREE!    </a> </html>