A tensor approach for local structure analysis in multi-dimensional images