[Insight-users] Re: How to convert from const CovarianceMatrixType to double [ ][3]

Luis Ibanez luis.ibanez at kitware.com
Mon Feb 5 18:52:49 EST 2007


Hi Juan,

The actual type of the MeanVectorType and CovarianceMatrixType are
taken as traits from the MahalanobisDistanceThresholdImageFunction
in


    Insight/Code/Common/itkMahalanobisDistanceThresholdImageFunction.h


Where they are declared as:


   /** Type used to represent the Covariance
       matrix of the vector population */
   typedef vnl_matrix<double> CovarianceMatrixType;

   /** Type used to represent the Mean Vector
        of the vector population */
   typedef vnl_vector<double> MeanVectorType;


You can get the pointer to the internal buffer of
a vnl_vector<double> by invoking the method:

               data_block();

that in this case will return a pointer to double.


The pointer to the internal buffer of a vnl_matrix
can also be obtained by calling its data_block()
method. Note that, in general, in the case of the
matrix you may have to double check the row/cols
orientation. In the case of the covariance matrix
you are probably safe, given that this matrix must
always be symmetric.



    Regards,


       Luis


=======================
Juan Paredes wrote:
> Hi itk-ers,
> 
> I'm trying to apply the SimpleFuzzyConnectednessRGBImageFilter   using 
> the  mean   and covariance  output   by  a   VectorConfidenceConnected 
> ImageFilter.
> 
> I need to convert mean from  const MeanVectorType to double  [ ] and 
> covariance  from const CovarianceMatrixType to double [ ][3].
> 
> Does anybody know how to do it?
> 
> Thanks in advance,
> 
> 
> Juan
>  
> 
> ------------------------------------------------------------------------
> 8:00? 8:25? 8:40? Find a flick < 
> http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news> in no time
> with theYahoo! Search movie showtime shortcut. < 
> http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news>


More information about the Insight-users mailing list