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: 2004/02/20 22:51:00 $
00007   Version:   $Revision: 1.5 $
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   BandNode() { m_NodeState = 0; }
00039 };  
00040 
00041 
00043 template <class NodeType>
00044 class ITK_EXPORT NarrowBand : public LightObject
00045 {
00046 public:
00048   typedef NarrowBand   Self;
00049   typedef LightObject  Superclass;
00050   typedef SmartPointer<Self>  Pointer;
00051   typedef SmartPointer<const Self>  ConstPointer;
00052   
00054   itkNewMacro(Self);
00055 
00057   itkTypeMacro(NarrowBand, LightObject);
00058 
00059   typedef std::vector<NodeType> NodeContainerType;
00060   typedef typename NodeContainerType::size_type SizeType;
00061   typedef typename NodeContainerType::const_iterator ConstIterator;
00062   typedef typename NodeContainerType::iterator Iterator;
00063 
00066   typedef struct RegionStruct
00067   {
00068     Iterator Begin;
00069     Iterator End;
00070   } RegionType;
00071 
00072   //typedef struct RegionStruct
00073   //{
00074   //  ConstIterator Begin;
00075   //  ConstIterator End;
00076  // } ConstRegionType;
00077 
00080   std::vector<struct RegionStruct> SplitBand( unsigned int );
00081   
00082   Iterator Begin()
00083   {
00084     return m_NodeContainer.begin();
00085   }
00086   ConstIterator Begin() const
00087   {
00088     return m_NodeContainer.begin();
00089   }
00090   Iterator End()
00091   {
00092     return m_NodeContainer.end();
00093   }
00094   ConstIterator End() const
00095   {
00096     return m_NodeContainer.end();
00097   }
00098 
00099   SizeType Size() const
00100   {
00101     return m_NodeContainer.size();
00102   }
00103   bool Empty() const
00104   {
00105     return m_NodeContainer.empty();
00106   }
00107   
00109   void Clear()
00110   {
00111     m_NodeContainer.clear();
00112   }
00113   void Reserve( SizeType n)
00114   {
00115     m_NodeContainer.reserve( n );
00116   }
00117   void PushBack( const NodeType &n)
00118   {
00119     m_NodeContainer.push_back(n);
00120   }
00121   void PopBack()
00122   {
00123     m_NodeContainer.pop_back();
00124   }
00125   void Resize( SizeType n )
00126   {
00127     m_NodeContainer.resize(n);
00128   }
00129   
00130   NodeType &operator[]( SizeType n )
00131   {
00132     return m_NodeContainer[n];
00133   }
00134   const NodeType& operator[](SizeType n) const
00135   {
00136     return m_NodeContainer[n];
00137   }
00138 
00142   void SetTotalRadius(float val) { m_TotalRadius = val;}
00143 
00144   float GetTotalRadius(){return m_TotalRadius;}
00145  
00148   void SetInnerRadius(float val) { m_InnerRadius = val;}
00149 
00150   float GetInnerRadius() { return m_InnerRadius;}
00151 
00152   
00153 protected:
00154   NarrowBand() {m_TotalRadius = 0.0; m_InnerRadius = 0.0;};
00155   float m_TotalRadius;
00156   float m_InnerRadius;
00157   
00158 private:
00159   NarrowBand(const Self&); //purposely not implemented
00160   void operator=(const Self&); //purposely not implemented
00161   NodeContainerType m_NodeContainer;
00162   
00163 };
00164 
00165 } // end namespace itk
00166 
00167 #ifndef ITK_MANUAL_INSTANTIATION
00168 #include "itkNarrowBand.txx"
00169 #endif
00170 
00171 #endif

Generated at Wed May 24 23:42:29 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000