ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkBinaryImageToLevelSetImageAdaptor.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 itkBinaryImageToLevelSetImageAdaptor_h
20#define itkBinaryImageToLevelSetImageAdaptor_h
21
23
26
30
33
34namespace itk
35{
50template <typename TInputImage, typename TLevelSet>
51class ITK_TEMPLATE_EXPORT BinaryImageToLevelSetImageAdaptor{};
52
53
56template <typename TInputImage, typename TLevelSetImage>
57class ITK_TEMPLATE_EXPORT BinaryImageToLevelSetImageAdaptor<TInputImage, LevelSetDenseImage<TLevelSetImage>>
58 : public BinaryImageToLevelSetImageAdaptorBase<TInputImage, LevelSetDenseImage<TLevelSetImage>>
59{
60public:
61 ITK_DISALLOW_COPY_AND_MOVE(BinaryImageToLevelSetImageAdaptor);
62
64
69
71 itkNewMacro(Self);
72
74 itkOverrideGetNameOfClassMacro(BinaryImageToLevelSetImageAdaptor);
75
76 using InputImageType = TInputImage;
77 using InputImagePixelType = typename InputImageType::PixelType;
78 using InputImageIndexType = typename InputImageType::IndexType;
79 using InputImagePointer = typename InputImageType::Pointer;
80 using InputImageRegionType = typename InputImageType::RegionType;
82
83 static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
84
87
90
94 itkSetObjectMacro(SignedDistanceTransformFilter, SignedDistanceTransformFilterType);
95 itkGetModifiableObjectMacro(SignedDistanceTransformFilter, SignedDistanceTransformFilterType);
97
101 void
102 Initialize() override;
103
104protected:
107
110
111private:
113};
114
116
123template <typename TInput, typename TOutput>
125 : public BinaryImageToLevelSetImageAdaptorBase<TInput, TOutput>
126{
127public:
128 ITK_DISALLOW_COPY_AND_MOVE(BinaryImageToSparseLevelSetImageAdaptorBase);
129
134
136 itkOverrideGetNameOfClassMacro(BinaryImageToSparseLevelSetImageAdaptorBase);
137
138 using typename Superclass::InputImageType;
139 using typename Superclass::InputImagePixelType;
140 using typename Superclass::InputImageIndexType;
141 using typename Superclass::InputImagePointer;
143 using typename Superclass::InputPixelRealType;
144
145 static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
146
147 using typename Superclass::LevelSetType;
148 using typename Superclass::LevelSetPointer;
149
150 using LevelSetInputType = typename LevelSetType::InputType;
151 using LevelSetOutputType = typename LevelSetType::OutputType;
152
153 using LevelSetLabelObjectType = typename LevelSetType::LabelObjectType;
154 using LayerIdType = typename LevelSetLabelObjectType::LabelType;
155 using LevelSetLabelObjectPointer = typename LevelSetType::LabelObjectPointer;
156 using LevelSetLabelObjectLengthType = typename LevelSetType::LabelObjectLengthType;
157 using LevelSetLabelObjectLineType = typename LevelSetType::LabelObjectLineType;
158
159 using LevelSetLabelMapType = typename LevelSetType::LabelMapType;
160 using LevelSetLabelMapPointer = typename LevelSetType::LabelMapPointer;
161
162 using LevelSetLayerType = typename LevelSetType::LayerType;
163 using LevelSetLayerIterator = typename LevelSetType::LayerIterator;
164 using LevelSetLayerConstIterator = typename LevelSetType::LayerConstIterator;
165
168
169 using LayerPairType = std::pair<LevelSetInputType, LevelSetOutputType>;
170
173
175
176protected:
181
183
185};
186
188
190template <typename TInput, typename TOutput>
191class ITK_TEMPLATE_EXPORT
194 WhitakerSparseLevelSetImage<TOutput, TInput::ImageDimension>>
195{
196public:
197 ITK_DISALLOW_COPY_AND_MOVE(BinaryImageToLevelSetImageAdaptor);
198
200
205
206
208 itkNewMacro(Self);
209
211 itkOverrideGetNameOfClassMacro(BinaryImageToLevelSetImageAdaptor);
212
213 using typename Superclass::InputImageType;
214 using typename Superclass::InputImagePixelType;
215 using typename Superclass::InputImageIndexType;
216 using typename Superclass::InputImagePointer;
218 using typename Superclass::InputPixelRealType;
219
220 static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
221
222 using typename Superclass::LevelSetPointer;
223
224 using typename Superclass::LevelSetInputType;
225 using typename Superclass::LevelSetOutputType;
226
228 using typename Superclass::LayerIdType;
232
235
236 using typename Superclass::LevelSetLayerType;
239
240 using typename Superclass::InternalImageType;
242
243 using typename Superclass::LayerPairType;
244
245 using typename Superclass::InputIteratorType;
247
249
250 void
251 Initialize() override;
252
253protected:
256
259
260private:
262 void
263 PropagateToOuterLayers(LayerIdType layerToBeScanned, LayerIdType outputLayer, LayerIdType testValue);
264
266 void
268
270 void
272};
273
275
277template <typename TInput>
279 : public BinaryImageToSparseLevelSetImageAdaptorBase<TInput, ShiSparseLevelSetImage<TInput::ImageDimension>>
280{
281public:
282 ITK_DISALLOW_COPY_AND_MOVE(BinaryImageToLevelSetImageAdaptor);
283
285
290
292 itkNewMacro(Self);
293
295 itkOverrideGetNameOfClassMacro(BinaryImageToLevelSetImageAdaptor);
296
297 using typename Superclass::InputImageType;
298
299 using typename Superclass::InputImagePixelType;
300 using typename Superclass::InputImageIndexType;
301 using typename Superclass::InputImagePointer;
303 using typename Superclass::InputPixelRealType;
304
305 static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
306
307 // using typename Superclass::LevelSetType;
308 using typename Superclass::LevelSetPointer;
309
310 using typename Superclass::LevelSetInputType;
311 using typename Superclass::LevelSetOutputType;
312
314 using typename Superclass::LayerIdType;
318
321
322 using typename Superclass::LevelSetLayerType;
325
326 using typename Superclass::InternalImageType;
328
329 using typename Superclass::LayerPairType;
330
331 using typename Superclass::InputIteratorType;
333
335
336 void
337 Initialize() override;
338
339protected:
342
345
347 void
349
350private:
351};
352
353
355
357template <typename TInput>
359 : public BinaryImageToSparseLevelSetImageAdaptorBase<TInput, MalcolmSparseLevelSetImage<TInput::ImageDimension>>
360{
361public:
362 ITK_DISALLOW_COPY_AND_MOVE(BinaryImageToLevelSetImageAdaptor);
363
365
370
371
373 itkNewMacro(Self);
374
376 itkOverrideGetNameOfClassMacro(BinaryImageToLevelSetImageAdaptor);
377
378 using typename Superclass::InputImageType;
379
380 using typename Superclass::InputImagePixelType;
381 using typename Superclass::InputImageIndexType;
382 using typename Superclass::InputImagePointer;
384 using typename Superclass::InputPixelRealType;
385
386 static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
387
388
389 using typename Superclass::LevelSetPointer;
390 using typename Superclass::LevelSetInputType;
391 using typename Superclass::LevelSetOutputType;
392
394 using typename Superclass::LayerIdType;
398
401
402 using typename Superclass::LevelSetLayerType;
405
406 using typename Superclass::InternalImageType;
408
409 using typename Superclass::LayerPairType;
410
411 using typename Superclass::InputIteratorType;
413
415
416 void
417 Initialize() override;
418
419protected:
422
425
427 void
429
431 void
433};
434
435} // namespace itk
436
437#ifndef ITK_MANUAL_INSTANTIATION
438# include "itkBinaryImageToLevelSetImageAdaptor.hxx"
439#endif
440#endif // itkBinaryImageToLevelSetImageAdaptorBase_h
typename NumericTraits< InputImagePixelType >::RealType InputPixelRealType
void PropagateToOuterLayers(LayerIdType layerToBeScanned, LayerIdType outputLayer, LayerIdType testValue)
Converts one binary image to the appropriate level-set type provided by the template argument TLevelS...
BinaryImageToLevelSetImageAdaptorBase< TInput, TOutput > Superclass
typename NumericTraits< InputImagePixelType >::RealType InputPixelRealType
~BinaryImageToSparseLevelSetImageAdaptorBase() override=default
typename LevelSetType::LabelObjectLineType LevelSetLabelObjectLineType
ShapedNeighborhoodIterator< InternalImageType > NeighborhoodIteratorType
ImageRegionIteratorWithIndex< InputImageType > InputIteratorType
typename LevelSetType::LabelObjectPointer LevelSetLabelObjectPointer
ImageRegionIteratorWithIndex< InternalImageType > InternalIteratorType
typename LevelSetType::LabelObjectLengthType LevelSetLabelObjectLengthType
typename LevelSetType::LayerConstIterator LevelSetLayerConstIterator
std::pair< LevelSetInputType, LevelSetOutputType > LayerPairType
A multi-dimensional iterator templated over image type that walks pixels within a region and is speci...
Base class for filters that take an image as input and produce an image as output.
Templated n-dimensional image class.
Definition itkImage.h:89
Base class for the "dense" representation of a level-set function on one image.
Derived class for the Malcolm representation of level-set function.
A neighborhood iterator which can take on an arbitrary shape.
Derived class for the shi representation of level-set function.
Implements transparent reference counting.
Derived class for the sparse-field representation of level-set function.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....