[Insight-users] C++ Template problem in ITK

Wei-Dong Lian weidong.lian at gmail.com
Wed Dec 3 12:19:05 EST 2008


Hello, everyone
Below are one member function in my class
"LevelSetInfoReader<VImageDimension>".

The line "typedef itk::Image< PixelType, VImageDimension> ImageType;" can
not compile successfully.
It indicated that "ImageType" is undefined type.
Generally, we can directly use the template parameter variable.
I will be appreciated if someone can give me some suggestions.
Thanks at first.
*****************************************************************
template<unsigned int VImageDimension>
bool
LevelSetInfoReader<VImageDimension>
::DoUpdate()
{
  typedef float PixelType;
  typedef itk::Image< PixelType, VImageDimension> ImageType;
  // INSTANCE READER
  typedef itk::ImageFileReader<ImageType> ReaderType;
  ReaderType::Pointer reader = ReaderType::New();
  reader->SetFileName(m_lsImageFile);
  ....
  ....
}
***************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20081203/cca945fe/attachment.htm>


More information about the Insight-users mailing list