The aim of this study is to investigate and correct for machine- and object-related distortions in magnetic resonance images for use in radiotherapy treatment planning. Patients with brain tumours underwent magnetic resonance imaging (MRI) in the radiotherapy position with the head fixed by a plastic cast in a Perspex localization frame. The imaging experiments were performed on a 1.5 T whole body MRI scanner with 3 mT m-1 maximum gradient capability. Image distortions, caused by static magnetic field inhomogeneity, were studied by varying the direction of the read-out gradient. For purposes of accuracy assessment, external and internal landmarks were indicated. Tubes attached to the cast and in the localization frame served as external landmarks. In the midsagittal plane the brain-sinus sphenoidalis interface, the pituitary gland-sinus sphenoidalis interface, the sphenoid bone and the corpora of the cervical vertebra served as internal landmarks. Landmark displacements as observed in the reversed read-out gradient experiments were analysed with respect to the contributions of machine-related static magnetic field inhomogeneity and susceptibility and chemical shift artifacts. The machine-related static magnetic field inhomogeneity in the midsagittal plane was determined from measurements on a grid phantom. Distortions due to chemical shift effects were estimated for bone marrow containing structures such as the sphenoid bone and the corpora of the cervical vertebra using the values obtained from the literature. Susceptibility-induced magnetic field perturbations are caused by the patient and the localization frame. Magnetic field perturbations were calculated for a typical patient dataset. The midsagittal head image was converted into a susceptibility distribution by segmenting the image into water-equivalent tissues and air; also the Perspex localization frame was included in the susceptibility distribution. Given the susceptibility distribution, the magnetic field was calculated by numerically solving the Maxwell equations for a magnetostatic field. Results were shown as magnetic field perturbations and corresponding spatial distortions of internal and external landmarks. The midsagittal head images were corrected for the machine imperfections (gradient non-linearity and static magnetic field inhomogeneity). The locations of the external landmarks in the frame were also corrected for susceptibility artifacts. The efficacy of the corrections was evaluated for these external landmarks in the localization frame with known geometry. In this study at 1.5 T with read-out gradient strength of 3 mT m-1, machine-related, chemical shift and susceptibility-induced static magnetic held inhomogeneity were of the same order, resulting in spatial distortions between -2 and 2 mm with only negative values for the chemical shift effect. Both the patient and the localization frame proved to perturb the magnetic field. The field perturbations were shown to be additive. In total, static magnetic field inhomogeneity led to spatial distortions ranging from -2 to 4 mm in the direction of the read-out gradient. Non-linearity of the gradients resulted in spatial distortions ranging from -3.5 to 0.5 mm. After correction for the machine imperfections and susceptibility artifacts, the geometric accuracy of the landmarks in the localization frame was better than 1.3 mm.