vtk.js volume picker

Hello, I am faced with the task of adapting VolumePicker for vtk.js from vtk so that it is possible to select a point on the volume that is rendered using VolumeRendering. Please tell me where to start, namely, the following questions are of interest:

  1. The VolumePicker logic for selecting a point is somehow tied to OpenGL shaders.

  2. Have there already been attempts to do this and what difficulties the developers faced.

And also i dont’t understand about t1 and t2 variable in source code. What it is? (Bellow screenshot)
And also i dont’t understand why is this->GlobalTMin constant needed

I have a demo version and it performs almost like what I expected, here is the basic logic:

  1. Get pick point on screen and calculate a ray with origin and normal based on the camera parallel projection;
  2. Get intersect point of the ray and the volume bounding box, this count cound be 0, 1, 2, when it is 1, take the origin as the start and the intersect as the end ;
  3. Set up sample distance and get sample points from the intersect points;
  4. Get the ct value of the sample points, if it meet the demands (in my project it is the bone ct value), return the one you need.
1 Like

hello, can i see the demo please?

Sorry it is not an online project so I can just provide the theory.

I understand, thank you for answering by question