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
Copy Markdown

@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

@ncullen93 ncullen93 closed this Jul 23, 2017
hjmjohnson pushed a commit to hjmjohnson/ITK that referenced this pull request Apr 19, 2026
hjmjohnson pushed a commit to hjmjohnson/ITK that referenced this pull request Apr 19, 2026
Add support for PadToSize parameter and different padding methods
hjmjohnson added a commit to hjmjohnson/ITK that referenced this pull request Apr 19, 2026
Delta (4 commits):
  ae7a7d8 (origin/main, origin/HEAD) COMP: Update ITKRemoteModuleBuildTestPackageAction to v5.4.6
  c4a709a COMP: Update minimum Python version to 3.10+
  b4a4713 Merge pull request InsightSoftwareConsortium#29 from blowekamp/gha_itk_6.0b02
  f617f57 ENH: Update CI scripts to ITK v6.0b02

Preparatory step for ingesting ITKSimpleITKFilters as an inline beta module
under Modules/Beta/SimpleITKFilters/.
hjmjohnson pushed a commit to hjmjohnson/ITK that referenced this pull request Apr 19, 2026
hjmjohnson pushed a commit to hjmjohnson/ITK that referenced this pull request Apr 19, 2026
…s_autofix_ci-itk-5.4.0-secret-syntax

ENH: Upgrade CI for ITK 5.4.0
hjmjohnson pushed a commit to hjmjohnson/ITK that referenced this pull request Apr 19, 2026
…k_6.0b02

ENH: Update CI scripts to ITK v6.0b02
hjmjohnson pushed a commit to hjmjohnson/ITK that referenced this pull request Apr 19, 2026
…de_cmake_version_for_ITKv4

COMP: Downgrade cmake_minimum_required for ITKv4 branch.
hjmjohnson added a commit to hjmjohnson/ITK that referenced this pull request Apr 19, 2026
Delta (4 commits):
  ae7a7d8 (origin/main, origin/HEAD) COMP: Update ITKRemoteModuleBuildTestPackageAction to v5.4.6
  c4a709a COMP: Update minimum Python version to 3.10+
  b4a4713 Merge pull request InsightSoftwareConsortium#29 from blowekamp/gha_itk_6.0b02
  f617f57 ENH: Update CI scripts to ITK v6.0b02

Preparatory step for ingesting ITKSimpleITKFilters as an inline beta module
under Modules/Beta/SimpleITKFilters/.
hjmjohnson pushed a commit to hjmjohnson/ITK that referenced this pull request Apr 22, 2026
…ompilerWarnings

COMP: Fix compiler warnings
hjmjohnson pushed a commit to hjmjohnson/ITK that referenced this pull request Apr 22, 2026
…ompilerWarnings

COMP: Fix compiler warnings
hjmjohnson pushed a commit that referenced this pull request Apr 25, 2026
Add support for PadToSize parameter and different padding methods
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