[Insight-users] Exception when using BSplineInterpolateImageFuntion
庄吓海(Xiahai Zhuang)
arhye at 163.com
Sun Oct 30 09:02:02 EST 2005
insight-users-request at itk.org,
I used the BSPlineItnerpolationImageFuntion for interpolate the image. However, when I setimage, there invoke an exception.
The code is:
typedef itk::Image<double,2> DoubleImage;
itk::CastImageFilter<itk::Image<unsigned short,2>,DoubleImage>::Pointer
cast2double = itk::CastImageFilter<itk::Image<unsigned short,2>,DoubleImage>::New();
m_pInterpolator2D = itk::BSplineInterpolateImageFunction<itk::Image<double,2>,double>::New();
m_pInterpolator2D->SetSplineOrder(3);
cast2double->SetInput(m_pImage2D);// m_pImage is a itk::Image<unsigned short,2> image
m_pInterpolator2D->SetInputImage(cast2double->GetOutput());
-------------------------inside the setInputImage()
template <class TImageType, class TCoordRep, class TCoefficientType>
void
BSplineInterpolateImageFunction<TImageType,TCoordRep,TCoefficientType>
::SetInputImage(const TImageType * inputData)
{
if ( inputData )
{
m_CoefficientFilter->SetInput(inputData);
// the Coefficient Filter requires that the spline order and the input data be set.
// TODO: We need to ensure that this is only run once and only after both input and
// spline order have been set. Should we force an update after the
// splineOrder has been set also?
m_CoefficientFilter->Update();----------------------------------------------Here, invoke a exception
Thanks in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20051030/bea98cf9/attachment.html
More information about the Insight-users
mailing list