% load image set for test
% shapes2 phantom: small motion
%     1: range of shifts 0.25:0.25:2
%     2: range of rotations 0.25:0.25:2
%     3: range of rotations 0.25:0.25:2 plus a constant shift of 2
% shepp-logan phantom: small motion
%     4: range of shifts 0.25:0.25:2
%     5: range of rotations 0.25:0.25:2
%     6: range of rotations 0.25:0.25:2 plus a constant shift of 2
% shapes2 phantom: large motion
%     7: range of shifts 1:12
%     8: range of rotations 1:12
% shepp-logan phantom: large motion
%     9: range of shifts 1:12
%     10: range of rotations 1:12
if set<7, nim=8; 
elseif set<11, nim=5;
end;

if set==1,
  load 'phantoms/shapes2/s2x000y000p000'; im0 = im;
  load 'phantoms/shapes2/s2x025y025p000'; im1 = im;
  load 'phantoms/shapes2/s2x050y050p000'; im2 = im;
  load 'phantoms/shapes2/s2x075y075p000'; im3 = im;
  load 'phantoms/shapes2/s2x100y100p000'; im4 = im;
  load 'phantoms/shapes2/s2x125y125p000'; im5 = im;
  load 'phantoms/shapes2/s2x150y150p000'; im6 = im;
  load 'phantoms/shapes2/s2x175y175p000'; im7 = im;
  load 'phantoms/shapes2/s2x200y200p000'; im8 = im;
  actx = 0.25:0.25:2;   acty = 0.25:0.25:2;  actt = zeros(1,nim);
elseif set==2,
  load 'phantoms/shapes2/s2x000y000p000'; im0 = im;
  load 'phantoms/shapes2/s2x000y000p025'; im1 = im;
  load 'phantoms/shapes2/s2x000y000p050'; im2 = im;
  load 'phantoms/shapes2/s2x000y000p075'; im3 = im;
  load 'phantoms/shapes2/s2x000y000p100'; im4 = im;
  load 'phantoms/shapes2/s2x000y000p125'; im5 = im;
  load 'phantoms/shapes2/s2x000y000p150'; im6 = im;
  load 'phantoms/shapes2/s2x000y000p175'; im7 = im;
  load 'phantoms/shapes2/s2x000y000p200'; im8 = im;
  actx = zeros(1,nim);    acty = zeros(1,nim);   actt = 0.25:0.25:2;
elseif set==3,
  load 'phantoms/shapes2/s2x200y200p000'; im0 = im;
  load 'phantoms/shapes2/s2x000y000p025'; im1 = im;
  load 'phantoms/shapes2/s2x000y000p050'; im2 = im;
  load 'phantoms/shapes2/s2x000y000p075'; im3 = im;
  load 'phantoms/shapes2/s2x000y000p100'; im4 = im;
  load 'phantoms/shapes2/s2x000y000p125'; im5 = im;
  load 'phantoms/shapes2/s2x000y000p150'; im6 = im;
  load 'phantoms/shapes2/s2x000y000p175'; im7 = im;
  load 'phantoms/shapes2/s2x000y000p200'; im8 = im;
  actx = -2*ones(1,nim);    acty = -2*ones(1,nim);   actt = 0.25:0.25:2;
elseif set==4,
  load 'phantoms/shepp/slx000y000p000'; im0 = im;
  load 'phantoms/shepp/slx025y025p000'; im1 = im;
  load 'phantoms/shepp/slx050y050p000'; im2 = im;
  load 'phantoms/shepp/slx075y075p000'; im3 = im;
  load 'phantoms/shepp/slx100y100p000'; im4 = im;
  load 'phantoms/shepp/slx125y125p000'; im5 = im;
  load 'phantoms/shepp/slx150y150p000'; im6 = im;
  load 'phantoms/shepp/slx175y175p000'; im7 = im;
  load 'phantoms/shepp/slx200y200p000'; im8 = im;
  actx = 0.25:0.25:2;   acty = 0.25:0.25:2;  actt = zeros(1,nim);
elseif set==5,
  load 'phantoms/shepp/slx000y000p000'; im0 = im;
  load 'phantoms/shepp/slx000y000p025'; im1 = im;
  load 'phantoms/shepp/slx000y000p050'; im2 = im;
  load 'phantoms/shepp/slx000y000p075'; im3 = im;
  load 'phantoms/shepp/slx000y000p100'; im4 = im;
  load 'phantoms/shepp/slx000y000p125'; im5 = im;
  load 'phantoms/shepp/slx000y000p150'; im6 = im;
  load 'phantoms/shepp/slx000y000p175'; im7 = im;
  load 'phantoms/shepp/slx000y000p200'; im8 = im;
  actx = zeros(1,nim);    acty = zeros(1,nim);   actt = 0.25:0.25:2;
