Skip to content
Snippets Groups Projects
Commit d12f8106 authored by Nicola Vigano's avatar Nicola Vigano
Browse files

Added forgotten Upsampling function

parent 63465eac
No related branches found
No related tags found
No related merge requests found
function vol = gtMathsUpsampleVolume(vol, scale)
% FUNCTION vol = gtMathsUpsampleVolume(vol, scale)
if (iscell(vol))
for ii = 1:numel(vol)
vol{ii} = gtMathsUpsampleVolume(vol{ii}, scale);
end
else
vol = upsample(vol, scale);
end
end
function vol = upsample(vol, scale)
vol_in_size = size(vol);
for ii_dim = numel(vol_in_size):-1:1
indx{ii_dim} = 1:vol_in_size(ii_dim);
indx{ii_dim} = indx{ii_dim}(ones(scale, 1), :);
indx{ii_dim} = reshape(indx{ii_dim}, [], 1);
end
vol = vol(indx{:});
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment