Of major concern in fully automated computerized treatment delivery is the possibility of gantry/couch or gantry/patient collisions. In this work, software has been developed to detect collisions between gantry and couch or patient for both transaxial and noncoplanar treatment fields during the treatment planning process. The code uses the gantry angles, turntable angles, and position of the couch surface relative to the isocenter supplied by the planner for the prescribed radiation fields. In addition, the maximum patient anterior-posterior and lateral separations are entered in order to model the patient outline by a conservative cylindrical ellipse. By accessing a database containing the precise mechanical dimensions of the therapy equipment, 3D analytical geometry is used to test for collisions between gantry/patient and gantry/couch for each treatment field. When collisions are detected, the software inspects the use of an extended distance treatment, by recalculating and testing for collisions, with the couch at a greater distance from the collimator along the direction of the central axis. If a collision is avoided at extended distance, the lateral, longitudinal, and vertical motions of the couch are recorded for entry into the treatment plan, or else a warning message is printed, together with the nearest permissible collision-free gantry angle. Upon inspection, the planner can either elect to use the calculated closest permissible gantry angle or reject the plan. The software verifies that each proposed treatment field is safe, but also that the transition between fields is collision-free. This requires that the sequence of the treatment fields be ordered, preferably into a sequence which minimizes the delivery time compatible with patient safety. A separate program, referred to as a segment manager, has been developed to optimize the sequence of the treatment planner's radiation fields. When collisions are possible on the transition between treatment fields, intermediate couch positions are inserted into the treatment delivery procedure to ensure a continual safe distance between both the couch and patient and the moving gantry. Treatment segments are organized according to gantry angle, beginning at 180-degrees, and sequentially stepping clockwise around the patient. The use of extended distance treatment is proposed as a means of increasing the safety zone between the patient and the gantry. As the gantry rotates, one proposal to maximize patient safety would maintain the couch at extended distance. In this case, the couch prescribes a circle around the isocenter, which is maintained at 180-degrees out of phase with the gantry motion.