<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV>Dear All:</DIV>
<DIV> </DIV>
<DIV>I am trying to write some template function. </DIV>
<DIV> </DIV>
<DIV>Here is my function, it just passed ReaderType::Pointer from the main program</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>template <class TInputImage></DIV>
<DIV>void IsotropicResample( TInputImage* inputimage )<BR>{<BR> <BR> const unsigned int Dimension=3;<BR> typedef short OutputPixelType;<BR> typedef itk::Image< OutputPixelType, Dimension > OutputImageType;<BR> <BR> typedef itk::ImageFileWriter< OutputImageType > WriterType;<BR> <BR> WriterType::Pointer writer = WriterType::New();<BR> <BR> writer->SetFileName("../data/test.hdr");<BR> writer->SetInput( inputimage->GetOutput() );<BR> <BR> try<BR> {<BR> writer->Update();<BR> }<BR> catch( itk::ExceptionObject & excep )<BR> {<BR> std::cerr << "Exception caught !" <<
std::endl;<BR> std::cerr << excep << std::endl;<BR> }<BR>;</DIV>
<DIV><BR>};</DIV>
<DIV> </DIV>
<DIV>////// in the main function, we call the function as following</DIV>
<DIV> </DIV>
<DIV>main()</DIV>
<DIV>{</DIV>
<DIV> typedef itk::ImageFileReader< InputImageType > ReaderType;</DIV>
<DIV> ReaderType::Pointer reader = ReaderType::New();</DIV>
<DIV> IsotropicResample <ReaderType> (reader );</DIV>
<DIV>}</DIV>
<DIV> </DIV>
<DIV>When I run the program through command line, everything is ok, I got the test.hdr as output.</DIV>
<DIV> </DIV>
<DIV>But when I debug program, the program catch error and goes to the catch branch.</DIV>
<DIV> </DIV>
<DIV>warning RTTI symbol not found,
<DIV>FileReader<itk::Image<short, 3u>, itk::DefaultConvertPixelTraits<short> >'</DIV></DIV>
<DIV> </DIV>
<DIV> try<BR> {<BR> writer->Update();<BR> }<BR> catch( itk::ExceptionObject & excep )<BR> {<BR> std::cerr << "Exception caught !" << std::endl;<BR> std::cerr << excep << std::endl;<BR> }</DIV>
<DIV> </DIV>
<DIV>However, the result is still there?</DIV>
<DIV> </DIV>
<DIV>Can sombody teach me how to solve this problem??<BR></DIV>
<DIV> </DIV>
<DIV>Thanks</DIV>
<DIV> </DIV>
<DIV>Baoyun<BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR>
<DIV style="FONT-SIZE: 13px; FONT-FAMILY: arial, helvetica, sans-serif"> </DIV></DIV></div><br>
</body></html>