[Insight-users] Strange instantiantion of unused class

Miller, James V (Research) millerjv at crd.ge.com
Thu Sep 15 08:42:27 EDT 2005


Nils, 

This class is a baseclass for binary and grayscale morphology.  There are 
several subclasses of this filter BinaryDilateImageFilter, BinaryErodeImageFilter, 
GrayscaleDilateImageFilter, GrayscaleFunctionDilateImageFilter, GrayscaleErodeImageFilter, 
GrayscaleFunctionErodeImageFilter.  Plus several algorithms use these filters internally, 
things like OpeningByReconstructionImageFilter, GrayscaleMorphologicalOpeningImageFilter, 
and SignedDanielssonDistanceMapImageFilter.

Are you using any of these?

Jim

-----Original Message-----
From: insight-users-bounces+millerjv=crd.ge.com at itk.org
[mailto:insight-users-bounces+millerjv=crd.ge.com at itk.org]On Behalf Of
Nils H. Busch
Sent: Thursday, September 15, 2005 7:15 AM
To: insight-users at itk.org
Subject: [Insight-users] Strange instantiantion of unused class


Hi,

I am encountering a strange error when compiling a custom class (derived from
itk::ImageToImageFilter).
The compiler complains it cannot find a matching function.
The error message is (shortened) something like this:
/usr/local/include/InsightToolkit/BasicFilters/itkMorphologyImageFilter.txx
In member function
  void itk::MorphologyImageFilter<TInputImage,TOutputImage,TKernel::
    GenerateInputRequestedRegion()  [with TInputImage =
  test_main::InternalImageType, TOutputImage = InternalImageType, TKernel =
    itk::BinaryBallStructuringElement<OutputPixelType,2>,
    itk::NeighborhoodAllocator<OutputPixelType > > ]
/usr/local/include/itkPoint.h : 97 instantiated from here
...
itkMorpholgyImageFilter.txx 62 error no matching function for call to
itk:ImageRegion<3>::PadByRadius(const itk::Size<2>);
...

Similar errors follow.

Apparantly, there is a mismatch in the Dimension argument (which explains
why I get this error only when I instantiate my class with Dim = 3.

The strange thing is, I never use the itkMorphologyImageFilter class in my
code. Absolutely nowhere.

I wrote some test programs where I instantiate my custom classes for various
Dim arguments. One only instantiates those classes. Works. A second uses
some member functions. Above error appears. I then stripped the second
test to a single instantiation like in my other test program. The error
persists.

I started from fresh working directories, compared the CMakeLists.txt
files (they link to the same libraries). Nothtinhg helped. Now, I am at a
loss.

How can it happen that a class gets instantiated (and most of all wrongly)
I never reference. Is this class (manually) instantiated in the ITK
library itself ?

I know this is rather obscure, and I don't really expect anyone can make
much of this, but maybe someone else experienced such strange behaviour
and knows how he got rid of it. Or someone can tell me a little more about
template instantiation in ITK and under what circumstances such conflicts
could happen.

I am using ITK v 1.8.1,
gcc 3.3.3,
cmake 1.9

Thanks,

-- 
  Nils H. Busch
_______________________________________________
Insight-users mailing list
Insight-users at itk.org
http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list