Skip to content
Snippets Groups Projects
Commit cfb9fd66 authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

MRG

parents 9ca940aa 96e3c75a
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