MRI uses a magnetic gradient and radio frequency pulses to take repetitive axial slices of the brain and reconstruct a 3-dimensional representation. Each brain scans 155 slices giving as 155 2D images which represent the 3D brain with each slice constituting of 1mm3 voxel.
An MRI can be defined as a function I(i, j) in 2D space or I(i, j, k) in 3D space, where i, j, k denote spatial coordinates. The values of the functions are intensity values and are typically represented by a grey value between 0 and 255. Every image consists of a finite set of image elements called pixels in 2D space or voxels in 3D space. Each image element is uniquely specified by its intensity value and its coordinates (i, j) for pixels and (i, j, k) for voxels, where i is the row number, j is the column number, and k is the slice number in a volumetric stack.