[Insight-users] how to realease the memory of a filter?

Andinet Enquobahrie andinet.enqu at kitware.com
Thu Mar 16 12:56:40 EST 2006


>Hi all,
>
>I'm working with big images (CTi and MRI) and I've got several filters in
>a pipeline + some other processing classes I wrote (not with the ITK
>organization, too bad... ).
>As I've understood, most of the filters produce a new image, "doubling"
>the memory. I would like to be able to release the memory as soon I
>don't need it any more. For example:
>
>...
>
>itkFilter1->SetInput( InputImage );
>itkFilter1->Update();
>TmpImage = itkFilter1->GetOutput();
>
>MyClassObject.SetInput( TmpImage );
>OutputImage = MyClassObject.GetOutput();
>
>// at this point I don't need any more InputImage
>
>...
>
>I tryed with: Delete() but at the end of the execution it gives me a
>SegFault I guess cause itk is trying to release the memory I already
>released...
>
>  
>

Turn on the ReleaseDataFlag...

itkFilter1->ReleaseDataFlagOn();

-Andinet

>What am I doing wrong?
>
>Thank you,
>cheers
>Alberto
>_______________________________________________
>Insight-users mailing list
>Insight-users at itk.org
>http://www.itk.org/mailman/listinfo/insight-users
>
>
>  
>




More information about the Insight-users mailing list