00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
#ifndef _itkLevelSet_h
00018
#define _itkLevelSet_h
00019
00020
#include "itkIndex.h"
00021
#include "itkImage.h"
00022
#include "itkVectorContainer.h"
00023
#include "itkVector.h"
00024
00025
namespace itk
00026 {
00027
00043
template<
class TPixel,
unsigned int VSetDimension = 2>
00044 class ITK_EXPORT LevelSetNode
00045 {
00046
public:
00048
typedef LevelSetNode
Self;
00049
00051
typedef TPixel
PixelType;
00052
00054
itkStaticConstMacro(SetDimension,
unsigned int, VSetDimension);
00055
00057
typedef Index<VSetDimension> IndexType;
00058
00060
bool operator> (
const Self& node )
const
00061 {
return m_Value > node.
m_Value; }
00062
00064
bool operator< (
const Self& node )
const
00065 {
return m_Value < node.m_Value; }
00066
00068
bool operator<= (
const Self& node )
const
00069 {
return m_Value <= node.m_Value; }
00070
00072
bool operator>= (
const Self& node )
const
00073 {
return m_Value >= node.m_Value; }
00074
00077 Self& operator= (
const Self& rhs )
00078 {
00079
if(
this == &rhs ) {
return *
this;}
00080
00081 m_Value = rhs.m_Value;
00082 m_Index = rhs.m_Index;
00083
return *
this;
00084 }
00085
00087 PixelType& GetValue()
00088 {
return m_Value; };
00089
const PixelType& GetValue()
const
00090 {
return m_Value; };
00091
void SetValue(
const PixelType& input )
00092 { m_Value = input; };
00093
00095 IndexType& GetIndex()
00096 {
return m_Index; }
00097 const IndexType& GetIndex()
const
00098
{
return m_Index; }
00099 void SetIndex(
const IndexType& input )
00100 { m_Index = input; };
00101
00103 LevelSetNode() : m_Value(
NumericTraits<
PixelType>::Zero ) {
00104 m_Index.Fill( 0 );
00105 };
00106
00108 LevelSetNode(
const Self &node) : m_Value( node.m_Value ), m_Index( node.m_Index ) {};
00109
00110
private:
00111 PixelType m_Value;
00112 IndexType m_Index;
00113
00114 };
00115
00129
template<
class TLevelSet>
00130
class ITK_EXPORT LevelSetTypeDefault
00131 {
00132
public:
00134 typedef LevelSetTypeDefault
Self;
00135
typedef TLevelSet
LevelSetImageType;
00136
00137
00139 itkStaticConstMacro(SetDimension,
unsigned int, TLevelSet::ImageDimension);
00140
00142
typedef typename TLevelSet::Pointer
LevelSetPointer;
00143
typedef typename TLevelSet::ConstPointer
LevelSetConstPointer;
00144
00146 typedef typename TLevelSet::PixelType
PixelType;
00147
00149
typedef
00150 LevelSetNode<PixelType, itkGetStaticConstMacro(SetDimension)> NodeType;
00151
00153
typedef VectorContainer<unsigned int,NodeType> NodeContainer;
00154
00156
typedef typename NodeContainer::Pointer
NodeContainerPointer;
00157 };
00158
00159
00175
template <
00176
class TPixel,
00177
unsigned int VAuxDimension = 1,
00178
unsigned int VSetDimension = 2
00179 >
00180
class ITK_EXPORT AuxVarTypeDefault
00181 {
00182
public:
00184 typedef AuxVarTypeDefault
Self;
00185
00187
typedef TPixel
AuxValueType;
00188
00190
itkStaticConstMacro(AuxDimension,
unsigned int, VAuxDimension);
00191
00193
itkStaticConstMacro(SetDimension,
unsigned int, VSetDimension);
00194
00196
typedef Vector<TPixel,VAuxDimension> AuxValueVectorType;
00197
00199
typedef VectorContainer<unsigned int,AuxValueVectorType> AuxValueContainer;
00200
00202
typedef Image<AuxValueType, VSetDimension> AuxImageType;
00203
00205
typedef typename AuxImageType::Pointer
AuxImagePointer;
00206 typedef typename AuxImageType::ConstPointer
AuxImageConstPointer;
00207 };
00208
00209
00210 }
00211
00212
#endif