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
29
30namespace itk
31{
60template <typename TInputImage, typename TFeatureImage>
61class ITK_TEMPLATE_EXPORT RegionBasedLevelSetFunctionData : public LightObject
62{
63public:
64 ITK_DISALLOW_COPY_AND_MOVE(RegionBasedLevelSetFunctionData);
65
70
71 static constexpr unsigned int ImageDimension = TFeatureImage::ImageDimension;
72
74 itkNewMacro(Self);
75
76 itkOverrideGetNameOfClassMacro(RegionBasedLevelSetFunctionData);
77
78 using InputImageType = TInputImage;
79 using InputImagePointer = typename InputImageType::Pointer;
80 using InputImageConstPointer = typename InputImageType::ConstPointer;
81 using InputPixelType = typename InputImageType::PixelType;
82 using InputRegionType = typename InputImageType::RegionType;
83 using InputSizeType = typename InputImageType::SizeType;
84 using InputSizeValueType = typename InputSizeType::SizeValueType;
85 using InputSpacingType = typename InputImageType::SpacingType;
86 using InputIndexType = typename InputImageType::IndexType;
87 using InputIndexValueType = typename InputIndexType::IndexValueType;
88 using InputPointType = typename InputImageType::PointType;
89
90 using FeatureImageType = TFeatureImage;
91 using FeatureImagePointer = typename FeatureImageType::Pointer;
92 using FeatureImageConstPointer = typename FeatureImageType::ConstPointer;
93 using FeaturePixelType = typename FeatureImageType::PixelType;
94 using FeatureRegionType = typename FeatureImageType::RegionType;
95 using FeatureSizeType = typename FeatureImageType::SizeType;
96 using FeatureSizeValueType = typename FeatureSizeType::SizeValueType;
97 using FeatureSpacingType = typename FeatureImageType::SpacingType;
98 using FeatureIndexType = typename FeatureImageType::IndexType;
99 using FeaturePointType = typename FeatureImageType::PointType;
100
101 // Allocates m_HeavisideFunctionOfLevelSetImage to have same origin,
102 // spacing and size as image. Also sets the m_Start and m_End indices.
103 void
105
106 // Checks if the given index lies in the domain of the current
107 // level-set function. The domain is defined by the start and end indices.
108 template <typename TIndex>
109 bool
110 VerifyInsideRegion(const TIndex & featureIndex)
111 {
112 for (unsigned int j = 0; j < ImageDimension; ++j)
113 {
114 if ((featureIndex[j] < static_cast<InputIndexValueType>(this->m_Start[j])) ||
115 (featureIndex[j] > static_cast<InputIndexValueType>(this->m_End[j])))
116 {
117 return false;
118 }
119 }
120 return true;
121 }
122
123 // Get the index into the domain of the current level-set function
124 InputIndexType
125 GetIndex(const FeatureIndexType & featureIndex);
126
127 // Get the index in the domain of the feature image
129 GetFeatureIndex(const InputIndexType & inputIndex);
130
133
137
138protected:
141};
142} // end namespace itk
143
144#ifndef ITK_MANUAL_INSTANTIATION
145# include "itkRegionBasedLevelSetFunctionData.hxx"
146#endif
147#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....