ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkRegionBasedLevelSetFunctionSharedData.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 itkRegionBasedLevelSetFunctionSharedData_h
19#define itkRegionBasedLevelSetFunctionSharedData_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, typename TSingleData>
62{
63public:
64 ITK_DISALLOW_COPY_AND_MOVE(RegionBasedLevelSetFunctionSharedData);
65
70
71 static constexpr unsigned int ImageDimension = TFeatureImage::ImageDimension;
72
73 itkOverrideGetNameOfClassMacro(RegionBasedLevelSetFunctionSharedData);
74
75 using InputImageType = TInputImage;
76 using InputImagePointer = typename InputImageType::Pointer;
77 using InputImageConstPointer = typename InputImageType::ConstPointer;
78 using InputPixelType = typename InputImageType::PixelType;
79 using InputRegionType = typename InputImageType::RegionType;
80 using InputSizeType = typename InputImageType::SizeType;
81 using InputSizeValueType = typename InputSizeType::SizeValueType;
82 using InputSpacingType = typename InputImageType::SpacingType;
83 using InputIndexType = typename InputImageType::IndexType;
84 using InputIndexValueType = typename InputIndexType::IndexValueType;
85 using InputPointType = typename InputImageType::PointType;
86
87 using FeatureImageType = TFeatureImage;
88 using FeatureImagePointer = typename FeatureImageType::Pointer;
89 using FeatureImageConstPointer = typename FeatureImageType::ConstPointer;
90 using FeaturePixelType = typename FeatureImageType::PixelType;
91 using FeatureRegionType = typename FeatureImageType::RegionType;
92 using FeatureSizeType = typename FeatureImageType::SizeType;
93 using FeatureSizeValueType = typename FeatureSizeType::SizeValueType;
94 using FeatureSpacingType = typename FeatureImageType::SpacingType;
95 using FeatureIndexType = typename FeatureImageType::IndexType;
96 using FeaturePointType = typename FeatureImageType::PointType;
97
98 using ListPixelType = std::list<unsigned int>;
104 using ListSizeValueType = typename ListSizeType::SizeValueType;
107 using ListIndexValueType = typename ListIndexType::IndexValueType;
110
116 using KdTreePointer = typename TreeType::Pointer;
117
118 using LevelSetDataType = TSingleData;
119 using LevelSetDataPointer = typename LevelSetDataType::Pointer;
120 using LevelSetDataPointerVector = std::vector<LevelSetDataPointer>;
121 using LevelSetDataPointerVectorIterator = typename LevelSetDataPointerVector::iterator;
122
123 void
124 SetFunctionCount(const unsigned int n)
125 {
126 this->m_FunctionCount = n;
127 this->m_LevelSetDataPointerVector.resize(n, nullptr);
128
129 auto it = m_LevelSetDataPointerVector.begin();
130 auto end = m_LevelSetDataPointerVector.end();
131 while (it != end)
132 {
133 (*it) = LevelSetDataType::New();
134 ++it;
135 }
136 }
137
138 void
139 SetNumberOfNeighbors(const unsigned int n)
140 {
141 this->m_NumberOfNeighbors = n;
142 }
143
144 void
145 CreateHeavisideFunctionOfLevelSetImage(const unsigned int j, const InputImageType * image)
146 {
147 m_LevelSetDataPointerVector[j]->CreateHeavisideFunctionOfLevelSetImage(image);
148 }
149
150 void
152 {
153 this->m_KdTree = kdtree;
154 }
155
156 void
158 {
160 this->m_NearestNeighborListImage->CopyInformation(featureImage);
161 this->m_NearestNeighborListImage->SetRegions(featureImage->GetLargestPossibleRegion());
162 this->m_NearestNeighborListImage->Allocate();
163 }
164
165 virtual void
167
169
170 unsigned int m_FunctionCount{};
171 unsigned int m_NumberOfNeighbors{ 6 };
174
175protected:
180};
181} // end namespace itk
182
183#endif
A multi-dimensional iterator templated over image type that walks pixels within a region and is speci...
Templated n-dimensional image class.
Definition itkImage.h:89
Point< PointValueType, VImageDimension > PointType
ImageRegion< VImageDimension > RegionType
Vector< SpacingValueType, VImageDimension > SpacingType
itk::Statistics::ListSample< CentroidVectorType > SampleType
typename LevelSetDataPointerVector::iterator LevelSetDataPointerVectorIterator
~RegionBasedLevelSetFunctionSharedData() override=default
ImageRegionIteratorWithIndex< ListImageType > ListIteratorType
Image< ListPixelType, Self::ImageDimension > ListImageType
itk::Statistics::KdTreeGenerator< SampleType > TreeGeneratorType
void CreateHeavisideFunctionOfLevelSetImage(const unsigned int j, const InputImageType *image)
Implements transparent reference counting.
This class generates a KdTree object without centroid information.
This class is the native implementation of the a Sample with an STL container.
A templated class holding a n-Dimensional vector.
Definition itkVector.h:63
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....