<html><div style='background-color:'><P>Hello, so I'm trying to display an image.. I read numbers from an instream '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 vtk-users!!!!!!!! u guys are great!!!!</P>
<P>-bob </P>
<P><FONT color=#006633>size[0] = numColumns; <BR>size[1] = 0;<BR>size[2]=numRows; </FONT></P>
<P><FONT color=#006633>vtkFloatArray *fltarray = vtkFloatArray::New();<BR> fltarray->SetNumberOfComponents(size[0]); <BR>fltarray->SetNumberOfTuples(size[2]); </FONT></P>
<P><FONT color=#006633><FONT color=#0033ff>for </FONT>(<FONT color=#0066ff>int </FONT>tupleCnt = 0; tupleCnt<numRows; tupleCnt++)<BR>{<BR> <FONT color=#0066ff>for</FONT>(<FONT color=#0066ff>int </FONT>i=0; i<numColumns; i++)<BR> inFile>>f[i];</FONT></P>
<P><FONT color=#006633> fltarray->InsertTuple(tupleCnt, f); //insert data at tuple location i <BR>}</FONT></P>
<P><FONT color=#006633>vtkImageData *imageData = vtkImageData::New();</FONT></P>
<P><FONT color=#006633> imageData->SetDimensions(size);<BR> imageData->SetSpacing(1.0, 1.0, 1.0);<BR> imageData->SetOrigin(0.0, 0.0, 0.0);<BR> imageData->SetScalarType(VTK_FLOAT);<BR> imageData->AllocateScalars();<BR> imageData->GetPointData()->SetScalars(fltarray);<BR> <BR> vtkImageViewer *viewer = vtkImageViewer::New();<BR> viewer->SetInput(imageData);<BR> viewer->SetColorWindow(255.0);<BR> viewer->SetColorLevel(156.0);<BR> <BR> <FONT color=#0066ff>while</FONT>(1)<BR> viewer->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>