The magnetogram inversion technique and some applications