NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkMeshGenerator.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef niftkMeshGenerator_h
16 #define niftkMeshGenerator_h
17 
18 #include <string>
19 #include <vector>
20 #include <utility>
21 
22 #include <vtkSmartPointer.h>
23 #include <vtkMultiBlockDataSet.h>
24 #include <itkImage.h>
25 
26 #include <niftkIOException.h>
27 
29 
30 namespace niftk {
42  public:
44  typedef itk::Image<unsigned char, 3> ITKImageType;
45 
46  private:
47  std::string m_InputFileName;
48  vtkSmartPointer<vtkMultiBlockDataSet> mp_OutputMeshes;
49  std::vector<std::vector<std::pair<int,int> > > m_SubMeshLabels;
50  bool m_DoSurface;
51 
52  public:
54  void SetFileName(const std::string &fileName) {
55  m_InputFileName = fileName;
56  }
57 
59  vtkSmartPointer<vtkMultiBlockDataSet>& GetOutput(void) {
60  return mp_OutputMeshes;
61  }
62 
64  const std::vector<std::vector<std::pair<int, int> > >& GetMeshLabels(void) const {
65  return m_SubMeshLabels;
66  }
76  private:
77  float m_facetAngle, m_facetEdgeLength, m_facetApproximationError;
78  float m_cellSize, m_cellEdgeRadiusRatio;
79 
80  public:
82  void SetFacetMinAngle(const float facetAngle) {
83  m_facetAngle = facetAngle;
84  }
85 
87  void SetFacetMaxEdgeLength(const float facetEdgeLength) {
88  m_facetEdgeLength = facetEdgeLength;
89  }
90 
92  void SetBoundaryApproximationError(const float facetApproximationError) {
93  m_facetApproximationError = facetApproximationError;
94  }
95 
97  void SetCellMaxSize(const float cellSize) {
98  m_cellSize = cellSize;
99  }
100 
102  void SetCellMaxRadiusEdgeRatio(const float cellEdgeRadiusRatio) {
103  m_cellEdgeRadiusRatio = cellEdgeRadiusRatio;
104  }
111  private:
112  void _ComputeMeshLabels(void);
113 
114  public:
116  void SetDoSurface(const bool doSurface)
117  {
118  m_DoSurface = doSurface;
119  }
120 
121  void Update(void) throw (niftk::IOException);
128  public:
129  MeshGenerator(void);
131  };
132 } /* namespace niftk */
133 
134 #endif /* MESHGENERATOR_H_ */
void SetCellMaxSize(const float cellSize)
Definition: niftkMeshGenerator.h:97
void SetFacetMaxEdgeLength(const float facetEdgeLength)
Definition: niftkMeshGenerator.h:87
vtkSmartPointer< vtkMultiBlockDataSet > & GetOutput(void)
Definition: niftkMeshGenerator.h:59
itk::Image< unsigned char, 3 > ITKImageType
Definition: niftkMeshGenerator.h:44
void SetCellMaxRadiusEdgeRatio(const float cellEdgeRadiusRatio)
Definition: niftkMeshGenerator.h:102
Creates a VTK mesh using CGAL as a back-end from any single-file image volume supported by ITK...
Definition: niftkMeshGenerator.h:37
void SetFileName(const std::string &fileName)
Definition: niftkMeshGenerator.h:54
#define NIFTKCOMMON_WINEXPORT
Definition: niftkCommonWin32ExportHeader.h:28
const std::vector< std::vector< std::pair< int, int > > > & GetMeshLabels(void) const
Definition: niftkMeshGenerator.h:64
void SetFacetMinAngle(const float facetAngle)
Definition: niftkMeshGenerator.h:82
void SetDoSurface(const bool doSurface)
Definition: niftkMeshGenerator.h:116
Definition: niftkExceptionObject.h:21
GLsizei const GLcharARB ** string
Definition: glew.h:5194
Exceptions for Filesystem, Network, ... I/O.
Definition: niftkIOException.h:26
void SetBoundaryApproximationError(const float facetApproximationError)
Definition: niftkMeshGenerator.h:92