Dear All,<br><br>I have a small problem in vtk: I have a class (not derived from any VTK object) that has methods for dealing with vtkImageData in various ways. For example, I am extracting one scalar component from a multi-component vtkImageData object using this function<br>
<br>vtkStructuredPoints* GetField (int index)<br>{<br>&nbsp;&nbsp;&nbsp; vtkImageExtractComponents *extr = vtkImageExtractComponents::New ();<br>&nbsp;&nbsp;&nbsp; extr-&gt;SetInput (this-&gt;GetInputField ());<br>&nbsp;&nbsp;&nbsp; extr-&gt;SetComponents (index);<br>
&nbsp;&nbsp;&nbsp; extr-&gt;Update ();<br>&nbsp;&nbsp;&nbsp; return (vtkStructuredPoints*) (extr-&gt;GetOutput ());<br>}<br clear="all"><br>I am wondering if there is a problem with deallocating the <i>extr</i> object in the above function. I obviously cannot manually call Delete () on it, since I must use it for returning my output. Is the Delete () method automatically called when returning from the function to the calling routine? How &#39;big&#39; is the extr object? Is it of the same size as the input to the vtkImageExtractComponents filter?<br>
<br>Thanks for taking the pain in reading this!<br>Adrian<br>-- <br>---------------------------------------------------<br>Adrian Albert<br>School of Engineering and Science<br>Jacobs University Bremen<br>Germany<br>Tel.: 00494212003258