In brain magnetic resonance images (brain MRI) analysis, for diagnosing certain brain conditions, it is necessary to quantify the brain tissue, which implies to separate the brain from extracranial or non-brain tissues through a process of isolation known as skull stripping. This is a non-trivial task since different types of tissues may have the same gray level, and during the separation process, some brain tissues could be removed. This paper presents a new solution approach for the skull stripping problem, based on saliency detection using dictionary learning and sparse coding, which can operate over T1 and T2 weighted axial brain MRI. Our method first subdivides the axial MRI into full overlapped patches and runs a dictionary learning over them for obtaining its sparse representation. Then, by analyzing the sparse coding matrix, we compute how many patches a dictionary atom affects to classify them as frequent or rare. Then, we calculate the saliency map of the axial MRI according to the composition of the image patches, i.e. an image patch is considered salient if it is mainly composed of frequent atoms, an atom is frequent whether it affects many patches. The non-salient pixels, corresponding to non-brain tissues, are eliminated from the MRI. Numerical results validate our method