The magnet design of a magnet for the functional MRI (fMRI) study of the human motor cortex poses a number of challenges due to the necessity of maintaining the subject in a natural, erect position, with free access to the environment. This paper presents the design of a superconducting magnet derived from a closed quasi-toroidal configuration. Subject access is obtained by deforming a section of the winding in such a way as to optimize the ensuing inhomogeneity and field intensity loss. The geometry of the deformed section and of the correcting structure are derived analytically and turn out to be function of a limited number of parameters. The optimization is readily achieved by a heuristic search in this limited dimensionality space. The final magnet configuration accommodates a sitting individual and produces a field intensity of 1.5 T with a total stored energy of 10 MJ; the magnet consists of planar and specially conformed, non planar coils. The maximum field on the conductor is less than 4.5T, allowing the use of NbTi wire with a current of the order of 400 A.