ITK  6.0.0
Insight Toolkit
itkUpdateMalcolmSparseLevelSet.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 itkUpdateMalcolmSparseLevelSet_h
20 #define itkUpdateMalcolmSparseLevelSet_h
21 
22 #include "itkImage.h"
30 
31 namespace itk
32 {
41 template <unsigned int VDimension, typename TEquationContainer>
42 class ITK_TEMPLATE_EXPORT UpdateMalcolmSparseLevelSet : public Object
43 {
44 public:
45  ITK_DISALLOW_COPY_AND_MOVE(UpdateMalcolmSparseLevelSet);
46 
50  using Superclass = Object;
51 
53  itkNewMacro(Self);
54 
56  itkOverrideGetNameOfClassMacro(UpdateMalcolmSparseLevelSet);
57 
58  static constexpr unsigned int ImageDimension = VDimension;
59 
65 
68 
73 
78 
82 
83  using EquationContainerType = TEquationContainer;
85  using TermContainerPointer = typename EquationContainerType::TermContainerPointer;
86 
87  itkGetModifiableObjectMacro(OutputLevelSet, LevelSetType);
88 
90  void
91  Update();
92 
94  itkSetObjectMacro(InputLevelSet, LevelSetType);
95  itkGetModifiableObjectMacro(InputLevelSet, LevelSetType);
99  itkGetMacro(RMSChangeAccumulator, LevelSetOutputRealType);
100 
102  itkSetObjectMacro(EquationContainer, EquationContainerType);
103  itkGetModifiableObjectMacro(EquationContainer, EquationContainerType);
107  itkSetMacro(CurrentLevelSetId, IdentifierType);
108  itkGetMacro(CurrentLevelSetId, IdentifierType);
111 protected:
113  ~UpdateMalcolmSparseLevelSet() override = default;
114 
115  // output
116  LevelSetPointer m_OutputLevelSet{};
117 
118  LevelSetLayerType m_Update{};
119 
120  IdentifierType m_CurrentLevelSetId{};
121  LevelSetOutputRealType m_RMSChangeAccumulator{};
122  EquationContainerPointer m_EquationContainer{};
123 
126 
127  LabelImagePointer m_InternalImage{};
128 
130 
131  bool m_IsUsingUnPhasedPropagation{ true };
132 
134  void
135  FillUpdateContainer();
136 
139  void
140  EvolveWithUnPhasedPropagation();
141 
144  void
145  EvolveWithPhasedPropagation(LevelSetLayerType & ioList, LevelSetLayerType & ioUpdate, const bool iContraction);
146 
149  void
150  CompactLayersToSinglePixelThickness();
151 
152 private:
153  // input
154  LevelSetPointer m_InputLevelSet{};
155 
156  LevelSetOffsetType m_Offset{};
157 
158  using NodePairType = std::pair<LevelSetInputType, LevelSetOutputType>;
159 };
160 } // namespace itk
161 
162 #ifndef ITK_MANUAL_INSTANTIATION
163 # include "itkUpdateMalcolmSparseLevelSet.hxx"
164 #endif
165 
166 #endif // itkUpdateMalcolmSparseLevelSet_h
itkLabelImageToLabelMapFilter.h
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::Index
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:68
itk::LevelSetSparseImage< int8_t, VDimension >::LayerMapConstIterator
typename LayerMapType::const_iterator LayerMapConstIterator
Definition: itkLevelSetSparseImage.h:83
itkNeighborhoodAlgorithm.h
itk::LevelSetBase< Index< VDimension >, VDimension, int8_t, ImageBase< VDimension > >::OutputRealType
typename NumericTraits< OutputType >::RealType OutputRealType
Definition: itkLevelSetBase.h:61
itk::UpdateMalcolmSparseLevelSet::LevelSetOffsetType
typename LevelSetType::OffsetType LevelSetOffsetType
Definition: itkUpdateMalcolmSparseLevelSet.h:64
itk::UpdateMalcolmSparseLevelSet::LevelSetLayerType
typename LevelSetType::LayerType LevelSetLayerType
Definition: itkUpdateMalcolmSparseLevelSet.h:74
itk::LevelSetSparseImage< int8_t, VDimension >::LabelObjectLineType
typename LabelObjectType::LineType LabelObjectLineType
Definition: itkLevelSetSparseImage.h:70
itk::LevelSetSparseImage< int8_t, VDimension >::LayerMapType
std::map< LayerIdType, LayerType > LayerMapType
Definition: itkLevelSetSparseImage.h:81
itk::UpdateMalcolmSparseLevelSet::LevelSetLayerMapIterator
typename LevelSetType::LayerMapIterator LevelSetLayerMapIterator
Definition: itkUpdateMalcolmSparseLevelSet.h:80
itkDiscreteLevelSetImage.h
itkImage.h
itk::LevelSetSparseImage< int8_t, VDimension >::LabelMapPointer
typename LabelMapType::Pointer LabelMapPointer
Definition: itkLevelSetSparseImage.h:73
itk::SmartPointer< Self >
itkImageRegionIteratorWithIndex.h
itk::UpdateMalcolmSparseLevelSet::LevelSetLabelMapType
typename LevelSetType::LabelMapType LevelSetLabelMapType
Definition: itkUpdateMalcolmSparseLevelSet.h:66
itk::ShapedNeighborhoodIterator
A neighborhood iterator which can take on an arbitrary shape.
Definition: itkShapedNeighborhoodIterator.h:150
itkMalcolmSparseLevelSetImage.h
itk::UpdateMalcolmSparseLevelSet::LevelSetLabelMapPointer
typename LevelSetType::LabelMapPointer LevelSetLabelMapPointer
Definition: itkUpdateMalcolmSparseLevelSet.h:67
itk::LabelMap
Templated n-dimensional image to store labeled objects.
Definition: itkLabelMap.h:70
itk::LevelSetSparseImage< int8_t, VDimension >::LabelObjectPointer
typename LabelObjectType::Pointer LabelObjectPointer
Definition: itkLevelSetSparseImage.h:68
itk::UpdateMalcolmSparseLevelSet
Base class for updating the Malcolm representation of level-set function.
Definition: itkUpdateMalcolmSparseLevelSet.h:42
itk::UpdateMalcolmSparseLevelSet::LevelSetInputType
typename LevelSetType::InputType LevelSetInputType
Definition: itkUpdateMalcolmSparseLevelSet.h:62
itk::LevelSetSparseImage< int8_t, VDimension >::LayerMapIterator
typename LayerMapType::iterator LayerMapIterator
Definition: itkLevelSetSparseImage.h:82
itk::LevelSetSparseImage< int8_t, VDimension >::LayerType
std::map< InputType, OutputType, Functor::LexicographicCompare > LayerType
Definition: itkLevelSetSparseImage.h:77
itk::UpdateMalcolmSparseLevelSet::LevelSetPointer
typename LevelSetType::Pointer LevelSetPointer
Definition: itkUpdateMalcolmSparseLevelSet.h:61
itk::UpdateMalcolmSparseLevelSet::EquationContainerPointer
typename EquationContainerType::Pointer EquationContainerPointer
Definition: itkUpdateMalcolmSparseLevelSet.h:84
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::LabelObject
The base class for the representation of a labeled binary object in an image.
Definition: itkLabelObject.h:65
itk::LevelSetSparseImage< int8_t, VDimension >::LabelObjectLengthType
typename LabelObjectType::LengthType LabelObjectLengthType
Definition: itkLevelSetSparseImage.h:69
itk::UpdateMalcolmSparseLevelSet::LevelSetLayerConstIterator
typename LevelSetType::LayerConstIterator LevelSetLayerConstIterator
Definition: itkUpdateMalcolmSparseLevelSet.h:76
itk::LevelSetSparseImage< int8_t, VDimension >::LayerIterator
typename LayerType::iterator LayerIterator
Definition: itkLevelSetSparseImage.h:78
itk::UpdateMalcolmSparseLevelSet::LevelSetLayerMapType
typename LevelSetType::LayerMapType LevelSetLayerMapType
Definition: itkUpdateMalcolmSparseLevelSet.h:79
itk::UpdateMalcolmSparseLevelSet::EquationContainerType
TEquationContainer EquationContainerType
Definition: itkUpdateMalcolmSparseLevelSet.h:83
itk::UpdateMalcolmSparseLevelSet::LevelSetLabelObjectType
typename LevelSetType::LabelObjectType LevelSetLabelObjectType
Definition: itkUpdateMalcolmSparseLevelSet.h:69
itk::UpdateMalcolmSparseLevelSet::LevelSetLayerMapConstIterator
typename LevelSetType::LayerMapConstIterator LevelSetLayerMapConstIterator
Definition: itkUpdateMalcolmSparseLevelSet.h:81
itk::UpdateMalcolmSparseLevelSet::LabelImagePointer
typename LabelImageType::Pointer LabelImagePointer
Definition: itkUpdateMalcolmSparseLevelSet.h:125
itk::UpdateMalcolmSparseLevelSet::TermContainerPointer
typename EquationContainerType::TermContainerPointer TermContainerPointer
Definition: itkUpdateMalcolmSparseLevelSet.h:85
itk::UpdateMalcolmSparseLevelSet::NodePairType
std::pair< LevelSetInputType, LevelSetOutputType > NodePairType
Definition: itkUpdateMalcolmSparseLevelSet.h:158
itk::LevelSetSparseImage< int8_t, VDimension >::LayerConstIterator
typename LayerType::const_iterator LayerConstIterator
Definition: itkLevelSetSparseImage.h:79
itkShapedNeighborhoodIterator.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::UpdateMalcolmSparseLevelSet::LevelSetLabelObjectLengthType
typename LevelSetType::LabelObjectLengthType LevelSetLabelObjectLengthType
Definition: itkUpdateMalcolmSparseLevelSet.h:71
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:61
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
itkLabelMapToLabelImageFilter.h
itk::UpdateMalcolmSparseLevelSet::LevelSetOutputRealType
typename LevelSetType::OutputRealType LevelSetOutputRealType
Definition: itkUpdateMalcolmSparseLevelSet.h:77
itk::LevelSetImage< Index< VDimension >, VDimension, int8_t >::OffsetType
typename ImageBaseType::OffsetType OffsetType
Definition: itkLevelSetImage.h:62
itk::LevelSetBase< Index< VDimension >, VDimension, int8_t, ImageBase< VDimension > >::OutputType
int8_t OutputType
Definition: itkLevelSetBase.h:59
itk::UpdateMalcolmSparseLevelSet::LevelSetLayerIterator
typename LevelSetType::LayerIterator LevelSetLayerIterator
Definition: itkUpdateMalcolmSparseLevelSet.h:75
itk::MalcolmSparseLevelSetImage
Derived class for the Malcolm representation of level-set function.
Definition: itkMalcolmSparseLevelSetImage.h:41
itk::UpdateMalcolmSparseLevelSet::LevelSetLabelObjectPointer
typename LevelSetType::LabelObjectPointer LevelSetLabelObjectPointer
Definition: itkUpdateMalcolmSparseLevelSet.h:70
itk::UpdateMalcolmSparseLevelSet::LevelSetOutputType
typename LevelSetType::OutputType LevelSetOutputType
Definition: itkUpdateMalcolmSparseLevelSet.h:63
itk::IdentifierType
SizeValueType IdentifierType
Definition: itkIntTypes.h:90
itk::UpdateMalcolmSparseLevelSet::LevelSetLabelObjectLineType
typename LevelSetType::LabelObjectLineType LevelSetLabelObjectLineType
Definition: itkUpdateMalcolmSparseLevelSet.h:72