[ITK-users] VNL Functions in Python

Matt McCormick matt.mccormick at kitware.com
Tue Apr 12 11:59:23 EDT 2016


Hi Robert,

> So far, I've used all the functions from numpy when I needed one, as don't
> see the additional effort that I'd need when wrapping.
> However, I have one question about the transpose method from VNL.
> Does this one "really" transpose the matrix, like the " ' " operator from
> matlab , or does it execute a non-conjugate transpose, like the " .' "
> operator in matlab?

There are both transpose() and conjugate_transpose() methods.  See here:

  http://www.vtk.org/vxl/doc/release/core/vnl/html/classvnl__matrix.html


> Another thing, when using VNL, I use the itk.F and itk.UC types. In numpy, I
> use the "normal" float and char types from python. Could this be a future
> source for problems, as the types may not work together?

The itk.F is a "normal" float and itk.UC is "normal" unsigned char.
To make our Python code more literate, we should use itk.ctype.

Instead of

  PixelType = itk.F

use

  PixelType = itk.ctype('float')

Both

  itk.F == itk.ctype('float')

and

  itk.UC == itk.ctype('unsigned char')

return True.

HTH,
Matt


More information about the Insight-users mailing list