GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
itkvtkMeshFilterBase.h
Go to the documentation of this file.
1 /*=========================================================================
2  Authors: The GoFigure Dev. Team.
3  at Megason Lab, Systems biology, Harvard Medical school, 2009-11
4 
5  Copyright (c) 2009-11, President and Fellows of Harvard College.
6  All rights reserved.
7 
8  Redistribution and use in source and binary forms, with or without
9  modification, are permitted provided that the following conditions are met:
10 
11  Redistributions of source code must retain the above copyright notice,
12  this list of conditions and the following disclaimer.
13  Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16  Neither the name of the President and Fellows of Harvard College
17  nor the names of its contributors may be used to endorse or promote
18  products derived from this software without specific prior written
19  permission.
20 
21  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
25  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26  OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
27  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
30  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 
33 =========================================================================*/
34 
35 #ifndef __itkvtkMeshFilterBase_h
36 #define __itkvtkMeshFilterBase_h
37 
38 #include "itkObject.h"
41 
42 #include "itkShapeLabelObject.h"
43 #include "itkLabelMap.h"
44 #include "itkLabelImageToShapeLabelMapFilter.h"
45 #include "itkLabelImageToStatisticsLabelMapFilter.h"
46 
47 namespace itk
48 {
49 template< class TFeatureImage >
50 class vtkMeshFilterBase : public Object
51 {
52 public:
53  typedef Object Superclass;
55  typedef SmartPointer< Self > Pointer;
56  typedef SmartPointer< const Self > ConstPointer;
57 
60 
61  typedef TFeatureImage FeatureImageType;
62  typedef typename FeatureImageType::Pointer FeatureImagePointer;
63  typedef typename FeatureImageType::PixelType FeatureImagePixelType;
64  typedef typename FeatureImageType::IndexType FeatureImageIndexType;
65  typedef typename FeatureImageType::PointType FeatureImagePointType;
66 
70 
73 
74 
75  // ---------------------------------------------------------------------------
76 
78  typedef unsigned int LabelType;
79 
80  // ---------------------------------------------------------------------------
81 
83  typedef ShapeLabelObject< LabelType,
84  FeatureImageType::ImageDimension >
86  typedef typename ShapeLabelObjectType::Pointer ShapeLabelObjectPointer;
87 
89  typedef LabelMap< ShapeLabelObjectType > ShapeLabelMapType;
90  typedef typename ShapeLabelMapType::Pointer ShapeLabelMapPointer;
91 
93  typedef LabelImageToShapeLabelMapFilter< FeatureImageType,
96  typedef typename ShapeConverterType::Pointer ShapeConverterPointer;
97 
98 
99  typedef typename ShapeLabelMapType::LabelObjectContainerType
101  typedef typename LabelObjectContainerType::const_iterator
103 
104  // ---------------------------------------------------------------------------
105 
107  typedef StatisticsLabelObject< LabelType,
108  FeatureImageType::ImageDimension >
110  typedef typename StatLabelObjectType::Pointer StatLabelObjectPointer;
111 
112 
113  typedef LabelMap< StatLabelObjectType > StatLabelMapType;
114  typedef typename StatLabelMapType::Pointer StatLabelMapPointer;
115 
116  typedef LabelImageToStatisticsLabelMapFilter<
120 
121  typedef typename StatConverterType::Pointer StatConverterPointer;
122 
123  // ---------------------------------------------------------------------------
124 
125  void SetNumberOfImages( const size_t& iN );
126 
127  void SetFeatureImage( const size_t& iId, FeatureImageType* iImage );
128 
129  void Update();
130 
131 protected:
133  virtual ~vtkMeshFilterBase() {}
134 
135  virtual void GenerateData() = 0;
136 
137  virtual void SetRequiredAttributeComputationFlags() = 0;
138 
140 
141  std::vector< FeatureImagePointer > m_Images;
142  std::vector< vtkPolyData* > m_Outputs;
144  std::vector< StatLabelMapPointer > m_StatLabelMap;
145  std::map< size_t, LabelType > m_MeshtoLabelIdMap;
146 
149 
150 private:
151  vtkMeshFilterBase( const Self& );
152  void operator = ( const Self& );
153 };
154 }
155 
156 #include "itkvtkMeshFilterBase.txx"
157 #endif
158 
MeshConverterType::Pointer MeshConverterPointer
ShapeLabelMapType::LabelObjectContainerType LabelObjectContainerType
StatisticsLabelObject< LabelType, FeatureImageType::ImageDimension > StatLabelObjectType
LabelMap< ShapeLabelObjectType > ShapeLabelMapType
LabelObjectContainerType::const_iterator LabelObjectIterator
ShapeLabelMapType::Pointer ShapeLabelMapPointer
FeatureImageType::PixelType FeatureImagePixelType
std::vector< StatLabelMapPointer > m_StatLabelMap
SmartPointer< Self > Pointer
void operator=(const Self &)
ConvertMeshesToLabelImageFilter< FeatureImageType > MeshToLabelFilterType
void SetNumberOfImages(const size_t &iN)
ShapeLabelObjectType::Pointer ShapeLabelObjectPointer
FeatureImageType::Pointer FeatureImagePointer
LabelImageToStatisticsLabelMapFilter< FeatureImageType, FeatureImageType, StatLabelMapType > StatConverterType
StatLabelMapType::Pointer StatLabelMapPointer
LabelImageToShapeLabelMapFilter< FeatureImageType, ShapeLabelMapType > ShapeConverterType
LabelMap< StatLabelObjectType > StatLabelMapType
ShapeConverterType::Pointer ShapeConverterPointer
SmartPointer< const Self > ConstPointer
StatLabelObjectType::Pointer StatLabelObjectPointer
ShapeLabelObject< LabelType, FeatureImageType::ImageDimension > ShapeLabelObjectType
itkTypeMacro(vtkMeshFilterBase, Object)
virtual void SetRequiredAttributeComputationFlags()=0
MeshToLabelFilterType::MeshType QuadEdgeMeshType
std::map< size_t, LabelType > m_MeshtoLabelIdMap
StatConverterType::Pointer StatConverterPointer
void SetFeatureImage(const size_t &iId, FeatureImageType *iImage)
vtkPolyDataToitkQuadEdgeMesh< QuadEdgeMeshType > MeshConverterType
virtual void GenerateData()=0
ShapeLabelMapPointer m_ShapeLabelMap
FeatureImageType::PointType FeatureImagePointType
std::vector< FeatureImagePointer > m_Images
FeatureImageType::IndexType FeatureImageIndexType
MeshToLabelFilterType::Pointer MeshToLabelFilterPointer
std::vector< vtkPolyData * > m_Outputs