ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkLevelSetSparseImage.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 
19 #ifndef itkLevelSetSparseImage_h
20 #define itkLevelSetSparseImage_h
21 
23 #include "itkObjectFactory.h"
24 
25 #include "itkLabelObject.h"
26 #include "itkLabelMap.h"
27 
28 namespace itk
29 {
39 template< typename TOutput, unsigned int VDimension >
40 class ITK_TEMPLATE_EXPORT LevelSetSparseImage :
41  public DiscreteLevelSetImage< TOutput, VDimension >
42 {
43 public:
48 
51 
52  itkStaticConstMacro ( Dimension, unsigned int, Superclass::Dimension );
53 
54  typedef typename Superclass::InputType InputType;
55  typedef typename Superclass::OutputType OutputType;
56  typedef typename Superclass::OutputRealType OutputRealType;
57  typedef typename Superclass::GradientType GradientType;
58  typedef typename Superclass::HessianType HessianType;
59  typedef typename Superclass::LevelSetDataType LevelSetDataType;
60 
62  typedef std::list< LayerIdType > LayerIdListType;
63 
68 
72 
73  typedef std::map< InputType, OutputType,
76  typedef typename LayerType::iterator LayerIterator;
77  typedef typename LayerType::const_iterator LayerConstIterator;
78 
79  typedef std::map< LayerIdType, LayerType > LayerMapType;
80  typedef typename LayerMapType::iterator LayerMapIterator;
81  typedef typename LayerMapType::const_iterator LayerMapConstIterator;
82 
84  virtual LayerIdType Status( const InputType& inputIndex ) const;
85 
87  const LayerType& GetLayer( LayerIdType value ) const;
88 
90  LayerType& GetLayer( LayerIdType value );
91 
93  void SetLayer( LayerIdType value, const LayerType& layer );
94 
96  virtual void SetLabelMap( LabelMapType* labelMap );
97  itkGetModifiableObjectMacro(LabelMap, LabelMapType );
99 
101  virtual void Graft( const DataObject* data ) ITK_OVERRIDE;
102 
104  template< typename TLabel >
105  typename LabelObject< TLabel, VDimension >::Pointer GetAsLabelObject();
106 
107 protected:
109  virtual ~LevelSetSparseImage() ITK_OVERRIDE;
110 
111  LayerMapType m_Layers;
112  LabelMapPointer m_LabelMap;
113  LayerIdListType m_InternalLabelList;
114 
116  virtual void InitializeLayers() = 0;
117 
118  virtual void InitializeInternalLabelList() = 0;
119 
120  virtual bool IsInsideDomain( const InputType& inputIndex ) const ITK_OVERRIDE;
121 
123  virtual void Initialize() ITK_OVERRIDE;
124 
126  virtual void CopyInformation( const DataObject* data ) ITK_OVERRIDE;
127 
128 private:
129  ITK_DISALLOW_COPY_AND_ASSIGN(LevelSetSparseImage);
130 };
131 
132 }
133 
134 #ifndef ITK_MANUAL_INSTANTIATION
135 #include "itkLevelSetSparseImage.hxx"
136 #endif
137 
138 #endif // itkLevelSetSparseImage_h
LayerMapType::const_iterator LayerMapConstIterator
std::map< InputType, OutputType, Functor::IndexLexicographicCompare< VDimension > > LayerType
Superclass::LevelSetDataType LevelSetDataType
LabelMapType::RegionType RegionType
LabelObject< LayerIdType, VDimension > LabelObjectType
SmartPointer< Self > Pointer
LayerType::iterator LayerIterator
LabelObjectType::Pointer LabelObjectPointer
LabelMapType::Pointer LabelMapPointer
LabelObjectType::LengthType LabelObjectLengthType
Order Index instances lexicographically.
Definition: itkIndex.h:356
Superclass::OutputType OutputType
Base class for the sparse representation of a level-set function on one Image.
std::map< LayerIdType, LayerType > LayerMapType
std::list< LayerIdType > LayerIdListType
LineType::LengthType LengthType
LabelMap< LabelObjectType > LabelMapType
SmartPointer< const Self > ConstPointer
Superclass::OutputRealType OutputRealType
Abstract class for a level-set function on one Image.
DiscreteLevelSetImage< TOutput, VDimension > Superclass
LayerMapType::iterator LayerMapIterator
Superclass::RegionType RegionType
Definition: itkLabelMap.h:121
Superclass::InputType InputType
LabelObjectType::LineType LabelObjectLineType
Superclass::GradientType GradientType
The base class for the representation of an labeled binary object in an image.
KWIML_INT_int8_t int8_t
Definition: itkIntTypes.h:82
LayerType::const_iterator LayerConstIterator
Templated n-dimensional image to store labeled objects.
Definition: itkLabelMap.h:70
Superclass::HessianType HessianType
Base class for all data objects in ITK.