Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkChiSquareNoiseModel.cpp
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 #include <vnl/vnl_cross.h>
17 #include <vnl/vnl_quaternion.h>
19 
20 using namespace mitk;
21 
22 template< class ScalarType >
24 {
25  m_RandGen.seed();
26 }
27 
28 template< class ScalarType >
30 {
31 
32 }
33 
34 template< class ScalarType >
36 {
37  if (seed>=0)
38  m_RandGen.seed(seed);
39  else
40  m_RandGen.seed();
41 }
42 
43 template< class ScalarType >
45 {
46  for( unsigned int i=0; i<pixel.Size(); i++)
47  pixel[i] += (ScalarType)(m_Distribution(m_RandGen)-m_Distribution.n());
48 }
double ScalarType
DataCollection - Class to facilitate loading/accessing structured data.
void SetSeed(int seed)
seed for random number generator