[Insight-users] Creating itkHistogramImageToImageMetric object fails

Bill Lorensen bill.lorensen at gmail.com
Wed Apr 21 15:17:47 EDT 2010


HistogramImageToImageMetric has no New() method. It is an abstract
class. It can only be used as a base class. You need to create one of
its derived classes.
http://public.kitware.com/Insight/Doxygen/html/classitk_1_1HistogramImageToImageMetric.html

Bill

On Wed, Apr 21, 2010 at 10:41 AM, Maarten Beek <beekmaarten at yahoo.com> wrote:
> Why does the following code not compile?
>
> const unsigned int Dimension = 3;
> typedef double ImagePixelType;
> typedef itk::Image<ImagePixelType, Dimension> ImageType;
> typedef itk::HistogramImageToImageMetric<ImageType,ImageType> HistType;
> HistType::Pointer Metric = HistType::New();
>
> error C2440: 'initializing' : cannot convert from 'itk::Object::Pointer' to
> 'itk::SmartPointer<TObjectType>'
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>


More information about the Insight-users mailing list