[Insight-developers] ImageToImageFilter: dimension reductionproblem

Wilson Chang wmcst6+@pitt.edu
Fri, 26 Apr 2002 16:17:51 -0400


Within the ImageToImageFilterDetail namespace, I have been trying to make a
class called ExtractImageRegionCopier that derives from ImageRegionCopier:

  template <unsigned int D1, unsigned int D2>
  class ITK_EXPORT ExtractImageFilterDetail: public ImageRegionCopier<D1,
D2>
  {

  public:
    void operator() (ImageRegion<D1> &destRegion,
                     const ImageRegion<D2> &srcRegion) const
    {
      std::cout<<"ExtractImageFilterDetail call"<<std::endl;
      ExtractImageCopyRegion<D1, D2>(BinaryUnsignedIntDispatch<D1,
D2>::ComparisonType(),
                         destRegion, srcRegion);
    }
  };

In the ExtractImageFilter class:

  typedef
    ImageToImageFilterDetail::ExtractImageFilterDetail<InputImageDimension,
                     OutputImageDimension> ExtractImageFilterDetailType;

and in ExtractImageFilter's constructor:

this->SetRegionCopier(m_ExtractImageRegionCopier);

But for some reason, all of the to "CopyRegion()" are getting routed to the
parent class ImageRegionCopier and not the child class
ExtractImageRegionCopier.
Ideas?
Does this have somethign to do with the fact that the "SetRegionCopier" call
expects a type of ImageRegionCopier, and not a child class?

wilson