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
43// For dense image level set split by putting part of the level set region in
44// each thread.
45template <typename TImage, typename TLevelSetEvolution>
46class ITK_TEMPLATE_EXPORT
48 ThreadedImageRegionPartitioner<TImage::ImageDimension>,
49 TLevelSetEvolution>
50 : public DomainThreader<ThreadedImageRegionPartitioner<TImage::ImageDimension>, TLevelSetEvolution>
51{
52public:
53 ITK_DISALLOW_COPY_AND_MOVE(LevelSetEvolutionComputeIterationThreader);
54
60
62 itkOverrideGetNameOfClassMacro(LevelSetEvolutionComputeIterationThreader);
63
65 itkNewMacro(Self);
66
68 using typename Superclass::DomainType;
69 using typename Superclass::AssociateType;
70
72 using LevelSetEvolutionType = TLevelSetEvolution;
73 using IdListType = typename LevelSetEvolutionType::IdListType;
74 using IdListConstIterator = typename LevelSetEvolutionType::IdListConstIterator;
75 using InputImageType = typename LevelSetEvolutionType::InputImageType;
76 using LevelSetType = typename LevelSetEvolutionType::LevelSetType;
79 using OffsetType = typename LevelSetType::OffsetType;
80 using LevelSetImageType = typename LevelSetEvolutionType::LevelSetImageType;
81 using LevelSetDataType = typename LevelSetEvolutionType::LevelSetDataType;
82 using LevelSetOutputRealType = typename LevelSetEvolutionType::LevelSetOutputRealType;
83 using LevelSetContainerType = typename LevelSetEvolutionType::LevelSetContainerType;
84 using EquationContainerType = typename LevelSetEvolutionType::EquationContainerType;
85 using TermContainerType = typename LevelSetEvolutionType::TermContainerType;
86
87protected:
89
90 void
91 ThreadedExecution(const DomainType & imageSubRegion, const ThreadIdType threadId) override;
92};
93
94// For dense image level set split by putting a level set domain in each thread.
95template <typename TImage, typename TLevelSetEvolution>
97 LevelSetDenseImage<TImage>,
99 typename TLevelSetEvolution::DomainMapImageFilterType::DomainMapType::const_iterator>,
100 TLevelSetEvolution>
101 : public DomainThreader<ThreadedIteratorRangePartitioner<
102 typename TLevelSetEvolution::DomainMapImageFilterType::DomainMapType::const_iterator>,
103 TLevelSetEvolution>
104{
105public:
106 ITK_DISALLOW_COPY_AND_MOVE(LevelSetEvolutionComputeIterationThreader);
107
109 typename TLevelSetEvolution::DomainMapImageFilterType::DomainMapType::const_iterator;
111
117
119 itkOverrideGetNameOfClassMacro(LevelSetEvolutionComputeIterationThreader);
120
122 itkNewMacro(Self);
123
125 using typename Superclass::DomainType;
126 using typename Superclass::AssociateType;
127
129 using LevelSetEvolutionType = TLevelSetEvolution;
130 using IdListType = typename LevelSetEvolutionType::IdListType;
131 using IdListConstIterator = typename LevelSetEvolutionType::IdListConstIterator;
132 using InputImageType = typename LevelSetEvolutionType::InputImageType;
133 using LevelSetType = typename LevelSetEvolutionType::LevelSetType;
136 using OffsetType = typename LevelSetType::OffsetType;
137 using LevelSetImageType = typename LevelSetEvolutionType::LevelSetImageType;
138 using LevelSetDataType = typename LevelSetEvolutionType::LevelSetDataType;
139 using LevelSetOutputRealType = typename LevelSetEvolutionType::LevelSetOutputRealType;
140 using LevelSetContainerType = typename LevelSetEvolutionType::LevelSetContainerType;
141 using EquationContainerType = typename LevelSetEvolutionType::EquationContainerType;
142 using TermContainerType = typename LevelSetEvolutionType::TermContainerType;
143
144protected:
146
147 void
148 ThreadedExecution(const DomainType & imageSubDomain, const ThreadIdType threadId) override;
149};
150
151// For Whitaker sparse level set split by putting part of the level set in each
152// thread.
153template <typename TOutput, unsigned int VDimension, typename TLevelSetEvolution>
155 WhitakerSparseLevelSetImage<TOutput, VDimension>,
156 ThreadedIteratorRangePartitioner<typename WhitakerSparseLevelSetImage<TOutput, VDimension>::LayerConstIterator>,
157 TLevelSetEvolution>
158 : public DomainThreader<
159 ThreadedIteratorRangePartitioner<typename WhitakerSparseLevelSetImage<TOutput, VDimension>::LayerConstIterator>,
160 TLevelSetEvolution>
161{
162public:
163 ITK_DISALLOW_COPY_AND_MOVE(LevelSetEvolutionComputeIterationThreader);
164
169 TLevelSetEvolution>;
172
174 itkOverrideGetNameOfClassMacro(LevelSetEvolutionComputeIterationThreader);
175
177 itkNewMacro(Self);
178
180 using typename Superclass::DomainType;
181 using typename Superclass::AssociateType;
182
184 using LevelSetEvolutionType = TLevelSetEvolution;
185 using LevelSetType = typename LevelSetEvolutionType::LevelSetType;
188 using OffsetType = typename LevelSetType::OffsetType;
189 using LevelSetContainerType = typename LevelSetEvolutionType::LevelSetContainerType;
190 using LevelSetIdentifierType = typename LevelSetEvolutionType::LevelSetIdentifierType;
191 using LevelSetInputType = typename LevelSetEvolutionType::LevelSetInputType;
192 using LevelSetOutputType = typename LevelSetEvolutionType::LevelSetOutputType;
193 using LevelSetDataType = typename LevelSetEvolutionType::LevelSetDataType;
194 using TermContainerType = typename LevelSetEvolutionType::TermContainerType;
195 using NodePairType = typename LevelSetEvolutionType::NodePairType;
196
197protected:
199
200 void
202
203 void
204 ThreadedExecution(const DomainType & iteratorSubRange, const ThreadIdType threadId) override;
205
206 void
208
209 using NodePairsPerThreadType = std::vector<std::vector<NodePairType>>;
210 NodePairsPerThreadType m_NodePairsPerThread{};
211};
212
213} // namespace itk
214
215#ifndef ITK_MANUAL_INSTANTIATION
216# include "itkLevelSetEvolutionComputeIterationThreader.hxx"
217#endif
218
219#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