A medical imaging method includes imaging a target with a hyperspectral imaging system in order to obtain imaging data. There is provided a method in medical imaging. In the method, a target is imaged with a hyperspectral imaging system in order to obtain imaging data. The obtained imaging data is pre-processed by spatial and spectral averaging. A number of endmembers to be determined from the pre-processed imaging data is selected. The endmembers are extracted from the pre-processed imaging data based on vertex component analysis on the pre-processed imaging data and the selected number of endmembers, said endmembers defining an extremity of projections of the pre-processed imaging data in a subspace spanned by the endmembers. At least one abundance map is generated of the selected number of endmembers in the pre-processed imaging data using a filter vector algorithm on the extracted endmembers and the imaging data.