An optical coherence tomography (OCT) system employing a microelectromechanical system (MEMS) mirror was used to measure the refractive index (RI) of anatomically different regions in acute brain tissue slices, in which viability was maintained. RI was measured in white-matter and grey-matter regions, including the cerebral cortex, putamen, hippocampus, thalamus and corpus callosum. The RI in the corpus callosum was found to be ~4% higher than the RIs in other regions. Changes in RI with tissue deformation were also measured in the cerebral cortex and corpus callosum under uniform compression (20-80% strain). For 80% strain, measured RIs increased nonlinearly by up to 70% and 90% in the cerebral cortex and corpus callosum respectively. Knowledge of RI in heterogeneous tissues can be used to correct distorted optical images caused by RI variations between different regions. Also deformation-dependent changes in RI can be applied to OCT elastography or to mechanical tests based on optical imaging such as indentation tests.