<DIV id=RTEContent>hello,</DIV>  <DIV>Does anyone know how to create an image from scratch in memory in VTK.</DIV>  <DIV>I tried this and many other things but it doesnt work.....</DIV>  <DIV>&nbsp;</DIV>  <DIV>**************************************************************************************************</DIV>  <DIV>vtkImageData *pZImage = vtkImageData::New();</DIV>  <DIV>pZImage-&gt;SetDimensions( wx , wy , 1 );</DIV>  <DIV>pZImage-&gt;SetOrigin( 0 , 0 , 0 );</DIV>  <DIV>pZImage-&gt;SetSpacing( 1 , 1 , 1 );</DIV>  <DIV>pZImage-&gt;SetScalarTypeToUnsignedChar();</DIV>  <DIV>pZImage-&gt;SetNumberOfScalarComponents( 1 );</DIV>  <DIV>pZImage-&gt;AllocateScalars();</DIV>  <DIV>&nbsp;</DIV>  <DIV>vtkUnsignedCharArray *pScalars = (vtkUnsignedCharArray *) pZImage-&gt;GetPointData()-&gt;GetScalars();</DIV>  <DIV>&nbsp;</DIV>  <DIV><BR>for( int i = 0 ; i &lt; wx ; i++ )</DIV>  <DIV>{</DIV>  <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">  <DIV>for( int j = 0 ; j &lt; wy ; j++ )</DIV> 
 <DIV>{</DIV>  <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">  <DIV>int index = i * j;</DIV>  <DIV>&nbsp;</DIV>  <DIV>pScalars-&gt;SetValue( index , 0 ); </DIV></BLOCKQUOTE>  <DIV>} </DIV></BLOCKQUOTE>  <DIV>}</DIV>  <DIV>&nbsp;</DIV>  <DIV>pZImage-&gt;GetPointData()-&gt;SetScalars( pScalars );</DIV>  <DIV>&nbsp;</DIV>  <DIV>vtkJPEGWriter *pImageWriter = vtkJPEGWriter::New();</DIV>  <DIV>pImageWriter -&gt;SetInput( pZImage );</DIV>  <DIV>pImageWriter -&gt;SetQuality( 100.0 );</DIV>  <DIV>pImageWriter -&gt;SetFileName( strImageFile );</DIV>  <DIV>pImageWriter -&gt;ProgressiveOff();</DIV>  <DIV>pImageWriter -&gt;Write();</DIV>  <DIV>&nbsp;</DIV>  <DIV>*************************************************************************************************</DIV>  <DIV>&nbsp;</DIV>  <DIV>I am sure there should be many ways.......</DIV>  <DIV>&nbsp;</DIV>  <DIV>Thanks in advance</DIV>  <DIV>&nbsp;</DIV>  <DIV>Regards,</DIV>  <DIV>&nbsp;</DIV>  <DIV>Deepak Roy<BR></DIV><p>
        
                <hr size=1>Yahoo! Shopping<br> 
Find Great Deals on Holiday Gifts at <a href="http://us.rd.yahoo.com/mail_us/footer/shopping/*http://shopping.yahoo.com/;_ylc=X3oDMTE2bzVzaHJtBF9TAzk1OTQ5NjM2BHNlYwNtYWlsdGFnBHNsawNob2xpZGF5LTA1 
">Yahoo! Shopping</a>