<br>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.<br><br>To do that, I'm copying bits out of itkEuler3DTransform.txx<br>
In that file, a RotationX matrix is defined:<br><br>Matrix<TScalarType,3,3> RotationX<br><br>However, when I try doing that, I'm getting the following error:<br><br>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<br>
<br>1) What does this mean?<br>2) How do I get my beloved Matrix?<br><br>#include <itkMatrix.h><br>#include <vnl/vnl_matrix.h><br><br> typedef itk::Matrix<double,3,3> Matrix;<br><br> Matrix RotationX;<br>
// ImageType::DirectionType RotationX;<br> <br>// vnl_matrix_fixed<double,3,3> RotationX;<br> <br> RotationX[0][0] = 1; RotationX[0][1] = 0; RotationX[0][2] = 0; <br> RotationX[1][0] = 0; RotationX[1][1] = cx; RotationX[1][2] = sx; <br>
RotationX[2][0] = 0; RotationX[2][1] = -sx; RotationX[2][2] = cx;<br><br> direction = direction*RotationX;<br><br>cheers,<br><br>Michael<br><br><br><br>