Nonzero exit code on ITK filter

0

I am using an ITK BinaryThinningImageFilter3D. However, the code (where mask is an np.uint8 3D Numpy array filled with 0s and 1s - it is a voxel representation of an arthery)

import itk
output = itk.BinaryThinningImageFilter3D.New(
    itk.GetImageFromArray(mask)
)

gives

Process finished with exit code -1073741819 (0xC0000005)

This answer points towards Python version - I checked it, everything is x64. I am leaning towards some kind of data type incompatibility. Any hints on how to fix?

python
numpy
itk
asked on Stack Overflow Sep 9, 2019 by alex

2 Answers

0

Wrap this in a try...catch block and print the error message. That will tell you what went wrong. Perhaps something like:

try:
  import itk
  output = itk.BinaryThinningImageFilter3D.New(
    itk.GetImageFromArray(mask))
except RuntimeError as e:
  print('Got an exception\n' + str(e))
answered on Stack Overflow Sep 9, 2019 by Dženan
0

I turns out there was a segfault. Issue fixed in new version of the library.

answered on Stack Overflow Nov 25, 2019 by alex

User contributions licensed under CC BY-SA 3.0