<!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>&nbsp;</DIV>
<DIV><FONT face=宋体 size=2> typedef itk::Image&lt;double,2&gt; 
DoubleImage;&nbsp;&nbsp; 
<BR>&nbsp;&nbsp;itk::CastImageFilter&lt;itk::Image&lt;unsigned 
short,2&gt;,DoubleImage&gt;::Pointer <BR>&nbsp;&nbsp;&nbsp;cast2double = 
itk::CastImageFilter&lt;itk::Image&lt;unsigned 
short,2&gt;,DoubleImage&gt;::New();<BR>&nbsp;&nbsp;m_pInterpolator2D&nbsp;= 
itk::BSplineInterpolateImageFunction&lt;itk::Image&lt;double,2&gt;,double&gt;::New();<BR>&nbsp;&nbsp;m_pInterpolator2D-&gt;SetSplineOrder(3);<BR>&nbsp;&nbsp;cast2double-&gt;SetInput(m_pImage2D);// 
m_pImage is a itk::Image&lt;unsigned short,2&gt; 
image<BR>&nbsp;&nbsp;m_pInterpolator2D-&gt;SetInputImage(cast2double-&gt;GetOutput());</FONT></DIV>
<DIV><FONT face=宋体 size=2>&nbsp; -------------------------inside 
the&nbsp;setInputImage()</FONT></DIV>
<DIV><FONT face=宋体 size=2>&nbsp; </FONT></DIV>
<DIV>template &lt;class TImageType, class TCoordRep, class 
TCoefficientType&gt;<BR>void 
<BR>BSplineInterpolateImageFunction&lt;TImageType,TCoordRep,TCoefficientType&gt;<BR>::SetInputImage(const 
TImageType * inputData)<BR>{<BR>&nbsp; if ( inputData )<BR>&nbsp;&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;&nbsp; m_CoefficientFilter-&gt;SetInput(inputData);</DIV>
<DIV>&nbsp;&nbsp;&nbsp; // the Coefficient Filter requires that the spline order 
and the input data be set.<BR>&nbsp;&nbsp;&nbsp; // TODO:&nbsp; We need to 
ensure that this is only run once and only after both input 
and<BR>&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; spline 
order have been set. Should we force an update after the <BR>&nbsp;&nbsp;&nbsp; 
//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; splineOrder has been set 
also?</DIV>
<DIV>&nbsp;&nbsp;&nbsp; 
m_CoefficientFilter-&gt;Update();----------------------------------------------Here, 
invoke a exception</DIV>
<DIV>
<P><FONT face=宋体 size=2>&nbsp; Thanks in advance</FONT></P></DIV></BODY></HTML>