# GetDifferenceFunction() declaration

**URL:** https://discourse.itk.org/t/getdifferencefunction-declaration/684
**Category:** Beginner Questions
**Created:** [February 18, 2018, 11:54pm UTC](https://discourse.itk.org/t/getdifferencefunction-declaration/684 "2018-02-18T23:54:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Bartosz](https://discourse.itk.org/letter_avatar_proxy/v4/letter/b/d26b3c/32.png) [@Bartosz](https://discourse.itk.org/u/Bartosz)
#### Post date: [February 18, 2018, 11:54pm UTC](https://discourse.itk.org/t/getdifferencefunction-declaration/684/1 "2018-02-18T23:54:19Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [February 19, 2018, 3:20am UTC](https://discourse.itk.org/t/getdifferencefunction-declaration/684/2 "2018-02-19T03:20:47Z")

</div>

Hi,

This function is defined here:

[https://github.com/InsightSoftwareConsortium/ITK/blob/ba72602b2b23fd1ab80d150e4d8be9f8ea739e63/Modules/Core/FiniteDifference/include/itkFiniteDifferenceImageFilter.h#L173-L182](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](https://github.com/InsightSoftwareConsortium/ITK/blob/ba72602b2b23fd1ab80d150e4d8be9f8ea739e63/Modules/Core/Common/include/itkMacro.h)

HTH,  
Matt

---

<div class="post-metadata">

### Author: ![Bartosz](https://discourse.itk.org/letter_avatar_proxy/v4/letter/b/d26b3c/32.png) [@Bartosz](https://discourse.itk.org/u/Bartosz)
#### Post date: [February 20, 2018, 9:16am UTC](https://discourse.itk.org/t/getdifferencefunction-declaration/684/3 "2018-02-20T09:16:11Z")

</div>

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!
