Hi,
I have a single voxel image in 3 dimensions and when I open it with niftimatlib, the matlab structure has nii.dim = [1, 1] despite the raw header having dim = [3 1 1 1 1 1 1 1].
I probably could fix this myself, but it would take some mucking about to get familiar with the code. If someone else can do it easily, it would be appreciated.
Thanks!
I found the place: in dim.m, lines 31-34:
dat = [double(dat(:)') 1 1];
lim = max([2 find(dat~=1)]);
dat = dat(1:lim);
obj.dim = dat;
Before that point, dat is the correct 'dim', with length = dim(0) from the header. So I don't see the reason to dismiss a dimension just because it has 1 element... I think the above should simply be:
obj.dim = double(dat);
I don't know if this is the same in the c library.