-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathrest_ChangeOrigin_Recursive.m
More file actions
executable file
·29 lines (25 loc) · 1.08 KB
/
rest_ChangeOrigin_Recursive.m
File metadata and controls
executable file
·29 lines (25 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function Result=rest_ChangeOrigin_Recursive(ADataDir, ANewOrigin)
%Recursive change ANALYZE 7.5 Format's Origin
%-----------------------------------------------------------
% Copyright(c) 2007~2010
% State Key Laboratory of Cognitive Neuroscience and Learning in Beijing Normal University
% Written by Xiao-Wei Song
% http://resting-fmri.sourceforge.net
%-----------------------------------------------------------
% <a href="Dawnwei.Song@gmail.com">Mail to Author</a>: Xiaowei Song
% Version=1.0;
% Release=20071101;
%Change Self dir first
rest_ChangeOrigin(ADataDir, ANewOrigin);
theFileList = dir(ADataDir);
ImgDirList ={};
for x = 1:size(struct2cell(theFileList),2),
if theFileList(x).isdir && (~ strcmpi(theFileList(x).name,'.')) && (~ strcmpi(theFileList(x).name,'..')),
ImgDirList=[ImgDirList; {theFileList(x).name}];
end
end
Result =ImgDirList;
for x = 1:size(ImgDirList,1),
rest_ChangeOrigin(fullfile(ADataDir,ImgDirList{x}), ANewOrigin);
rest_ChangeOrigin_Recursive(fullfile(ADataDir,ImgDirList{x}), ANewOrigin);
end