GetDifferenceFunction() declaration

Hello,

Where can I find the definition of function:

SetDifferenceFunction()
and`
GetDifferenceFunction()

they appear in:
…/ITK/Modules/Core/FiniteDifference/include/itkFiniteDifferenceImageFilter.hxx
at line 39

this->SetDifferenceFunction( static_cast< FiniteDifferenceFunctionType * >( cffp.GetPointer() ) );
and 138
RadiusType radius = this->GetDifferenceFunction()->GetRadius();

I assume they come from multilevel inheritance, but I can’t find the actual definition or even declaration of those functions except of:

…/ITK/Modules/Nonunit/Review/include/itkMultiphaseFiniteDifferenceImageFilter.h
but how they are derived?

Thanks for any help in understanding the source code.

Hi,

This function is defined here:

https://github.com/InsightSoftwareConsortium/ITK/blob/ba72602b2b23fd1ab80d150e4d8be9f8ea739e63/Modules/Core/FiniteDifference/include/itkFiniteDifferenceImageFilter.h#L173-L182

with macros from itkMacro.h:

https://github.com/InsightSoftwareConsortium/ITK/blob/ba72602b2b23fd1ab80d150e4d8be9f8ea739e63/Modules/Core/Common/include/itkMacro.h

HTH,
Matt

2 Likes

OK so before compilation the itkGetConstReferenceObjectMacro changes:

Blockquote
virtual const typename type::Pointer & Get##name () const
{
return this->m_##name;
}

to

Blockquote
virtual const typename FiniteDifferenceFunctionType::Pointer & GetDifferenceFunction () const
{
return this->m_DifferenceFunction;
}

using the ## macro (token concatenation).

Thank you very much!

2 Likes