Completed test.
This should be the alpha version.
This commit is contained in:
parent
4add96e8bb
commit
ad058cb455
@ -52,7 +52,14 @@ classdef BSM<handle
|
|||||||
% obj.calc(n) to calculated the nth SPM.mat file
|
% obj.calc(n) to calculated the nth SPM.mat file
|
||||||
% obj.calc([1 3 6]) to indicate which SPM.mat file to calculate
|
% obj.calc([1 3 6]) to indicate which SPM.mat file to calculate
|
||||||
|
|
||||||
|
%only initialize once. Every subsequent call to this function,
|
||||||
|
%do not reinitialize.
|
||||||
|
persistent InitDone
|
||||||
|
if isempty(InitDone) || not(InitDone)
|
||||||
|
% initialize spm job enviourment
|
||||||
|
spm_jobman('initcfg');
|
||||||
|
InitDone = true;
|
||||||
|
end
|
||||||
SPMidx=[];% will contain the index to the SPMs to work on
|
SPMidx=[];% will contain the index to the SPMs to work on
|
||||||
if logical(numel(varargin))
|
if logical(numel(varargin))
|
||||||
SPMidx=varargin{1};
|
SPMidx=varargin{1};
|
||||||
@ -112,8 +119,7 @@ classdef BSM<handle
|
|||||||
[val,TF]=obj.MyGetVal('Type',varargin);if TF;obj.Type=val;end
|
[val,TF]=obj.MyGetVal('Type',varargin);if TF;obj.Type=val;end
|
||||||
[val,TF]=obj.MyGetVal('Acfl',varargin);if TF;obj.Acfl=val;end
|
[val,TF]=obj.MyGetVal('Acfl',varargin);if TF;obj.Acfl=val;end
|
||||||
end
|
end
|
||||||
% initialize spm job enviourment
|
|
||||||
spm_jobman('initcfg');
|
|
||||||
end
|
end
|
||||||
function val=get.NumSPMs(obj)
|
function val=get.NumSPMs(obj)
|
||||||
val=numel(obj.SPMs);
|
val=numel(obj.SPMs);
|
||||||
@ -259,8 +265,12 @@ classdef BSM<handle
|
|||||||
obj.RunJob(DirTrialList{e});%process SPM
|
obj.RunJob(DirTrialList{e});%process SPM
|
||||||
BetaTrialList{e}=spm_select('ExtFPList',DirTrialList{e},'^beta_0001.*.nii$',1);
|
BetaTrialList{e}=spm_select('ExtFPList',DirTrialList{e},'^beta_0001.*.nii$',1);
|
||||||
end% end loop
|
end% end loop
|
||||||
|
try
|
||||||
obj.PackBetas(BetaTrialList,LocalTargetFolder,CurCol)%pack per event result
|
obj.PackBetas(BetaTrialList,LocalTargetFolder,CurCol)%pack per event result
|
||||||
obj.CleanUp(TargetFolderCurCol);
|
obj.CleanUp(TargetFolderCurCol);
|
||||||
|
catch ME
|
||||||
|
keyboard; %for debuging purpose only
|
||||||
|
end
|
||||||
end % end loop act. col
|
end % end loop act. col
|
||||||
% restore warning status
|
% restore warning status
|
||||||
warning(WarnStat);
|
warning(WarnStat);
|
||||||
@ -269,7 +279,7 @@ classdef BSM<handle
|
|||||||
rethrow(ME);
|
rethrow(ME);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function CleanUp(~,D)
|
function CleanUp(obj,D)
|
||||||
if obj.Clean
|
if obj.Clean
|
||||||
try
|
try
|
||||||
rmdir(D,'s');
|
rmdir(D,'s');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user