# How to import images used to analysis in SPM to FreeSurfer

FreeSurfer uses the recon-all command to semi-automatically generate its statistics. This tool implies a certain directory structure in which the files with the images for the samples should be organized into. In FreeSurfer tutorial they call this specific directory structure the FSFAST structure.

I need to analyse images that were previously worked on in SPM, and it has the following directory structure for the patients:

/experiment/patients/A.o/


and for controls:

/experiment/controls/A.o/


Within each directory there are .hdr, .img, .mat and .mask files for each observation, which was obtained in two different times. So the naming of the files have the following order:

experiment_subjectnumber_time1.img


and for the second acquisition reads:

experiment_subjectnumber_time2.img


The same with all the before mentioned extensions (hdr, mat, mask).

It seems that in the FreeSurfer workflow the command unpacksdcmdir is used to extract data from the nii and dicon types and organize them in the FSFAST structure. Can it be used on directory structures like the one I have?

recon-all -s SUBJECTNAME -all -i IMAGE.IMG