Skip to content

Commit

Permalink
ENH: Add MetaDataObject wrapping with Matrix
Browse files Browse the repository at this point in the history
Needed to convert image to xarray. Dict method on image
fails without these wrappings.
  • Loading branch information
PranjalSahu committed Aug 17, 2022
1 parent 9ed9070 commit 7d6212d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Modules/Core/Common/wrapping/itkMetaDataObject.wrap
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
itk_wrap_include("itkArray.h")
itk_wrap_include("<vector>")
itk_wrap_include("itkMatrix.h")

itk_wrap_class("itk::MetaDataObject" POINTER)
itk_wrap_template("D" "double")
Expand All @@ -17,4 +18,6 @@ itk_wrap_class("itk::MetaDataObject" POINTER)
itk_wrap_template("vectorD" "std::vector< double >")
itk_wrap_template("vectorvectorF" "std::vector< std::vector< float > >")
itk_wrap_template("vectorvectorD" "std::vector< std::vector< double > >")
itk_wrap_template("matrixD33" "itk::Matrix< double, 3, 3 >")
itk_wrap_template("matrixF44" "itk::Matrix< float, 4, 4 >")
itk_end_wrap_class()
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,9 @@
print(md["double"])

# Required for "NRRD_measurement frame"
itk.MetaDataObject[itk.vector[itk.vector[itk.D]]].New()
md1 = itk.MetaDataObject[itk.vector[itk.vector[itk.D]]].New()
print(md1)

# Required for "qto_xyz" metadata
md2 = itk.MetaDataObject[itk.Matrix[itk.F, 4, 4]].New()
print(md2)

0 comments on commit 7d6212d

Please sign in to comment.