ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkUpdateWhitakerSparseLevelSet.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 itkUpdateWhitakerSparseLevelSet_h
20 #define itkUpdateWhitakerSparseLevelSet_h
21 
22 #include "itkImage.h"
30 
31 namespace itk
32 {
42 template< unsigned int VDimension,
43  typename TLevelSetValueType,
44  typename TEquationContainer >
45 class ITK_TEMPLATE_EXPORT UpdateWhitakerSparseLevelSet : public Object
46 {
47 public:
51  typedef Object Superclass;
52 
54  itkNewMacro( Self );
55 
57  itkTypeMacro( UpdateWhitakerSparseLevelSet, Object );
58 
59  itkStaticConstMacro( ImageDimension, unsigned int, VDimension );
60 
61  typedef TLevelSetValueType LevelSetOutputType;
62 
68 
71 
76 
82 
86 
87  typedef TEquationContainer EquationContainerType;
88  typedef typename EquationContainerType::Pointer EquationContainerPointer;
89 
90  typedef typename EquationContainerType::TermContainerType TermContainerType;
91  typedef typename EquationContainerType::TermContainerPointer TermContainerPointer;
92 
95 
98 
99  itkGetModifiableObjectMacro(OutputLevelSet, LevelSetType );
100 
102  void Update();
103 
105  itkSetObjectMacro( InputLevelSet, LevelSetType );
106  itkGetModifiableObjectMacro(InputLevelSet, LevelSetType );
108 
110  itkSetMacro( TimeStep, LevelSetOutputType );
111  itkGetMacro( TimeStep, LevelSetOutputType );
113 
115  itkGetMacro( RMSChangeAccumulator, LevelSetOutputType );
116 
118  itkSetObjectMacro( EquationContainer, EquationContainerType );
119  itkGetModifiableObjectMacro(EquationContainer, EquationContainerType );
121 
123  itkSetMacro( CurrentLevelSetId, IdentifierType );
124  itkGetMacro( CurrentLevelSetId, IdentifierType );
126 
128  void SetUpdate( const LevelSetLayerType& update );
129 
130 protected:
132  virtual ~UpdateWhitakerSparseLevelSet() ITK_OVERRIDE;
133 
135  void UpdateLayerZero();
136 
138  void UpdateLayerMinus1();
139 
141  void UpdateLayerPlus1();
142 
144  void UpdateLayerMinus2();
145 
147  void UpdateLayerPlus2();
148 
150  void MovePointIntoZeroLevelSet();
151 
153  void MovePointFromMinus1();
154 
156  void MovePointFromPlus1();
157 
159  void MovePointFromMinus2();
160 
162  void MovePointFromPlus2();
163 
164 private:
165  ITK_DISALLOW_COPY_AND_ASSIGN(UpdateWhitakerSparseLevelSet);
166 
167  LevelSetOutputType m_TimeStep;
168  LevelSetOutputType m_RMSChangeAccumulator;
169  IdentifierType m_CurrentLevelSetId;
170 
171  EquationContainerPointer m_EquationContainer;
172 
174  LevelSetPointer m_InputLevelSet;
175  LevelSetPointer m_OutputLevelSet;
176 
177  LevelSetPointer m_TempLevelSet;
178  LevelSetLayerType m_TempPhi;
179 
180  LevelSetLayerIdType m_MinStatus;
181  LevelSetLayerIdType m_MaxStatus;
182 
183  LabelImagePointer m_InternalImage;
184 
186 
188 
190 };
191 }
192 
193 #ifndef ITK_MANUAL_INSTANTIATION
194 #include "itkUpdateWhitakerSparseLevelSet.hxx"
195 #endif
196 #endif // itkUpdateWhitakerSparseLevelSet_h
LabelImageToLabelMapFilter< LabelImageType, LevelSetLabelMapType > LabelImageToLabelMapFilterType
convert a labeled image to a label collection image
Light weight base class for most itk classes.
EquationContainerType::Pointer EquationContainerPointer
Represent the offset between two n-dimensional indexes in a n-dimensional image.
Definition: itkOffset.h:56
Superclass::LabelObjectLengthType LabelObjectLengthType
Superclass::LayerConstIterator LayerConstIterator
LevelSetType::LabelMapPointer LevelSetLabelMapPointer
LevelSetType::LayerMapIterator LevelSetLayerMapIterator
Superclass::LayerMapConstIterator LayerMapConstIterator
A neighborhood iterator which can take on an arbitrary shape.
Image< LevelSetLayerIdType, ImageDimension > LabelImageType
LabelMapToLabelImageFilter< LevelSetLabelMapType, LabelImageType > LabelMapToLabelImageFilterType
SizeValueType IdentifierType
Definition: itkIntTypes.h:147
Derived class for the sparse-field representation of level-set function.
EquationContainerType::TermContainerPointer TermContainerPointer
LevelSetType::LayerMapConstIterator LevelSetLayerMapConstIterator
LevelSetType::LayerConstIterator LevelSetLayerConstIterator
LevelSetType::LabelObjectLengthType LevelSetLabelObjectLengthType
Superclass::LabelObjectLineType LabelObjectLineType
Superclass::LayerMapIterator LayerMapIterator
Base class for updating the level-set function.
LevelSetType::LabelObjectLineType LevelSetLabelObjectLineType
EquationContainerType::TermContainerType TermContainerType
Superclass::LabelObjectPointer LabelObjectPointer
std::pair< LevelSetInputType, LevelSetOutputType > NodePairType
LevelSetType::LabelObjectPointer LevelSetLabelObjectPointer
Base class for most ITK classes.
Definition: itkObject.h:59
LevelSetType::OutputRealType LevelSetOutputRealType
LevelSetType::LabelObjectType LevelSetLabelObjectType
Templated n-dimensional image class.
Definition: itkImage.h:75
WhitakerSparseLevelSetImage< LevelSetOutputType, ImageDimension > LevelSetType
Converts a LabelMap to a labeled image.