The selection a small region within the body is a critical requirement for in vivo NMR spectroscopy. This thesis presents different methods to optimize this selection and avoid contamination with extraneous signals even in presence of static magnetic field inhomogeneities and radiofrequency pulses imperfections.The first method presented allows for correcting single-voxel spectrum.The second reconstruction method for spectroscopic imaging is based on solving a system of linear equations instead of the inverse Fourier transform usually used.This particular modification allows taking into account defects in the local magnetic field.The last method developedallows metabolites quantificationeven when the signal is weak or when themagnetic field defects are large.