-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathODFStreamline.h
executable file
·61 lines (51 loc) · 1.93 KB
/
ODFStreamline.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef DEF_ODF_STREAMLINE
#define DEF_ODF_STREAMLINE
#include <iostream>
#include <vector>
#include <itkVectorImage.h>
#include <itkImage.h>
#include <itkImageFileWriter.h>
#include "vnl/vnl_vector.h"
#include "vnl/vnl_vector_fixed.h"
#include "vnl/vnl_math.h"
class ODFStreamline
{
public:
typedef double ODFType;
typedef itk::VectorImage <ODFType, 3> ODFImageType;
typedef itk::Image <ODFType, 3> DoubleImageType ;
typedef itk::Image <unsigned long, 3 > LabelImageType ;
typedef vnl_vector_fixed<double, 3> CoordinateType ;
ODFStreamline ( ODFImageType::Pointer, unsigned long ) ;
~ODFStreamline() {} ;
LabelImageType::Pointer Streamline ( LabelImageType::Pointer, unsigned long, bool ) ;
void SetFAImage ( DoubleImageType::Pointer fa )
{
m_FAImage = fa ;
m_FAArray = fa->GetPixelContainer()->GetBufferPointer() ;
}
void SetCoordinateTable ( std::vector < CoordinateType > vec )
{
m_CoordinateTable = vec ;
}
protected:
unsigned long m_XDim, m_YDim, m_ZDim ;
unsigned long m_NumberOfDirs ;
ODFImageType::Pointer m_ODFImage ;
LabelImageType::Pointer m_StreamlineImage ;
DoubleImageType::Pointer m_FAImage ;
unsigned long m_NumberOfSourceVoxels ;
ODFType *m_ODFArray ;
unsigned long *m_StreamlineArray, *m_SourceArray ;
double *m_FAArray ;
std::vector < CoordinateType > m_SourceVoxels ;
std::vector < CoordinateType > m_CoordinateTable ;
double m_StepSize ;
void StreamlineFromVoxel ( unsigned long, unsigned long, unsigned long, bool ) ;
void FindSourceVoxels () ;
void WriteSourceVoxels () ;
bool FacingAway ( int i, int j ) ;
int GetOpposite ( unsigned int i ) ;
long unsigned GetPeakDir ( unsigned long ) ;
};
#endif