GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
itkBinaryMaskImageToGoFigureMeshAttributes.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 #ifndef __itkBinaryMaskImageToGoFigureMeshAttributes_h
35 #define __itkBinaryMaskImageToGoFigureMeshAttributes_h
36 
37 #include "itkLightObject.h"
38 #include "itkShapeLabelObject.h"
39 #include "itkStatisticsLabelObject.h"
40 #include "itkLabelImageToShapeLabelMapFilter.h"
41 #include "itkLabelImageToStatisticsLabelMapFilter.h"
42 
43 namespace itk
44 {
52 template< class TInput, class TMask >
54 {
55 public:
57  typedef LightObject Superclass;
58  typedef SmartPointer< Self > Pointer;
59  typedef SmartPointer< const Self > ConstPointer;
60 
61  typedef TInput ImageType;
62  typedef typename ImageType::Pointer ImagePointer;
63  typedef typename ImageType::SizeType ImageSizeType;
64  typedef typename ImageType::SpacingType ImageSpacingType;
65 
66  typedef TMask MaskImageType;
67  typedef typename MaskImageType::Pointer MaskImagePointer;
68 
69  itkStaticConstMacro(ImageDimension, unsigned int,
70  ImageType::ImageDimension);
71 
74 
77 
79 // void PrintSelf( std::ostream& os, Indent indent ) const;
80 
81  typedef unsigned char LabelType;
82 
83  typedef ShapeLabelObject< LabelType, ImageDimension > ShapeLabelObjectType;
84  typedef typename ShapeLabelObjectType::Pointer ShapeLabelObjectPointer;
85 
86  typedef StatisticsLabelObject< LabelType, ImageDimension > StatLabelObjectType;
87  typedef typename StatLabelObjectType::Pointer StatLabelObjectPointer;
88 
89  typedef LabelMap< ShapeLabelObjectType > ShapeLabelMapType;
90  typedef typename ShapeLabelMapType::Pointer ShapeLabelMapPointer;
91 
92  typedef LabelMap< StatLabelObjectType > StatLabelMapType;
93  typedef typename StatLabelMapType::Pointer StatLabelMapPointer;
94 
95  typedef LabelImageToShapeLabelMapFilter< MaskImageType,
97  typedef typename ShapeConverterType::Pointer ShapeConverterPointer;
98 
99  typedef LabelImageToStatisticsLabelMapFilter< MaskImageType,
100  ImageType,
102  typedef typename StatConverterType::Pointer StatConverterPointer;
103 
105  void SetImage(ImageType *iInput);
106 
108  void SetMaskImage(MaskImageType *iMask);
109 
111  void SetIntensityBasedComputation( const bool& iComputation );
112 
114  void Update();
115 
117  unsigned int GetSize();
118 
120  double GetPhysicalSize();
121 
123  double GetMeanIntensity();
124 
126  double GetSumIntensity();
127 
128 protected:
131 
134 
136 
138 
139  unsigned int m_Size;
140 
142  double m_Mean;
143  double m_Sum;
145 
146  virtual void GenerateData();
147 
148 private:
150  void operator=(const Self &);
151 };
152 }
153 #include "itkBinaryMaskImageToGoFigureMeshAttributes.txx"
154 #endif
ShapeLabelObject< LabelType, ImageDimension > ShapeLabelObjectType
itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension)
double GetMeanIntensity()
Get the mean intensity inside the mesh.
LabelImageToStatisticsLabelMapFilter< MaskImageType, ImageType, StatLabelMapType > StatConverterType
void SetImage(ImageType *iInput)
Set the Image.
LabelImageToShapeLabelMapFilter< MaskImageType, ShapeLabelMapType > ShapeConverterType
void Update()
Here make all the computation.
itkTypeMacro(BinaryMaskImageToGoFigureMeshAttributes, LightObject)
Compute Mesh Attributes from a binary mask image.
void SetIntensityBasedComputation(const bool &iComputation)
Do you need to compute any intensity related attributes.
double GetPhysicalSize()
Get the volume inside the mesh.
double GetSumIntensity()
Get the total intensity inside the mesh.
unsigned int GetSize()
Get the number of voxels inside the mesh.
void SetMaskImage(MaskImageType *iMask)
Set the binary mask which corresponds to the input mesh.
StatisticsLabelObject< LabelType, ImageDimension > StatLabelObjectType