Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkNarrowBand.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkNarrowBand.h,v $ 00005 Language: C++ 00006 Date: $Date: 2003/09/10 14:28:52 $ 00007 Version: $Revision: 1.4 $ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 #ifndef __itkNarrowBand_h 00018 #define __itkNarrowBand_h 00019 00020 #include "itkLightObject.h" 00021 #include "itkObjectFactory.h" 00022 #include <vector> 00023 00024 namespace itk { 00031 template <class TIndexType, class TDataType> 00032 class BandNode 00033 { 00034 public: 00035 TDataType m_Data; 00036 TIndexType m_Index; 00037 signed char m_NodeState; 00038 }; 00039 00040 00042 template <class NodeType> 00043 class ITK_EXPORT NarrowBand : public LightObject 00044 { 00045 public: 00047 typedef NarrowBand Self; 00048 typedef LightObject Superclass; 00049 typedef SmartPointer<Self> Pointer; 00050 typedef SmartPointer<const Self> ConstPointer; 00051 00053 itkNewMacro(Self); 00054 00056 itkTypeMacro(NarrowBand, LightObject); 00057 00058 typedef std::vector<NodeType> NodeContainerType; 00059 typedef typename NodeContainerType::size_type SizeType; 00060 typedef typename NodeContainerType::const_iterator ConstIterator; 00061 typedef typename NodeContainerType::iterator Iterator; 00062 00065 typedef struct RegionStruct 00066 { 00067 Iterator Begin; 00068 Iterator End; 00069 } RegionType; 00070 00071 //typedef struct RegionStruct 00072 //{ 00073 // ConstIterator Begin; 00074 // ConstIterator End; 00075 // } ConstRegionType; 00076 00079 std::vector<struct RegionStruct> SplitBand( unsigned int ); 00080 00081 Iterator Begin() 00082 { 00083 return m_NodeContainer.begin(); 00084 } 00085 ConstIterator Begin() const 00086 { 00087 return m_NodeContainer.begin(); 00088 } 00089 Iterator End() 00090 { 00091 return m_NodeContainer.end(); 00092 } 00093 ConstIterator End() const 00094 { 00095 return m_NodeContainer.end(); 00096 } 00097 00098 SizeType Size() const 00099 { 00100 return m_NodeContainer.size(); 00101 } 00102 bool Empty() const 00103 { 00104 return m_NodeContainer.empty(); 00105 } 00106 00108 void Clear() 00109 { 00110 m_NodeContainer.clear(); 00111 } 00112 void Reserve( SizeType n) 00113 { 00114 m_NodeContainer.reserve( n ); 00115 } 00116 void PushBack( const NodeType &n) 00117 { 00118 m_NodeContainer.push_back(n); 00119 } 00120 void PopBack() 00121 { 00122 m_NodeContainer.pop_back(); 00123 } 00124 void Resize( SizeType n ) 00125 { 00126 m_NodeContainer.resize(n); 00127 } 00128 00129 NodeType &operator[]( SizeType n ) 00130 { 00131 return m_NodeContainer[n]; 00132 } 00133 const NodeType& operator[](SizeType n) const 00134 { 00135 return m_NodeContainer[n]; 00136 } 00137 00141 void SetTotalRadius(float val) { m_TotalRadius = val;} 00142 00143 float GetTotalRadius(){return m_TotalRadius;} 00144 00147 void SetInnerRadius(float val) { m_InnerRadius = val;} 00148 00149 float GetInnerRadius() { return m_InnerRadius;} 00150 00151 00152 protected: 00153 NarrowBand() {m_TotalRadius = 0.0; m_InnerRadius = 0.0;}; 00154 float m_TotalRadius; 00155 float m_InnerRadius; 00156 00157 private: 00158 NarrowBand(const Self&); //purposely not implemented 00159 void operator=(const Self&); //purposely not implemented 00160 NodeContainerType m_NodeContainer; 00161 00162 }; 00163 00164 } // end namespace itk 00165 00166 #ifndef ITK_MANUAL_INSTANTIATION 00167 #include "itkNarrowBand.txx" 00168 #endif 00169 00170 #endif

Generated at Sun Apr 1 02:38:23 2007 for ITK by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2000