[Insight-users] casting of smart pointers

Karthik Krishnan karthik.krishnan at kitware.com
Wed Nov 11 08:06:20 EST 2009


SplineInterpType *subclassRawPointer = dynamic_cast<SplineInterpType
*>(interpolator.GetPointer());
subclass->SetSplineOrder(3);

SplineInterpType::Pointer subclassSmartPointer = subclass;


On Wed, Nov 11, 2009 at 6:12 AM, Lodron, Gerald
<Gerald.Lodron at joanneum.at>wrote:

> Hello,
>
> Can anybody tell me what the conventional way is to cast a smartpointer?
>
> typedef typename itk::InterpolateImageFunction<ImageType,double>
> InterpType;
> typedef typename itk::BSplineInterpolateImageFunction<ImageType, double,
> double> SplineInterpType;
>
>
> InterpType::Pointer interpolator;
>
> interpolator = SplineInterpType::New();
> dynamic_cast<SplineInterpType::Pointer>(interpolator)->SetSplineOrder(3);
>    //does not work
>
>
> Best regards
>
>
> _____________________________________
> 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/20091111/122ab93f/attachment.htm>


More information about the Insight-users mailing list