Over the last decades, scanning magnetic microscopy techniques have been increasingly used in paleomagnetism and rock magnetism. Different from standard paleomagnetic magnetometers, scanning magnetic microscopes produce high-resolution maps of the vertical component of the magnetic induction field on a plane located over the sample. These high-resolution magnetic maps can be used for estimating the magnetization distribution within a rock sample by inversion. Previous studies have estimated the magnetization distribution within rock samples by inverting the magnetic data measured on a plane above the sample. Here we present a new spacial domain method for inverting the magnetic induction measured on four planes around the sample in order to retrieve its internal magnetization distribution. We have presumed that internal magnetization distribution of the sample varies along one of its axes. Our method approximates the sample geometry by an interpretation model composed of a one-dimensional array of juxtaposed rectangular prisms with uniform magnetization. The Cartesian components of the magnetization vector within each rectangular prism are the parameters to be estimated by solving linear inverse problem. Tests with synthetic data show the performance of our method in retrieving complex magnetization distribution even in the presence of magnetization heterogeneities. We have also applied our method to invert experimentally measured magnetic data produced by a highly-magnetized synthetic sample that was manufacturated in laboratory. The results show that, even in the presence of apparent position noise, our method was able to retrieve magnetization distribuition consistent with the anhysteretic remanence magnetization induced in the sample.