[a6edca]: / HelperFunctions / matlab / reorient / reorientNiiBatch.m

Download this file

13 lines (13 with data), 521 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
function reorientNiiBatch(inNiiDir,outNiiDir)
targetlist = dir(fullfile(inNiiDir,'*_degibb.nii'));
for id = 1:length(targetlist)
target = targetlist(id);
reoriented_path = fullfile(outNiiDir,target.name);
if exist(reoriented_path,'file')
fprintf("%s exist, skippping ...", target.name);
continue
end
target = targetlist(id);
target_path = fullfile(target.folder, target.name);
reorientNii(target_path, outNiiDir);
end