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: 2007/01/13 21:05:14 $
00007   Version:   $Revision: 1.6 $
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:
00047 
00049   typedef NarrowBand   Self;
00050   typedef LightObject  Superclass;
00051   typedef SmartPointer<Self>  Pointer;
00052   typedef SmartPointer<const Self>  ConstPointer;
00053 
00055   itkNewMacro(Self);
00056 
00058   itkTypeMacro(NarrowBand, LightObject);
00059 
00060   typedef std::vector<NodeType> NodeContainerType;
00061   typedef typename NodeContainerType::size_type SizeType;
00062   typedef typename NodeContainerType::const_iterator ConstIterator;
00063   typedef typename NodeContainerType::iterator Iterator;
00064 
00067   typedef struct RegionStruct
00068   {
00069     Iterator Begin;
00070     Iterator End;
00071   } RegionType;
00072 
00073   //typedef struct RegionStruct
00074   //{
00075   //  ConstIterator Begin;
00076   //  ConstIterator End;
00077  // } ConstRegionType;
00078 
00081 #if !defined(CABLE_CONFIGURATION)
00082  std::vector<struct RegionStruct> SplitBand( unsigned int );
00083 #endif
00084 
00085   Iterator Begin()
00086   {
00087     return m_NodeContainer.begin();
00088   }
00089   ConstIterator Begin() const
00090   {
00091     return m_NodeContainer.begin();
00092   }
00093   Iterator End()
00094   {
00095     return m_NodeContainer.end();
00096   }
00097   ConstIterator End() const
00098   {
00099     return m_NodeContainer.end();
00100   }
00101 
00102   SizeType Size() const
00103   {
00104     return m_NodeContainer.size();
00105   }
00106   bool Empty() const
00107   {
00108     return m_NodeContainer.empty();
00109   }
00110   
00112   void Clear()
00113   {
00114     m_NodeContainer.clear();
00115   }
00116   void Reserve( SizeType n)
00117   {
00118     m_NodeContainer.reserve( n );
00119   }
00120   void PushBack( const NodeType &n)
00121   {
00122     m_NodeContainer.push_back(n);
00123   }
00124   void PopBack()
00125   {
00126     m_NodeContainer.pop_back();
00127   }
00128   void Resize( SizeType n )
00129   {
00130     m_NodeContainer.resize(n);
00131   }
00133 
00134   NodeType &operator[]( SizeType n )
00135   {
00136     return m_NodeContainer[n];
00137   }
00138   const NodeType& operator[](SizeType n) const
00139   {
00140     return m_NodeContainer[n];
00141   }
00142 
00146   void SetTotalRadius(float val) { m_TotalRadius = val;}
00147 
00148   float GetTotalRadius(){return m_TotalRadius;}
00149  
00152   void SetInnerRadius(float val) { m_InnerRadius = val;}
00153 
00154   float GetInnerRadius() { return m_InnerRadius;}
00155 
00156   
00157 protected:
00158   NarrowBand() {m_TotalRadius = 0.0; m_InnerRadius = 0.0;};
00159   float m_TotalRadius;
00160   float m_InnerRadius;
00161   
00162 private:
00163   NarrowBand(const Self&); //purposely not implemented
00164   void operator=(const Self&); //purposely not implemented
00165   NodeContainerType m_NodeContainer;
00166   
00167 };
00168 
00169 } // end namespace itk
00170 
00171 #ifndef ITK_MANUAL_INSTANTIATION
00172 #include "itkNarrowBand.txx"
00173 #endif
00174 
00175 #endif
00176 

Generated at Sun Sep 23 13:37:30 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000