NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkMeshMerger.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 niftkMeshMerger_h
16 #define niftkMeshMerger_h
17 
19 
20 #include <vtkMultiBlockDataSet.h>
21 #include <vtkSmartPointer.h>
22 #include <vtkUnstructuredGrid.h>
23 
24 #include <vector>
25 #include <string>
26 
28 
29 namespace niftk {
35  private:
36  std::vector<int> m_DesiredLabels;
37  bool m_UseImageLabels;
38  const std::vector<std::vector<std::pair<int,int> > > *mpc_SubMeshLabels;
39 
40  public:
47  void SetDesiredLabels(const std::vector<int> &desiredLabels) {
48  m_DesiredLabels = desiredLabels;
49  }
50 
51  const std::vector<int>& GetDesiredLabels(void) const {
52  return m_DesiredLabels;
53  }
54 
55  void SetMeshLabels(const std::vector<std::vector<std::pair<int,int> > > &subMeshLabels) {
56  mpc_SubMeshLabels = &subMeshLabels;
57  }
58 
59 
61  void ToggleUseImageLabels(void) {
62  m_UseImageLabels = !m_UseImageLabels;
63  }
70  private:
71  vtkSmartPointer<vtkMultiBlockDataSet> *mpp_SubMeshes;
72  vtkSmartPointer<vtkUnstructuredGrid> mp_OutputMesh;
73 
74  public:
75  void SetInput(vtkSmartPointer<vtkMultiBlockDataSet> &inputSubMeshes) {
76  mpp_SubMeshes = &inputSubMeshes;
77  }
78 
79  vtkSmartPointer<vtkUnstructuredGrid> GetOutput(void) {
80  return mp_OutputMesh;
81  }
82 
83  void Update(void) throw (niftk::InvalidArgumentException);
85  };
86 }
87 #endif /* MESHMERGER_H_ */
Definition: niftkMeshMerger.h:30
const std::vector< int > & GetDesiredLabels(void) const
Setter for list of submeshes that are desired in the output mesh.
Definition: niftkMeshMerger.h:51
#define NIFTKCOMMON_WINEXPORT
Definition: niftkCommonWin32ExportHeader.h:28
void SetInput(vtkSmartPointer< vtkMultiBlockDataSet > &inputSubMeshes)
Definition: niftkMeshMerger.h:75
vtkSmartPointer< vtkUnstructuredGrid > GetOutput(void)
Definition: niftkMeshMerger.h:79
Exceptions for signalling invalid input.
Definition: niftkInvalidArgumentException.h:26
void ToggleUseImageLabels(void)
Definition: niftkMeshMerger.h:61
Definition: niftkExceptionObject.h:21
void SetDesiredLabels(const std::vector< int > &desiredLabels)
Setter for list of submeshes that are desired in the output mesh.
Definition: niftkMeshMerger.h:47
void SetMeshLabels(const std::vector< std::vector< std::pair< int, int > > > &subMeshLabels)
Setter for list of submeshes that are desired in the output mesh.
Definition: niftkMeshMerger.h:55