18#ifndef itkSLICImageFilter_h
19#define itkSLICImageFilter_h
60template <
typename TInputImage,
typename TOutputImage,
typename TDistancePixel =
float>
79 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
107 itkSetMacro(SpatialProximityWeight,
double);
108 itkGetConstMacro(SpatialProximityWeight,
double);
114 itkSetMacro(MaximumNumberOfIterations,
unsigned int);
115 itkGetConstMacro(MaximumNumberOfIterations,
unsigned int);
138 itkSetMacro(InitializationPerturbation,
bool);
139 itkGetMacro(InitializationPerturbation,
bool);
140 itkBooleanMacro(InitializationPerturbation);
150 itkSetMacro(EnforceConnectivity,
bool);
151 itkGetMacro(EnforceConnectivity,
bool);
152 itkBooleanMacro(EnforceConnectivity);
161 itkGetConstMacro(AverageResidual,
double);
207 unsigned int m_MaximumNumberOfIterations{};
208 double m_SpatialProximityWeight{ 10.0 };
211 std::vector<ClusterComponentType> m_Clusters{};
212 std::vector<ClusterComponentType> m_OldClusters{};
219 std::vector<IndexType> & indexStack);
231 std::vector<UpdateClusterMap> m_UpdateClusterPerThread{};
236 bool m_EnforceConnectivity{
true };
238 bool m_InitializationPerturbation{
true };
240 double m_AverageResidual{};
241 std::mutex m_Mutex{};
245#ifndef ITK_MANUAL_INSTANTIATION
246# include "itkSLICImageFilter.hxx"
A templated class holding a point in n-Dimensional image space.
Base class for all data objects in ITK.
Base class for all process objects that output image data.
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
Base class for filters that take an image as input and produce an image as output.
TInputImage InputImageType
Templated n-dimensional image class.
Control indentation during Print() invocation.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Simple Linear Iterative Clustering (SLIC) super-pixel segmentation.
typename InputImageType::PixelType InputPixelType
double ClusterComponentType
void EnlargeOutputRequestedRegion(DataObject *output) override
typename OutputImageType::PixelType OutputPixelType
void SingleThreadedConnectivity()
void ThreadedUpdateClusters(const OutputImageRegionType &updateRegionForThread)
void ThreadedPerturbClusters(SizeValueType clusterIndex)
void BeforeThreadedGenerateData() override
void PrintSelf(std::ostream &os, Indent indent) const override
void AfterThreadedGenerateData() override
void RelabelConnectedRegion(const IndexType &seed, OutputPixelType requiredLabel, OutputPixelType outputLabel, std::vector< IndexType > &indexStack)
std::map< vcl_size_t, UpdateCluster > UpdateClusterMap
void GenerateData() override
TDistancePixel DistanceType
DistanceType Distance(const ClusterType &cluster1, const ClusterType &cluster2)
DistanceType Distance(const ClusterType &cluster, const InputPixelType &_v, const PointType &pt)
typename InputImageType::PointType PointType
void SetSuperGridSize(unsigned int i, unsigned int factor)
~SLICImageFilter() override=default
typename InputImageType::IndexType IndexType
vnl_vector_ref< ClusterComponentType > ClusterType
void SetSuperGridSize(unsigned int factor)
void ThreadedConnectivity(SizeValueType clusterIndex)
void ThreadedUpdateDistanceAndLabel(const OutputImageRegionType &outputRegionForThread)
ImageBaseType::RegionType RegionType
ImageBaseType::IndexType IndexType
ImageBaseType::PointType PointType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
vnl_vector< ClusterComponentType > cluster