<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<BODY bgColor=#eaeaea><FONT size=2><FONT face=宋体><A
href="mailto:insight-users-request@itk.org">insight-users-request@itk.org</A>,
</FONT></FONT>
<DIV>I used the BSPlineItnerpolationImageFuntion for interpolate the image.
However, when I setimage, there invoke an exception.</DIV>
<DIV>The code is:</DIV>
<DIV> </DIV>
<DIV><FONT face=宋体 size=2> typedef itk::Image<double,2>
DoubleImage;
<BR> itk::CastImageFilter<itk::Image<unsigned
short,2>,DoubleImage>::Pointer <BR> cast2double =
itk::CastImageFilter<itk::Image<unsigned
short,2>,DoubleImage>::New();<BR> m_pInterpolator2D =
itk::BSplineInterpolateImageFunction<itk::Image<double,2>,double>::New();<BR> m_pInterpolator2D->SetSplineOrder(3);<BR> cast2double->SetInput(m_pImage2D);//
m_pImage is a itk::Image<unsigned short,2>
image<BR> m_pInterpolator2D->SetInputImage(cast2double->GetOutput());</FONT></DIV>
<DIV><FONT face=宋体 size=2> -------------------------inside
the setInputImage()</FONT></DIV>
<DIV><FONT face=宋体 size=2> </FONT></DIV>
<DIV>template <class TImageType, class TCoordRep, class
TCoefficientType><BR>void
<BR>BSplineInterpolateImageFunction<TImageType,TCoordRep,TCoefficientType><BR>::SetInputImage(const
TImageType * inputData)<BR>{<BR> if ( inputData )<BR>
{<BR> m_CoefficientFilter->SetInput(inputData);</DIV>
<DIV> // the Coefficient Filter requires that the spline order
and the input data be set.<BR> // TODO: We need to
ensure that this is only run once and only after both input
and<BR> // spline
order have been set. Should we force an update after the <BR>
// splineOrder has been set
also?</DIV>
<DIV>
m_CoefficientFilter->Update();----------------------------------------------Here,
invoke a exception</DIV>
<DIV>
<P><FONT face=宋体 size=2> Thanks in advance</FONT></P></DIV></BODY></HTML>