-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_shifted_images.m
More file actions
23 lines (19 loc) · 897 Bytes
/
create_shifted_images.m
File metadata and controls
23 lines (19 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function image_series=create_shifted_images(GT,compressing_factor)
if isscalar(GT)
temp=GT;
GT=zeros(GT*compressing_factor+(compressing_factor-1),GT*compressing_factor+(compressing_factor-1));
GT(1:temp*compressing_factor,1:temp*compressing_factor)=phantom("Modified Shepp-Logan",temp*compressing_factor);
else
[rows,cols]=size(GT);
if ~mod(rows-(compressing_factor-1),compressing_factor)==0 || ~mod(cols-(compressing_factor-1),compressing_factor)
error("The image does not have redundancy for shifts. ");
end
end
image_series=cell(compressing_factor,compressing_factor);
small_pixel_number=length(GT)-(compressing_factor-1);
for i=1:compressing_factor
for j=1:compressing_factor
image_series{i,j}=GT(i:i+small_pixel_number-1,j:j+small_pixel_number-1);
end
end
end