% WA5: Distortion

% An fieldmap is provided on the course website: fm.mat or (.dat or .txt).
% The units are Siemens convention - while phases are usually represented
% with numbers from 0 to 2pi, Siemens re-scales this to 0 - 4095 to take
% advantage of the full range of 12-bit integer file format.
%
% 1) Load this file into Matlab (or your favorite programming language).
%
% 2) Display (in 3 separate figures, or side-by-side) the fieldmap as-is
% (scaled from 0 to 4095), converted to true phase (0 to 2pi), and
% converted to frequency (for this you need to know the echo times for the
% two images that were used to calculate this phase map:  TE1 = 4.89ms and
% TE2 = 7.35ms).  Include a colorbar with each image.  For the third one,
% subtract the mean out of the image, so what is displayed is a map of
% frequency relative to the mean.  This is the map that will be used for
% the rest of the assignment.
%
% 3) Calculate a voxel displacement map for the following images:
%
%    A) A 64 x 64 EPI image acquired with a total read-out time of 25ms.
%
%    B) A 64 x 64 EPI image acquired with a total read-out time of 50ms.
% 
%    C) A 128 x 128 EPI image acquired with a total read-out time of 100ms.
%       Hint: there are various ways of resampling the frequency map to get
%       a 128 x 128 image. With Matlab's image processing toolbox, the
%       command B = imresize(A,2); will convert a 64 x 64 matrix, A, to a
%       128 x 128 matrix, B.
%
%    D) A 128 x 128 EPI image acquired in 4 shots, with a per-segment
%    read-out time of 25ms.
%
% 4) Which image will be more distorted: the image in 3A) or 3D)?