Mapping between coordinate position (x,y,z) and voxel index

With vtkVolumePicker, you can get the pick in the actor’s local coordinates (i.e. mapper coordinates) with these methods:

picker.GetMapperPosition()
picker.GetMapperNormal()

Or, if you have the transform that you applied to the volume, you can apply the inverse to the pick position:

point = transform.GetInverse().TransformPoint(point)
normal = transform.GetInverse().TransformNormal(normal)

If you don’t have the transform, then you can create it from the prop matrix of the vtkVolume

transform = vtk.vtkTransform()
transform.Concatenate(volumeActor.GetMatrix())
1 Like