Skip to content

Commit c023aba

Browse files
committed
Fixed small but in Code/SOM_WriteNII.m and merged Joe's fix to the central script
1 parent 5c1be9c commit c023aba

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

ConnTool/Code/SOM_WriteNII.m

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,16 @@
4444
return
4545
end
4646

47-
if any(volDIM(1:3)-size(niftiIn.dat(:,:,:,1)))
47+
niiDIM = size(niftiIn.dat(:,:,:,1));
48+
49+
% Needed to add this in case the "template" image was also two-dimensional
50+
% Robert Welsh - 2015-10-29
51+
52+
if length(niiDIM) < length(volDIM)
53+
niiDIM = [niiDIM 1];
54+
end
55+
56+
if any(volDIM(1:3)-niiDIM)
4857
SOM_LOG(sprintf('FATAL ERROR : TemplateImage dimension doesn''t match data dimension to be written\n'));
4958
return
5059
end

0 commit comments

Comments
 (0)