To convert a const smart pointer to a non const one, you can do:

typedef itk::Image<float, 3> Image3D;
...
Image3D::ConstPointer img = this->GetInput(0);
Image3D::Pointer img2 = const_cast<Image3D*>(img.GetPointer());

On Thu, Nov 10, 2011 at 9:22 PM, Miri Trope <[email protected]> wrote:
> As I mentioned, the casting from mitk->itk->mitk is because the command
> getInput(0) which gets the input image returns a const pointer which I must
> convert to itk in order to get a non-const pointer and manipulate some
> filters on that image.
>
> do you have another way (more direct, without the casting "loop" (const
> pointer to mitk->itk-> non-const pointer to mitk))? would you publish your
> offer ?

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to