[Insight-users] strange Template - Errors in MSVC 7.1

Henning Meyer tutmann at gmail.com
Wed Feb 15 11:33:44 EST 2006


Hello,

I try to implement a new ImageRegistrationMethod, but I can't really
get to work because of strange errors from the MS VC compiler 7.1.
For example I wrote this small piece of code:

template <typename TImage >
class ITK_EXPORT myTest : public ProcessObject {
	public:
  static const unsigned int myImageDimension = itk::GetImageDimension<
TImage >::ImageDimension;
  typedef ImageToImageMetric< TImage, TImage > myMetric;
  typedef typename myMetric::TransformType myTransform;
  typedef typename Image< myTransform, myImageDimension > TransformImageType;
  typedef typename TransformImageType::Pointer     TransformImagePointer;
};

When I instatiate this Class by:
itk::myTest< itk::Image< float, 2> > tut;

I get a long list of errors pointing to ~ImportImageContainer().
Why this?
What's wrong with my code?
How should I create an image of transformations?

And finally: Whats the difference between typdef and typedef typename?
Whats the difference between template <class T> and template <typename
T>?

Thank you!

Henning


More information about the Insight-users mailing list