[Insight-developers] Lots of new warnings: Adding an alternative GetInverse() method to the transform hierarchy.

Luis Ibanez luis.ibanez at kitware.com
Sat Jun 28 14:36:01 EDT 2008


Hi Bill,

Yeap, I'm working on the remaining ones.

I had to set up my build to do

     LEGACY_SILENT = OFF
     LECACY_REMOVE = ON

to see all the other problems....


    Luis


-------------------
Bill Lorensen wrote:
> My local slicer3 build is now failing. I found one problem with the
> use of itkLegcayMacro. It must have a trailing ";". I fixed
> itkTransform.h and checked it in.
> 
> Now I am getting errors like:
> [  0%] Building CXX object
> Libs/vtkITK/CMakeFiles/vtkITK.dir/vtkITKBSplineTransform.o
> /home/lorensen/Projects/Insight/Code/Common/itkMatrixOffsetTransformBase.h:349:
> error: two or more data types in declaration of 'GetInverse'
> /home/lorensen/Projects/Insight/Code/Common/itkMatrixOffsetTransformBase.txx:282:
> error: prototype for 'bool itk::MatrixOffsetTransformBase<TScalarType,
> NInputDimensions,
> NOutputDimensions>::GetInverse(itk::MatrixOffsetTransformBase<TScalarType,
> NInputDimensions, NOutputDimensions>*) const' does not match any in
> class 'itk::MatrixOffsetTransformBase<TScalarType, NInputDimensions,
> NOutputDimensions>'
> /home/lorensen/Projects/Insight/Code/Common/itkMatrixOffsetTransformBase.h:349:
> error: candidate is: virtual itk::itkLegacyMethodRemoved
> itk::MatrixOffsetTransformBase<TScalarType, NInputDimensions,
> NOutputDimensions>::GetInverse(itk::SmartPointer<itk::TransformBase>&)
> const
> /home/lorensen/Projects/Insight/Code/Common/itkMatrixOffsetTransformBase.txx:282:
> error: template definition of non-template 'bool
> itk::MatrixOffsetTransformBase<TScalarType, NInputDimensions,
> NOutputDimensions>::GetInverse(itk::MatrixOffsetTransformBase<TScalarType,
> NInputDimensions, NOutputDimensions>*) const'
> /home/lorensen/Projects/Insight/Code/Common/itkMatrixOffsetTransformBase.txx:310:
> error: prototype for 'bool itk::MatrixOffsetTransformBase<TScalarType,
> NInputDimensions,
> NOutputDimensions>::GetInverse(itk::SmartPointer<itk::TransformBase>&)
> const' does not match any in class
> 'itk::MatrixOffsetTransformBase<TScalarType, NInputDimensions,
> NOutputDimensions>'
> /home/lorensen/Projects/Insight/Code/Common/itkMatrixOffsetTransformBase.txx:282:
> error: candidates are: bool
> itk::MatrixOffsetTransformBase<TScalarType, NInputDimensions,
> NOutputDimensions>::GetInverse(itk::MatrixOffsetTransformBase<TScalarType,
> NInputDimensions, NOutputDimensions>*) const
> /home/lorensen/Projects/Insight/Code/Common/itkMatrixOffsetTransformBase.h:349:
> error:                 virtual itk::itkLegacyMethodRemoved
> itk::MatrixOffsetTransformBase<TScalarType, NInputDimensions,
> NOutputDimensions>::GetInverse(itk::SmartPointer<itk::TransformBase>&)
> const
> /home/lorensen/Projects/Insight/Code/Common/itkMatrixOffsetTransformBase.txx:310:
> error: template definition of non-template 'bool
> itk::MatrixOffsetTransformBase<TScalarType, NInputDimensions,
> NOutputDimensions>::GetInverse(itk::SmartPointer<itk::TransformBase>&)
> const'
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:8:
> warning: 'class vtkITKBSplineTransformHelper' has virtual functions
> but non-virtual destructor
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:
> In instantiation of 'vtkITKBSplineTransformHelperImpl<2u>':
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:197:
>   instantiated from here
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:51:
> warning: 'class vtkITKBSplineTransformHelperImpl<2u>' has virtual
> functions but non-virtual destructor
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:
> In instantiation of 'vtkITKBSplineTransformHelperImpl<3u>':
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:200:
>   instantiated from here
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:51:
> warning: 'class vtkITKBSplineTransformHelperImpl<3u>' has virtual
> functions but non-virtual destructor
> /home/lorensen/Projects/Insight/Code/Common/itkMatrixOffsetTransformBase.h:
> In instantiation of 'itk::MatrixOffsetTransformBase<double, 3u, 3u>':
> /home/lorensen/Projects/Insight/Code/Common/itkAffineTransform.h:110:
>  instantiated from 'itk::AffineTransform<double, 3u>'
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:1003:
>   instantiated from here
> /home/lorensen/Projects/Insight/Code/Common/itkMatrixOffsetTransformBase.h:349:
> error: conflicting return type specified for
> 'itk::itkLegacyMethodRemoved
> itk::MatrixOffsetTransformBase<TScalarType, NInputDimensions,
> NOutputDimensions>::GetInverse(itk::SmartPointer<itk::TransformBase>&)
> const [with TScalarType = double, unsigned int NInputDimensions = 3u,
> unsigned int NOutputDimensions = 3u]'
> /home/lorensen/Projects/Insight/Code/Common/itkTransformBase.h:94:
> error:   overriding 'virtual bool
> itk::TransformBase::GetInverse(itk::SmartPointer<itk::TransformBase>&)
> const'
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:
> In member function 'void
> vtkITKBSplineTransformHelperImpl<O>::SetBulkTransform(const double
> (*)[3], const double*) [with unsigned int O = 3u]':
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:1044:
>   instantiated from here
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:1002:
> warning: unused variable 'VTKDimension'
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:
> In member function 'void
> vtkITKBSplineTransformHelperImpl<O>::GetBulkTransform(double (*)[3],
> double*) const [with unsigned int O = 3u]':
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:1044:
>   instantiated from here
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:1024:
> warning: unused variable 'VTKDimension'
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:
> In member function 'const typename
> vtkITKBSplineTransformHelperImpl<O>::BulkTransformType*
> vtkITKBSplineTransformHelperImpl<O>::GetBulkTransform() const [with
> unsigned int O = 3u]':
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:1044:
>   instantiated from here
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:1043:
> warning: unused variable 'VTKDimension'
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:
> In member function 'void
> vtkITKBSplineTransformHelperImpl<O>::SetBulkTransform(const double
> (*)[3], const double*) [with unsigned int O = 2u]':
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:1044:
>   instantiated from here
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:1002:
> warning: unused variable 'VTKDimension'
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:
> In member function 'void
> vtkITKBSplineTransformHelperImpl<O>::GetBulkTransform(double (*)[3],
> double*) const [with unsigned int O = 2u]':
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:1044:
>   instantiated from here
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:1024:
> warning: unused variable 'VTKDimension'
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:
> In member function 'const typename
> vtkITKBSplineTransformHelperImpl<O>::BulkTransformType*
> vtkITKBSplineTransformHelperImpl<O>::GetBulkTransform() const [with
> unsigned int O = 2u]':
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:1044:
>   instantiated from here
> /home/lorensen/Projects/Slicer3/Libs/vtkITK/vtkITKBSplineTransform.cxx:1043:
> warning: unused variable 'VTKDimension'
> make[2]: *** [Libs/vtkITK/CMakeFiles/vtkITK.dir/vtkITKBSplineTransform.o]
> Error 1
> make[1]: *** [Libs/vtkITK/CMakeFiles/vtkITK.dir/all] Error 2
> make: *** [all] Error 2
> [lorensen at localhost vtkITK]$
> 
> 
> 
> On Sat, Jun 28, 2008 at 9:54 AM, Luis Ibanez <luis.ibanez at kitware.com> wrote:
> 
>>Hi Bill,
>>
>>Yeap, the change is now being backed off.
>>
>>The existing GetInverse method use "Self" as argument, therefore
>>every class returns a trasnsform of its own type.
>>
>>The change to virtual was not enough,
>>in practice we need a full new method with a different signature.
>>
>>We are replacing (via backward-compatible deprecation mechanism)
>>the method
>>
>> bool Transform::GetInverse( Self * inverse );
>>
>>with
>>
>> virtual bool
>> TransformBase::GetInverse( TransformBase::Pointer & inverse ) const;
>>
>>
>>The change has been committed now.
>>
>>
>> Luis
>>
>>
>>----------------------
>>Bill Lorensen wrote:
>>
>>>Luis,
>>>
>>>After your itkTransform.h changes, there are lots of warnings:
>>>http://www.cdash.org/CDash/viewBuildError.php?type=1&buildid=110692
>>>
>>>Bill
>>>
>>
> 


More information about the Insight-developers mailing list