[Insight-users] itk::Transform<double, 3u, 3u>’ is not a direct base of ...

motes motes mort.motes at gmail.com
Sat Feb 20 19:33:01 EST 2010


I am trying to subclass the BSplineDeformableTransform:


#include <iostream>
#include "itkTransform.h"
#include "itkImage.h"
#include "itkImageRegion.h"
#include "itkBSplineDeformableTransform.h"
#include "itkBSplineInterpolationWeightFunction.h"

namespace itk
{

template <
    class TScalarType = double,          // Data type for scalars
    unsigned int NDimensions = 3,        // Number of dimensions
    unsigned int VSplineOrder = 3 >      // Spline order

class ITK_EXPORT  MyTransform : public BSplineDeformableTransform<
TScalarType, NDimensions, NDimensions >
{
public:


But when I create the MyTransform:

#include "MyTransform.h"
int main(){

  typedef itk::MyTransform<double,3,3>                 Transform;
  Transform::Pointer transform = Transform::New();
return 0;
}

I get the error:
error: type ‘itk::Transform<double, 3u, 3u>’ is not a direct base of
‘itk::MyTransform<double, 3u, 3u>’


Is it not possible to subclass eg. BSplineDeformableTransform like this?





I have tried to subclass Transform instead and it works:

namespace itk
{

template <
    class TScalarType = double,          // Data type for scalars
    unsigned int NDimensions = 3,        // Number of dimensions
    unsigned int VSplineOrder = 3 >      // Spline order

class ITK_EXPORT  MyTransform : public Transform< TScalarType,
NDimensions, NDimensions >
{
public:


But then I need to copy almost all the functions from the
BSplineDeformableTransform which seems pretty bad. Any ideas?


More information about the Insight-users mailing list