Wrote all the code for setting up the image slice position and location.