[Insight-users] Re: How to use VNL classess?
Luis Ibanez
luis.ibanez at kitware.com
Sun, 11 Jan 2004 16:35:06 -0500
Hi Steven,
This sounds like homework...
---
1) You can use the vnl_matrix_fixed as
#include "vnl/vnl_matrix_fixed.h"
typedef vnl_matrix_fixed< double, 4, 4 > MatrixType;
MatrixType A;
// then assign values to the components
A(0,0) = 1.0;
A(1,2) = 3.0; // ... etc.
// then multiply matrices in order to cumulate
// transformations
MatrixType B;
MatrixType C;
C = B * A;
2) Use the class vnl_inverse
#include "vnl/vnl_inverse.h"
#include "vnl/vnl_matrix_fixed.h"
#include "vnl/vnl_vector_fixed.h"
typeder vnl_vector_fixed<double,4> VectorType;
typeder vnl_matrix_fixed<double,4,4> MatrixType;
VectorType B;
MatrixType A;
VectorType X = vnl_inverse( A ) * B;
Look at the header file vnl_inverse.h in
Insight/Utilities/vxl/core/vnl/
3) About
"How to use ITK in order to do this with VNL..."
Well...
you simply don't need ITK just for doing this.
Regards,
Luis
--------------------
Steven Chen wrote:
> Hi, All
>
> I was asked to do some transformation in Matrix.
> (1) Given local transformation parameters, create the 4X4 matrix;
> (2) From A X = B , each element of A and B can be calculated from
> formular, and i was asked to figure out what is X.
>
> So how to use ITK to do this using VNL classes?
>
> Thanks a lot.
>
> Steven
>
> ------------------------------------------------------------------------
> Do you Yahoo!?
> Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
> <http://pa.yahoo.com/*http://us.rd.yahoo.com/hotjobs/mail_footer_email/evt=21482/*http://hotjobs.sweepstakes.yahoo.com/signingbonus>
>