Hello there,
I just started to fiddle with itk at the lab. What I was trying to do is to fetch the texture of a nifti image and plug it to a corresponding mesh, interpolating a pixel intensity value as needed. Code looks as follow, and append the adequat texture for each node of the mesh.
texture = np.zeros (len(mesh.vertices))
lin_interpolator = itk.LinearInterpolateImageFunction.New (itkimage)
for i in range(len(mesh.vertices)):
index = itkimage.TransformPhysicalPointToContinuousIndex(mesh.vertices[i])
texture [i] = lin_interpolator.Evaluate (index)
However, the kernel systematically crashes when trying to run the code. did any of you already have such case? I am very much a beginner so it could be a very simple oversight from my part.
As a side note, a simpler version without the interpolator and with GetPixel works well.