ITK/Examples/Statistics/GaussianDistribution

From KitwarePublic
< ITK‎ | Examples
Revision as of 14:17, 3 January 2011 by Daviddoria (talk | contribs) (Created page with "==GaussianDistribution.cxx== <source lang="cpp"> #include "itkGaussianDistribution.h" int main(int, char* [] ) { itk::Statistics::GaussianDistribution::Pointer gaussian = itk:...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

GaussianDistribution.cxx

<source lang="cpp">

  1. include "itkGaussianDistribution.h"

int main(int, char* [] ) {

 itk::Statistics::GaussianDistribution::Pointer gaussian = itk::Statistics::GaussianDistribution::New();
 gaussian->SetMean(2.0);
 gaussian->SetVariance(1.0);
 std::cout << gaussian->EvaluatePDF(2.1) << std::endl;
 return EXIT_SUCCESS;

} </source>

CMakeLists.txt

<source lang="cmake"> cmake_minimum_required(VERSION 2.6)

PROJECT(GaussianDistribution)

FIND_PACKAGE(ITK REQUIRED) INCLUDE(${ITK_USE_FILE})

ADD_EXECUTABLE(GaussianDistribution GaussianDistribution.cxx) TARGET_LINK_LIBRARIES(GaussianDistribution ITKBasicFilters ITKCommon ITKIO ITKStatistics)

</source>