To a reaction-diffusion medium with an inhomogeneous anisotropic diffusion tensor D, we add a fourth spatial dimension such that the determinant of the diffusion tensor is constant in four dimensions. We propose a generalized minimal principle for rotor filaments, stating that the scroll wave filament strives to minimize its surface area in the higher-dimensional space. As a consequence, stationary scroll wave filaments in the original 3D medium are geodesic curves with respect to the metric tensor G ¼ detðDÞD −1 . The theory is confirmed by numerical simulations for positive and negative filament tension and a model with a non-stationary spiral core. We conclude that filaments in cardiac tissue with positive tension preferentially reside or anchor in regions where cardiac cells are less interconnected, such as portions of the cardiac wall with a large number of cleavage planes.