[Insight-users] Creating itkHistogramImageToImageMetric object fails

Maarten Beek beekmaarten at yahoo.com
Wed Apr 21 15:31:12 EDT 2010


Ok that makes sense.
But why do I then see a New() method in the doxygen documentation on the web?




________________________________
From: Bill Lorensen <bill.lorensen at gmail.com>
To: Maarten Beek <beekmaarten at yahoo.com>
Cc: insight-users at itk.org
Sent: Wed, April 21, 2010 3:17:47 PM
Subject: Re: [Insight-users] Creating itkHistogramImageToImageMetric object  fails

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
>
>



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100421/f9d23653/attachment-0001.htm>


More information about the Insight-users mailing list