Created Function for reading and sampling 2D/3D image data
closes-#3544