21 #ifndef otbKMeansAttributesLabelMapFilter_h
22 #define otbKMeansAttributesLabelMapFilter_h
24 #include "itkLabelMapFilter.h"
26 #include "itkListSample.h"
27 #include "itkWeightedCentroidKdTreeGenerator.h"
28 #include "itkKdTreeBasedKmeansEstimator.h"
38 template <
class TInputImage>
44 typedef itk::LabelMapFilter<TInputImage, TInputImage>
Superclass;
63 typedef itk::VariableLengthVector<AttributesValueType>
VectorType;
73 typedef typename TreeGeneratorType::KdTreeType
TreeType;
74 typedef itk::Statistics::KdTreeBasedKmeansEstimator<TreeType>
EstimatorType;
75 typedef itk::Statistics::EuclideanDistanceMetric<VectorType>
DistanceType;
79 itkStaticConstMacro(InputImageDimension,
unsigned int, TInputImage::ImageDimension);
105 itkSetMacro(NumberOfClasses,
unsigned int);
106 itkGetMacro(NumberOfClasses,
unsigned int);
111 return m_LabelMapToSampleListFilter->GetMeasurementFunctor();
116 m_LabelMapToSampleListFilter->SetMeasurementFunctor(functor);
140 #ifndef OTB_MANUAL_INSTANTIATION
Execute a KMeans on the attributes of a itk::LabelMap<otb::AttributesMapLabelObject>
itk::Statistics::KdTreeBasedKmeansEstimator< TreeType > EstimatorType
const CentroidsVectorType & GetCentroids() const
LabelMapToSampleListFilterType::MeasurementFunctorType MeasurementFunctorType
itk::Statistics::WeightedCentroidKdTreeGenerator< ListSampleType > TreeGeneratorType
std::vector< VectorType > CentroidsVectorType
TreeGeneratorType::KdTreeType TreeType
itkGetObjectMacro(InputLabelMap, InputImageType)
itk::SmartPointer< const Self > ConstPointer
DataObjectType::Pointer DataObjectPointerType
itk::Statistics::ListSample< VectorType > ListSampleType
InputImageType::ConstPointer InputImageConstPointer
void operator=(const Self &)=delete
LabelObjectType::AttributesValueType AttributesValueType
void SetMeasurementFunctor(MeasurementFunctorType &functor)
InputImageType::Pointer InputImagePointer
InputImageType::RegionType InputImageRegionType
CentroidsVectorType m_Centroids
itk::Statistics::EuclideanDistanceMetric< VectorType > DistanceType
itk::SmartPointer< Self > Pointer
CentroidsVectorType & GetCentroids()
TInputImage InputImageType
LabelMapToSampleListFilterType::Pointer m_LabelMapToSampleListFilter
otb::LabelMapWithClassLabelToLabeledSampleListFilter< InputImageType, ListSampleType, TrainingListSampleType > LabelMapToSampleListFilterType
itk::VariableLengthVector< AttributesValueType > VectorType
KMeansAttributesLabelMapFilter Self
InputImageType::LabelObjectType LabelObjectType
MeasurementFunctorType & GetMeasurementFunctor()
InputImagePointer m_InputLabelMap
LabelObjectType::ClassLabelType ClassLabelType
itk::FixedArray< ClassLabelType, 1 > ClassLabelVectorType
InputImageType::PixelType InputImagePixelType
itk::LabelMapFilter< TInputImage, TInputImage > Superclass
itk::DataObject DataObjectType
KMeansAttributesLabelMapFilter(const Self &)=delete
~KMeansAttributesLabelMapFilter() override
itk::Statistics::ListSample< ClassLabelVectorType > TrainingListSampleType
unsigned int m_NumberOfClasses
This class converts a LabelObjectMap with some class labeled objects to a SampleList and a TrainingSa...
TMeasurementFunctor MeasurementFunctorType
itk::SmartPointer< Self > Pointer
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.