function tda_GetTDAMetrics(Allvolume,Header, MeanOut, StdOut, CVOut)
%-----------------------------------------------------------
%   Written by SUN Jia-Wei 200413.
%   Mail to Authors: jiaweisun0512@163.com


[mpath, mname] = fileparts(MeanOut);
[spath, sname] = fileparts(StdOut);
[cpath, cname] = fileparts(CVOut);
inpath_Misc(mpath,'MakeCurrentDir');
inpath_Misc(spath,'MakeCurrentDir');
inpath_Misc(cpath,'MakeCurrentDir');
rp_WriteNiftiImage(squeeze(mean(Allvolume,4)),Header,MeanOut);
rp_WriteNiftiImage(squeeze(std(Allvolume,0,4)),Header,StdOut);
Temp = squeeze(std(Allvolume,0,4)) ./ squeeze(mean(Allvolume,4));
Temp(find(isnan(Temp)))=0;
rp_WriteNiftiImage(Temp,Header,CVOut);
end