Skip to content

Commit 00a7db8

Browse files
author
papadopo
committed
spm2-fileparts.patch
Fix for Matlab 7.13 (R2011b) The fourth output argument of fileparts (file version) is no longer supported and has been removed. http://www.mathworks.fr/help/techdoc/ref/fileparts.html This had been generating warnings since R2010a. Starting with R2011b it generates actual errors. git-svn-id: https://svn.code.sf.net/p/spm2/code/trunk@42 05888fa5-3f6b-416b-901c-fe7d8d848dd3
1 parent 9bae84b commit 00a7db8

23 files changed

+52
-52
lines changed

spm_applydef_ui.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function spm_applydef(VD,VI)
6060

6161
%_______________________________________________________________________
6262
function out = prepend(in, pre)
63-
[pth,nme,ext,ver] = fileparts(in);
64-
out = fullfile(pth,[pre nme ext ver]);
63+
[pth,nme,ext] = fileparts(in);
64+
out = fullfile(pth,[pre nme ext]);
6565
return;
6666
%_______________________________________________________________________

spm_bias_apply.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
VO.dim(4) = spm_type('float');
3131

3232
if nargout==0,
33-
[pth,nm,xt,vr] = fileparts(deblank(V.fname));
34-
VO.fname = fullfile(pth,['m' nm xt vr]);
35-
%VO.fname = ['m' nm xt vr];
33+
[pth,nm,xt] = fileparts(deblank(V.fname));
34+
VO.fname = fullfile(pth,['m' nm xt]);
35+
%VO.fname = ['m' nm xt];
3636
VO.pinfo = [1 0 0]';
3737
VO = spm_create_vol(VO);
3838
else,

spm_bias_estimate.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@
6868
T = (Alpha + IC0)\(Alpha*T - Beta);
6969
T = reshape([0 ; T],nbas);
7070

71-
[pth,nm,xt,vr] = fileparts(deblank(V.fname));
72-
S = fullfile(pth,['bias_' nm '.mat']);
73-
%S = ['bias_' nm '.mat'];
71+
[pth,nm,xt] = fileparts(deblank(V.fname));
72+
S = fullfile(pth,['bias_' nm '.mat']);
73+
%S = ['bias_' nm '.mat'];
7474
save(S,'V','T','h');
7575
fprintf('%g %g\n', ll, lp);
7676

spm_bias_ui.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ function bias_ui(flags)
8585
for i=1:size(PP,1),
8686
spm('FigName',['Flatten: working on scan ' num2str(i)],Finter,CmdLine);
8787
drawnow;
88-
P = deblank(PP(i,:));
89-
T = spm_bias_estimate(P,flags);
90-
[pth,nm,xt,vr] = fileparts(P);
91-
S = fullfile(pth,['bias_' nm '.mat']);
92-
%S = ['bias_' nm '.mat'];
88+
P = deblank(PP(i,:));
89+
T = spm_bias_estimate(P,flags);
90+
[pth,nm,xt] = fileparts(P);
91+
S = fullfile(pth,['bias_' nm '.mat']);
92+
%S = ['bias_' nm '.mat'];
9393
spm_bias_apply(P,S);
9494
end;
9595
if 0,

spm_mask.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ function spm_mask(P1,P2, thresh)
4848
% Create headers
4949
VO=V2;
5050
for i=1:m2,
51-
[pth,nm,xt,vr] = fileparts(deblank(VO(i).fname));
52-
%VO(i).fname = fullfile(pth,['m' nm xt vr]);
51+
[pth,nm,xt] = fileparts(deblank(VO(i).fname));
52+
%VO(i).fname = fullfile(pth,['m' nm xt]);
5353
VO(i).fname = ['m' nm '.img'];
5454
VO(i).descrip = 'Masked';
5555
VO(i).mat = VO(1).mat;

spm_normalise.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@
124124
if ischar(VG), VG = spm_vol(VG); end;
125125
if nargin<3,
126126
if nargout==0,
127-
[pth,nm,xt,vr] = fileparts(deblank(VF(1).fname));
128-
matname = fullfile(pth,[nm '_sn.mat']);
127+
[pth,nm,xt] = fileparts(deblank(VF(1).fname));
128+
matname = fullfile(pth,[nm '_sn.mat']);
129129
else,
130130
matname = '';
131131
end;

spm_orthviews.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1167,7 +1167,7 @@ function redraw(arg1)
11671167
addpath(pluginpath);
11681168
% fprintf('spm_orthviews: Using Plugins in %s\n', pluginpath);
11691169
for k = 1:length(pluginfiles)
1170-
[p pluginname e v] = fileparts(pluginfiles(k).name);
1170+
[p pluginname e] = fileparts(pluginfiles(k).name);
11711171
st.plugins{k} = strrep(pluginname, 'spm_ov_','');
11721172
% fprintf('%s\n',st.plugins{k});
11731173
end;

spm_orthviews/spm_ov_roi.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@
229229
roifname = [];
230230
else
231231
imfname = spm_get(1, '*.img', 'Select image defining ROI space');
232-
[p n e v] = fileparts(imfname);
233-
roifname = fullfile(p,['roitool' e v]);
232+
[p n e] = fileparts(imfname);
233+
roifname = fullfile(p,['roitool' e]);
234234
roifname = spm_input('ROI filename','!+1','s',roifname);
235235
end;
236236
spm_figure('Clear', Finter);

spm_realign.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ function save_parameters(V)
493493

494494
%_______________________________________________________________________
495495
function PO = prepend(PI,pre)
496-
[pth,nm,xt,vr] = fileparts(deblank(PI));
497-
PO = fullfile(pth,[pre nm xt vr]);
496+
[pth,nm,xt] = fileparts(deblank(PI));
497+
PO = fullfile(pth,[pre nm xt]);
498498
return;
499499
%_______________________________________________________________________

spm_realign_ui.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ function run_ui(defs, modality, unwarp)
540540
end
541541
ds = spm_uw_estimate(P{i}{j},uwe_flags);
542542
ads(j) = ds;
543-
[path,name,ext,ver] = fileparts(P{i}{j}(1,:));
543+
[path,name,ext] = fileparts(P{i}{j}(1,:));
544544
pefile = fullfile(path,[name '_uw.mat']);
545545
save(pefile,'ds');
546546
end

0 commit comments

Comments
 (0)