My /vtk file has following structuire:
vtk DataFile Version 4.2
vtk output
ASCII
DATASET POLYDATA
POINTS 109382 float
-37.2217 -29.809 -9.85098 -37.0058 -30.0193 -9.81293 -37.1069 -30.4734 -12.9625
…
-21.5091 5.62117 56.814 -21.0796 5.62067 56.8002
POLYGONS 218728 874912
3 0 1 2
3 3 2 1
…
3 109380 108436 109381
3 109381 108436 108404
POINT_DATA 109382
NORMALS Normals float
0.703098 0.692624 -0.161015 0.702831 0.690654 -0.17037 0.703527 0.699859 -0.123484
…
-0.0314577 -0.209089 -0.97739 -0.0314568 -0.209091 -0.97739
As I understand Polygons creates a contour along the borders of the tumor (using POINTS above or normalized POINTS from last part of file). I need 3d numpy array that was filled by 1 inside this countour and by 0 outside it.