[Insight-users] c++ question

Luis Ibanez luis.ibanez@kitware.com
Thu, 24 Apr 2003 11:50:42 -0400


Hi Zein,

Please include the compiler error in your message.
That will certainly help.

----

My guess is that the problem is related to
the declaration of the return type. When using
a type that has been typedefed in the class, you
need to add the scope specification:

The declaration of your method should look like:

   template <class TInputImage, class TOutputImage>
   CSGenerator<TInputImage,TOutputImage>::TransformationType
   CSGenerator<TInputImage,TOutputImage>
   ::GenerateTheMatrix(IndexType m_WinCenter, VectorType m_Normal)



Regards,


   Luis


---------------
salah wrote:
> Hi all,
> 
> May be this question is silly. 
> 
> I have defined a 4x4 matrix as follows
> 
>  typedef itk::Matrix<float, 4, 4>  TransformationType;
> 
> 
> I tried then to define a function in my templated class to generate a matrix 
> an return it as result
> 
> I need to call something like:
> 
> TransformationType  T;
> 
> T = GenerateTheMatrix (... ..);
> 
> I have defined the function GenerateTheMatrix as follows:
> 
> template <class TInputImage, class TOutputImage>
> TransformationType      CSGenerator<TInputImage,TOutputImage>
> ::GenerateTheMatrix(IndexType m_WinCenter, VectorType m_Normal)
> {   
>     TransformationType      R;  
>      R[0]= ...;        R[1]=  ...;  ......
>      return R;
> }
>  
> The compiler did not accept this and reported an error.
> 
> Can anybody please tell me what is wrong with that and how to go around 
> this problem??
> 
> Many Thanks
> 
> Zein 
> 
> ->8<------------->8<------------->8<------------->8<------------->8<------------->8<-
> Zein I. Salah 
> University of Tübingen, WSI-GRIS, Sand 14, 72076 Tübingen 
> Email: salah@gris.uni-tuebingen.de
> Tel.: (07071) 29 75465 (GRIS),           Fax: (07071) 29 54 66
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
>