ITK  6.0.0
Insight Toolkit
itkLevelSetEvolutionComputeIterationThreader.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#ifndef itkLevelSetEvolutionComputeIterationThreader_h
19#define itkLevelSetEvolutionComputeIterationThreader_h
20
21#include "itkDomainThreader.h"
24
27
28namespace itk
29{
30
39template <typename TLevelSet, typename TDomainPartitioner, typename TLevelSetEvolution>
41
42// For dense image level set split by putting part of the level set region in
43// each thread.
44template <typename TImage, typename TLevelSetEvolution>
45class ITK_TEMPLATE_EXPORT
47 ThreadedImageRegionPartitioner<TImage::ImageDimension>,
48 TLevelSetEvolution>
49 : public DomainThreader<ThreadedImageRegionPartitioner<TImage::ImageDimension>, TLevelSetEvolution>
50{
51public:
52 ITK_DISALLOW_COPY_AND_MOVE(LevelSetEvolutionComputeIterationThreader);
53
59
61 itkOverrideGetNameOfClassMacro(LevelSetEvolutionComputeIterationThreader);
62
64 itkNewMacro(Self);
65
67 using typename Superclass::DomainType;
68 using typename Superclass::AssociateType;
69
71 using LevelSetEvolutionType = TLevelSetEvolution;
72 using IdListType = typename LevelSetEvolutionType::IdListType;
73 using IdListConstIterator = typename LevelSetEvolutionType::IdListConstIterator;
74 using InputImageType = typename LevelSetEvolutionType::InputImageType;
75 using LevelSetType = typename LevelSetEvolutionType::LevelSetType;
78 using OffsetType = typename LevelSetType::OffsetType;
79 using LevelSetImageType = typename LevelSetEvolutionType::LevelSetImageType;
80 using LevelSetDataType = typename LevelSetEvolutionType::LevelSetDataType;
81 using LevelSetOutputRealType = typename LevelSetEvolutionType::LevelSetOutputRealType;
82 using LevelSetContainerType = typename LevelSetEvolutionType::LevelSetContainerType;
83 using EquationContainerType = typename LevelSetEvolutionType::EquationContainerType;
84 using TermContainerType = typename LevelSetEvolutionType::TermContainerType;
85
86protected:
88
89 void
90 ThreadedExecution(const DomainType & imageSubRegion, const ThreadIdType threadId) override;
91};
92
93// For dense image level set split by putting a level set domain in each thread.
94template <typename TImage, typename TLevelSetEvolution>
96 LevelSetDenseImage<TImage>,
98 typename TLevelSetEvolution::DomainMapImageFilterType::DomainMapType::const_iterator>,
99 TLevelSetEvolution>
100 : public DomainThreader<ThreadedIteratorRangePartitioner<
101 typename TLevelSetEvolution::DomainMapImageFilterType::DomainMapType::const_iterator>,
102 TLevelSetEvolution>
103{
104public:
105 ITK_DISALLOW_COPY_AND_MOVE(LevelSetEvolutionComputeIterationThreader);
106
108 typename TLevelSetEvolution::DomainMapImageFilterType::DomainMapType::const_iterator;
110
116
118 itkOverrideGetNameOfClassMacro(LevelSetEvolutionComputeIterationThreader);
119
121 itkNewMacro(Self);
122
124 using typename Superclass::DomainType;
125 using typename Superclass::AssociateType;
126
128 using LevelSetEvolutionType = TLevelSetEvolution;
129 using IdListType = typename LevelSetEvolutionType::IdListType;
130 using IdListConstIterator = typename LevelSetEvolutionType::IdListConstIterator;
131 using InputImageType = typename LevelSetEvolutionType::InputImageType;
132 using LevelSetType = typename LevelSetEvolutionType::LevelSetType;
135 using OffsetType = typename LevelSetType::OffsetType;
136 using LevelSetImageType = typename LevelSetEvolutionType::LevelSetImageType;
137 using LevelSetDataType = typename LevelSetEvolutionType::LevelSetDataType;
138 using LevelSetOutputRealType = typename LevelSetEvolutionType::LevelSetOutputRealType;
139 using LevelSetContainerType = typename LevelSetEvolutionType::LevelSetContainerType;
140 using EquationContainerType = typename LevelSetEvolutionType::EquationContainerType;
141 using TermContainerType = typename LevelSetEvolutionType::TermContainerType;
142
143protected:
145
146 void
147 ThreadedExecution(const DomainType & imageSubDomain, const ThreadIdType threadId) override;
148};
149
150// For Whitaker sparse level set split by putting part of the level set in each
151// thread.
152template <typename TOutput, unsigned int VDimension, typename TLevelSetEvolution>
154 WhitakerSparseLevelSetImage<TOutput, VDimension>,
155 ThreadedIteratorRangePartitioner<typename WhitakerSparseLevelSetImage<TOutput, VDimension>::LayerConstIterator>,
156 TLevelSetEvolution>
157 : public DomainThreader<
158 ThreadedIteratorRangePartitioner<typename WhitakerSparseLevelSetImage<TOutput, VDimension>::LayerConstIterator>,
159 TLevelSetEvolution>
160{
161public:
162 ITK_DISALLOW_COPY_AND_MOVE(LevelSetEvolutionComputeIterationThreader);
163
168 TLevelSetEvolution>;
171
173 itkOverrideGetNameOfClassMacro(LevelSetEvolutionComputeIterationThreader);
174
176 itkNewMacro(Self);
177
179 using typename Superclass::DomainType;
180 using typename Superclass::AssociateType;
181
183 using LevelSetEvolutionType = TLevelSetEvolution;
184 using LevelSetType = typename LevelSetEvolutionType::LevelSetType;
187 using OffsetType = typename LevelSetType::OffsetType;
188 using LevelSetContainerType = typename LevelSetEvolutionType::LevelSetContainerType;
189 using LevelSetIdentifierType = typename LevelSetEvolutionType::LevelSetIdentifierType;
190 using LevelSetInputType = typename LevelSetEvolutionType::LevelSetInputType;
191 using LevelSetOutputType = typename LevelSetEvolutionType::LevelSetOutputType;
192 using LevelSetDataType = typename LevelSetEvolutionType::LevelSetDataType;
193 using TermContainerType = typename LevelSetEvolutionType::TermContainerType;
194 using NodePairType = typename LevelSetEvolutionType::NodePairType;
195
196protected:
198
199 void
201
202 void
203 ThreadedExecution(const DomainType & iteratorSubRange, const ThreadIdType threadId) override;
204
205 void
207
208 using NodePairsPerThreadType = std::vector<std::vector<NodePairType>>;
209 NodePairsPerThreadType m_NodePairsPerThread{};
210};
211
212} // namespace itk
213
214#ifndef ITK_MANUAL_INSTANTIATION
215# include "itkLevelSetEvolutionComputeIterationThreader.hxx"
216#endif
217
218#endif
Multi-threaded processing on a domain by processing sub-domains per thread.
Base class for the "dense" representation of a level-set function on one image.
Light weight base class for most itk classes.
Class for partitioning of an ImageRegion.
Partitions an iterator range for threading.
Derived class for the sparse-field representation of level-set function.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned int ThreadIdType
Definition: itkIntTypes.h:102