From 78d877406cd4dd97abef66991c415dfb5523037c Mon Sep 17 00:00:00 2001 From: Julien Michel <julien.michel@orfeo-toolbox.org> Date: Tue, 29 May 2012 15:52:54 +0200 Subject: [PATCH] ENH: Adding threshold and number of iterations parameters, using macro for accessors --- Code/OBIA/otbMeanShiftSegmentationFilter.h | 28 +++++++++------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/Code/OBIA/otbMeanShiftSegmentationFilter.h b/Code/OBIA/otbMeanShiftSegmentationFilter.h index 3281d97947..636a17a9c7 100644 --- a/Code/OBIA/otbMeanShiftSegmentationFilter.h +++ b/Code/OBIA/otbMeanShiftSegmentationFilter.h @@ -73,28 +73,22 @@ public: /** Sets the spatial bandwidth (or radius in the case of a uniform kernel) * of the neighborhood for each pixel */ - virtual void SetSpatialBandwidth(const RealType _arg) - { - this->m_MeanShiftFilter->SetSpatialBandwidth(_arg); - } - virtual RealType GetSpatialBandwidth () - { - return this->m_MeanShiftFilter->GetSpatialBandwidth(); - } - + otbSetObjectMemberMacro(MeanShiftFilter,SpatialBandwidth,RealType); + otbGetObjectMemberConstReferenceMacro(MeanShiftFilter,SpatialBandwidth,RealType); /** Sets the spectral bandwidth (or radius for a uniform kernel) for pixels * to be included in the same mode */ - virtual void SetRangeBandwidth(const RealType _arg) - { - this->m_MeanShiftFilter->SetRangeBandwidth(_arg); - } - virtual RealType GetRangeBandwidth () - { - return this->m_MeanShiftFilter->GetRangeBandwidth(); - } + otbSetObjectMemberMacro(MeanShiftFilter,RangeBandwidth,RealType); + otbGetObjectMemberConstReferenceMacro(MeanShiftFilter,RangeBandwidth,RealType); + + /** Set the maximum number of iterations */ + otbSetObjectMemberMacro(MeanShiftFilter,MaxIterationNumber,unsigned int); + otbGetObjectMemberConstReferenceMacro(MeanShiftFilter,MaxIterationNumber,unsigned int); + /** Set the convergence threshold */ + otbSetObjectMemberMacro(MeanShiftFilter,Threshold,RealType); + otbGetObjectMemberConstReferenceMacro(MeanShiftFilter,Threshold,RealType); /** Returns the const image of region labels */ const OutputLabelImageType * GetLabelOutput() const; -- GitLab