[ITK] [ITK-users] ITK with Python Wrap: print itkMatrix proxy object

Matt McCormick matt.mccormick at kitware.com
Mon Sep 12 17:07:46 EDT 2016


Hallo Fabio,

To print elements of the matrix, for example, the first row and the
first column:

  direction = image.GetDirection()
  vnlDirection = direction.GetVnlMatrix()
  print(vnlDirection.get(0, 0)

HTH,
Matt

On Mon, Sep 12, 2016 at 3:19 PM, D'Isidoro  Fabio <fisidoro at ethz.ch> wrote:
> Hallo,
>
>
>
> I am using ITK with Python wrap. I would like to print the direction matrix
> of a 3D image obtained with the command
>
>
>
> image.GetDirection()
>
>
>
> However, what is printed is just
>
>
>
> <itkMatrixPython.itkMatrixD33; proxy of <Swig object of type ‘itkMatrixD33
> *’ at 0x0D3E1470> >
>
>
>
> I understand it’s related to the wrapping, but how can I solve it?
>
>
>
> Thank you,
>
>
>
> Fabio
>
>
> _____________________________________
> 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 Community mailing list