Skip to content

Commit e6a0cf1

Browse files
committed
Accepts3DMatrixNow
1 parent 1c63137 commit e6a0cf1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Aux/CleanNIFTI.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,15 @@
7272
if verbose; disp('-Input is a Matrix.'); end;
7373
Y = double(V0);
7474
I0= size(Y,1); T0 = size(Y,2);
75-
elseif isnumeric(V0) && size(V0,1)<=size(V0,2)
75+
elseif isnumeric(V0) && size(V0,1)<=size(V0,2) && size(V0,3)==1
7676
if verbose; disp('-Input is a Matrix.'); end;
7777
error('Check the input, matrix should be in form of IxT, where I=XxYxZ!');
78+
elseif isnumeric(V0) && size(V0,3)>1 && size(V0,4)>1
79+
disp(['-Input is a 4D matrix.'])
80+
X0 = size(V0,1); Y0 = size(V0,2); Z0 = size(V0,3); T0 = size(V0,4);
81+
I0 = prod([X0,Y0,Z0]);
82+
Y = reshape(V0,[I0,T0]); clear V2;
83+
V1 = [];
7884
end
7985

8086
%Y = double(Y);%to work with int 16bit as well.

0 commit comments

Comments
 (0)