Python code to do stats on MRI images