[Insight-users] vnl_fixed_matrix up to 4
Karthik Krishnan
Karthik.Krishnan at kitware.com
Thu Feb 3 11:16:45 EST 2005
Hi Lagaffe,
I am not sure what the correct solution is, but I would prefer not
modifying the ITK source directory and including explicit instantiations
in your code instead. I think the problem with vnl is that you have to
explicitly instantiate your STL stuff. Thats done in the Templates
directories as Luis mentioned. But you could do that explicitly from you
code using the *_INSTANTIATE macro. So to compile the code mentioned in
http://public.kitware.com/pipermail/insight-users/2004-June/008948.html,
add two lines as below:
>>/ Hi all,
/>>/ I'm having a linking problem when compiling the following code (I'm
/>>/ including only the important parts):
/>>/ /
/>>/ #include "itkVector.h"
/>>/ #include "itkListSample.h"
/>>/ #include "itkCovarianceCalculator.h"
/
#include "/ITK/Insight/Utilities/vxl/core/vnl/vnl_matrix_fixed.txx"
VNL_MATRIX_FIXED_INSTANTIATE(double, 60, 60);
>>/ int main( int argc, char * argv[] )
/>>/ {
/>>/ const unsigned int vsize = 60;
/>>/ typedef itk::Vector< float, vsize > InputPixelType;
/>>/ typedef itk::Statistics::ListSample< InputPixelType > SampleType ;
/>>/ SampleType::Pointer sample = SampleType::New() ;
/>>/ // here I create the samplelist
/>>/ typedef itk::Statistics::CovarianceCalculator< SampleType >
/>>/ CovarianceAlgorithmType;
/>>/ CovarianceAlgorithmType::Pointer covarianceAlgorithm =
/>>/ CovarianceAlgorithmType::New();
/>>/ covarianceAlgorithm->SetInputSample( sample );
/>>/ // I've already calculated the mean:
/>>/ covarianceAlgorithm->SetMean( meanAlgorithm->GetOutput() );
/>>/ covarianceAlgorithm->Update();
/>>/ return 0;
/>>/ }/
Also see
http://www.esat.kuleuven.ac.be/~targetjr/vxl/book.html
Section 3.4 Template instantiation.
Thanks
kk
Lagaffe wrote:
> Hello Luis,
>
> I have the same problem you have already answered about
> vnl_fixed_matrix up to 4
> you previous answer was:
> http://public.kitware.com/pipermail/insight-users/2004-June/008948.html
> So I added: vnl_matrix_fixed+double.5.5-.cxx to
> InsightToolkit-1.8.1\Utilities\vxl\core\vnl\Templates
> and do the modification inside my new vnl_matrix_fixed+double.5.5-.cxx.
>
> You said that after you have to modify the /CMakeLists.txt file// in
> that directory/, but there is no CMakerList in that directory ??
> So, how can I modify ITK to work with my new
> vnl_matrix_fixed+double.5.5-.cxx ?
>
> Thanks for help, I know you are very busy with ITK 1.10 ;-) good luck
>
> Lagaffe
>
> ------------------------------------------------------------------------
> Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour
> vos mails !
> Créez votre Yahoo! Mail
> <http://fr.rd.yahoo.com/mail/taglines/*http://fr.rd.yahoo.com/evt=25917/*http://fr.rd.yahoo.com/mail_fr/mail_campaigns/splash/taglines_250/default/*http://fr.promotions.yahoo.com/mail/creer28.html>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Insight-users mailing list
>Insight-users at itk.org
>http://www.itk.org/mailman/listinfo/insight-users
>
>
More information about the Insight-users
mailing list