ITK  6.0.0
Insight Toolkit
itkLevelSetSparseImage.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 itkLevelSetSparseImage_h
20#define itkLevelSetSparseImage_h
21
23#include "itkObjectFactory.h"
24
25#include "itkLabelObject.h"
26#include "itkLabelMap.h"
28
29namespace itk
30{
31
41template <typename TOutput, unsigned int VDimension>
42class ITK_TEMPLATE_EXPORT LevelSetSparseImage : public DiscreteLevelSetImage<TOutput, VDimension>
43{
44public:
45 ITK_DISALLOW_COPY_AND_MOVE(LevelSetSparseImage);
46
51
53 itkOverrideGetNameOfClassMacro(LevelSetSparseImage);
54
55 static constexpr unsigned int Dimension = Superclass::Dimension;
56
57 using typename Superclass::InputType;
58 using typename Superclass::OutputType;
59 using typename Superclass::OutputRealType;
60 using typename Superclass::GradientType;
61 using typename Superclass::HessianType;
62 using typename Superclass::LevelSetDataType;
63
64 using LayerIdType = int8_t;
65 using LayerIdListType = std::list<LayerIdType>;
66
71
76
77 using LayerType = std::map<InputType, OutputType, Functor::LexicographicCompare>;
78 using LayerIterator = typename LayerType::iterator;
79 using LayerConstIterator = typename LayerType::const_iterator;
80
81 using LayerMapType = std::map<LayerIdType, LayerType>;
82 using LayerMapIterator = typename LayerMapType::iterator;
83 using LayerMapConstIterator = typename LayerMapType::const_iterator;
84
86 virtual LayerIdType
87 Status(const InputType & inputIndex) const;
88
90 const LayerType &
91 GetLayer(LayerIdType value) const;
92
94 LayerType &
96
98 void
99 SetLayer(LayerIdType value, const LayerType & layer);
100
102 virtual void
104 itkGetModifiableObjectMacro(LabelMap, LabelMapType);
108 void
109 Graft(const DataObject * data) override;
110
112 template <typename TLabel>
115
116protected:
118 ~LevelSetSparseImage() override = default;
119
120 LayerMapType m_Layers{};
121 LabelMapPointer m_LabelMap{};
122 LayerIdListType m_InternalLabelList{};
123
125 virtual void
127
128 virtual void
130
131 bool
132 IsInsideDomain(const InputType & inputIndex) const override;
133
135 void
136 Initialize() override;
137
139 void
140 CopyInformation(const DataObject * data) override;
141};
142
143} // namespace itk
144
145#ifndef ITK_MANUAL_INSTANTIATION
146# include "itkLevelSetSparseImage.hxx"
147#endif
148
149#endif // itkLevelSetSparseImage_h
Base class for all data objects in ITK.
Abstract class for a level-set function on one Image.
Templated n-dimensional image to store labeled objects.
Definition: itkLabelMap.h:71
The base class for the representation of a labeled binary object in an image.
typename LineType::LengthType LengthType
Base class for the sparse representation of a level-set function on one Image.
typename LabelMapType::ConstPointer LabelMapConstPointer
typename LayerType::const_iterator LayerConstIterator
typename LabelObjectType::LineType LabelObjectLineType
std::map< LayerIdType, LayerType > LayerMapType
void CopyInformation(const DataObject *data) override
bool IsInsideDomain(const InputType &inputIndex) const override
virtual LayerIdType Status(const InputType &inputIndex) const
const LayerType & GetLayer(LayerIdType value) const
typename LabelObjectType::Pointer LabelObjectPointer
~LevelSetSparseImage() override=default
virtual void SetLabelMap(LabelMapType *labelMap)
void Graft(const DataObject *data) override
std::map< InputType, OutputType, Functor::LexicographicCompare > LayerType
std::list< LayerIdType > LayerIdListType
LayerType & GetLayer(LayerIdType value)
virtual void InitializeInternalLabelList()=0
typename LayerType::iterator LayerIterator
typename LabelMapType::Pointer LabelMapPointer
typename LayerMapType::iterator LayerMapIterator
typename LayerMapType::const_iterator LayerMapConstIterator
virtual void InitializeLayers()=0
void SetLayer(LayerIdType value, const LayerType &layer)
LabelObject< TLabel, VDimension >::Pointer GetAsLabelObject()
void Initialize() override
typename LabelMapType::RegionType RegionType
typename LabelObjectType::LengthType LabelObjectLengthType
Base class for most ITK classes.
Definition: itkObject.h:62
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....