The purpose of this study is to develop automatic algorithms for the segmentation phase of radiotherapy treatment planning. We develop new image processing techniques that are based on solving a partial differential equation for the evolution of the curve that identifies the segmented organ. The velocity function is based on the piecewise Mumford-Shah functional. Our method incorporates information about the target organ into classical segmentation algorithms. This information, which is given in terms of a three-dimensional wire-frame representation of the organ, serves as an initial guess for the segmentation algorithm. We check the performance of the new algorithm on eight data sets of three different organs: rectum, bladder, and kidney. The results of the automatic segmentation were compared with a manual segmentation of each data set by radiation oncology faculty and residents. The quality of the automatic segmentation was measured with the ``kappa-statistics'', and with a count of over and under-segmented frames, and was shown in most cases to be very close to the manual segmentation of the same data. A typical segmentation of an organ with 60 slices takes less than 10 seconds on a Pentium IV laptop.