DMRITool  v0.1.1-139-g860d86b4
Diffusion MRI Tool
itkFiberTracts.h
Go to the documentation of this file.
1 
11 #ifndef __itkFiberTracts_h
12 #define __itkFiberTracts_h
13 
14 #include "itkFiber.h"
15 
16 #include "itkTrackvisHeader.h"
17 #include "utlSmartAssert.h"
18 #include "utlCore.h"
19 #include "utlITKMacro.h"
20 
21 namespace itk
22 {
23 
24 
25 template< typename TValue=double >
26 class FiberTracts: public DataObject
27 {
28 public:
30  typedef FiberTracts Self;
31  typedef DataObject Superclass;
32  typedef SmartPointer< Self > Pointer;
33  typedef SmartPointer< const Self > ConstPointer;
34 
35  itkNewMacro(Self);
36 
37  itkTypeMacro(FiberTracts, DataObject );
38 
39  typedef TValue ValueType;
40 
42  typedef std::shared_ptr<HeaderType> HeaderPointer;
43 
45  typedef typename FiberType::Pointer FiberPointer;
46  typedef typename FiberType::TractType TractType;
49 
50  typedef VectorContainer< unsigned int, FiberPointer > FiberContainerType;
51  typedef typename FiberContainerType::Pointer FiberContainerPointer;
52 
53  itkSetGetMacro(Header, HeaderPointer);
54 
55  itkSetGetMacro(Fibers, FiberContainerPointer);
56 
57  int GetNumberOfFibers() const
58  {
59  return m_Fibers->Size();
60  }
61 
62  int GetNumberOfPoints() const;
63 
64  FiberPointer GetFiber(const int index) const
65  {
66  return m_Fibers->GetElement(index);
67  }
68 
69  typename FiberTracts<TValue>::Pointer DeepClone() const;
70 
71  void PrintFibersHeader(std::ostream & os=std::cout, Indent indent=0) const
72  {
73  itk::PrintTractVisHeader(*m_Header, os <<indent);
74  }
75 
76  bool HasPropertyName(const std::string& name) const
77  {
78  return itk::HasPropertyName(*m_Header, name);
79  }
80  bool HasScalarName(const std::string& name) const
81  {
82  return itk::HasScalarName(*m_Header, name);
83  }
84 
86  void RemoveScalarsByName(const std::string& name);
88  void RemovePropertiesByName(const std::string& name);
89 
91  void GetPointStats(std::vector<double>& numPointsStats, std::vector<double>& pointDistStats) const;
92 
94  Pointer SelectByIndicesOfTracts(const std::vector<int>& indices);
95 
97  Pointer SelectByBallROI(double x, double y, double z, double radius);
98 
100  void AppendFiber(const FiberPointer fiber);
101 
103  void AppendFibers(const Pointer fibers);
104 
105 protected:
106  FiberTracts(): m_Header(new HeaderType())
107  {
108  }
110 
111  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
112 
113  typename LightObject::Pointer InternalClone() const ITK_OVERRIDE;
114 
115  HeaderPointer m_Header;
116 
117  FiberContainerPointer m_Fibers = FiberContainerType::New();
118 
119 
120 private:
121  FiberTracts(const Self &) ITK_DELETE_FUNCTION;
122  void operator=(const Self &) ITK_DELETE_FUNCTION;
123 
124 };
125 
126 
127 }
128 
129 #if !defined(ITK_MANUAL_INSTANTIATION) && !defined(__itkFiberTracts_hxx)
130 #include "itkFiberTracts.hxx"
131 #endif
132 
133 #endif
Represent a path of line segments through ND Space.
FiberTracts< TValue >::Pointer DeepClone() const
HeaderPointer m_Header
FiberType::Pointer FiberPointer
FiberContainerPointer m_Fibers
int GetNumberOfFibers() const
FiberType::TractPointer TractPointer
bool HasScalarName(const std::string &name) const
bool HasPropertyName(const TrackVisHeaderType &header, const std::string &name)
TractType::Pointer TractPointer
Definition: itkFiber.h:43
TractType::VertexType VertexType
void PrintTractVisHeader(const TrackVisHeaderType &header, std::ostream &os=std::cout)
void AppendFiber(const FiberPointer fiber)
DataObject Superclass
#define ITK_DELETE_FUNCTION
Definition: utlITKMacro.h:49
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
itkSetGetMacro(Header, HeaderPointer)
Created "07-24-2017.
void GetPointStats(std::vector< double > &numPointsStats, std::vector< double > &pointDistStats) const
Fiber< ValueType > FiberType
SmartPointer< const Self > ConstPointer
VectorContainer< unsigned int, FiberPointer > FiberContainerType
FiberPointer GetFiber(const int index) const
#define ITK_OVERRIDE
Definition: utlITKMacro.h:46
Created "07-24-2017.
void AppendFibers(const Pointer fibers)
SmartPointer< Self > Pointer
Definition: itkFiber.h:33
Pointer SelectByBallROI(double x, double y, double z, double radius)
FiberContainerType::Pointer FiberContainerPointer
void RemovePropertiesByName(const std::string &name)
bool HasScalarName(const TrackVisHeaderType &header, const std::string &name)
std::shared_ptr< HeaderType > HeaderPointer
bool HasPropertyName(const std::string &name) const
Pointer SelectByIndicesOfTracts(const std::vector< int > &indices)
FiberType::TractType TractType
Created "07-22-2017.
FiberTracts Self
SmartPointer< Self > Pointer
void PrintFibersHeader(std::ostream &os=std::cout, Indent indent=0) const
LightObject::Pointer InternalClone() const ITK_OVERRIDE
TrackVisHeaderType HeaderType
int GetNumberOfPoints() const
void RemoveScalarsByName(const std::string &name)