16 #include <vnl/vnl_cross.h>
17 #include <vnl/vnl_quaternion.h>
22 template<
class ScalarType >
25 , m_Diffusivity(0.001)
27 , m_RandomizeSticks(false)
36 stick[0] = sticks->get(0,i); stick[1] = sticks->get(1,i); stick[2] = sticks->get(2,i);
42 template<
class ScalarType >
48 template<
class ScalarType >
53 if (dir>=this->m_GradientList.size())
58 if (m_RandomizeSticks)
59 m_NumSticks = 30 + this->m_RandGen->GetIntegerVariate()%31;
66 for (
unsigned int j=0; j<m_NumSticks; j++)
70 dot = GetRandomDirection()*g;
73 signal += std::exp( (
double)(b*bVal*dot*dot) );
75 signal /= m_NumSticks;
83 template<
class ScalarType >
87 vec[0] = this->m_RandGen->GetNormalVariate();
88 vec[1] = this->m_RandGen->GetNormalVariate();
89 vec[2] = this->m_RandGen->GetNormalVariate();
94 template<
class ScalarType >
98 signal.SetSize(this->m_GradientList.size());
101 if (m_RandomizeSticks)
102 m_NumSticks = 30 + this->m_RandGen->GetIntegerVariate()%31;
104 for(
unsigned int i=0; i<this->m_GradientList.size(); i++)
111 for (
unsigned int j=0; j<m_NumSticks; j++)
114 if(m_RandomizeSticks)
115 dot = GetRandomDirection()*g;
118 signal[i] += std::exp( (
double)(b*bVal*dot*dot) );
120 signal[i] /= m_NumSticks;
GradientListType m_Sticks
Stick container.
GradientType GetRandomDirection()
unsigned int m_NumSticks
Number of sticks.
PixelType SimulateMeasurement()
DataCollection - Class to facilitate loading/accessing structured data.
ItkRandGenType::Pointer m_RandGen
Random number generator.
DiffusionSignalModel< ScalarType >::GradientType GradientType
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.