17 #ifndef __itkOrientationDistributionFunction_h
18 #define __itkOrientationDistributionFunction_h
21 #include "itkIndent.h"
22 #include "itkFixedArray.h"
23 #include "itkMatrix.h"
24 #include "itkSymmetricEigenAnalysis.h"
25 #include "itkSimpleFastMutexLock.h"
26 #include "itkDiffusionTensor3D.h"
28 #include "vtkPolyData.h"
29 #include "vtkPoints.h"
30 #include "vtkCellArray.h"
31 #include "vtkDelaunay2D.h"
32 #include "vtkCleanPolyData.h"
33 #include "vtkAppendPolyData.h"
49 template <
typename TComponent,
unsigned int NOdfDirections >
51 FixedArray<TComponent,NOdfDirections>
63 typedef FixedArray<TComponent,NOdfDirections>
Superclass;
69 typedef FixedArray<TComponent,
70 itkGetStaticConstMacro(InternalDimension)>
BaseArray;
78 typedef Matrix<TComponent, NOdfDirections, NOdfDirections>
MatrixType;
96 Self&
operator= (
const ComponentArrayType r);
105 Self
operator*(
const RealValueType & scalar )
const;
106 Self
operator/(
const RealValueType & scalar )
const;
107 const Self &
operator*=(
const RealValueType & scalar );
108 const Self &
operator/=(
const RealValueType & scalar );
113 return itkGetStaticConstMacro(m_Directions);
119 return itkGetStaticConstMacro(InternalDimension);
124 {
return this->operator[](c); }
131 { this->operator[](c) = v; }
134 ValueType &
operator()(
unsigned int row,
unsigned int col );
135 const ValueType &
operator()(
unsigned int row,
unsigned int col )
const;
193 static vtkPolyData* m_BaseMesh;
195 static double m_MaxChordLength;
197 static DirectionsType* m_Directions;
199 static std::vector< std::vector<int>* >* m_NeighborIdxs;
201 static std::vector< std::vector<int>* >* m_AngularRangeIdxs;
203 static std::vector<int>* m_HalfSphereIdxs;
205 static itk::SimpleFastMutexLock m_MutexBaseMesh;
206 static itk::SimpleFastMutexLock m_MutexHalfSphereIdxs;
207 static itk::SimpleFastMutexLock m_MutexNeighbors;
208 static itk::SimpleFastMutexLock m_MutexAngularRange;
217 template<
typename TComponent,
unsigned int NOdfDirections >
220 template<
typename TComponent,
unsigned int NOdfDirections >
229 #define ITK_TEMPLATE_OrientationDistributionFunction(_, EXPORT, x, y) namespace itk { \
230 _(2(class MITKDIFFUSIONCORE_EXPORT EXPORT OrientationDistributionFunction< ITK_TEMPLATE_2 x >)) \
231 namespace Templates { typedef OrientationDistributionFunction< ITK_TEMPLATE_2 x > \
232 OrientationDistributionFunction##y; } \
235 #if ITK_TEMPLATE_EXPLICIT
236 # include "Templates/itkOrientationDistributionFunction+-.h"
244 #endif //__itkOrientationDistributionFunction_h
NumericTraits< ValueType >::RealType AccumulateValueType
Superclass::ValueType ValueType
Self operator+(const Self &vec) const
std::istream InputStreamType
OrientationDistributionFunction Self
ComponentType ComponentArrayType[itkGetStaticConstMacro(InternalDimension)]
vnl_matrix_fixed< double, 3, NOdfDirections > DirectionsType
ComponentType GetMinValue() const
TComponent GetPrincipleCurvature(double alphaMinDegree, double alphaMaxDegree, int invert) const
Self MinMaxNormalize() const
int GetNthDiffusionDirection(int n, vnl_vector_fixed< double, 3 > rndVec) const
static double GetMaxChordLength()
void SetNthComponent(int c, const ComponentType &v)
ComponentType GetMeanValue() const
OrientationDistributionFunction(const ComponentArrayType r)
std::ostream OutputStreamType
static unsigned int GetNumberOfComponents()
static DirectionsType * GetDirections()
ValueType & operator()(unsigned int row, unsigned int col)
const Self & operator*=(const RealValueType &scalar)
Self PostMultiply(const MatrixType &m) const
#define MITKDIFFUSIONCORE_EXPORT
static vtkPolyData * GetBaseMesh()
Self PreMultiply(const MatrixType &m) const
Self operator-(const Self &vec) const
ComponentType GetMaxValue() const
const Self & operator+=(const Self &vec)
FixedArray< TComponent, NOdfDirections > Superclass
Represents an ODF for Q-Ball imaging.
static vnl_vector_fixed< double, 3 > GetDirection(int i)
Self operator/(const RealValueType &scalar) const
static void ComputeBaseMesh()
FixedArray< TComponent, itkGetStaticConstMacro(InternalDimension)> BaseArray
TComponent GetNormalizedEntropy() const
ValueType
Type of the value held by a Value object.
static std::vector< int > GetNeighbors(int idx)
NumericTraits< ValueType >::RealType RealValueType
void InitFromEllipsoid(itk::DiffusionTensor3D< TComponent > tensor)
Self & operator=(const Self &r)
Self operator*(const RealValueType &scalar) const
TComponent GetNematicOrderParameter() const
TComponent GetGeneralizedGFA(int k, int p) const
TComponent GetStdDevByMaxValue() const
void InitFromTensor(itk::DiffusionTensor3D< TComponent > tensor)
Self MaxNormalize() const
ComponentType GetNthComponent(int c) const
itkStaticConstMacro(InternalDimension, unsigned int, NOdfDirections)
const Self & operator-=(const Self &vec)
MITKDIFFUSIONCORE_EXPORT InputStreamType & operator>>(InputStreamType &is, OrientationDistributionFunction< TComponent, NOdfDirections > &c)
OrientationDistributionFunction(const ComponentType &r)
MITKDIFFUSIONCORE_EXPORT OutputStreamType & operator<<(OutputStreamType &os, const OrientationDistributionFunction< TComponent, NOdfDirections > &c)
OrientationDistributionFunction(const Self &r)
Matrix< TComponent, NOdfDirections, NOdfDirections > MatrixType
const Self & operator/=(const RealValueType &scalar)
OrientationDistributionFunction()
ComponentType GetInterpolatedComponent(vnl_vector_fixed< double, 3 > dir, InterpolationMethods method) const
int GetPrincipleDiffusionDirection() const
TComponent GetGeneralizedFractionalAnisotropy() const