This routine decides whether to show a cutout slice or a rendered surface
at pixel i,j. The routine is as follows:
Check whether ac contains a surface near vl (the opacity of ac > 0.5).
If there is a surface at or near vl,
the 3 intersections of the ray from i,j into the volume with
the x,y,z cutout-planes are determined.
-the surface is rendered if the closest intersection is beyond
the crossing of the cutout planes (as seen from the viewplane),
or if the the ray is parallel to any of the planes.
-the value at the intersection is interpolated, classified
and composed if the closest intersection is on this side
of the crossing.
You can optimize this by only calculating the intersection if ijk is closer
to the viewplane than the crossing of the cutout planes.