[Insight-users] itkMatrix error: discards qualifiers??

michiel mentink michael.mentink at st-hughs.ox.ac.uk
Mon Mar 29 12:01:39 EDT 2010


In an autodidactic effort, I'm trying to rotate an image by 'hand', by
multiplying the 'direction' matrix of an image by a rotation matrix.

To do that, I'm copying bits out of itkEuler3DTransform.txx
In that file, a RotationX matrix is defined:

Matrix<TScalarType,3,3> RotationX

However, when I try doing that, I'm getting the following error:

error: passing ‘const itk::Matrix<double, 3u, 3u>’ as ‘this’ argument of
‘const itk::Matrix<T, NRows, NColumns>& itk::Matrix<T, NRows,
NColumns>::operator=(const itk::Matrix<T, NRows, NColumns>&) [with T =
double, unsigned int NRows = 3u, unsigned int NColumns = 3u]’ discards
qualifiers

1) What does this mean?
2) How do I get my beloved Matrix?

#include <itkMatrix.h>
#include <vnl/vnl_matrix.h>

  typedef itk::Matrix<double,3,3> Matrix;

  Matrix RotationX;
 // ImageType::DirectionType RotationX;

//  vnl_matrix_fixed<double,3,3> RotationX;

  RotationX[0][0] = 1; RotationX[0][1] =   0; RotationX[0][2] = 0;
  RotationX[1][0] = 0; RotationX[1][1] =  cx; RotationX[1][2] = sx;
  RotationX[2][0] = 0; RotationX[2][1] = -sx; RotationX[2][2] = cx;

  direction = direction*RotationX;

cheers,

Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100329/8493df1f/attachment.htm>


More information about the Insight-users mailing list