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

motes motes mort.motes at gmail.com
Sun Feb 21 03:47:32 EST 2010


Maybe I am blind but I don't see the difference. What have you changed
in the definition?

On Sun, Feb 21, 2010 at 5:32 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> Try:
> 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, VSplineOrder >
> {
> public:
>
>
> On Sat, Feb 20, 2010 at 7:33 PM, motes motes <mort.motes at gmail.com> wrote:
>> 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?
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.html
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-users
>>
>


More information about the Insight-users mailing list