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

Bill Lorensen bill.lorensen at gmail.com
Wed Dec 3 12:40:09 EST 2008


Have you included "itkImage.h"?

On Wed, Dec 3, 2008 at 12:19 PM, Wei-Dong Lian <weidong.lian at gmail.com> wrote:
> 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);
>   ....
>   ....
> }
> ***************************************************************
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>


More information about the Insight-users mailing list