ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkRegionBasedLevelSetFunctionData.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 itkRegionBasedLevelSetFunctionData_h
19#define itkRegionBasedLevelSetFunctionData_h
20
21#include "itkLightObject.h"
22
23#include "itkVector.h"
24#include "itkListSample.h"
25#include "itkKdTreeGenerator.h"
26
28
29namespace itk
30{
46template <typename TInputImage, typename TFeatureImage>
47class ITK_TEMPLATE_EXPORT RegionBasedLevelSetFunctionData : public LightObject
48{
49public:
50 ITK_DISALLOW_COPY_AND_MOVE(RegionBasedLevelSetFunctionData);
51
56
57 static constexpr unsigned int ImageDimension = TFeatureImage::ImageDimension;
58
60 itkNewMacro(Self);
61
62 itkOverrideGetNameOfClassMacro(RegionBasedLevelSetFunctionData);
63
64 using InputImageType = TInputImage;
65 using InputImagePointer = typename InputImageType::Pointer;
66 using InputImageConstPointer = typename InputImageType::ConstPointer;
67 using InputPixelType = typename InputImageType::PixelType;
68 using InputRegionType = typename InputImageType::RegionType;
69 using InputSizeType = typename InputImageType::SizeType;
70 using InputSizeValueType = typename InputSizeType::SizeValueType;
71 using InputSpacingType = typename InputImageType::SpacingType;
72 using InputIndexType = typename InputImageType::IndexType;
73 using InputIndexValueType = typename InputIndexType::IndexValueType;
74 using InputPointType = typename InputImageType::PointType;
75
76 using FeatureImageType = TFeatureImage;
77 using FeatureImagePointer = typename FeatureImageType::Pointer;
78 using FeatureImageConstPointer = typename FeatureImageType::ConstPointer;
79 using FeaturePixelType = typename FeatureImageType::PixelType;
80 using FeatureRegionType = typename FeatureImageType::RegionType;
81 using FeatureSizeType = typename FeatureImageType::SizeType;
82 using FeatureSizeValueType = typename FeatureSizeType::SizeValueType;
83 using FeatureSpacingType = typename FeatureImageType::SpacingType;
84 using FeatureIndexType = typename FeatureImageType::IndexType;
85 using FeaturePointType = typename FeatureImageType::PointType;
86
87 // Allocates m_HeavisideFunctionOfLevelSetImage to have same origin,
88 // spacing and size as image. Also sets the m_Start and m_End indices.
89 void
91
92 // Checks if the given index lies in the domain of the current
93 // level-set function. The domain is defined by the start and end indices.
94 template <typename TIndex>
95 bool
96 VerifyInsideRegion(const TIndex & featureIndex)
97 {
98 for (unsigned int j = 0; j < ImageDimension; ++j)
99 {
100 if ((featureIndex[j] < static_cast<InputIndexValueType>(this->m_Start[j])) ||
101 (featureIndex[j] > static_cast<InputIndexValueType>(this->m_End[j])))
102 {
103 return false;
104 }
105 }
106 return true;
107 }
108
109 // Get the index into the domain of the current level-set function
110 InputIndexType
111 GetIndex(const FeatureIndexType & featureIndex);
112
113 // Get the index in the domain of the feature image
115 GetFeatureIndex(const InputIndexType & inputIndex);
116
119
123
124protected:
127};
128} // end namespace itk
129
130#ifndef ITK_MANUAL_INSTANTIATION
131# include "itkRegionBasedLevelSetFunctionData.hxx"
132#endif
133#endif
typename FeatureSizeType::SizeValueType FeatureSizeValueType
typename InputImageType::RegionType InputRegionType
typename InputImageType::ConstPointer InputImageConstPointer
InputIndexType GetIndex(const FeatureIndexType &featureIndex)
void CreateHeavisideFunctionOfLevelSetImage(const InputImageType *image)
typename FeatureImageType::SpacingType FeatureSpacingType
typename InputImageType::SpacingType InputSpacingType
typename FeatureImageType::RegionType FeatureRegionType
typename FeatureImageType::IndexType FeatureIndexType
FeatureIndexType GetFeatureIndex(const InputIndexType &inputIndex)
typename InputIndexType::IndexValueType InputIndexValueType
typename FeatureImageType::ConstPointer FeatureImageConstPointer
typename FeatureImageType::PointType FeaturePointType
typename FeatureImageType::PixelType FeaturePixelType
typename InputSizeType::SizeValueType InputSizeValueType
typename FeatureImageType::SizeType FeatureSizeType
typename FeatureImageType::Pointer FeatureImagePointer
~RegionBasedLevelSetFunctionData() override=default
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....