The presented method describes how to identify and solve measurement artifacts related to secondary ion mass spectrometry as well as obtain realistic 3D distributions of impurities/dopants in solid state materials.