Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkChiSquareNoiseModel.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef _MITK_ChiSquareNoiseModel_H
18 #define _MITK_ChiSquareNoiseModel_H
19 
21 #include <itkMersenneTwisterRandomVariateGenerator.h>
22 
23 namespace mitk {
24 
30 template< class ScalarType >
31 class ChiSquareNoiseModel : public DiffusionNoiseModel< ScalarType >
32 {
33 public:
34 
37 
39 
41  void AddNoise(PixelType& pixel);
42 
43  void SetNoiseVariance(double var){ m_Distribution = boost::random::chi_squared_distribution<double>(var/2); }
44  double GetNoiseVariance(){ return m_Distribution.n()*2; }
45  void SetSeed(int seed);
46 
47 protected:
48 
49  boost::random::mt19937 m_RandGen;
50  boost::random::chi_squared_distribution<double> m_Distribution;
51 };
52 
53 }
54 
56 
57 #endif
58 
DataCollection - Class to facilitate loading/accessing structured data.
boost::random::chi_squared_distribution< double > m_Distribution
Implementation of noise following a chi-squared distribution.
DiffusionNoiseModel< ScalarType >::PixelType PixelType
void SetSeed(int seed)
seed for random number generator
Abstract class for diffusion noise models.
boost::random::mt19937 m_RandGen