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?

alex
  • 10,900
  • 15
  • 70
  • 100

2 Answers2

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))
Dženan
  • 3,329
  • 3
  • 31
  • 44
0

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

alex
  • 10,900
  • 15
  • 70
  • 100