Brain tumor classification and segmentation using sparse coding and dictionary learning