[Insight-developers] Bug in ImageBase causing extra updates
Bradley Lowekamp
blowekamp at mail.nih.gov
Mon Feb 9 12:12:08 EST 2009
Hello,
I found the following bug and am looking to see if anyone sees any
complications with the proposed fix of this:
http://www.itk.org/Bug/view.php?id=8490
It can be easy noticed (comments say it's wrong):
template<unsigned int VImageDimension>
void
ImageBase<VImageDimension>
::Initialize()
{
//
// We don't modify ourselves because the "ReleaseData" methods
depend upon
// no modification when initialized.
//
// Call the superclass which should initialize the BufferedRegion
ivar.
Superclass::Initialize();
// Clear the offset table
memset( m_OffsetTable, 0, (VImageDimension+1)*sizeof(unsigned
long) );
// Clear the BufferedRegion ivar
this->SetBufferedRegion( RegionType() );
}
and
//----------------------------------------------------------------------------
template<unsigned int VImageDimension>
void
ImageBase<VImageDimension>
::SetBufferedRegion(const RegionType ®ion)
{
if (m_BufferedRegion != region)
{
m_BufferedRegion = region;
this->ComputeOffsetTable();
this->Modified();
}
}
In addition to the manifestation mentioned in Mantis, it also occurs
in itkImageFileWriterStreamingTest2.cxx in the "=== Updating
mismatched IORegion ==".
Unfortunately the itkShiftScaleInPlaceImageFilterTest.cxx uses the
FilterWatcher. So if the execution of this filters is not as expected,
then the test will still pass.
Brad
========================================================
Bradley Lowekamp
Lockheed Martin Contractor for
Office of High Performance Computing and Communications
National Library of Medicine
blowekamp at mail.nih.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090209/078555c5/attachment.htm>
More information about the Insight-developers
mailing list