Skip to content
Snippets Groups Projects
Commit 24c338a6 authored by Julien Michel's avatar Julien Michel
Browse files

ENH: Giving access to parameter accessor so as to be able to pass some accessor parameters

parent febb7105
No related branches found
No related tags found
No related merge requests found
......@@ -94,6 +94,17 @@ public:
itkSetMacro( ReverseOrdering, bool );
itkBooleanMacro( ReverseOrdering );
AttributeAccessorType & GetAccessor()
{
return m_Accessor;
}
void SetAccessor(const AttributeAccessorType& accessor)
{
m_Accessor = accessor;
this->Modified();
}
protected:
AttributeOpeningLabelMapFilter();
~AttributeOpeningLabelMapFilter() {};
......@@ -108,6 +119,7 @@ private:
AttributeValueType m_Lambda;
bool m_ReverseOrdering;
AttributeAccessorType m_Accessor;
} ; // end of class
......
......@@ -42,8 +42,6 @@ AttributeOpeningLabelMapFilter<TImage, TAttributeAccessor>
ImageType * output = this->GetOutput();
AttributeAccessorType accessor;
const typename ImageType::LabelObjectContainerType & labelObjectContainer = output->GetLabelObjectContainer();
ProgressReporter progress( this, 0, labelObjectContainer.size() );
......@@ -55,8 +53,8 @@ AttributeOpeningLabelMapFilter<TImage, TAttributeAccessor>
typename LabelObjectType::LabelType label = it->first;
LabelObjectType * labelObject = it->second;
if( ( !m_ReverseOrdering && accessor( labelObject ) < m_Lambda )
|| ( m_ReverseOrdering && accessor( labelObject ) > m_Lambda ) )
if( ( !m_ReverseOrdering && m_Accessor( labelObject ) < m_Lambda )
|| ( m_ReverseOrdering && m_Accessor( labelObject ) > m_Lambda ) )
{
// must increment the iterator before removing the object to avoid invalidating the iterator
it++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment