Hi, everyone<br>
<br>
&nbsp;&nbsp;&nbsp; I'm trying to use watershed segmetation filter. The input is a 3D volume, which is defined as:<br>
&nbsp;&nbsp;&nbsp; typedef itk::Image&lt; short, 3 &gt;&nbsp;&nbsp; ShortVolumeType;<br>
&nbsp;&nbsp;&nbsp; The expected output is defined as <br>
&nbsp;&nbsp;&nbsp;&nbsp; typedef itk::Image&lt; unsigned char, 3 &gt;&nbsp;&nbsp; UCharVolumeType;<br>
<br>
&nbsp; &nbsp; My operating system is red hat linux and the program is
coded by using g++.&nbsp; The code I'm writing is as follows:<br>
<br>
&nbsp;&nbsp;&nbsp; typedef itk::Functor::ScalarToRGBPixelFunctor&lt;short&gt; ColorMapFunctorType;<br>
&nbsp;&nbsp;&nbsp; typedef itk::UnaryFunctorImageFilter&lt;
ShortVolumeType, RGBVolumeType, ColorMapFunctorType&gt;
CColorMapFilterType;<br>
&nbsp;&nbsp;&nbsp; typedef itk::VectorCastImageFilter&lt;RGBVolumeType, VectorVolumeType&gt; CastFilterType;<br>
&nbsp;&nbsp;&nbsp; typedef
itk::VectorGradientAnisotropicDiffusionImageFilter&lt;VectorVolumeType,
VectorVolumeType&gt;&nbsp; DiffusionFilterType;<br>
&nbsp;&nbsp;&nbsp; typedef itk::VectorGradientMagnitudeImageFilter&lt;VectorVolumeType&gt; GradientMagnitudeFilterType; <br>
&nbsp;&nbsp;&nbsp; typedef itk::WatershedImageFilter&lt;ScalarVolumeType&gt; WatershedFilterType;<br>
&nbsp;&nbsp;&nbsp; typedef itk::Image&lt;unsigned long, 3&gt;&nbsp;&nbsp; LabeledImageType;<br>
&nbsp;&nbsp;&nbsp; typedef itk::CastImageFilter&lt;LabeledImageType, UCharVolumeType&gt; CastImageFilterType;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; CColorMapFilterType::Pointer ccolormapper = CColorMapFilterType::New();<br>
&nbsp;&nbsp;&nbsp; ccolormapper-&gt;SetInput(v);<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; CastFilterType::Pointer caster = CastFilterType::New();<br>
&nbsp;&nbsp;&nbsp; caster-&gt;SetInput(ccolormapper-&gt;GetOutput());<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; DiffusionFilterType::Pointer diffusion = DiffusionFilterType::New();<br>
&nbsp;&nbsp;&nbsp; diffusion-&gt;SetNumberOfIterations( 5 );<br>
&nbsp;&nbsp;&nbsp; diffusion-&gt;SetConductanceParameter( 2.5 );<br>
&nbsp;&nbsp;&nbsp; diffusion-&gt;SetTimeStep(0.1);<br>
&nbsp;&nbsp;&nbsp; diffusion-&gt;SetInput(caster-&gt;GetOutput());<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; GradientMagnitudeFilterType::Pointer gradient = GradientMagnitudeFilterType::New();<br>
&nbsp;&nbsp;&nbsp; gradient-&gt;SetUsePrincipleComponents(false);<br>
&nbsp;&nbsp;&nbsp; gradient-&gt;SetInput(diffusion-&gt;GetOutput());<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; WatershedFilterType::Pointer watershed = WatershedFilterType::New();<br>
&nbsp;&nbsp;&nbsp; watershed-&gt;SetLevel( 0.4 );<br>
&nbsp;&nbsp;&nbsp; watershed-&gt;SetThreshold( 0.5 );<br>
&nbsp;&nbsp;&nbsp; watershed-&gt;SetInput(gradient-&gt;GetOutput());<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; CastImageFilterType::Pointer cast = CastImageFilterType::New();<br>
&nbsp;&nbsp;&nbsp; cast-&gt;SetInput(watershed-&gt;GetOutput());<br>
&nbsp;&nbsp;&nbsp; cast-&gt;Update();<br>
&nbsp;&nbsp;&nbsp; segvolume = cast-&gt;GetOutput();<br>
<br>
&nbsp;&nbsp; When I compiled the program, it's running fine except the
last step: building the executable. Here are the error information:<br>
<br>
&nbsp;&nbsp; Building executable /home/jliu1/illustrative/exampApp...<br>
VtkCanvas.o(.gnu.linkonce.t._ZN3itk20WatershedImageFilterINS_5ImageIfLj3EEEE12GenerateDataEv+0x117):
In function `itk::WatershedImageFilter&lt;itk::Image&lt;float,
(unsigned)3&gt; &gt;::GenerateData()':<br>
/home/krs/src/InsightToolkit-2.2.0/Code/Common/itkDerivativeOperator.txx:48:
undefined reference to `typeinfo for
itk::WatershedMiniPipelineProgressCommand'<br>
VtkCanvas.o(.gnu.linkonce.t._ZN3itk36WatershedMiniPipelineProgressCommandC1Ev+0x19):
In function
`itk::WatershedMiniPipelineProgressCommand::WatershedMiniPipelineProgressCommand[in-charge]()':<br>
/usr/include/c++/3.2.2/bits/stl_vector.h:891: undefined reference to `vtable for itk::WatershedMiniPipelineProgressCommand'<br>
VtkCanvas.o(.gnu.linkonce.t._ZN3itk13ObjectFactoryINS_36WatershedMiniPipelineProgressCommandEE6CreateEv+0x11):
In function
`itk::ObjectFactory&lt;itk::WatershedMiniPipelineProgressCommand&gt;::Create()':<br>
/usr/include/c++/3.2.2/bits/stl_vector.h:967: undefined reference to `typeinfo for itk::WatershedMiniPipelineProgressCommand'<br>
VtkCanvas.o(.gnu.linkonce.t._ZN3itk13ObjectFactoryINS_36WatershedMiniPipelineProgressCommandEE6CreateEv+0x51):
In function
`itk::ObjectFactory&lt;itk::WatershedMiniPipelineProgressCommand&gt;::Create()':<br>
/home/krs/src/InsightToolkit-2.2.0/Code/Common/itkImportImageContainer.txx:64:
undefined reference to `typeinfo for
itk::WatershedMiniPipelineProgressCommand'<br>
collect2: ld returned 1 exit status<br>
gmake[1]: *** [/home/jliu1/illustrative/exampApp] Error 1<br>
gmake: *** [default_target] Error 2<br>
<br>
Can anyone tell me what's the error in my program or cmakelist.txt? Thanks..<br clear="all"><br>-- <br>Sincerly<br>Jianfei Liu<br><br>