Convert 3 Dimensional Image To 2 Dimensional Matlab