[Insight-users] Help needed in using code from WatershedSegmentation1

SHEN, WEICHENG . WEICHENG . SHEN at saic . com
Fri, 21 Nov 2003 12:40:31 -0500


Greetings,

I have a little test program called cvision (which was created using MS
Visiual Studio 6 with MFC option). Inside that project, I attempt to use the
itk code from example WatershedSegmentation1. Here is what I did. 

1. Test the WatershedSegmentation1 by "rebuilding" it using MS Visual Studio
6. It works fine, and it indicates that the ITK is working appropriately.

2. Inside my project cvision, I copied the code of WatershedSegmentation1
into a function, and modified the appropriate C/C++ compiler and linker
options. 

3. "Rebuild" the cvision project, and the following message occurs when
compiling the line "DiffusionFilterType::Pointer diffusion =
DiffusionFilterType::New();"



========================================================================
Deleting intermediate files and output files for project 'cvision - Win32
Debug'.
--------------------Configuration: cvision - Win32 Debug--------------------
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
cvapp.cpp
c:\projects\insighttoolkit-1.2.0\code\common\itkfinitedifferenceimagefilter.
txx(158) : error C2955: 'list' : use of class template requires template
argument list
        c:\program files\microsoft visual studio\vc98\include\list(415) :
see declaration of 'list'
        c:\projects\insighttoolkit-1.2.0\code\common\itksmartpointer.h(59) :
while compiling class-template member function 'double __thiscall
itk::FiniteDifferenceImageFilter<class itk::Image<class
itk::Vector<float,3>,2>,class itk::Image<class itk
::Vector<float,3>,2> >::ResolveTimeStep(const double *,const bool *,int)'
cvision.cpp
cvisionDlg.cpp
Generating Code...
Error executing cl.exe.

cvision.exe - 1 error(s), 0 warning(s)
=======================================================================

My initial guess is that somehow the compiler is confused the variable list
in "itkfinitedifferenceimagefilter.txx" with the list of C++. Any
suggestions that I shall do to resolve this? Thanks a lot!


Weicheng