3-D optimization of magnetic field shimming in MRI by convex programming approach