DMRITool  v0.1.1-139-g860d86b4
Diffusion MRI Tool
itkMeshFromContinuousSphericalFunctionImageFilter.h
Go to the documentation of this file.
1 
18 #ifndef __itkMeshFromContinuousSphericalFunctionImageFilter_h
19 #define __itkMeshFromContinuousSphericalFunctionImageFilter_h
20 
21 
23 
24 namespace itk
25 {
26 
40 template < class TInputImage, class TOutputMesh=vtkPolyData>
42  : public MeshFromSphericalFunctionImageFilter<TInputImage, TOutputMesh>
43 {
44 public:
48  typedef SmartPointer<Self> Pointer;
49  typedef SmartPointer<const Self> ConstPointer;
50 
52  itkNewMacro(Self);
53 
56 
57  //** Convenient typedefs */
58  typedef TInputImage InputImageType;
59  typedef typename InputImageType::Pointer InputImagePointer;
60  typedef typename InputImageType::ConstPointer InputImageConstPointer;
61  typedef typename InputImageType::IndexType InputImageIndexType;
62  typedef typename InputImageType::SizeType InputImageSizeType;
63  typedef typename InputImageType::SizeValueType InputImageSizeValueType;
64  typedef typename InputImageType::SpacingType InputImageSpacingType;
65  typedef typename InputImageType::PixelType InputImagePixelType;
66  typedef typename InputImageType::RegionType InputImageRegionType;
67  typedef typename InputImageType::PointType InputImagePointType;
68 
69  typedef TOutputMesh OutputMeshPolyDataType;
70 
76 
77 
82 
90 
91 
92  itkSetMacro(BasicShape, BasicShapeType);
93  itkGetMacro(BasicShape, BasicShapeType);
94 
95  itkSetMacro(TessellationOrder, unsigned int);
96  itkGetMacro(TessellationOrder, unsigned int);
97 
98  itkSetMacro(BasisMatrix, MatrixPointer);
99  itkGetMacro(BasisMatrix, MatrixPointer);
100 
101  itkSetGetBooleanMacro(Stretch);
102 
103  virtual MatrixPointer ComputeBasisMatrix()
104  {
105  return MatrixPointer();
106  }
107 
108  virtual VectorType NormalizeUnitIntegral(const VectorType& x) const
109  {
110  return x;
111  }
112 
113 protected:
115 
117  {};
118 
120  {
121  utlSAGlobalException(this->m_ColorScheme!=Superclass::MAGNITUDE && this->m_ColorScheme!=Superclass::DIRECTION)
122  (this->m_ColorScheme).msg("wrong m_ColorScheme");
123  utlSAGlobalException(!m_Stretch && this->m_ColorScheme!=Superclass::MAGNITUDE)
124  (m_Stretch)(this->m_ColorScheme).msg("If m_Stretch is set off, then m_ColorScheme has to be MAGNITUDE");
125  }
126 
127  void ScaleSamples(VectorType& b) const;
128 
129  void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE;
130 
131  typename LightObject::Pointer InternalClone() const ITK_OVERRIDE;
132 
133  // virtual void GenerateData();
134  void ThreadedGenerateData(const typename TInputImage::RegionType& regionForThread,ThreadIdType threadId ) ITK_OVERRIDE;
135  void BeforeThreadedGenerateData() ITK_OVERRIDE;
136 
137  SphereTessellatorPointer m_SphereTessellator;
138  BasicShapeType m_BasicShape;
139  unsigned int m_TessellationOrder;
140 
141  MatrixPointer m_BasisMatrix;
142 
144  bool m_Stretch=true;
145 
146 private:
147  MeshFromContinuousSphericalFunctionImageFilter(const Self&); //purposely not implemented
148  void operator=(const Self&);//purposely not implemented
149 
150 };
151 
152 } // end namespace itk
153 
154 // Define instantiation macro for this template.
155 #define ITK_TEMPLATE_MeshFromContinuousSphericalFunctionImageFilter(_, EXPORT, x, y) namespace itk { \
156  _(2(class EXPORT MeshFromContinuousSphericalFunctionImageFilter< ITK_TEMPLATE_2 x >)) \
157  namespace Templates { typedef MeshFromContinuousSphericalFunctionImageFilter< ITK_TEMPLATE_2 x > MeshFromContinuousSphericalFunctionImageFilter##y; } \
158  }
159 
160 #if ITK_TEMPLATE_EXPLICIT
161 # include "Templates/itkMeshFromContinuousSphericalFunctionImageFilter+-.h"
162 #endif
163 
164 #if !defined(ITK_MANUAL_INSTANTIATION) && !defined(__itkMeshFromContinuousSphericalFunctionImageFilter_hxx)
166 #endif
167 
168 #endif
MeshFromSphericalFunctionImageFilter< TInputImage, TOutputMesh > Superclass
#define utlSAGlobalException(expr)
Definition: utlCoreMacro.h:362
#define ITK_OVERRIDE
Definition: utlITKMacro.h:46
Superclass::OutputMeshPolyDataPointer OutputMeshPolyDataPointer
Compute mesh from general spherical function.
Compute mesh from continuous spherical function linearly represented by a set of bases.
SmartPointer< Self > Pointer
Tesselates a sphere via subdivision of tetrahedron, octahedron, or icosahedron.
#define itkSetGetBooleanMacro(name)
Definition: utlITKMacro.h:139