[Insight-users] Re: [Insight-users]... Problems in ImageFunction
Luis Ibanez
luis.ibanez@kitware.com
Fri, 18 Oct 2002 11:28:37 -0400
Hi Reinhold,
Yes, there is an include missing, but....
it is arguably that it is up to the user to
include it.
This is Generic Programming issue:
The ImageFunction is templated over an Image type,
However it is up to you to select what this image
type means. As long as your image type respectes
the API of the itk::Image you can use any definition.
If you look closer at the definition of the ImageFunction
class, there is nothing itk::Image specific.... except
for the GetImageDimension helper class that is producing
the error messages. This helper class is required in order
to cover for a deficiency in VC++ and Borland for getting
enum values from template parameters.
The helper class is defined in the itkImageBase.h file
and it is the only link between the itk::ImageFunction
and the itk::Image.
We could get rid of the dependendcy by moving the
GetImageDimension helper class to a basic include
like itkMacro.h... but it may be simpler to follow
your suggestion and include the itkImageBase.h
So,
the include itkImageBase.h has been added
to itkImageFunction.h
Thanks for pointing this out,
Luis
=============================================================
Reinhold Füreder wrote:
>
...snip
> --------
> (Comment for the other points below: I use MSVC 6.0)
> --------
> 2) ImageFunction (itkimagefunction.h):
> May it be that there is one include missing? Because if I include #include
> <itkImageBase.h> in my own file (probably before the include or usage of the
> above class) the following error doesn't pop up:
>
> d:\yann\cvs\insight\code\common\itkimagefunction.h(61) : error C2039:
> 'GetImageDimension' : is not a member of 'itk'
> d:\yann\cvs\insight\code\common\itkimagefunction.h(181) : see
> reference to class template instantiation
> 'itk::ImageFunction<TInputImage,TOutput,TCoordRep>' being compiled
> ... (and so on)
> --------
...snip
>
> Thanks,
> Reinhold
>
> ------------------------------
> University of Exeter
> School of Engineering and Computer Science
> Harrison Building
> North Park Road
> Exeter, EX4 4QF
> UK
>
>