--- title: "multivariate template coordinates example for eigenanatomy" author: "Brian B. Avants" date: "`r Sys.Date()`" bibliography: REFERENCES.bib output: rmarkdown::html_vignette vignette: > %\VignetteEngine{knitr::rmarkdown} %\VignetteIndexEntry{multivariate template coordinates example for eigenanatomy} %\VignetteEncoding{UTF-8} \usepackage[utf8]{inputenc} --- How to make a table and plot coordinates of a multivariate (soft) region of interest as produced by methods such as eigenanatomy. First, load in a custom template paired with the output of a multivariate sparse decomposition or (alternatively) could be just a statistical map with zeroes in non-interesting areas. ```{r,eval=FALSE} library( ANTsR ) tem<-antsImageRead( getANTsRData("ch2") ) temlab2<-antsImageRead( getANTsRData("ch2a") ) temporalLobeRegions = thresholdImage( temlab2, 80, 90 ) %>% smoothImage( 3 ) otherRegions = thresholdImage( temlab2, 20, 25 ) %>% smoothImage( 1.5 ) ``` This is the custom template and soft ROI pair. ```{r,message=FALSE,warning=FALSE,eval=FALSE} mytem<-list( tem, temporalLobeRegions, otherRegions ) plot( tem, temporalLobeRegions, window.overlay=c(0.1, max( temporalLobeRegions ) ) ) plot( tem, otherRegions, axis=3, window.overlay=c(0.1, max( otherRegions ) ) ) plot( tem, otherRegions, axis=1, window.overlay=c(0.1, max( otherRegions ) ) ) ``` Gather the canonical template ( e.g. MNI space ). ```{r,eval=FALSE} mymni<-list( antsImageRead(getANTsRData("mni") ), antsImageRead(getANTsRData("mnib") ), antsImageRead(getANTsRData("mnia") ) ) ``` Map to the canonical template. ```{r,eval=FALSE} mynetworkdescriptor<-getMultivariateTemplateCoordinates( mytem, mymni , convertToTal = TRUE , pvals=c(0.01,0.05) ) ``` Now look at the results in table form. This tells us where the (center of) the data is located in anatomical space and associates the known p-values with it. This is simulated data, so we already know the answers to this and these correspond to what we find here. ```{r,results='asis',eval=FALSE} knitr::kable( mynetworkdescriptor$networks ) ``` Enjoy.