Description Usage Arguments Value Examples
View source: R/volume_regions.R
Find center of mass of regions in a brain volume segmentation.
1 | segmentation_centers(volatlas, named_regions = NULL, vox2ras = diag(4))
|
volatlas |
3d integer array, the brain volume segmentation. Can be an |
named_regions |
the regions to consider, a named list where the keys are character strings: the region names from the colorLUT, and the values are integers: the region codes from the volume. See |
vox2ras |
4x4 numerical matrix, the voxel to RAS coordinate transformation matrix for the volume. If NULL and volatlas is an fs.volume instance, the function will try to extract it from the volume header. The default is the identity matrix, which will return voxel indices instead of RAS coordinates. |
data.frame with region names and the center of mass x, y and z coordinates for the regions.
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
if(has_fs()) {
fsh = fs_home();
lutfile = file.path(fsh, "FreeSurferColorLUT.txt");
segfile = file.path(fsh, 'subjects', 'fsaverage', 'mri', 'aseg.mgz');
named_regions = name_regions(segfile, lutfile);
named_regions$Unknown = NULL; # Ignore an atlas region.
sc = segmentation_centers(segfile, named_regions);
regions_distance_matrix = dist(sc);
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.