When we use a function like the size of mask, we first resample the mask so that it is the same size as the function.
According to Super Teacher's reply, there are three ways:http://restfmri.net/forum/node/88, after trying to decide to use the first, namely:http://restfmri.net/node/78 , organized as follows.
After downloading the good code in the second URL, add the MATLAB path, the resample process only need to use the following four lines of code (from the two senior mail communication to pick out, modified a note):
Mask=rest_readfile (' Mask file path '); mask=mask>0; Mask_downsampled=rest_resample3d (original mask, [desired dimension]); Rest_writefile (mask_downsampled, ' Output path ', [disered dimention], [voxel size], [Origin coordinate], ' data type ');
Where original mask input the mask file name with the full path (I use HDR), of course, the current directory is not required;
Voxel size and Origin coordinate as well as the data type can be seen with the micro-open function, the data type is generally ' double ';
In addition origin coordinate to use the structure header. Origin is given, enter the time where the header can be entered directly.
Later added: The Third kind is also very useful, and very soon. The first method is to write your own code, using the interpolation method, but in resample some templates (such as Craddock), the use of the first method will cause the addition of unnecessary boundaries, the picture will be drawn with a lot of borders. Because did not find in script where to change Resample method, or honestly use tools SPM Bar ... Although it is written here is SPM5, but SPM12 and 5 of this part is the same, can be copied completely.
(3) Use spm5:a. Click "Coregister"
B. Click "New" Coreg:reslice ""
C. "Image defining Space": choose one of your functional Image. e.g. your normalized functional image or image after Detrend and Filter.
D. "Images to Reslice": Choose the mask file or ROI definition file. e.g. brainmask_05_61x73x61.img
E. "Reslice Options", "interpolation": choose "Nearest neighbour"
F. Just click "Run". Then you'll get the resmapled mask or ROI file with a surfix of "R".
Resample The Mask