Matlab MRI utility functions