In this paper, we describe a pixel based approach for automated segmentation of tumor components from MR images. Sparse coding with data-adapted dictionaries has been successfully employed in several image recovery and vision problems. Since it is trivial to obtain sparse codes for pixel values, we propose to consider their non-linear similarities to perform kernel sparse coding in a high dimensional feature space. We develop the kernel K-lines clustering procedure for inferring kernel dictionaries and use the kernel sparse codes to determine if a pixel belongs to a tumorous region. By incorporating spatial locality information of the pixels, contiguous tumor regions can be efficiently identified. A low complexity segmentation approach, which allows the user to initialize the tumor region, is also presented. Results show that both of the proposed approaches lead to accurate tumor identification with a low false positive rate, when compared to manual segmentation by an expert.