Compressed sensing has shown great potential to speed up magnetic resonance imaging (MRI) assuming the image is sparse and compressible in a transform domain. Conventional methods typically use a pre-defined sparsifying transform such as wavelets or finite difference, which sometimes does not lead to a sufficient sparse representation. In this paper, we design a patch-based nonlocal operator (PANO) to model the sparsity between image patches. The linearity of PANO allows us to establish a general formulation to reconstruct magnetic resonance image from undersampled data and provides feasibility to incorporate prior information learnt from guide images. To demonstrate the feasibility and performance of PANO, learning similarities from multi-modal images are presented to significantly improve the reconstructed images over conventional redundant wavelets in terms of visual quality and reconstruction errors.