ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkUpdateShiSparseLevelSet.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 itkUpdateShiSparseLevelSet_h
20 #define itkUpdateShiSparseLevelSet_h
21 
22 #include "itkImage.h"
30 
31 namespace itk
32 {
41 template< unsigned int VDimension,
42  typename TEquationContainer >
43 class ITK_TEMPLATE_EXPORT UpdateShiSparseLevelSet : public Object
44 {
45 public:
49  typedef Object Superclass;
50 
52  itkNewMacro( Self );
53 
55  itkTypeMacro( UpdateShiSparseLevelSet, Object );
56 
57  itkStaticConstMacro( ImageDimension, unsigned int, VDimension );
58 
63  typedef typename LevelSetType::OffsetType LevelSetOffsetType;
64 
67 
72 
77 
81 
82  typedef TEquationContainer EquationContainerType;
83  typedef typename EquationContainerType::Pointer EquationContainerPointer;
84  typedef typename EquationContainerType::TermContainerPointer TermContainerPointer;
85 
86  itkGetModifiableObjectMacro(OutputLevelSet, LevelSetType );
87 
89  void Update();
90 
92  itkSetObjectMacro( InputLevelSet, LevelSetType );
93  itkGetModifiableObjectMacro(InputLevelSet, LevelSetType );
95 
97  itkGetMacro( RMSChangeAccumulator, LevelSetOutputRealType );
98 
100  itkSetObjectMacro( EquationContainer, EquationContainerType );
101  itkGetModifiableObjectMacro(EquationContainer, EquationContainerType );
103 
105  itkSetMacro( CurrentLevelSetId, IdentifierType );
106  itkGetMacro( CurrentLevelSetId, IdentifierType );
108 
109 protected:
111  virtual ~UpdateShiSparseLevelSet() ITK_OVERRIDE;
112 
113  // output
114  LevelSetPointer m_OutputLevelSet;
115 
116  IdentifierType m_CurrentLevelSetId;
117  LevelSetOutputRealType m_RMSChangeAccumulator;
118  EquationContainerPointer m_EquationContainer;
119 
120  typedef Image< int8_t, ImageDimension > LabelImageType;
121  typedef typename LabelImageType::Pointer LabelImagePointer;
122 
123  LabelImagePointer m_InternalImage;
124 
126 
128  // this is the same as Procedure 2
129  // Input is a update image point m_UpdateImage
130  // Input is also ShiSparseLevelSetImagePointer
131  void UpdateLayerPlusOne();
132 
134  void UpdateLayerMinusOne();
135 
137  bool Con( const LevelSetInputType& idx,
138  const LevelSetOutputType& currentStatus,
139  const LevelSetOutputRealType& currentUpdate ) const;
140 
141 private:
142  ITK_DISALLOW_COPY_AND_ASSIGN(UpdateShiSparseLevelSet);
143 
144  // input
145  LevelSetPointer m_InputLevelSet;
147 
149 };
150 }
151 
152 #ifndef ITK_MANUAL_INSTANTIATION
153 #include "itkUpdateShiSparseLevelSet.hxx"
154 #endif
155 
156 #endif // itkUpdateShiSparseLevelSet_h
EquationContainerType::Pointer EquationContainerPointer
Light weight base class for most itk classes.
Superclass::LabelObjectLineType LabelObjectLineType
LevelSetType::LabelObjectLengthType LevelSetLabelObjectLengthType
LevelSetType::LayerMapIterator LevelSetLayerMapIterator
Derived class for the shi representation of level-set function.
LevelSetType::LabelMapPointer LevelSetLabelMapPointer
LevelSetType::LayerConstIterator LevelSetLayerConstIterator
Superclass::LabelMapType LabelMapType
LevelSetType::OutputRealType LevelSetOutputRealType
A neighborhood iterator which can take on an arbitrary shape.
Superclass::OutputRealType OutputRealType
std::pair< LevelSetInputType, LevelSetOutputType > NodePairType
SizeValueType IdentifierType
Definition: itkIntTypes.h:147
LevelSetType::LabelObjectLineType LevelSetLabelObjectLineType
LevelSetType::LabelObjectPointer LevelSetLabelObjectPointer
Superclass::LayerIterator LayerIterator
Superclass::LayerMapIterator LayerMapIterator
Superclass::LabelObjectType LabelObjectType
LevelSetType::LayerMapType LevelSetLayerMapType
Superclass::LabelObjectPointer LabelObjectPointer
Superclass::LabelObjectLengthType LabelObjectLengthType
LevelSetType::LayerIterator LevelSetLayerIterator
Base class for updating the Shi representation of level-set function.
ShiSparseLevelSetImage< ImageDimension > LevelSetType
LevelSetType::InputType LevelSetInputType
LevelSetType::OutputType LevelSetOutputType
KWIML_INT_int8_t int8_t
Definition: itkIntTypes.h:82
EquationContainerType::TermContainerPointer TermContainerPointer
LevelSetType::LabelMapType LevelSetLabelMapType
LevelSetType::OffsetType LevelSetOffsetType
Base class for most ITK classes.
Definition: itkObject.h:59
SmartPointer< const Self > ConstPointer
Superclass::LayerMapConstIterator LayerMapConstIterator
Templated n-dimensional image class.
Definition: itkImage.h:75
Superclass::LayerMapType LayerMapType
Superclass::LayerConstIterator LayerConstIterator
LevelSetType::LayerMapConstIterator LevelSetLayerMapConstIterator
LevelSetType::LayerType LevelSetLayerType
LevelSetType::LabelObjectType LevelSetLabelObjectType