--out outfile


Script to prepare surface-based data for high-level analysis by resampling surface or volume source data to a common sujbect (usually an average subject) and then concatenating them into one file which can then be used by a number of programs (eg, mri_glmfit).


--out outfile

Save output here.

--target subject

Subject to use as the common-space. All the input data will be resampled to the surface of this subject.

--hemi hemi

Use hemi for source and target surfaces. hemi can be lh or rh.

--meas surfmeasure

Use subject/surf/hemi.surfmeasure as input. For use with --s, --fsgd, or --f. Implies --srcfmt curv.

--area surfname

Extract vertex area from subject/surf/hemi.surfname to use as input. For use with --s, --fsgd, or --f. surfname does not include hemi. Eg, white, pial.

--s subjN

Specify an input subject on the command-line. All subjects must be specified in this way on the command-line (ie, each with its own --s). For use with --meas.

--fsgd fsgdfile

Specify the list of input subjects from the fsgd file. The fsgd file can then be used with mri_glmfit (unless --paired-diff is specified). The subject list is obtained from the "Input" lines. See for more info. For use with --meas.

--f subjlistfile

List all subjects separated by white space in subjlistfile. This is just an alternative to using an fsgd file. For use with --meas.

--is surfmeasfile

Specify full path to input surface measure file. This is an alternative to using --meas. This still requires that a subject list be supplied.

--srcfmt fmt

Specify source format when using --is. This is mainly needed when the input format is not one recognized by mri_convert (eg, "curv" format that thickness files are in). --meas implies --srcfmt curv. Can also use "paint" or "w".

--iv volmeasfile

Specify full path to a volume file and its registration matrix file. The registration matrix file is of the type accepted/created by tkregister2. The volume is sampled to the surface, and the result is used as the input surface measure. This is an alternative to using --meas. This still requires that a subject list be supplied.

--projfrac projfrac

When sampling a volume onto the surface, sample a fraction of the thickness along the surface normal. projfrac is 0-1. Default is 0.

--fwhm fwhm

Smooth the data on the target surface by fwhm mm. As a workflow strategy, it might make more sense to run it without any smoothing, and then use mri_surf2surf to smooth the output. That way you can smooth to whatever levels you want without having to re-run mris_preproc.

--fwhm-src fwhm

Smooth the data on the source surface by fwhm mm. It is better to do it on the target surface.

--niters niters --niters-src niterssrc

Smooth target or source by niters or nitersrc nearest neighbor iterations. This is an alternative to specifying the smoothing level with FWHM.


After concatenating all the inputs together, create a new output file by computing paired differences, ie, Input1-Input2, Input3-Input4, etc. There must be an even number of inputs.


Same as --paired-diff, but normalizes by average of time points, ie, (Input1-Input2)/((Input1-Input2)/2).


Same as --paired-diff, but normalizes by time point 1, ie, (Input1-Input2)/Input1.


Same as --paired-diff, but normalizes by time point 2, ie, (Input1-Input2)/Input2.

--cache-out cachefile --cache-in cachefile --cache-out-only tmpdir

Unless you are planning to do some type of semi-real-time processing, you can ignore caching. With --cache-out cachefile, mris_preproc will save the data for each subject, after resampling to the target and smoothing, in the subjects surf directory as hemi.cachefile. In a subsequent call to mris_preproc, you can specify --cache-in cachefile, and the precomputed data will be used. If you are going to smooth your data at some point, do it when caching out. If you want to cache without actually creating an output, then --cache-out-only. You must supply a tmpdir. The true tmpdir will be created under this. tmpdir itself will not be deleted. None of the paired diff options will affect caching.


After concatenating all the inputs together (and possibly computing paired diffs), compute the mean of all inputs. This may be helpful as part of a lower-level analysis. Eg, if there are multiple measures for each subjects, these can be averaged together for each subject separately, then combined in a second call to mris_preproc.


Synthesize the input data with white gaussian noise. For volume source, the volume is synthesized prior to resampling to the surface. The synthesis is done prior to any smoothing. This is mainly good for testing and running simulations.

--surfreg SurfReg

Use hemi.SurfReg as the surface registration to the common space. Default is sphere.reg.


Reshape spatial dimensions. Normally, the output volume-encoded surface file will have spatial dimension of nvertices-by-1-by-1 (ie, number of columns equals number of vertices, nrows=nslices=1). This will not work for ANALYZE and NIFTI formats because they cannot represent a dimension with more than 32k elements. This flag instructs mris_preproc to change the number of cols, rows, and slices so that no one dimension is greater than 32k. When ANALYZE and NIFTI formats are automatically detected, reshaping is turned on.

--tmpdir tmpdir

Use tmpdir. By default, creates a tmpdir in the output directory. Implies --nocleanup


Do not delete temporary directory and files.


DO delete temporary directory and files. Done by default.


Example 1

mris_preproc --s abc01-anat --s abc02-anat --s abc03-anat --s abc04-anat \

Example 2

mris_preproc --fsgd abc.fsgd --target fsaverage --hemi lh --meas thickness \

Example 3

mris_preproc --s abc01-anat --s abc02-anat --s abc03-anat --s abc04-anat \

Example 4

mris_preproc --target fsaverage --hemi lh --out abc-lh-thickness.mgh \

Example 5

Same as #2 but computes paired differneces, ie, there will be two

mris_preproc --fsgd abc.fsgd --target fsaverage --hemi lh --meas thickness \

Example 6

Sample volume data (no --meas):

mris_preproc --fsgd abc.fsgd --target fsaverage --hemi lh \



See Also

mri_glmfit, othercommand2


FreeSurfer, FsFast

Methods Description




Reporting Bugs

Report bugs to <>



mris_preproc (last edited 2011-01-13 12:25:05 by tanha)