A computed tomography (CT)-based image processing computer program was developed for three-dimensional (3D) femoral endosteal cavity shape modelling. For the examinations 50 cadaver femora were used. In the CT imaging 30 axial slices were taken above and below the lesser trochanter area from each femur. Different image analysis methods were used for femoral cavity detection depending on the structure of the processed slice. In the femoral shaft area simple thresholding methods succeeded, but in the problem areas of the metaphyseal femur edge, detection operators and local thresholding were required. In contour tracking several criteria were used to check the validity of the border pixels. The results were saved as four output data files: (i) a file for the longest anteroposterior (ap), mediolateral (ml) and oblique diameters computed by a Euclidian method, (ii) and (iii) files for 2D and 3D data respectively, and (iv) a file for centre points of each slice. Finally, testing of the results and dimensions obtained from the image analysis were carried out manually by sawing the femora into 10 stipulated horizontal slices. The ap and ml dimensions were measured with a caliper ruler. The CT-based image processing yielded a peak distribution of dimensions with a negative difference to those obtained in manual measurements. The mean difference between the image processing and the manual measurements was 1.1 mm (+/-0.7 mm, +/-1 SD). The difference was highest in the proximal slices of the femora of group I (with lowest cortical thickness), i.e. 1.3 mm (+/-0.8 mm) and lowest in the distal slices of the femora from group III (with highest cortical thickness), i.e. 0.9 mm (+/-0.6 mm). The results are acceptable for further use of the program to study endosteal anatomy for individual femoral component selection and designing basis.