In MATLAB, try something like this:
% files to convert - GUI selection
fnames = cfg_getfile(Inf,'Image');
for k = 1:numel(files)
% split file name parts
[p n e v] = spm_fileparts(fnames{k});
% read volume
V=spm_vol(fnames{k});
dat = spm_read_vols(V);
% change file name
V.fname = fullfile(p, [n '.nii' v]);
% write data
spm_write_vol(V,dat);
end
I'm not sure whether this works for 4D-files, though.
Volkmar
Am Donnerstag, den 16.04.2009, 23:47 -0400 schrieb Adnan Virani:
> SPM Community,
>
> I wanted to convert my img/hdr files to nii format. Could anyone
> recommend a free program that will do this?
>
> Thanks.
>
> --
> Adnan Virani
> [log in to unmask]
--
Volkmar Glauche
-
Department of Neurology [log in to unmask]
Universitaetsklinikum Freiburg Phone 49(0)761-270-5331
Breisacher Str. 64 Fax 49(0)761-270-5416
79106 Freiburg http://fbi.uniklinik-freiburg.de/
|