2016-11-28 24 views
0

私はITKを使用しています。 itk::LinearInterpolateImageFunctionitk::InterpolateImageFunctionのサブクラスです。C++抽象型宣言

以下の記述はなぜ無効ですか?

itk::InterpolateImageFunction<ImageType,double>::Pointer interpolator = itk::LinearInterpolateImageFunction<ImageType, double>::New(); 

私が手にエラーがInterpolateImageFunction::PointerのtypedefがSmartPointer<InterpolateImageFunction>

error: conversion from itk::LinearInterpolateImageFunction<itk::Image<unsigned char, 3u>, double>::Pointer {aka itk::SmartPointer<itk::LinearInterpolateImageFunction<itk::Image<unsigned char, 3u>, double> >} to non-scalar type itk::InterpolateImageFunction<itk::Image<unsigned char, 3u>, double>::Pointer {aka itk::SmartPointer<itk::InterpolateImageFunction<itk::Image<unsigned char, 3u>, double> >} requested

答えて

4

です。 std::shared_ptrとは異なり、itk::SmartPointerは、関連するタイプのスマートポインタ間の変換をサポートしていません。つまり、InterpolateImageFunction<X,Y>::PointerLinearInterpolateImageFunction<X,Y>::Pointerは無関係のタイプです。

関連する問題