[Insight-developers] possible bug in BSplineInterpolateImageFunction->SetInputImage

M.Staring at lumc.nl M.Staring at lumc.nl
Tue Oct 13 03:46:31 EDT 2009


Hi Luis,

My build was green, so I just comitted the fix:

http://www.itk.org/cgi-bin/viewcvs.cgi/Code/BasicFilters/itkBSplineInterpolateImageFunction.txx?root=Insight&r1=1.21&r2=1.22&sortby=date

Thanks,

Marius

> -----Original Message-----
> From: Luis Ibanez [mailto:luis.ibanez at kitware.com] 
> Sent: Tuesday, October 13, 2009 12:13 AM
> To: Staring, M. (LKEB)
> Cc: insight-developers at itk.org
> Subject: Re: [Insight-developers] possible bug in 
> BSplineInterpolateImageFunction->SetInputImage
> 
> Hi Marius,
> 
> Thanks for pointing this out.
> 
> Your analysis makes sense.
> 
> Just setting the m_Coefficients pointer to NULL, will
> not result in the deallocation of the m_CoefficientsFilter
> output.
> 
> Your suggested fix looks right,
> 
> Please go ahead and (at your convenience) submit
> an Experimental build, and if Green, then commit the
> change to the repository.
> 
> 
>      Thanks
> 
> 
>            Luis
> 
> 
> --------------------------------------------------------------
> ---------
> On Mon, Oct 12, 2009 at 7:30 AM,  <M.Staring at lumc.nl> wrote:
> > Hi all,
> >
> > The SetInputImage() fucntion of the class 
> BSplineInterpolateImageFunction is
> > as follows:
> >
> > if ( inputData )
> > {
> >   ....
> > }
> > else
> > {
> >   m_Coefficients = NULL;
> > }
> >
> > Suppose SetInputImage was previously called with some large 
> moving image (in
> > the registration framework).
> >
> > When SetInputImage is called as SetInputImage(0), the 
> m_Coefficients is set
> > to NULL in the else. However, this does not result in a 
> deletion of the
> > data, since the reference count is 2: 1 for the
> > BSplineInterpolateImageFunction, but also an additional 1 for the
> > m_CoefficientFilter of type BSplineDecompositionImageFilter 
> which stores a
> > reference to m_Coefficients.
> >
> > As I would interprete calling SetInputImage(0) as a request 
> for deleting the
> > data m_Coefficients (which can be really large, since it is 
> a double image
> > the size of the moving image), I would suggest to change 
> the implementation
> > to:
> >
> > if ( inputData )
> > {
> >   ....
> > }
> > else
> > {
> >   m_CoefficientFilter->GetOutput()->DisconnectPipeline();
> >   m_Coefficients = NULL;
> > }
> >
> > Is my interpretation correct?
> >
> > If you think so I can submit an experimental build and 
> commit this cange to
> > the repository.
> >
> > With kind regards,
> >
> > Marius
> >
> >
> >
> > Marius Staring, PhD
> > Division of Image Processing (LKEB)
> > Department of Radiology
> > Leiden University Medical Center
> > PO Box 9600, 2300 RC Leiden, The Netherlands
> > phone: +31 (0)71 526 1106, fax: +31 (0)71 526 6801
> > m.staring at lumc.nl
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the ITK FAQ at:
> > http://www.itk.org/Wiki/ITK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.itk.org/mailman/listinfo/insight-developers
> >
> >
> 
> No virus found in this incoming message.
> Checked by AVG - www.avg.com 
> Version: 8.5.421 / Virus Database: 270.14.11/2430 - Release 
> Date: 10/12/09 04:01:00
> 


More information about the Insight-developers mailing list