[Insight-users] a bug in ImportImageFilter?

Miller, James V (Research) millerjv at crd . ge . com
Fri, 18 Jul 2003 15:50:14 -0400


This might be a naming/doc issue.  Here "Source" refers to the
ImportImageFilter.
It is considered a "source" since it produces output but doesn't take an
input
in the tradition pipeline sense. "Source" is the generic name of an object
that 
produces output.  This is in contrast to a "filter".

"Source" does not mean your application rather it means the
ImportImageFilter.



> -----Original Message-----
> From: Carolyn Johnston [mailto:Carolyn . Johnston at vexcel . com]
> Sent: Friday, July 18, 2003 3:21 PM
> To: insight-users at public . kitware . com
> Subject: [Insight-users] a bug in ImportImageFilter?
> 
> 
> Could there be a bug in SetImportPointer? I noted while 
> debugging that 
> although passing the value LetSourceManageMemory = true is 
> supposed to, 
> well, allow the source to manage the memory according to the 
> manual, delete 
> is called on the import pointer if m_SourceManageMemory == true, and 
> stepping through the code I note m_SourceManageMemory is reset to 
> LetSourceManageMemory (code snippet included). I note also that the 
> destructor deletes the memory if m_SourceManageMemory is true.
> 
> I thought it was possible this is a bug that slipped through 
> testing, since 
> this may be a part of ITK that isn't used as frequently as 
> the standard 
> image readers. This is apparently what was causing the shift 
> problem I 
> posted a couple of days ago.
> 
> :) Carolyn
> 
> ______________________________________________________________
> __________________________
> ImportImageFilter<TPixel, VImageDimension>
> ::SetImportPointer(TPixel *ptr, unsigned long num, bool 
> LetSourceManageMemory)
> {
>    if (ptr != m_ImportPointer)
>      {
>      if (m_ImportPointer && m_SourceManageMemory)
>        {
>        delete [] m_ImportPointer;
>        }
>      m_ImportPointer = ptr;
>      this->Modified();
>      }
>    m_SourceManageMemory = ;
>    m_Size = num;
> }
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>