Rendering Colon Centerline
Input: Colon centerline vertices, in the global coordinate systemOutput: Visible centerline in the 3d projection image for the 3D flythrough view
Procedure:
Obviously, the centerline in the 3d image projection is got by joining the visible centerline points in that part of the image with lines. (glLines)
For this the global coordinates of those points have to be converted to the local screen coordinates. The screen size - 512*512
So x - (0.0,512.0) and y - (0.0,512.0). Also z - (0.0,1.0)
So the first step should be to analyse the connection between the submarine object (camera) and 'itself' ( the object keeping track of the current 3d view). The camera coordinates are in global coordinate system ( in which the centerline vertices are) so the camera and the vertices correspond.
We have to find the corresponding screen coordinates used for rendering the image, when the camera jumps to a certain position. This transformation is the one to be applied to the vertices.
The 3d image is rendered by volume raycasting, and the resulting color values filled in the data structure is mapped as a 2d texture onto the widget.
The idea is :
* For the camera position, map into the data structure storing the centerline points, and find a certain number (?) of points, taking the point closest to the camera position as the median.
* Make these points pass through the same transformation pipeline which the camera position passes through and get the corresponding points in screen coordinates.
* The issue of lines between non-zero z values not being rendered might arise. In that case, either solve that issue or (for now), do further transformations to keep z-value 0 and get only x,y coordinates.
* If (0,512.0), gives problems, possible solution might be to use
glPushmatrix();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0,1.0,0.0,1.0,0.0,-1.0);
--Draw lines--
glMatrixMode(GL_MODELVIEW);
glPopmatrix();
* Another possible issue is the 2d image texture being drawn on the centerline.
Logically, this should give the centerline part for that portion of the image.
0 Comments:
Post a Comment
<< Home