SimpleITK  
sitkSLICImageFilter.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* http://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 sitkSLICImageFilter_h
19#define sitkSLICImageFilter_h
20
21/*
22 * WARNING: DO NOT EDIT THIS FILE!
23 * THIS FILE IS AUTOMATICALLY GENERATED BY THE SIMPLEITK BUILD PROCESS.
24 * Please look at sitkImageFilterTemplate.h.jinja to make changes.
25 */
26
27#include <memory>
28
29#include "sitkBasicFilters.h"
30#include "sitkImageFilter.h"
32
33namespace itk::simple {
34
61public:
63
66
70
72 using PixelIDTypeList = typelist2::append<BasicPixelIDTypeList, VectorPixelIDTypeList>::type;
73
74
75
76
79 void
80 SetSuperGridSize(std::vector<unsigned int> SuperGridSize )
81 { this->m_SuperGridSize = std::move(SuperGridSize); }
82
84 std::vector<unsigned int>
85 GetSuperGridSize() const { return this->m_SuperGridSize; }
86
87
93 void
94 SetSpatialProximityWeight(double SpatialProximityWeight )
95 { this->m_SpatialProximityWeight = SpatialProximityWeight; }
96
98 double
100
101
106 void
107 SetMaximumNumberOfIterations(uint32_t MaximumNumberOfIterations )
108 { this->m_MaximumNumberOfIterations = MaximumNumberOfIterations; }
109
111 uint32_t
113
114
121 void
122 SetEnforceConnectivity(bool EnforceConnectivity )
123 { this->m_EnforceConnectivity = EnforceConnectivity; }
124
126 void
128 void
132 bool
134
135
141 void
142 SetInitializationPerturbation(bool InitializationPerturbation )
143 { this->m_InitializationPerturbation = InitializationPerturbation; }
144
146 void
148 void
152 bool
154
155
163 double GetAverageResidual()const { return this->m_pfGetAverageResidual(); }
164
166 std::string GetName() const { return std::string("SLICImageFilter"); }
167
169 std::string ToString() const;
170
171
173 Image Execute(const Image &image1);
174
175
176private:
178 using MemberFunctionType = Image (Self::*)(const Image &image1);
179 template <class TImageType> Image ExecuteInternal(const Image &image1);
182
183
184 std::vector<unsigned int> m_SuperGridSize{ std::vector<unsigned int>(3, 50) };
185
187
188 /* Number of iterations to run */
190
192
194
195
196
197 std::function<double()> m_pfGetAverageResidual;
198
199
200 // Holder of process object for active measurements
201 std::unique_ptr<itk::ProcessObject, ProcessObjectDeleter> m_Filter{nullptr};
202
203
204
205};
206
207
217 const Image &image1, std::vector<unsigned int> superGridSize = std::vector<unsigned int>(3, 50), double spatialProximityWeight = 10.0, uint32_t maximumNumberOfIterations = 5u, bool enforceConnectivity = true, bool initializationPerturbation = true
218);
219
221
222}
223#endif
The Image class for SimpleITK.
Definition sitkImage.h:77
void SetSuperGridSize(std::vector< unsigned int > SuperGridSize)
void SetSpatialProximityWeight(double SpatialProximityWeight)
The spatial weight for the distance function. Increasing this value makes the superpixel shape more r...
std::function< double()> m_pfGetAverageResidual
void SetMaximumNumberOfIterations(uint32_t MaximumNumberOfIterations)
Number of iterations to run. Specify the number of iterations to run when optimizing the clusters.
void SetEnforceConnectivity(bool EnforceConnectivity)
Post processing step to enforce superpixel morphology. Enable an additional computation which ensures...
Image ExecuteInternal(const Image &image1)
Image Execute(const Image &image1)
typelist2::append< BasicPixelIDTypeList, VectorPixelIDTypeList >::type PixelIDTypeList
std::unique_ptr< itk::ProcessObject, ProcessObjectDeleter > m_Filter
std::vector< unsigned int > m_SuperGridSize
uint32_t GetMaximumNumberOfIterations() const
static const detail::MemberFunctionFactory< MemberFunctionType > & GetMemberFunctionFactory()
void SetInitializationPerturbation(bool InitializationPerturbation)
Enable perturbation of initial cluster center location. After grid based initialization,...
std::string ToString() const
double GetAverageResidual() const
Get the current average cluster residual. After each iteration the residual is computed as the distan...
std::vector< unsigned int > GetSuperGridSize() const
Image(Self::*)(const Image &image1) MemberFunctionType
A class used to instantiate and generate function object to templated member functions.
Image SLIC(const Image &image1, std::vector< unsigned int > superGridSize=std::vector< unsigned int >(3, 50), double spatialProximityWeight=10.0, uint32_t maximumNumberOfIterations=5u, bool enforceConnectivity=true, bool initializationPerturbation=true)
Simple Linear Iterative Clustering (SLIC) super-pixel segmentation.
#define SITKBasicFilters_EXPORT