diff --git a/swe.m b/swe.m index 33b504a..8d09838 100644 --- a/swe.m +++ b/swe.m @@ -11,7 +11,7 @@ % Written by Bryan Guillaume % $Id$ -versionNo = '1.2.11'; +versionNo = '2.0.0'; try Modality = spm_get_defaults('modality'); @@ -59,11 +59,9 @@ %================================================================== case 'asciiwelcome' %-ASCII swe banner welcome %================================================================== - disp( ' ___ ___ _ ___ _ _ '); - disp( ' / __) _ _ | __) _ _ /_| (__ \ /_|/_| '); - disp( ' \__ \ \\/\// | __) \\// || _ / __/ _ || || '); - disp( ' (___/ \/\/ |___) \/ |||_| \___)|_| || || '); - fprintf('\n swe v%s \n', versionNo); + a = generateAscii(['SwE v' versionNo]); + fprintf('%s \n', a{1}, a{2}, a{3}, a{4}); + fprintf('swe v%s \n', versionNo); case 'colour' @@ -82,6 +80,8 @@ return +end + %======================================================================= % SUBFUNCTIONS %======================================================================= @@ -109,4 +109,147 @@ ok = 0; end -return \ No newline at end of file +return + +end + +% The following functions are for generating the ascii welcome message for +% SwE. +% ------------------------------------------------------------------------- +% This method converts character 'char' to it's equivalent 4-line ascii +% art. New characters can be added by creating new cases in the below +% switch. +function aChar = char2ascii(char) + + switch char + + case '0' + + aChar = {' ___ ',... + '| |',... + '| | |',... + '|___|'}; + + case '1' + + aChar = {' _ ',... + '/_|',... + ' ||',... + ' ||'}; + + case '2' + + aChar = {' ___ ',... + '(__ \',... + '/ __/',... + '\___)'}; + + case '3' + + aChar = {' ___ ',... + '(__ )',... + ' (_ \',... + '(___/'}; + case '4' + + aChar = {' __ ',... + ' /. |',... + '(_ _)',... + ' (_) '}; + case '5' + + aChar = {' ___ ',... + '| __)',... + '|__ \',... + '(___/'}; + + case '6' + + aChar = {' _ ',... + ' / ) ',... + '/ _ \',... + '\___/'}; + case '7' + + aChar = {' ___ ',... + '(__ )',... + ' / / ',... + '(_/ '}; + case '8' + + aChar = {' ___ ',... + '| _ |',... + '| _ |',... + '|___| '}; + case '9' + + aChar = {' ___ ',... + '/ _ \',... + '\_ /',... + ' (_/ '}; + + case '.' + + aChar = {' ',... + ' ',... + ' _ ',... + '|_|'}; + + case 'S' + + aChar = {' ___ ',... + '/ __)',... + '\__ \',... + '(___/'}; + + case 'w' + + aChar = {' ',... + '_ _',... + '\\/\//',... + ' \/\/ '}; + + case 'E' + + aChar = {' ___ ',... + '| __)',... + '| __)',... + '|___)'}; + + case ' ' + + aChar = {' ',... + ' ',... + ' ',... + ' '}; + + case 'v' + + aChar = {' ',... + '_ _ ',... + '\\// ',... + ' \/ '}; + + + end + +end + +% This function takes two cell arrays containing ascii art in the form +% {line1, line2, line3,...} and concatenates them horizontally. +function c = concatAscii(a,b) + + c = arrayfun(@(i) [a{i} b{i}], 1:length(b),'UniformOutput',false); +end + +% This function takes in a string as input and recursively generates the +% ASCII art representation of said string. +function ascii = generateAscii(str) + + if length(str)~=1 + ascii = concatAscii(generateAscii(str(1:(end-1))), generateAscii(str(end))); + else + ascii = char2ascii(str); + end + +end \ No newline at end of file diff --git a/swe_getSPM.m b/swe_getSPM.m index 98e219a..2ffddea 100644 --- a/swe_getSPM.m +++ b/swe_getSPM.m @@ -711,6 +711,19 @@ %-------------------------------------------------------------------------- if STAT ~= 'P' + % Get the equivalent statistic + switch STAT + + case 'T' + + eSTAT = 'Z'; + + case 'F' + + eSTAT = 'X'; + + end + % If we are doing voxelwise inference on a parametric. if ~isfield(SwE, 'WB') && infType == 0 @@ -748,7 +761,7 @@ try u = xSwE.u; catch - u = spm_input(['threshold {',STAT,' or p value}'],'+0','r',0.001,1); + u = spm_input(['threshold {',eSTAT,' or p value}'],'+0','r',0.001,1); end if u <= 1 thresDesc = ['p<' num2str(u) ' (unc.)']; @@ -800,7 +813,7 @@ try u = xSwE.u; catch - u = spm_input(['threshold {',STAT,' or p value}'],'+1','r',0.001,1); + u = spm_input(['threshold {',eSTAT,' or p value}'],'+1','r',0.001,1); end if u <= 1 thresDesc = ['p<' num2str(u) ' (unc.)']; @@ -900,7 +913,7 @@ try u = xSwE.u; catch - u = spm_input(['threshold {',STAT,' or p value}'],'+0','r',0.001,1); + u = spm_input(['threshold {',eSTAT,' or p value}'],'+0','r',0.001,1); end if u <= 1 thresDesc = ['p<' num2str(u) ' (unc.)']; @@ -989,7 +1002,7 @@ try u = xSwE.u; catch - u = spm_input(['threshold {',STAT,' or p value}'],'+1','r',0.001,1); + u = spm_input(['threshold {',eSTAT,' or p value}'],'+1','r',0.001,1); end if u <= 1 thresDesc = ['p<' num2str(u) ' (unc.)'];