View source: R/fsaverage_to_vol.R
fsaverage_to_vol | R Documentation |
Applies the Wu et al. regfusion method to obtain MNI volume coordinates, then interpolates values.
fsaverage_to_vol( lh_input, rh_input, target_space = "FSL_MNI152", rf_type = "RF_ANTs", interp = "linear", out_type = "mgz", out_dir = NULL, fsaverage_path = NULL )
lh_input |
numerical vector of per-vertex data for the left hemisphere of the template subject. Must contain 163842 values for the |
rh_input |
numerical vector of per-vertex data for the right hemisphere of the template subject. Must contain 163842 values for the |
target_space |
character string, the target template or the space that your output volume should be in. One of 'FSL_MNI152' or 'SPM_Colin27'. |
rf_type |
the |
interp |
interpolation method, currently only 'linear' and 'nearest' are supported. The performance of the 'linear' method is currently quite bad, and it will be rewritten in |
out_type |
character string, the format of the output files. One of the following: 'mgz' or 'mgh' for FreeSurfer MGZ/MGH format, 'nii' for NIFTI v1 format. Ignored unless out_dir is not NULL. |
out_dir |
optional character string, the path to a writable output directory to which the output should be written as volume files. If |
fsaverage_path |
character string or NULL, the file system path to the |
named list with keys 'projected' and 'projected_seg', each of which holds an fs.volume
instance, its 'data' key holds a 256x256x256
array with the projected data. The data in 'projected_seg' is identical to the data in 'projected', with the exception that data values originating from the right hemisphere have been incremented by 1000. See out_dir
parameter to easily write results to files. If out_dir is not NULL
, the return value additionally contains the following keys: 'out_file' and the output file format at key 'out_format'.
This function requires the packages 'fsbrain' and 'haze', which are optional dependencies. The package 'fsbrain' can be installed from CRAN. For 'haze', see https://github.com/dfsp-spirit/haze
.
This function is quite expensive computationally, especially when using interp = 'linear'
.
Tim Schäfer for the R version, Wu Jianxiao and CBIG for the original Matlab version.
## Not run: lh_input = rnorm(163842L, 3.0, 0.2); rh_input = rnorm(163842L, 3.0, 0.2); res = fsaverage_to_vol(lh_input, rh_input, "FSL_MNI152"); ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.