[Insight-developers] RE: Adaptor update mechanism

Miller, James V (Research) millerjv at crd.ge.com
Tue May 31 20:39:12 EDT 2005


Karthik, 

I'd have to look at this in more detail.  Your suggested changes do not seem
correct to me.  

ImageAdaptor2 works fine for me if I remove the call to reader->Update().
(Using .Net 2003).

The LargestPossibleRegion and the RequestedRegion should have been propagated
through the adaptered already.  If there is a problem, it might be somewhere 
where m_BufferedRegion is accessed directly instead of via an access method.

The only place I see this happening is in ComputeOffsetTable(). We could have
that method call GetBufferedRegion().  However, I cannot duplicate the error 
you are getting.


Jim


-----Original Message-----
From: Karthik Krishnan [mailto:Karthik.Krishnan at kitware.com]
Sent: Tuesday, May 31, 2005 5:22 PM
To: Insight-developers (E-mail); Luis Ibanez; Miller, James V (Research)
Subject: Adaptor update mechanism


Hi,

The adaptors don't seem to propagate information when plugged into the 
pipeline. For example ImageAdaptor2 example segfaults if 
reader->Update() is commented out.

I believe that  the Update() call in ImageAdaptor.txx should be

//----------------------------------------------------------------------------
template <class TImage, class TAccessor >
void
ImageAdaptor<TImage , TAccessor>
::Update()
{
  Superclass::Update();
 
  Superclass::SetLargestPossibleRegion( 
m_Image->GetLargestPossibleRegion() );
  Superclass::SetBufferedRegion( m_Image->GetBufferedRegion() );
  Superclass::SetRequestedRegion( m_Image->GetRequestedRegion() );
  m_Image->Update();
}

instead of what it is now. Please correct me if I am mistaken. I don't 
want to commit incorrect code since I am not familiar enough with the 
pipeline mechanism.

Thanks
Regards
Karthik



More information about the Insight-developers mailing list