Shapeworks Studio  2.1
Shape analysis software suite
bounding_box.h
1 /*=========================================================================
2  Program: ShapeWorks: Particle-based Shape Correspondence & Visualization
3  Module: $RCSfile: bounding_box.h,v $
4  Date: $Date: 2011/03/24 01:17:36 $
5  Version: $Revision: 1.2 $
6  Author: $Author: wmartin $
7 
8  Copyright (c) 2009 Scientific Computing and Imaging Institute.
9  See ShapeWorksLicense.txt for details.
10 
11  This software is distributed WITHOUT ANY WARRANTY; without even
12  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13  PURPOSE. See the above copyright notices for more information.
14 =========================================================================*/
15 #ifndef __st_bounding_box_h
16 #define __st_bounding_box_h
17 
18 #include "itkImage.h"
19 #include "tinyxml.h"
20 #include <sstream>
21 #include <string>
22 #include "tool.h"
23 #include "itkImageRegion.h"
24 
25 namespace shapetools
26 {
32 template <class T, unsigned int D>
33 class bounding_box : public tool<T, D>
34 {
35 public:
36  typedef T pixel_type;
37  typedef itk::Image<T, D> image_type;
38  typedef typename image_type::RegionType region_type;
39 
40  bounding_box(const char *fname);
41  bounding_box() {}
42  virtual ~bounding_box() {}
43 
44  virtual void operator()(typename image_type::Pointer);
45 
47  const pixel_type background() const
48  { return m_background; }
49  pixel_type &background()
50  { return m_background; }
51 
53  const region_type& region() const
54  { return m_region; }
55  region_type &region()
56  { return m_region; }
57 
58 private:
59  pixel_type m_background;
60 
61  region_type m_region;
62 };
63 
64 
65 } // end namespace
66 #endif
67 
68 #ifndef ST_MANUAL_INSTANTIATION
69 #include "bounding_box.txx"
70 #endif