elseif set==6,
  load 'phantoms/shepp/slx200y200p000'; im0 = im;
  load 'phantoms/shepp/slx000y000p025'; im1 = im;
  load 'phantoms/shepp/slx000y000p050'; im2 = im;
  load 'phantoms/shepp/slx000y000p075'; im3 = im;
  load 'phantoms/shepp/slx000y000p100'; im4 = im;
  load 'phantoms/shepp/slx000y000p125'; im5 = im;
  load 'phantoms/shepp/slx000y000p150'; im6 = im;
  load 'phantoms/shepp/slx000y000p175'; im7 = im;
  load 'phantoms/shepp/slx000y000p200'; im8 = im;
  actx = -2*ones(1,nim);    acty = -2*ones(1,nim);   actt = 0.25:0.25:2;
elseif set==7,
  load 'phantoms/shapes2/s2x000y000p000'; im0 = im;
  load 'phantoms/shapes2/s2x100y100p000'; im1 = im;
  load 'phantoms/shapes2/s2x200y200p000'; im2 = im;
  load 'phantoms/shapes2/s2x400y400p000'; im3 = im;
  load 'phantoms/shapes2/s2x800y800p000'; im4 = im;
  load 'phantoms/shapes2/s2x1200y1200p000'; im5 = im;
  actx = [1 2 4 8 12];   acty = [1 2 4 8 12];   actt = zeros(1,nim); 
elseif set==8,
  load 'phantoms/shapes2/s2x000y000p000'; im0 = im;
  load 'phantoms/shapes2/s2x000y000p100'; im1 = im;
  load 'phantoms/shapes2/s2x000y000p200'; im2 = im;
  load 'phantoms/shapes2/s2x000y000p400'; im3 = im;
  load 'phantoms/shapes2/s2x000y000p800'; im4 = im;
  load 'phantoms/shapes2/s2x000y000p1200'; im5 = im;
  actx = zeros(1,nim);    acty = zeros(1,nim);   actt = [1 2 4 8 12];
elseif set==9,
  load 'phantoms/shepp/slx000y000p000'; im0 = im;
  load 'phantoms/shepp/slx100y100p000'; im1 = im;
  load 'phantoms/shepp/slx200y200p000'; im2 = im;
  load 'phantoms/shepp/slx400y400p000'; im3 = im;
  load 'phantoms/shepp/slx800y800p000'; im4 = im;
  load 'phantoms/shepp/slx1200y1200p000'; im5 = im;
  actx = [1 2 4 8 12];   acty = [1 2 4 8 12];   actt = zeros(1,nim); 
elseif set==10,
  load 'phantoms/shepp/slx000y000p000'; im0 = im;
  load 'phantoms/shepp/slx000y000p100'; im1 = im;
  load 'phantoms/shepp/slx000y000p200'; im2 = im;
  load 'phantoms/shepp/slx000y000p400'; im3 = im;
  load 'phantoms/shepp/slx000y000p800'; im4 = im;
  load 'phantoms/shepp/slx000y000p1200'; im5 = im;
  actx = zeros(1,nim);    acty = zeros(1,nim);   actt = [1 2 4 8 12];
end;

% add noise to images & rescale to range [0.0 1.0]
im0 = im0 + normrnd(m,std,s,s); im0 = im0 - min(min(im0)); im0 = im0/max(max(im0));
im1 = im1 + normrnd(m,std,s,s); im1 = im1 - min(min(im1)); im1 = im1/max(max(im1));
im2 = im2 + normrnd(m,std,s,s); im2 = im2 - min(min(im2)); im2 = im2/max(max(im2));
im3 = im3 + normrnd(m,std,s,s); im3 = im3 - min(min(im3)); im3 = im3/max(max(im3));
if nim > 3,
im4 = im4 + normrnd(m,std,s,s); im4 = im4 - min(min(im4)); im4 = im4/max(max(im4));
im5 = im5 + normrnd(m,std,s,s); im5 = im5 - min(min(im5)); im5 = im5/max(max(im5));
end; 
if nim > 5,
im6 = im6 + normrnd(m,std,s,s); im6 = im6 - min(min(im6)); im6 = im6/max(max(im6));
im7 = im7 + normrnd(m,std,s,s); im7 = im7 - min(min(im7)); im7 = im7/max(max(im7));
im8 = im8 + normrnd(m,std,s,s); im8 = im8 - min(min(im8)); im8 = im8/max(max(im8));
end;

% much more convenient to have translated images in single array
Images(:,:,1) = im1; Images(:,:,2) = im2; Images(:,:,3) = im3; 
if nim > 3, Images(:,:,4) = im4; Images(:,:,5) = im5; end;
if nim > 5, Images(:,:,6) = im6; Images(:,:,7) = im7; Images(:,:,8) = im8; end;

clear im1 im2 im3 im4 im5 im6 im7 im8
