In recent years, matrix-assisted laser desorption/ionization (MALDI)-imaging mass spectrometry has become a mature technology, allowing for reproducible high-resolution measurements to localize proteins and smaller molecules. However, despite this impressive technological advance, only a few papers have been published concerned with computational methods for MALDI-imaging data. We address this issue proposing a new procedure for spatial segmentation of MALDI-imaging data sets. This procedure clusters all spectra into different groups based on their similarity. This partition is represented by a segmentation map, which helps to understand the spatial structure of the sample. The core of our segmentation procedure is the edge-preserving denoising of images corresponding to specific masses that reduces pixel-to-pixel variability and improves the segmentation map significantly. Moreover, before applying denoising, we reduce the data set selecting peaks appearing in at least 1% of spectra. High dimensional discriminant clustering completes the procedure. We analyzed two data sets using the proposed pipeline. First, for a rat brain coronal section the calculated segmentation maps highlight the anatomical and functional structure of the brain. Second, a section of a neuroendocrine tumor invading the small intestine was interpreted where the tumor area was discriminated and functionally similar regions were indicated.