<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 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? really appreciate any suggestion .<br><br>vtkImageData *id =vtkImageData::New();<br> id->SetDimensions(10,25,100);<br> id->SetScalarTypeToUnsignedShort();<br> id->SetNumberOfScalarComponents(1);<br> id->AllocateScalars();<br> <br> unsigned short *ptr= (unsigned short *) id->GetScalarPointer();<br> for(int i=0; i<10*25*100;i++)<br> { <br>
*ptr++=i;<br> }<br><br> vtkImageFlip *flipX=vtkImageFlip::New();<br> flipX->SetInput(id);<br> flipX->SetFilteredAxis(0);<br> flipX->Update();<br><br> vtkImageData *id2=vtkImageData::SafeDownCast(flipX->GetOutput());<br> <br> id->Delete();<br> flipX->Delete();<br> id2->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've always wanted on the new @ymail and @rocketmail.<br>
Hurry before someone else does!