Skip to content

Commit

Permalink
Pad all planes of a multiplane image
Browse files Browse the repository at this point in the history
  • Loading branch information
petercorke committed Mar 10, 2013
1 parent f33aeef commit 69dfc48
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ipad.m
Expand Up @@ -46,6 +46,20 @@
val = NaN;
end

if ndims(in) > 2
% multiplane case
d = size(in);
nimages = prod(d(3:end));
out = [];
for i=1:nimages
out(:,:,i) = ipad(in(:,:,i), sides, n, val);
end

d2 = size(out);
out = reshape(out, [d2(1) d2(2) d(3:end)]);
return
end

out = in;
for side=sides
[w,h] = isize(out);
Expand Down

0 comments on commit 69dfc48

Please sign in to comment.