I'm trying to create a class to hold some 3D volume data and I want to use the ITK library to do this. At the same time I want my class to contain some information that is particular to the data. As the data type may change, it would be nice to have some flexibility about it, and here lies my problem.
With itk, one creates a new image type by spcifying the pixel type and the dimensionality of the data. In my case the first one is varible and the dimension is fixed at 3.
Clasically, for a volume of data type double on would do something like:
Now, this is not enough for me so I created my own templated class and here was one classical caveat of the template typedef so I had to be careful about this.
typedef itk::Image<double, 3> DoubleVolume;
DoubleVolume::Pointer aVolume = DoubleVolume::New();
In a very much simplified implementation, this is what I need and I can't figure it out, what I am doing wrong:
template<typename VoxelT = double>
typedef itk::Image<VoxelT, 3> ItkVolume;
Upon compilation I get the following:
typedef OctVolume<double> DoubleOctVolume;
Any idea about what the problem may be? I tried a yet more simplified version by partially specializing an own defined template and having it as a member of my class, and that worked very much ok.
../src/main.cpp:20: error: type ‘itk::Image<VoxelT, 3u>’ is not derived from type ‘OctVolume<VoxelT>’
../src/main.cpp:20: error: expected ‘;’ before ‘m_vol’