c++ - instantiating ImageToPathFilter in ITK -
i trying use imagetopathfilter in itk not able instantiate using normal classname::pointer = classname::new();
routine.
this code
typedef itk::image<unsigned int, 3> labelimagetype; typedef itk::chaincodepath<2> pathtype; typedef itk::imagetopathfilter<labelimagetype, pathtype> imagetopathtype; imagetopathtype::pointer filter = imagetopathtype::new();
that last line causing following error
cannot convert 'itk::smartpointer<itk::pathsource<toutputpath>>' 'itk::smartpointer<itk::imagetopathfilter<labelimagetype,pathtype>>'
this class advertised filter inherits pathsource using pathsource<pathtype>
instead of imagetopathfilter
works cannot use setinput()
itk filter.
i think solution might involve casting wizardry ignorant in department.
thank you
it turns out itk::imagetopathfilter
class base class not meant instantiated.
itk classes use smart pointers have itknewmacro
in definition, class doesn't, calling new()
on class end calling parent's new() itk::pathsource
. explains error message.
Comments
Post a Comment