Skip to content

fix bug in itk.GetVnlMatrixFromArray python wrapping#29

Closed
ncullen93 wants to merge 1 commit intoInsightSoftwareConsortium:masterfrom
ncullen93:vnl-bug
Closed

fix bug in itk.GetVnlMatrixFromArray python wrapping#29
ncullen93 wants to merge 1 commit intoInsightSoftwareConsortium:masterfrom
ncullen93:vnl-bug

Conversation

@ncullen93
Copy link

@ncullen93 ncullen93 commented Jul 21, 2017

vnlObject is supposed to be arr.. seems like a copy-paste error.

>>> import itk
>>> import numpy as np
>>> itk.GetVnlMatrixFromArray(np.ones((3,3))) # doesnt work
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-696-efd313fbd347> in <module>()
----> 1 itk.GetVnlMatrixFromArray(np.ones((3,3)))

/Users/ncullen/anaconda/lib/python3.6/site-packages/itkExtras.py in GetVnlMatrixFromArray(arr)
    341     """Get a vnl matrix from a Python array.
    342     """
--> 343     return _GetVnlObjectFromArray(arr, "GetVnlMatrixFromArray")
    344 
    345 def GetVnlMatrixViewFromArray(arr):

/Users/ncullen/anaconda/lib/python3.6/site-packages/itkExtras.py in _GetVnlObjectFromArray(arr, function)
    326     PixelType = _get_itk_pixelid(arr)
    327     templatedFunction = getattr(itk.PyVnl[PixelType], function)
--> 328     return templatedFunction(vnlObject)
    329 
    330 def GetVnlVectorFromArray(arr):

NameError: name 'vnlObject' is not defined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant