ITK icon indicating copy to clipboard operation
ITK copied to clipboard

Calling python itk.meshread on the linked file causes itk to segfault.

Open HastingsGreer opened this issue 1 year ago • 2 comments

Description

Calling python itk.meshread on the linked file causes itk to segfault.

Steps to Reproduce

Download

https://github.com/uncbiag/OAI_analysis_2/blob/oh-no/meshR.vtk

import itk
itk.imread("meshR.vtk")

Actual behavior

>>> itk.meshread("Downloads/meshR.vtk")
zsh: segmentation fault  python
(base) hastings@hastingss-air ~ % /Users/hastings/opt/anaconda3/lib/python3.8/multiprocessing/resource_tracker.py:216:     UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '

Reproducibility

I have reproduced on mac and linux 100%

Versions

I have seen this on itk 5.3.0

Environment

Mac and linux, with the default pip install itk

Additional Information

HastingsGreer avatar Feb 23 '24 21:02 HastingsGreer

Quick and easy reproduction: https://colab.research.google.com/drive/1n1t0525CigneZ--2QTxSsiPsKXQ6LKaP?usp=sharing

(There is no output when it segfaults, the notebook just restarts with an error message)

HastingsGreer avatar Feb 23 '24 21:02 HastingsGreer

The reader is choking on the presence of OFFSETS, which is because VTK changed the format in legacy file format version 5.1:

https://github.com/Kitware/VTK/commit/7f76b9e97b1a05cfe4fcd5f9af58f0d7a385b639

which is currently undocumented:

https://gitlab.kitware.com/vtk/vtk/-/issues/17989

thewtex avatar Mar 11 '24 18:03 thewtex

Also: https://discourse.vtk.org/t/legacy-polydata-file-compatibility/5354/11

thewtex avatar May 13 '24 20:05 thewtex