DMRITool  v0.1.1-139-g860d86b4
Diffusion MRI Tool
itkMeshFromFiberTractsFilter.h
Go to the documentation of this file.
1 
11 #ifndef __itkMeshFromFiberTractsFilter_h
12 #define __itkMeshFromFiberTractsFilter_h
13 
14 #include <itkLightProcessObject.h>
15 #include <vtkPolyData.h>
16 #include <vtkSmartPointer.h>
17 
18 #include "itkFiberTracts.h"
19 #include "utlCoreMacro.h"
20 
21 namespace itk
22 {
23 
31 class ITK_EXPORT MeshFromFiberTractsFilter : public LightProcessObject
32 {
33 public:
36  typedef LightProcessObject Superclass;
37  typedef SmartPointer<Self> Pointer;
38 
40  itkNewMacro(Self);
41 
43  itkTypeMacro(MeshFromFiberTractsFilter, LightProcessObject);
44 
51 
52  typedef vtkPolyData OutputMeshPolyDataType;
53  typedef vtkSmartPointer<vtkPolyData> OutputMeshPolyDataPointer;
54 
56  typedef enum
57  {
59  GLYPH_LINE=0, //0
61  GLYPH_TUBE
63 
64  typedef enum
65  {
67  COLOR_NONE=0,
81  COLOR_BY_PROPERTY
83 
84  itkSetGetMacro(FiberTracts, FiberTractsPointer);
85 
86  itkSetGetMacro(ColorScheme, ColorSchemeType);
87  itkSetGetMacro(ShapeMode, GlyphShapeType);
88 
89  itkSetGetMacro(TubeRadius, double);
90 
91  void SetColor(double r, double g, double b)
92  {
93  m_Color[0]=r, m_Color[1]=g, m_Color[2]=b;
94  }
95  const double* GetColor() const
96  {
97  return m_Color;
98  }
99 
100  void SetFlip(const int flipx, const int flipy, const int flipz )
101  {
102  m_Flip[0]=flipx, m_Flip[1]=flipy, m_Flip[2]=flipz;
103  }
104  std::vector<int> GetFlip() const
105  {
106  return m_Flip;
107  }
108 
110  virtual void Update();
111 
112  OutputMeshPolyDataPointer GetOutput() const
113  {
114  return this->m_Mesh;
115  }
116 
117 
118 protected:
121 
122  typename LightObject::Pointer InternalClone() const ITK_OVERRIDE;
123 
124  void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE
125  {
126  Superclass::PrintSelf(os, indent);
127  m_FiberTracts->Print(os, indent);
128  utl::PrintVector(m_Flip, "m_Flip");
129  PrintVar(true, os<<indent, m_TubeRadius, m_ShapeMode, m_ColorScheme);
130  PrintVar(true, os<<indent, m_Color[0], m_Color[1], m_Color[2]);
131  m_Mesh->Print(std::cout<<"m_Mesh=");
132  }
133 
134  FiberTractsPointer m_FiberTracts = FiberTractsType::New();
135 
136  ColorSchemeType m_ColorScheme=COLOR_BY_POINT_DIRECTION;
137 
138  GlyphShapeType m_ShapeMode=GLYPH_LINE;
139 
140  OutputMeshPolyDataPointer m_Mesh = OutputMeshPolyDataType::New();
141 
142  double m_Color[3]={255,0,0};
143 
144  double m_TubeRadius=0.2;
145 
147  std::vector<int> m_Flip = std::vector<int>(3, 0);
148 
149 private:
150  MeshFromFiberTractsFilter(const Self&); //purposely not implemented
151  void operator=(const Self&); //purposely not implemented
152 
153 };
154 
155 
156 }
157 
158 #ifndef ITK_MANUAL_INSTANTIATION
160 #endif
161 
162 
163 #endif
FiberType::Pointer FiberPointer
TractType::VertexType VertexType
Definition: itkFiber.h:44
void SetColor(double r, double g, double b)
void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
FiberTractsType::FiberPointer FiberPointer
vtkSmartPointer< vtkPolyData > OutputMeshPolyDataPointer
#define ITK_OVERRIDE
Definition: utlITKMacro.h:46
void SetFlip(const int flipx, const int flipy, const int flipz)
#define PrintVar(cond, os,...)
Definition: utlCoreMacro.h:242
std::vector< ValueType > STDVectorType
Definition: itkFiber.h:46
#define itkSetGetMacro(name, type)
Definition: utlITKMacro.h:134
void PrintVector(const std::vector< T > &vec, const std::string &str="", const char *separate=" ", std::ostream &os=std::cout, bool showStats=true)
Definition: utlCore.h:1002
Created "07-22-2017.
macros for utlCore
SmartPointer< Self > Pointer
OutputMeshPolyDataPointer GetOutput() const