[Insight-users] Release Data in MultiResolutionPDEDeformableRegistration

Karthik Krishnan Karthik.Krishnan at kitware.com
Tue Aug 8 14:50:40 EDT 2006


Please log this as a bug report at

http://itk.org/Bug/

Thanks.
-karthik

Thomas Albrecht wrote:

> Hi,
>
> I noticed that when using the MultiResolutionPDEDeformableRegistration 
> filter on input images whose DataReleaseFlags are set to true, the 
> input images are not released until the very end of the registration, 
> even though they are never again used after the multiresolution 
> pyramids are created.
> This way, the images are gone after the registration anyway but still 
> take up memory when they are no longer needed, during the 
> registration, which itself needs as much memory as possible.
>
> I suggest the following changes: In the file 
> itkMultiResolutionPDEDeformableRegistration.txx, just before the 
> creation of the multiresolution pyramids (Line number 237 on ITK 2.6) 
> in the function GenerateData(), add the following line:
>
>  this->RestoreInputReleaseDataFlags();
>
> Thus the ReleaseDataFlags of the input images, which are by default 
> set to false during the execution of GenerateData(), are restored and 
> so after the following lines (see below), the input images are 
> released from memory, iff their ReleaseDataFlags were set to true 
> before the registration was started.
>
>  // Create the image pyramids.
>  m_MovingImagePyramid->SetInput( movingImage );
>  m_MovingImagePyramid->UpdateLargestPossibleRegion();
>
>  m_FixedImagePyramid->SetInput( fixedImage );
>  m_FixedImagePyramid->UpdateLargestPossibleRegion();
>
> I tested this modified version of 
> itkMultiResolutionPDEDeformableRegistration.txx and it seems to work 
> fine. It looks like the input images are really never used again after 
> the multiresolution pyramids are created.
>
> Does anyone have any comments? Should this change be incorporated into 
> the current CVS version of the code?
>
> Bye
>
> Tom
> _______________________________________________
> 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