Hi Oliver
you can save your data from matlab using the function attached.
it is not very sofisticated but I think it will fit your needs.
Jose Manjon
Olivier Salvado wrote:
>
> I am using the BrainWeb datasets from McGill to test different
> versions and parameters of the segmentation step.
> (_http://www.bic.mni.mcgill.ca/brainweb/_)
> I have downloaded the datasets in raw format, and written a function
> to read them in matlab. Now I need to go through all the volumes and
> generate the nifti and analyze files to import them into SPM (SPM2 and
> SPM5) with the correct header information.
>
> Has anyone already done that and could share the converted volumes
> with me?
>
> Olivier
>
> __________________________________________________
> Olivier Salvado, PhD
>
> Case Western Reserve University | Case Center for Imaging Research
> University Hospitals of Cleveland | Department of Radiology | Wearn B49
> 11100 Euclid Av. | Cleveland, OH 44106
> Ph. (216) 983 3426 | Fax: (216) 844 4987
>
--
________________________________________________________
Dr. Jose V. Manjón Herrera ------- [log in to unmask]
home: http://personales.upv.es/jmanjon
[IBIME - Biomedical Imaging Area]
BET - Bioengineering, Electronics and Telemedicine Group
UPV - Politechnical University of Valencia - Spain
________________________________________________________
function [Vo]=create_spmvol(data,fileName,res)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% data: 3D data matrix
% filename: volume filename (i.e. 'mydata.img')
% res: voxel resolution (i.e. [1,1,1])
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
V.fname=imgName;
V.dim=[size(data) 4];
V.mat=[res(1) 0 0 0;0 res(2) 0 0;0 0 res(3) 0;0 0 0 1];
V.pinfo=[1;0;0];
Vo=spm_create_vol(V);
spm_write_vol(Vo,data);
|