Hi!
I have a question for u guys!
I would like to use the c++ package ITK (www.itk.org) for internal handling och data and functions in a dataset3D class of mine!
I also want to use a base class to be able to use all kinds of datasets (2D/3D/4D...)
-----------------------------------------------------------
class dataset_base{
public:
virtual void printDataInfo()=0;
DATASET_TYPE type;
string file_path;
};
-----------------------------------------------------------
But I need some help with the template part of my dataset class....
Today my class looks like this...
------------------dataset3D.h-----------------------------------------
#ifndef _dataset3D_h_
#define _dataset3D_h_
#pragma once
#include <string>
#include <stdio.h>
#include <iostream>
#include "itkImage.h"
#include "itkImageFileReader.h"
#include "dataset_base.h"
using namespace std;
template<class T>
class dataset3D: public dataset_base{
public:
typedef itk::Image<T,3> ImageType;
typedef typename ImageType::Pointer ImagePointerType;
typename int a;
dataset3D2(string filepath);
void printDataInfo();
private:
ImagePointerType theImage;
// int loadVolumeFromFile(string file);
ImagePointerType loadVolumeFromFile(string file);
};
#include "dataset3D2.cpp"
#endif
------------------dataset3D.cpp-----------------------------------------
//template<class T> int dataset3D2<T>::loadVolumeFromFile(string file){
template<class T> dataset3D2<T>::ImagePointerType dataset3D2<T>::loadVolumeFromFile(string file){ //(***)
cout<<"load_v("<<file<<")"<<endl;
}
return image.GetPointer();
}
-----------------------------------------------------------
But this gives following Compiler error in visual 7.1...
pointing at row (***)
Compiling...
dataset_array.cpp
c:\Joel\Code\ITKVTK\matrix\Src\Main\dataset3D2.cpp (28) : warning C4346: 'dataset3D2<T>::ImagePointerType' : dependent name is not a type
prefix with 'typename' to indicate a type
.....
.....
What is it that I am doing wrong!
I thought that (typedef typename was enough...)
Thanks in advance...
// Joel