<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi all,<br><br>In this part of code I tried to create a new vtkImageData , pass it&nbsp; through vtkImageFlip , get the output and then tried to free the memory. Don't know why I get Segmentation fault , what could I be missing here?&nbsp; really appreciate any suggestion .<br><br>vtkImageData *id =vtkImageData::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; id-&gt;SetDimensions(10,25,100);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; id-&gt;SetScalarTypeToUnsignedShort();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; id-&gt;SetNumberOfScalarComponents(1);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; id-&gt;AllocateScalars();<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; unsigned short *ptr= (unsigned short *) id-&gt;GetScalarPointer();<br>&nbsp;&nbsp;&nbsp; for(int i=0; i&lt;10*25*100;i++)<br>&nbsp;&nbsp;&nbsp; { <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
 *ptr++=i;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; vtkImageFlip *flipX=vtkImageFlip::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; flipX-&gt;SetInput(id);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; flipX-&gt;SetFilteredAxis(0);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; flipX-&gt;Update();<br><br>&nbsp;&nbsp;&nbsp; vtkImageData *id2=vtkImageData::SafeDownCast(flipX-&gt;GetOutput());<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; id-&gt;Delete();<br>&nbsp;&nbsp;&nbsp; flipX-&gt;Delete();<br>&nbsp;&nbsp;&nbsp; id2-&gt;Delete(); //probably because of this?<br><br>Cheers,<br><br>Anthony<br></td></tr></table><br>
      <hr size=1> <a href="http://sg.rd.yahoo.com/aa/mail/domainchoice/mail/signature/*http://mail.promotions.yahoo.com/newdomains/aa/"> New Email addresses available on Yahoo! </a> <br>
Get the Email name you&#39;ve always wanted on the new @ymail and @rocketmail.<br>
Hurry before someone else does!