MATLAB: How to find a medial axis

image processingrotation

i am working on Spect images axial slices, i've got an slice and i have the boundaries of the slice how can i find the medial axis of this slice and rotate the whole stack of slices around this axis? thanks