[Insight-developers] Interpolation support in itk::ImageFunction

Iván Macía imacia at vicomtech.org
Mon Feb 4 04:51:54 EST 2008


Hi,

 

Some time ago I implemented some image functions in a contribution to the
Insight Journal. 

 

HYPERLINK
"http://www.insight-journal.org/InsightJournalManager/view_reviews.php?back=
publications.php%3Fjournalid%3D9%26order%3Drating%26revision_display%3Dcombi
ned&pubid=179"http://www.insight-journal.org/InsightJournalManager/view_revi
ews.php?back=publications.php%3Fjournalid%3D9%26order%3Drating%26revision_di
splay%3Dcombined&pubid=179

 

The code uses nearest neighbour interpolation in the Evaluate() method as
this interpolation mode is trivial to implement.

 

However, in order to use linear interpolation I had to add a flag to my
ImageFunction-derived class and copy some code from
LinearInterpolateImageFunction. What I do is copy the corresponding code
from itk::LinearInterpolateImageFunction and replace the call 

 

this->GetInputImage()->GetPixel( neighIndex )

 

to get the image valur of each neighbour with the call

 

this->EvaluateAtIndex( neighIndex )

 

as the values are not yet calculated inside the ImageFunction.

 

In my opinion such functionality should be in the ImageFunction superclass
itself but I wasn’t able to find any support for this. I wanted to know if
there is any built-in support to do this in ImageFunction and otherwise what
would be the best way to do it (using an enum? a template parameter? reusing
interpolation image functions? ).

 

Thanks in advance

 

Iván Macía

 


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.19.19/1257 - Release Date: 03/02/2008
17:49
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.itk.org/mailman/private/insight-developers/attachments/20080204/e1bf8a1c/attachment.html


More information about the Insight-developers mailing list