[ITK-users] How to use smart pointer in WrapITK?

Matt McCormick matt.mccormick at kitware.com
Mon Jul 31 10:57:58 EDT 2017


Hi Nick,

Thanks for bringing this up -- you found a bug. The method should be
returning a raw pointer instead of a SmartPointer.

Please review this patch, which will address the issue:

  http://review.source.kitware.com/#/c/22546/

Thanks,
Matt

On Sat, Jul 29, 2017 at 10:58 AM, Nick Cullen via Insight-users
<insight-users at itk.org> wrote:
> I guess my work around for now is to add this function to
> itkN4BiasFieldCorrectionImageFilter.h:
>
>   const BiasFieldControlPointLatticeType*
> GetBiasFieldControlPointLatticeImage() const
>     {
>     return static_cast<const BiasFieldControlPointLatticeType*>(
> this->m_LogBiasFieldControlPointLattice );
>     }
>
>
>
> On Saturday, July 29, 2017 10:35 AM, Nick Cullen via Insight-users
> <insight-users at itk.org> wrote:
>
>
> When I run itk.N4BiasFieldCorrectionImageFilter, I want to get the control
> point lattice, but when I run:
>
> correcter.GetLogBiasFieldControlPointLattice()
>
> It returns a SmartPointer: <Swig Object of type 'itk::SmartPointer<
> itk::Image< itk::Vector< float,1 >,2 > > *' at 0x15e775300>
>
> Can I get the actual image from this in WrapITK? Is this happening because I
> haven't wrapped another class - specifically
> itk::BSplineScatteredDataPointSetToImageFilter, which is where the
> LogBiasFieldControlPointLattice comes from?
>
> Thanks!!
> _____________________________________
> 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.php
>
> 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://public.kitware.com/mailman/listinfo/insight-users
>
>
>
> _____________________________________
> 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.php
>
> 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://public.kitware.com/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list