No subject


Wed Oct 7 22:37:18 EDT 2009


'MyTransform' but why is that an error?










On Sun, Feb 21, 2010 at 9:52 AM, motes motes <mort.motes at gmail.com> wrote:
> Ah sorry! I have now changed to (VSplineOrder):
>
> =A0TScalarType, NDimensions, VSplineOrder >
>
> but I still get the same error. Any ideas are most welcome!
>
>
>
> On Sun, Feb 21, 2010 at 5:32 AM, Bill Lorensen <bill.lorensen at gmail.com> =
wrote:
>> Try:
>> namespace itk
>> {
>>
>> template <
>> =A0 class TScalarType =3D double, =A0 =A0 =A0 =A0 =A0// Data type for sc=
alars
>> =A0 unsigned int NDimensions =3D 3, =A0 =A0 =A0 =A0// Number of dimensio=
ns
>> =A0 unsigned int VSplineOrder =3D 3 > =A0 =A0 =A0// Spline order
>>
>> class ITK_EXPORT =A0MyTransform : public BSplineDeformableTransform<
>> TScalarType, NDimensions, VSplineOrder >
>> {
>> public:
>>
>>
>> On Sat, Feb 20, 2010 at 7:33 PM, motes motes <mort.motes at gmail.com> wrot=
e:
>>> 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 <
>>> =A0 =A0class TScalarType =3D double, =A0 =A0 =A0 =A0 =A0// Data type fo=
r scalars
>>> =A0 =A0unsigned int NDimensions =3D 3, =A0 =A0 =A0 =A0// Number of dime=
nsions
>>> =A0 =A0unsigned int VSplineOrder =3D 3 > =A0 =A0 =A0// Spline order
>>>
>>> class ITK_EXPORT =A0MyTransform : public BSplineDeformableTransform<
>>> TScalarType, NDimensions, NDimensions >
>>> {
>>> public:
>>>
>>>
>>> But when I create the MyTransform:
>>>
>>> #include "MyTransform.h"
>>> int main(){
>>>
>>> =A0typedef itk::MyTransform<double,3,3> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 Transform;
>>> =A0Transform::Pointer transform =3D Transform::New();
>>> return 0;
>>> }
>>>
>>> I get the error:
>>> error: type =91itk::Transform<double, 3u, 3u>=92 is not a direct base o=
f
>>> =91itk::MyTransform<double, 3u, 3u>=92
>>>
>>>
>>> Is it not possible to subclass eg. BSplineDeformableTransform like this=
?
>>>
>>>
>>>
>>>
>>>
>>> I have tried to subclass Transform instead and it works:
>>>
>>> namespace itk
>>> {
>>>
>>> template <
>>> =A0 =A0class TScalarType =3D double, =A0 =A0 =A0 =A0 =A0// Data type fo=
r scalars
>>> =A0 =A0unsigned int NDimensions =3D 3, =A0 =A0 =A0 =A0// Number of dime=
nsions
>>> =A0 =A0unsigned int VSplineOrder =3D 3 > =A0 =A0 =A0// Spline order
>>>
>>> class ITK_EXPORT =A0MyTransform : 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