[Insight-users] Using Array 2D

kumar MaKumartr@netscape.net
Wed, 25 Dec 2002 17:18:56 -0100


Hi

I have some problem with using Array2D in ITK
I have defined
Array2D<double> W(row,col);
and
 Array2D<double> Dprime(row,col);

and then if I do

 Dprime =    ((W.transpose()*W)/row*col));

Since the rhs results in a vnl_matrix , I get the following error

: no match for `itk::Array2D<double> & = vnl_matrix<double>'
/opt/tools/itk/Insight_Nightly/Insight/Code/Common/itkArray2D.h:62: 
candidates are: class itk::Array2D<double> & 
itk::Array2D<double>::operator =(const itk::Array2D<double> &)

This is  strange as Array2D is extended from vnl_matrix and hence the 
assignment should work
Even  .operator= did not work and gave the error below

: no matching function for call to `itk::Array2D<double>::operator = 
(vnl_matrix<double>)'
/opt/tools/itk/Insight_Nightly/Insight/Code/Common/itkArray2D.h:62: 
candidates are: class itk::Array2D<double> & 
itk::Array2D<double>::operator =(const itk::Array2D<double> &)



But  Dprime.set_columns(0,(W.transpose()*W)/np*ns);
works well

Thanks in advance for all the help

Regards
Kumar