Add utility wrapped functions to itk.Matrix (and itk.VariableSizeMatrix). And a str function to print them.
This would also ease the manipulation of itk matrices.
instead of having to GetVnlMatrix().set_ to set/get the data. Something like itkmatrix[0][1] = 12 would be helpful as well.
Here I show an example image.GetDirection()
Steps to Reproduce
try:
from urllib.request import urlretrieve
except ImportError:
from urllib import urlretrieve
import os
import itk
# Download data (3D)
file_name = '005_32months_T2_RegT1_Reg2Atlas_ManualBrainMask_Stripped.nrrd'
if not os.path.exists(file_name):
url = 'https://data.kitware.com/api/v1/file/564a5b078d777f7522dbfaa6/download'
urlretrieve(url, file_name)
image = itk.imread(file_name)
print(image.GetDirection())
Expected and actual behavior
Expected that: print(image.GetDirection()) shows the content of the matrix, instead of:
<itkMatrixPython.itkMatrixD33; proxy of <Swig Object of type 'itkMatrixD33 *' at 0x7fb35d6c5c60> >
Add utility wrapped functions to itk.Matrix (and itk.VariableSizeMatrix). And a str function to print them.
This would also ease the manipulation of itk matrices.
instead of having to
GetVnlMatrix().set_to set/get the data. Something likeitkmatrix[0][1] = 12would be helpful as well.Here I show an example
image.GetDirection()Steps to Reproduce
Expected and actual behavior
Expected that:
print(image.GetDirection())shows the content of the matrix, instead of: