Skip to content

vedo.file_io.write throws a DeprecationWarning #1292

@IgorTatarnikov

Description

@IgorTatarnikov

Seems GetData and SetCells is deprecated as of vtk 9.6.0. See the traceback below:

  brainglobe_atlasapi/atlas_generation/mesh_utils.py:237: in create_region_mesh
      extract_mesh_from_mask(
  brainglobe_atlasapi/atlas_generation/mesh_utils.py:151: in extract_mesh_from_mask
      write(mesh, str(obj_filepath))
  .tox/py311/lib/python3.11/site-packages/vedo/file_io.py:1354: in write
      for i, f in enumerate(objct.cells):
                            ^^^^^^^^^^^
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  
  cls = <vedo.mesh.Mesh object at 0x7f55b19e6790>
  
      @property
      def cells(cls):
          """
          Get the cells connectivity ids as a numpy array.
      
          The output format is: `[[id0 ... idn], [id0 ... idm],  etc]`.
          """
          try:
              # valid for unstructured grid
              arr1d = utils.vtk2numpy(cls.dataset.GetCells().GetData())
          except AttributeError:
              try:
                  # valid for polydata
  >               arr1d = utils.vtk2numpy(cls.dataset.GetPolys().GetData())
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  E               DeprecationWarning: Call to deprecated method GetData. (Use ExportLegacyFormat, or GetOffsetsArray/GetConnectivityArray instead.) -- Deprecated since version 9.6.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions