The increased availability of ultra-high field scanners provides an opportunity to perform fMRI at sub-millimeter spatial scales and enables in vivo probing of laminar function in the human brain. In most previous studies, the definition of cortical layers, or depths, is based on an anatomical reference image that is collected by a different acquisition sequence and exhibits different geometric distortion compared to the functional images. Here, we propose to generate the anatomical image with the fMRI acquisition technique by incorporating magnetization transfer (MT) weighted imaging. Small flip angle binomial pulse trains are used as MT preparation, with a flexible duration (several to tens of milliseconds), which can be applied before each EPI segment without constraining the acquisition length (segment or slice number). The method's feasibility was demonstrated at 7T for coverage of either a small slab or the near-whole brain at 0.8 mm isotropic resolution. Tissue contrast was found to be similar to that obtained with a state-of-art anatomical reference based on MP2RAGE. This MT-weighted EPI image allows an automatic reconstruction of the cortical surface to support laminar analysis in native fMRI space, obviating the need for distortion correction and registration.