[Insight-developers] Filters propagating GetSpacing()/GetOrigin()

Miller, James V (CRD) millerjv@crd.ge.com
Fri, 29 Jun 2001 20:12:45 -0400


I rearranged some code to address the issues presented in my previous email.  I moved the default
implementation of GetSpacing() and GetOrigin() to ImageBase (which is only templated over
ImageDimension).  This allows us to properly implement PhysicalImage::CopyInformation().  

PhysicalImage::CopyInformation() now casts its input parameter to an ImageBase.  If this cast is
successful, we know that GetSpacing() and
GetOrigin() are defined.  So the spacing and origin can be properly
copied from the input to the output.

As long as all image classes derive from ImageBase, this methodology 
will work.  

Note that if a filter does not want the default behavior of copying meta-data like spacing and origin
from the first input to all the outputs, that filter will still need to override
ProcessObject::UpdateOutputInformation().