[Insight-developers] ITKImageFunction dependecy in Transform

Matt McCormick matt.mccormick at kitware.com
Wed Aug 10 13:28:19 EDT 2011


On Wed, Aug 10, 2011 at 12:25 PM, M Stauffer (V) <mstauff at verizon.net> wrote:
> Thanks Matt, see below...
>
>>> In rebasing the Transform changes patch set onto the latest
>>itk master, I've
>>> got a dependency problem. DeformationFieldTransform
>>> includes itkVectorLinearInterpolateImageFunction.h, which is
>>> in ITKImageFunction. But adding this to
>>Transform/itk-module.cmake causes a
>>> circular dependency. Any suggestions? I don't know how to
>>handle this.
>>
>>That is a difficult problem.  Moving DeformationFieldTransform to
>>ITKImageFunction would probably not be appropriate.  Is it possible to
>>use a C++ forward declaration for
>>VectorLinearInterpolateImageFunction?  I assume that any module
>>depending on ITKTransform is also likely to depend on ITKImageFunction
>>anyway.
>
> OK, a forward declare works. Of course I have to declare the template
> parrameters along with the forward declaration so it's a little messy in
> that it will need changing if the VectorLinearInterpolateImageFunction
> template parameters change. Although if the class template pararmeters
> change, lots of classes will change so I figure that's not a real
> problem. So is forward-declaration like this ok in the ITK style?

Great.

ITK has very strong backwards compatibility, changes to the API like
that will not take place after the ITKv4 release, and changes that
break compatibility during ITKv4 need to have migration documents.
http://www.vtk.org/Wiki/ITK_Release_4/Users_Migration_Guide

Forward declaration is not typical ITK style.  However, if it is
documented with a comment in the code explaining the need to break
circular dependency, it could be OK.

Thanks,
Matt


More information about the Insight-developers mailing list