From 9cf3cc1f7ed6c54201ca41938000e2f6803e1fd7 Mon Sep 17 00:00:00 2001 From: Angel Garcia de la Garza Date: Fri, 20 Dec 2019 13:59:31 -0600 Subject: [PATCH] "added website" --- NEWS.md | 2 +- docs/404.html | 135 +++++++++++++++ docs/authors.html | 168 +++++++++++++++++++ docs/docsearch.css | 148 +++++++++++++++++ docs/docsearch.js | 85 ++++++++++ docs/index.html | 140 ++++++++++++++++ docs/link.svg | 12 ++ docs/news/index.html | 141 ++++++++++++++++ docs/pkgdown.css | 256 +++++++++++++++++++++++++++++ docs/pkgdown.js | 113 +++++++++++++ docs/pkgdown.yml | 5 + docs/reference/anovagamVoxel.html | 225 +++++++++++++++++++++++++ docs/reference/anovagammVoxel.html | 234 ++++++++++++++++++++++++++ docs/reference/anovalmVoxel.html | 216 ++++++++++++++++++++++++ docs/reference/anovalmerVoxel.html | 225 +++++++++++++++++++++++++ docs/reference/gamCluster.html | 214 ++++++++++++++++++++++++ docs/reference/gamNIfTI.html | 235 ++++++++++++++++++++++++++ docs/reference/gamRandomise.html | 220 +++++++++++++++++++++++++ docs/reference/gamVoxel.html | 214 ++++++++++++++++++++++++ docs/reference/gammCluster.html | 222 +++++++++++++++++++++++++ docs/reference/gammNIfTI.html | 244 +++++++++++++++++++++++++++ docs/reference/gammVoxel.html | 222 +++++++++++++++++++++++++ docs/reference/index.html | 252 ++++++++++++++++++++++++++++ docs/reference/listFormula.html | 175 ++++++++++++++++++++ docs/reference/lmCluster.html | 214 ++++++++++++++++++++++++ docs/reference/lmNIfTI.html | 235 ++++++++++++++++++++++++++ docs/reference/lmVoxel.html | 214 ++++++++++++++++++++++++ docs/reference/lmerCluster.html | 216 ++++++++++++++++++++++++ docs/reference/lmerNIfTI.html | 237 ++++++++++++++++++++++++++ docs/reference/lmerVoxel.html | 212 ++++++++++++++++++++++++ docs/reference/mergeNiftis.html | 184 +++++++++++++++++++++ docs/reference/parMap.html | 201 ++++++++++++++++++++++ docs/reference/plotGAM.html | 209 +++++++++++++++++++++++ docs/reference/plotGAMM.html | 217 ++++++++++++++++++++++++ docs/reference/rgamParam.html | 214 ++++++++++++++++++++++++ docs/reference/rgamm4Param.html | 222 +++++++++++++++++++++++++ docs/reference/rlmParam.html | 213 ++++++++++++++++++++++++ docs/reference/rlmerParam.html | 216 ++++++++++++++++++++++++ docs/reference/rparMap.html | 216 ++++++++++++++++++++++++ docs/reference/ts2matrix.html | 175 ++++++++++++++++++++ docs/reference/ts2meanCluster.html | 175 ++++++++++++++++++++ docs/reference/vgamParam.html | 214 ++++++++++++++++++++++++ docs/reference/vgamm4Param.html | 222 +++++++++++++++++++++++++ docs/reference/vlmParam.html | 213 ++++++++++++++++++++++++ docs/reference/vlmerParam.html | 216 ++++++++++++++++++++++++ 45 files changed, 8537 insertions(+), 1 deletion(-) create mode 100644 docs/404.html create mode 100644 docs/authors.html create mode 100644 docs/docsearch.css create mode 100644 docs/docsearch.js create mode 100644 docs/index.html create mode 100644 docs/link.svg create mode 100644 docs/news/index.html create mode 100644 docs/pkgdown.css create mode 100644 docs/pkgdown.js create mode 100644 docs/pkgdown.yml create mode 100644 docs/reference/anovagamVoxel.html create mode 100644 docs/reference/anovagammVoxel.html create mode 100644 docs/reference/anovalmVoxel.html create mode 100644 docs/reference/anovalmerVoxel.html create mode 100644 docs/reference/gamCluster.html create mode 100644 docs/reference/gamNIfTI.html create mode 100644 docs/reference/gamRandomise.html create mode 100644 docs/reference/gamVoxel.html create mode 100644 docs/reference/gammCluster.html create mode 100644 docs/reference/gammNIfTI.html create mode 100644 docs/reference/gammVoxel.html create mode 100644 docs/reference/index.html create mode 100644 docs/reference/listFormula.html create mode 100644 docs/reference/lmCluster.html create mode 100644 docs/reference/lmNIfTI.html create mode 100644 docs/reference/lmVoxel.html create mode 100644 docs/reference/lmerCluster.html create mode 100644 docs/reference/lmerNIfTI.html create mode 100644 docs/reference/lmerVoxel.html create mode 100644 docs/reference/mergeNiftis.html create mode 100644 docs/reference/parMap.html create mode 100644 docs/reference/plotGAM.html create mode 100644 docs/reference/plotGAMM.html create mode 100644 docs/reference/rgamParam.html create mode 100644 docs/reference/rgamm4Param.html create mode 100644 docs/reference/rlmParam.html create mode 100644 docs/reference/rlmerParam.html create mode 100644 docs/reference/rparMap.html create mode 100644 docs/reference/ts2matrix.html create mode 100644 docs/reference/ts2meanCluster.html create mode 100644 docs/reference/vgamParam.html create mode 100644 docs/reference/vgamm4Param.html create mode 100644 docs/reference/vlmParam.html create mode 100644 docs/reference/vlmerParam.html diff --git a/NEWS.md b/NEWS.md index e979eb7..6d25a3c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -#voxel +# voxel Functions for the voxelwise analysis of NIfTI data in R. diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 0000000..911ae01 --- /dev/null +++ b/docs/404.html @@ -0,0 +1,135 @@ + + + + + + + + +Page not found (404) • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +Content not found. Please use links in the navbar. + +
+ +
+ + + +
+ + +
+

Site built with pkgdown 1.4.1.

+
+ +
+
+ + + + + + + + diff --git a/docs/authors.html b/docs/authors.html new file mode 100644 index 0000000..35e592f --- /dev/null +++ b/docs/authors.html @@ -0,0 +1,168 @@ + + + + + + + + +Authors • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +
    +
  • +

    Angel Garcia de la Garza. Author, maintainer. +

    +
  • +
  • +

    Simon Vandekar. Author. +

    +
  • +
  • +

    David Roalf. Author. +

    +
  • +
  • +

    Kosha Ruparel. Author. +

    +
  • +
  • +

    Ruben Gur. Author. +

    +
  • +
  • +

    Raquel Gur. Author. +

    +
  • +
  • +

    Theodore Satterthwaite. Author. +

    +
  • +
  • +

    R. Taki Shinohara. Author. +

    +
  • +
+ +
+ +
+ + + +
+ + +
+

Site built with pkgdown 1.4.1.

+
+ +
+
+ + + + + + + + diff --git a/docs/docsearch.css b/docs/docsearch.css new file mode 100644 index 0000000..e5f1fe1 --- /dev/null +++ b/docs/docsearch.css @@ -0,0 +1,148 @@ +/* Docsearch -------------------------------------------------------------- */ +/* + Source: https://github.com/algolia/docsearch/ + License: MIT +*/ + +.algolia-autocomplete { + display: block; + -webkit-box-flex: 1; + -ms-flex: 1; + flex: 1 +} + +.algolia-autocomplete .ds-dropdown-menu { + width: 100%; + min-width: none; + max-width: none; + padding: .75rem 0; + background-color: #fff; + background-clip: padding-box; + border: 1px solid rgba(0, 0, 0, .1); + box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175); +} + +@media (min-width:768px) { + .algolia-autocomplete .ds-dropdown-menu { + width: 175% + } +} + +.algolia-autocomplete .ds-dropdown-menu::before { + display: none +} + +.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] { + padding: 0; + background-color: rgb(255,255,255); + border: 0; + max-height: 80vh; +} + +.algolia-autocomplete .ds-dropdown-menu .ds-suggestions { + margin-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion { + padding: 0; + overflow: visible +} + +.algolia-autocomplete .algolia-docsearch-suggestion--category-header { + padding: .125rem 1rem; + margin-top: 0; + font-size: 1.3em; + font-weight: 500; + color: #00008B; + border-bottom: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--wrapper { + float: none; + padding-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column { + float: none; + width: auto; + padding: 0; + text-align: left +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content { + float: none; + width: auto; + padding: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content::before { + display: none +} + +.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header { + padding-top: .75rem; + margin-top: .75rem; + border-top: 1px solid rgba(0, 0, 0, .1) +} + +.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column { + display: block; + padding: .1rem 1rem; + margin-bottom: 0.1; + font-size: 1.0em; + font-weight: 400 + /* display: none */ +} + +.algolia-autocomplete .algolia-docsearch-suggestion--title { + display: block; + padding: .25rem 1rem; + margin-bottom: 0; + font-size: 0.9em; + font-weight: 400 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--text { + padding: 0 1rem .5rem; + margin-top: -.25rem; + font-size: 0.8em; + font-weight: 400; + line-height: 1.25 +} + +.algolia-autocomplete .algolia-docsearch-footer { + width: 110px; + height: 20px; + z-index: 3; + margin-top: 10.66667px; + float: right; + font-size: 0; + line-height: 0; +} + +.algolia-autocomplete .algolia-docsearch-footer--logo { + background-image: url("data:image/svg+xml;utf8,"); + background-repeat: no-repeat; + background-position: 50%; + background-size: 100%; + overflow: hidden; + text-indent: -9000px; + width: 100%; + height: 100%; + display: block; + transform: translate(-8px); +} + +.algolia-autocomplete .algolia-docsearch-suggestion--highlight { + color: #FF8C00; + background: rgba(232, 189, 54, 0.1) +} + + +.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight { + box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5) +} + +.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content { + background-color: rgba(192, 192, 192, .15) +} diff --git a/docs/docsearch.js b/docs/docsearch.js new file mode 100644 index 0000000..b35504c --- /dev/null +++ b/docs/docsearch.js @@ -0,0 +1,85 @@ +$(function() { + + // register a handler to move the focus to the search bar + // upon pressing shift + "/" (i.e. "?") + $(document).on('keydown', function(e) { + if (e.shiftKey && e.keyCode == 191) { + e.preventDefault(); + $("#search-input").focus(); + } + }); + + $(document).ready(function() { + // do keyword highlighting + /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ + var mark = function() { + + var referrer = document.URL ; + var paramKey = "q" ; + + if (referrer.indexOf("?") !== -1) { + var qs = referrer.substr(referrer.indexOf('?') + 1); + var qs_noanchor = qs.split('#')[0]; + var qsa = qs_noanchor.split('&'); + var keyword = ""; + + for (var i = 0; i < qsa.length; i++) { + var currentParam = qsa[i].split('='); + + if (currentParam.length !== 2) { + continue; + } + + if (currentParam[0] == paramKey) { + keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); + } + } + + if (keyword !== "") { + $(".contents").unmark({ + done: function() { + $(".contents").mark(keyword); + } + }); + } + } + }; + + mark(); + }); +}); + +/* Search term highlighting ------------------------------*/ + +function matchedWords(hit) { + var words = []; + + var hierarchy = hit._highlightResult.hierarchy; + // loop to fetch from lvl0, lvl1, etc. + for (var idx in hierarchy) { + words = words.concat(hierarchy[idx].matchedWords); + } + + var content = hit._highlightResult.content; + if (content) { + words = words.concat(content.matchedWords); + } + + // return unique words + var words_uniq = [...new Set(words)]; + return words_uniq; +} + +function updateHitURL(hit) { + + var words = matchedWords(hit); + var url = ""; + + if (hit.anchor) { + url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; + } else { + url = hit.url + '?q=' + escape(words.join(" ")); + } + + return url; +} diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..c04d43f --- /dev/null +++ b/docs/index.html @@ -0,0 +1,140 @@ + + + + + + + +Mass-Univariate Voxelwise Analysis of Medical Imaging Data • voxel + + + + + + + + + + +
+
+ + + + +
+
+ + +
+ +

Functions for the voxelwise analysis of NIfTI data in R.

+
+ +
+ + +
+ + +
+ +
+

Site built with pkgdown 1.4.1.

+
+ +
+
+ + + + + + diff --git a/docs/link.svg b/docs/link.svg new file mode 100644 index 0000000..88ad827 --- /dev/null +++ b/docs/link.svg @@ -0,0 +1,12 @@ + + + + + + diff --git a/docs/news/index.html b/docs/news/index.html new file mode 100644 index 0000000..1824b77 --- /dev/null +++ b/docs/news/index.html @@ -0,0 +1,141 @@ + + + + + + + + +Changelog • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +
+ + + +
+ + +
+ + +
+

Site built with pkgdown 1.4.1.

+
+ +
+
+ + + + + + + + diff --git a/docs/pkgdown.css b/docs/pkgdown.css new file mode 100644 index 0000000..9145958 --- /dev/null +++ b/docs/pkgdown.css @@ -0,0 +1,256 @@ +/* Sticky footer */ + +/** + * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ + * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css + * + * .Site -> body > .container + * .Site-content -> body > .container .row + * .footer -> footer + * + * Key idea seems to be to ensure that .container and __all its parents__ + * have height set to 100% + * + */ + +html, body { + height: 100%; +} + +body > .container { + display: flex; + height: 100%; + flex-direction: column; +} + +body > .container .row { + flex: 1 0 auto; +} + +footer { + margin-top: 45px; + padding: 35px 0 36px; + border-top: 1px solid #e5e5e5; + color: #666; + display: flex; + flex-shrink: 0; +} +footer p { + margin-bottom: 0; +} +footer div { + flex: 1; +} +footer .pkgdown { + text-align: right; +} +footer p { + margin-bottom: 0; +} + +img.icon { + float: right; +} + +img { + max-width: 100%; +} + +/* Fix bug in bootstrap (only seen in firefox) */ +summary { + display: list-item; +} + +/* Typographic tweaking ---------------------------------*/ + +.contents .page-header { + margin-top: calc(-60px + 1em); +} + +/* Section anchors ---------------------------------*/ + +a.anchor { + margin-left: -30px; + display:inline-block; + width: 30px; + height: 30px; + visibility: hidden; + + background-image: url(./link.svg); + background-repeat: no-repeat; + background-size: 20px 20px; + background-position: center center; +} + +.hasAnchor:hover a.anchor { + visibility: visible; +} + +@media (max-width: 767px) { + .hasAnchor:hover a.anchor { + visibility: hidden; + } +} + + +/* Fixes for fixed navbar --------------------------*/ + +.contents h1, .contents h2, .contents h3, .contents h4 { + padding-top: 60px; + margin-top: -40px; +} + +/* Sidebar --------------------------*/ + +#sidebar { + margin-top: 30px; + position: -webkit-sticky; + position: sticky; + top: 70px; +} +#sidebar h2 { + font-size: 1.5em; + margin-top: 1em; +} + +#sidebar h2:first-child { + margin-top: 0; +} + +#sidebar .list-unstyled li { + margin-bottom: 0.5em; +} + +.orcid { + height: 16px; + /* margins are required by official ORCID trademark and display guidelines */ + margin-left:4px; + margin-right:4px; + vertical-align: middle; +} + +/* Reference index & topics ----------------------------------------------- */ + +.ref-index th {font-weight: normal;} + +.ref-index td {vertical-align: top;} +.ref-index .icon {width: 40px;} +.ref-index .alias {width: 40%;} +.ref-index-icons .alias {width: calc(40% - 40px);} +.ref-index .title {width: 60%;} + +.ref-arguments th {text-align: right; padding-right: 10px;} +.ref-arguments th, .ref-arguments td {vertical-align: top;} +.ref-arguments .name {width: 20%;} +.ref-arguments .desc {width: 80%;} + +/* Nice scrolling for wide elements --------------------------------------- */ + +table { + display: block; + overflow: auto; +} + +/* Syntax highlighting ---------------------------------------------------- */ + +pre { + word-wrap: normal; + word-break: normal; + border: 1px solid #eee; +} + +pre, code { + background-color: #f8f8f8; + color: #333; +} + +pre code { + overflow: auto; + word-wrap: normal; + white-space: pre; +} + +pre .img { + margin: 5px 0; +} + +pre .img img { + background-color: #fff; + display: block; + height: auto; +} + +code a, pre a { + color: #375f84; +} + +a.sourceLine:hover { + text-decoration: none; +} + +.fl {color: #1514b5;} +.fu {color: #000000;} /* function */ +.ch,.st {color: #036a07;} /* string */ +.kw {color: #264D66;} /* keyword */ +.co {color: #888888;} /* comment */ + +.message { color: black; font-weight: bolder;} +.error { color: orange; font-weight: bolder;} +.warning { color: #6A0366; font-weight: bolder;} + +/* Clipboard --------------------------*/ + +.hasCopyButton { + position: relative; +} + +.btn-copy-ex { + position: absolute; + right: 0; + top: 0; + visibility: hidden; +} + +.hasCopyButton:hover button.btn-copy-ex { + visibility: visible; +} + +/* headroom.js ------------------------ */ + +.headroom { + will-change: transform; + transition: transform 200ms linear; +} +.headroom--pinned { + transform: translateY(0%); +} +.headroom--unpinned { + transform: translateY(-100%); +} + +/* mark.js ----------------------------*/ + +mark { + background-color: rgba(255, 255, 51, 0.5); + border-bottom: 2px solid rgba(255, 153, 51, 0.3); + padding: 1px; +} + +/* vertical spacing after htmlwidgets */ +.html-widget { + margin-bottom: 10px; +} + +/* fontawesome ------------------------ */ + +.fab { + font-family: "Font Awesome 5 Brands" !important; +} + +/* don't display links in code chunks when printing */ +/* source: https://stackoverflow.com/a/10781533 */ +@media print { + code a:link:after, code a:visited:after { + content: ""; + } +} diff --git a/docs/pkgdown.js b/docs/pkgdown.js new file mode 100644 index 0000000..087a762 --- /dev/null +++ b/docs/pkgdown.js @@ -0,0 +1,113 @@ +/* http://gregfranko.com/blog/jquery-best-practices/ */ +(function($) { + $(function() { + + $('.navbar-fixed-top').headroom(); + + $('body').css('padding-top', $('.navbar').height() + 10); + $(window).resize(function(){ + $('body').css('padding-top', $('.navbar').height() + 10); + }); + + $('body').scrollspy({ + target: '#sidebar', + offset: 60 + }); + + $('[data-toggle="tooltip"]').tooltip(); + + var cur_path = paths(location.pathname); + var links = $("#navbar ul li a"); + var max_length = -1; + var pos = -1; + for (var i = 0; i < links.length; i++) { + if (links[i].getAttribute("href") === "#") + continue; + // Ignore external links + if (links[i].host !== location.host) + continue; + + var nav_path = paths(links[i].pathname); + + var length = prefix_length(nav_path, cur_path); + if (length > max_length) { + max_length = length; + pos = i; + } + } + + // Add class to parent
  • , and enclosing
  • if in dropdown + if (pos >= 0) { + var menu_anchor = $(links[pos]); + menu_anchor.parent().addClass("active"); + menu_anchor.closest("li.dropdown").addClass("active"); + } + }); + + function paths(pathname) { + var pieces = pathname.split("/"); + pieces.shift(); // always starts with / + + var end = pieces[pieces.length - 1]; + if (end === "index.html" || end === "") + pieces.pop(); + return(pieces); + } + + // Returns -1 if not found + function prefix_length(needle, haystack) { + if (needle.length > haystack.length) + return(-1); + + // Special case for length-0 haystack, since for loop won't run + if (haystack.length === 0) { + return(needle.length === 0 ? 0 : -1); + } + + for (var i = 0; i < haystack.length; i++) { + if (needle[i] != haystack[i]) + return(i); + } + + return(haystack.length); + } + + /* Clipboard --------------------------*/ + + function changeTooltipMessage(element, msg) { + var tooltipOriginalTitle=element.getAttribute('data-original-title'); + element.setAttribute('data-original-title', msg); + $(element).tooltip('show'); + element.setAttribute('data-original-title', tooltipOriginalTitle); + } + + if(ClipboardJS.isSupported()) { + $(document).ready(function() { + var copyButton = ""; + + $(".examples, div.sourceCode").addClass("hasCopyButton"); + + // Insert copy buttons: + $(copyButton).prependTo(".hasCopyButton"); + + // Initialize tooltips: + $('.btn-copy-ex').tooltip({container: 'body'}); + + // Initialize clipboard: + var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { + text: function(trigger) { + return trigger.parentNode.textContent; + } + }); + + clipboardBtnCopies.on('success', function(e) { + changeTooltipMessage(e.trigger, 'Copied!'); + e.clearSelection(); + }); + + clipboardBtnCopies.on('error', function() { + changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); + }); + }); + } +})(window.jQuery || window.$) diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml new file mode 100644 index 0000000..8999c6f --- /dev/null +++ b/docs/pkgdown.yml @@ -0,0 +1,5 @@ +pandoc: 2.3.1 +pkgdown: 1.4.1 +pkgdown_sha: ~ +articles: [] + diff --git a/docs/reference/anovagamVoxel.html b/docs/reference/anovagamVoxel.html new file mode 100644 index 0000000..f08183e --- /dev/null +++ b/docs/reference/anovagamVoxel.html @@ -0,0 +1,225 @@ + + + + + + + + +Computes voxelwise analysis of variance (ANOVA) tables for a Generalized Additive Model. — anovagamVoxel • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function computes analysis of variance tables for the fitted models after running a Generalized Additive Model (from mgcv::gam). +The analysis will run in all voxels in the mask and will return the analysis of variance table for each voxel. +Please check the mgcv::anova.gam documentation for further information about specific arguments used in anova.gam. Multi-model calls are disabled.

    + +
    + +
    anovagamVoxel(image, mask, fourdOut = NULL, formula, subjData,
    +  dispersion = NULL, freq = FALSE, mc.preschedule = TRUE, ncores = 1,
    +  ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will call mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. Must be a binary mask

    fourdOut

    To be passed to mergeNifti, This is the path and file name without the suffix to save the fourd file. Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to gam()

    subjData

    Dataframe containing all the covariates used for the analysis

    dispersion

    To be passed to mgcv::anova.gam, Defaults to NULL. Dispersion Parameter, not normally used.

    freq

    To be passed to mgcv::anova.gam, Defaults to FALSE. Frequentist or Bayesian approximations for p-values

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use

    ...

    Additional arguments passed to gam()

    + +

    Value

    + +

    Returns list of models fitted to each voxel over the masked images passed to function.

    + + +

    Examples

    +
    image <- oro.nifti::nifti(img = array(1:200, dim =c(2,2,2,25))) +mask <- oro.nifti::nifti(img = array(0:1, dim = c(2,2,2,1))) +set.seed(1) +covs <- data.frame(x = runif(25), y=runif(25)) +fm1 <- "~ s(x) + y" +models <- anovagamVoxel(image=image, mask=mask, + formula=fm1, subjData=covs, ncores = 1)
    #> [1] "Created time series to matrix" +#> [1] "Created formula list" +#> [1] "Running test ANOVA" +#> [1] "Running parallel ANOVAs" +#> elapsed +#> 0.07 +#> [1] "Parallel ANOVAs Ran"
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/anovagammVoxel.html b/docs/reference/anovagammVoxel.html new file mode 100644 index 0000000..0e2cd1e --- /dev/null +++ b/docs/reference/anovagammVoxel.html @@ -0,0 +1,234 @@ + + + + + + + + +Computes voxelwise analysis of variance (ANOVA) tables for a Generalized Additive Mixed Effects Model. — anovagammVoxel • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function computes analysis of variance tables for the fitted Generalized Additive Mixed Effects (from gamm4::gamm4) models. +The analysis will run in all voxels in the specified mask and will return a list with the ANOVA table at each voxel. +Please check the mgcv::anova.gam documentation for further information about specific arguments used in anova.gam. Multi-model calls are disabled.

    + +
    + +
    anovagammVoxel(image, mask, fourdOut = NULL, formula, randomFormula, subjData,
    +  dispersion = NULL, freq = FALSE, mc.preschedule = TRUE, ncores = 1,
    +  ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will call mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. Must be a binary.

    fourdOut

    To be passed to mergeNifti, This is the output path to write out the fourd file. Do not include a suffix (i.e. .nii.gz). Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to gamm4()

    randomFormula

    Random effects formula passed to gamm4()

    subjData

    Dataframe containing all the covariates used for the analysis

    dispersion

    To be passed to mgcv::anova.gam, Defaults to NULL. Dispersion Parameter, not normally used.

    freq

    To be passed to mgcv::anova.gam, Defaults to FALSE. Frequentist or Bayesian approximations for p-values

    mc.preschedule

    To be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use

    ...

    Additional arguments passed to gamm4()

    + +

    Value

    + +

    Returns list of models fitted to each voxel over the masked images passed to function.

    + + +

    Examples

    +
    + +image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(data = c(rep(0,15), rep(1,1)), + dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25), y=runif(25), id = rep(1:5,5)) +f1 <- "~ s(x) + y" +randomFormula <- "~(1|id)" +models <- anovagammVoxel(image, mask, formula = f1, + randomFormula = randomFormula, + subjData = covs, ncores = 1, REML=TRUE)
    #> [1] "Created time series to matrix" +#> [1] "Created formula list" +#> [1] "Running test ANOVA" +#> [1] "Running parallel ANOVAs" +#> elapsed +#> 0.571 +#> [1] "Parallel ANOVAs Ran"
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/anovalmVoxel.html b/docs/reference/anovalmVoxel.html new file mode 100644 index 0000000..f5616d0 --- /dev/null +++ b/docs/reference/anovalmVoxel.html @@ -0,0 +1,216 @@ + + + + + + + + +Computes voxelwise analysis of variance (ANOVA) tables for a Linear Model. — anovalmVoxel • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function computes analysis of variance tables for the fitted models after running a Linear Model using the stats::lm() function. +The analysis will run in all voxels in the mask and will return the analysis of variance table for each voxel. +Please check the stats documentation for further information about specific arguments used in stats::anova.lm(). Multi-model calls are disabled.

    + +
    + +
    anovalmVoxel(image, mask, fourdOut = NULL, formula, subjData,
    +  mc.preschedule = TRUE, ncores = 1, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will all mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. Must be a binary mask

    fourdOut

    To be passed to mergeNifti, This is the path and file name without the suffix to save the fourd file. Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to lm()

    subjData

    Dataframe containing all the covariates used for the analysis

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use

    ...

    Additional arguments passed to lm()

    + +

    Value

    + +

    Returns list of models fitted to each voxel over the masked images passed to function.

    + + +

    Examples

    +
    image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(0:1, dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25), y=runif(25)) +fm1 <- "~ x + y" +models <- anovalmVoxel(image=image, mask=mask, + formula=fm1, subjData=covs, ncores = 1)
    #> [1] "Created time series to matrix" +#> [1] "Created formula list" +#> [1] "Running test ANOVA" +#> [1] "Running parallel ANOVAs" +#> elapsed +#> 0.044 +#> [1] "Parallel ANOVAs Ran"
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/anovalmerVoxel.html b/docs/reference/anovalmerVoxel.html new file mode 100644 index 0000000..64be904 --- /dev/null +++ b/docs/reference/anovalmerVoxel.html @@ -0,0 +1,225 @@ + + + + + + + + +Computes voxelwise analysis of variance (ANOVA) tables for a Linear Mixed Effects Model. — anovalmerVoxel • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function computes analysis of variance tables for the fitted models after running a Linear Mixed Effect Model using the lmerTest() function and the anova function in that package. +The analysis will run in all voxels in the mask and will return the analysis of variance table for each voxel. +Please check the lmerTest documentation for further information about specific arguments used in anova.lmerModLmerTest. Multi-model calls are disabled.

    + +
    + +
    anovalmerVoxel(image, mask, fourdOut = NULL, formula, subjData,
    +  ddf = "Satterthwaite", type = 3, mc.preschedule = TRUE, ncores = 1,
    +  ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will call mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. Must be a binary mask

    fourdOut

    To be passed to mergeNifti, This is the path and file name without the suffix to save the fourd file. Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to lmer()

    subjData

    Dataframe containing all the covariates used for the analysis

    ddf

    Which approximation of DDF to be used. To be passed to anova.lmerModLmerTest. Defaults to "Satterthwaite"

    type

    Type of hypothesis to be test (defined from SAS terminology). Defaults to 3. To be passed to anova.lmerModLmerTest

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use

    ...

    Additional arguments passed to lmer()

    + +

    Value

    + +

    Returns list of models fitted to each voxel over the masked images passed to function.

    + + +

    Examples

    +
    + +image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(c(rep(0,15), rep(1,1)), dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25), y = runif(25), id = rep(1:5,5)) +fm1 <- "~ x + y + (1|id)" +models <- anovalmerVoxel(image, mask, formula = fm1, subjData = covs, ncores = 1, REML=TRUE)
    #> [1] "Created time series to matrix" +#> [1] "Created formula list" +#> [1] "Running test ANOVA"
    #> boundary (singular) fit: see ?isSingular
    #> [1] "Running parallel ANOVAs"
    #> boundary (singular) fit: see ?isSingular
    #> boundary (singular) fit: see ?isSingular
    #> boundary (singular) fit: see ?isSingular
    #> boundary (singular) fit: see ?isSingular
    #> elapsed +#> 0.325 +#> [1] "Parallel ANOVAs Ran"
    +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/gamCluster.html b/docs/reference/gamCluster.html new file mode 100644 index 0000000..6295dc9 --- /dev/null +++ b/docs/reference/gamCluster.html @@ -0,0 +1,214 @@ + + + + + + + + +Run a Generalized Additive Model on the mean intensity over a region of interest — gamCluster • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is able to run a Generalized Additive Model (GAM) using the mgcv package. +All clusters must be labeled with integers in the mask passed as an argument.

    + +
    + +
    gamCluster(image, mask, fourdOut = NULL, formula, subjData,
    +  mc.preschedule = TRUE, ncores = 1, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will call mergeNiftis() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. All clusters must be labeled with integers in the mask passed as an argument

    fourdOut

    To be passed to mergeNifti, This is the path and file name without the suffix to save the fourd file. Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to gam()

    subjData

    Dataframe containing all the covariates used for the analysis

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use for the analysis

    ...

    Additional arguments passed to gam()

    + +

    Value

    + +

    Returns list of models fitted to the mean voxel intensity over region of interest.

    + + +

    Examples

    +
    image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(1:4, dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25)) +fm1 <- "~ s(x)" +models <- gamCluster(image=image, mask=mask, + formula=fm1, subjData=covs, ncores = 1, method="REML")
    #> [1] "Created meanCluster Matrix" +#> [1] "Created formula list" +#> [1] "Running test model" +#> [1] "Running parallel models" +#> elapsed +#> 0.1 +#> [1] "Parallel Models Ran"
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/gamNIfTI.html b/docs/reference/gamNIfTI.html new file mode 100644 index 0000000..3210dba --- /dev/null +++ b/docs/reference/gamNIfTI.html @@ -0,0 +1,235 @@ + + + + + + + + +Wrapper to run a Generalized Additive model on a NIfTI image and output parametric maps — gamNIfTI • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is able to run a Generalized Additive Model (GAM) using the mgcv package. +The analysis will run in all voxels in in the mask and will return parametric and smooth coefficients. +The function will create parametric maps according to the model selected. +The function will return a p-map, t-map, z-map, p-adjusted-map for parametric terms and p-map, z-map, p-adjusted-map for smooth terms. +You can select which type of p-value correction you want done on the map.

    + +
    + +
    gamNIfTI(image, mask, fourdOut = NULL, formula, subjData,
    +  mc.preschedule = TRUE, ncores = 1, method = "none", residual = FALSE,
    +  outDir = NULL, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will call mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. Must be a binary mask

    fourdOut

    To be passed to mergeNifti, This is the path and file name without the suffix to save the fourd file. Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to gam()

    subjData

    Dataframe containing all the covariates used for the analysis

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use

    method

    which method of correction for multiple comparisons (default is none)

    residual

    If set to TRUE then residuals maps will be returned along parametric maps

    outDir

    Path to the folder where to output parametric maps (Default is Null, only change if you want to write maps out)

    ...

    Additional arguments passed to gam()

    + +

    Value

    + +

    Parametric maps of the fitted models

    + + +

    Examples

    +
    image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(0:1, dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25), y = rnorm(25)) +fm1 <- "~ x + s(y)" +Maps <- gamNIfTI(image=image, mask=mask, + formula=fm1, subjData=covs, ncores = 1, method="fdr")
    #> [1] "Created time series to matrix" +#> [1] "Created formula list" +#> [1] "Running test model" +#> [1] "Running parallel models" +#> elapsed +#> 0.242 +#> [1] "Parallel Models Ran" +#> [1] "Creating parametric maps" +#> [1] "Working with output of gam object"
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/gamRandomise.html b/docs/reference/gamRandomise.html new file mode 100644 index 0000000..707bdaa --- /dev/null +++ b/docs/reference/gamRandomise.html @@ -0,0 +1,220 @@ + + + + + + + + +Generate FSL Randomise call for a GAM Model — gamRandomise • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is able to generate all the necessary files to run randomise with a GAM Model +This script will write out all design and contrast files +This function will run a f-test to compare a full and reduced model (a model with and without spline)

    + +
    + +
    gamRandomise(image, maskPath = NULL, formulaFull, formulaRed, subjData,
    +  outDir, nsim = 500, thresh = 0.01, run = FALSE)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input path of 'nifti' image or vector of path(s) to images. If multiple paths, the script will all mergeNiftis() and merge across time.

    maskPath

    to mask. Must be a binary mask

    formulaFull

    Must be the formula of the full model (i.e. "~s(age,k=5)+sex+mprage_antsCT_vol_TBV")

    formulaRed

    Must be the formula of the reduced model (i.e. "~sex+mprage_antsCT_vol_TBV")

    subjData

    Dataframe containing all the covariates used for the analysis

    outDir

    output directory for randomise

    nsim

    Number of simulations

    thresh

    significance threshold

    run

    FALSE will only print randomise command but won't it

    + +

    Value

    + +

    Return randomise command

    + + +

    Examples

    +
    if (FALSE) { + +subjData = mgcv::gamSim(1,n=400,dist="normal",scale=2) +OutDirRoot="Output Directory" +maskName="Path to mask" +imagePath="Path to output" +covsFormula="~s(age,k=5)+sex+mprage_antsCT_vol_TBV" +redFormula="~sex+mprage_antsCT_vol_TBV" + +gamRandomise(image = imagePath, maskPath = maskName, formulaFull = covsFormula, + formulaRed = redFormula, subjData = subjData, outDir = OutDirRoot) + +}
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/gamVoxel.html b/docs/reference/gamVoxel.html new file mode 100644 index 0000000..493028a --- /dev/null +++ b/docs/reference/gamVoxel.html @@ -0,0 +1,214 @@ + + + + + + + + +Run a Generalized Additive Model on all voxels of a NIfTI image within a mask. — gamVoxel • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is able to run a Generalized Additive Model (GAM) using the mgcv package. +The analysis will run in all voxels in in the mask and will return the model fit for each voxel.

    + +
    + +
    gamVoxel(image, mask, fourdOut = NULL, formula, subjData,
    +  mc.preschedule = TRUE, ncores = 1, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will call mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. Must be a binary mask

    fourdOut

    To be passed to mergeNifti, This is the path and file name without the suffix to save the fourd file. Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to gam()

    subjData

    Dataframe containing all the covariates used for the analysis

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use

    ...

    Additional arguments passed to gam()

    + +

    Value

    + +

    List of models fitted to each voxel over the masked images passed to function.

    + + +

    Examples

    +
    image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(0:1, dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25)) +fm1 <- "~ s(x)" +models <- gamVoxel(image=image, mask=mask, + formula=fm1, subjData=covs, ncores = 1)
    #> [1] "Created time series to matrix" +#> [1] "Created formula list" +#> [1] "Running test model" +#> [1] "Running parallel models" +#> elapsed +#> 0.183 +#> [1] "Parallel Models Ran"
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/gammCluster.html b/docs/reference/gammCluster.html new file mode 100644 index 0000000..e63c7eb --- /dev/null +++ b/docs/reference/gammCluster.html @@ -0,0 +1,222 @@ + + + + + + + + +Run a Generalized Additive Mixed Effects Model on the mean intensity over a region of interest — gammCluster • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is able to run a Generalized Additive Mixed Effects Model (GAMM) using the gamm4() function. +All clusters or Regions of Interest must be labeled with integers in the mask passed as an argument.

    + +
    + +
    gammCluster(image, mask, fourdOut = NULL, formula, randomFormula, subjData,
    +  mc.preschedule = TRUE, ncores = 1, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will call mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. All clusters must be labeled with integers in the mask passed as an argument

    fourdOut

    To be passed to mergeNifti, This is the path and file name without the suffix to save the fourd file. Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to gamm4()

    randomFormula

    Random effects formula passed to gamm4()

    subjData

    Dataframe containing all the covariates used for the analysis

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use for the analysis

    ...

    Additional arguments passed to gamm4()

    + +

    Value

    + +

    Returns list of models fitted to the mean voxel intensity a region or interest.

    + + +

    Examples

    +
    + +image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(c(rep(0,14),1,2), dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25), id = rep(1:5,5)) +fm1 <- "~ s(x)" +randomFormula <- "~(1|id)" +models <- gammCluster(image, mask, formula = fm1, + randomFormula = randomFormula, subjData = covs, ncores = 1, REML=TRUE)
    #> [1] "Created meanCluster Matrix" +#> [1] "Created formula list" +#> [1] "Running test model" +#> [1] "Running parallel models" +#> elapsed +#> 0.127 +#> [1] "Parallel Models Ran"
    +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/gammNIfTI.html b/docs/reference/gammNIfTI.html new file mode 100644 index 0000000..8933a19 --- /dev/null +++ b/docs/reference/gammNIfTI.html @@ -0,0 +1,244 @@ + + + + + + + + +Wrapper to run a Generalized Additive Mixed Effects model on an Nifti and output a parametric map — gammNIfTI • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is able to run a Generalized Additive Model (GAMM) using the gamm4() function. +The analysis will run in all voxels within the mask and will return parametric and smooth coefficients. +The function will create parametric maps according to the model selected. +The function will return a p-map, t-map, z-map, p-adjusted-map for parametric terms and p-map, z-map, p-adjusted-map for smooth terms. +You can select which type of p-value correction you want done on the map

    + +
    + +
    gammNIfTI(image, mask, fourdOut = NULL, formula, randomFormula, subjData,
    +  mc.preschedule = TRUE, ncores = 1, method = "none", residual = FALSE,
    +  outDir = NULL, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will call mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. Must be a binary mask

    fourdOut

    To be passed to mergeNifti, This is the path and file name without the suffix to save the fourd file. Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to gamm4()

    randomFormula

    Random effects formula passed to gamm4()

    subjData

    Dataframe containing all the covariates used for the analysis

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use

    method

    which method of correction for multiple comparisons (default is none)

    residual

    If set to TRUE then residuals maps will be returned along parametric maps

    outDir

    Path to the folder where to output parametric maps (Default is Null, only change if you want to write maps out)

    ...

    Additional arguments passed to gamm4()

    + +

    Value

    + +

    Returns Parametric maps of the fitted models over the NIfTI image

    + + +

    Examples

    +
    +image <- oro.nifti::nifti(img = array(rnorm(1600, sd=10), dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(c(rep(0,14), rep(1,2)), dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25), y = runif(25), id = rep(1:5,5)) +fm1 <- "~ s(x) + s(y)" +randomFormula <- "~(1|id)" +Maps <- gammNIfTI(image, mask, formula = fm1, + randomFormula = randomFormula, subjData = covs, ncores = 1, + method="fdr", REML=TRUE)
    #> [1] "Created time series to matrix" +#> [1] "Created formula list" +#> [1] "Running test model" +#> [1] "Running parallel models" +#> elapsed +#> 0.56 +#> [1] "Parallel Models Ran" +#> [1] "Creating parametric maps" +#> [1] "Working with output of gam object"
    + +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/gammVoxel.html b/docs/reference/gammVoxel.html new file mode 100644 index 0000000..3dafa84 --- /dev/null +++ b/docs/reference/gammVoxel.html @@ -0,0 +1,222 @@ + + + + + + + + +Run a Generalized Additive Mixed Effects Model on all voxels of a NIfTI image within a mask. — gammVoxel • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is able to run a Generalized Mixed Effects Model (GAMM) using the gamm4() function. +The analysis will run in all voxels within the mask and will return the model fit for each voxel.

    + +
    + +
    gammVoxel(image, mask, fourdOut = NULL, formula, randomFormula, subjData,
    +  mc.preschedule = TRUE, ncores = 1, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will call mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. Must be a binary mask

    fourdOut

    To be passed to mergeNifti, This is the path and file name without the suffix to save the fourd file. Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to gamm4()

    randomFormula

    Random effects formula passed to gamm4()

    subjData

    Dataframe containing all the covariates used for the analysis

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use

    ...

    Additional arguments passed to gamm4()

    + +

    Value

    + +

    Returns list of models fitted to each voxel over the masked images passed to function.

    + + +

    Examples

    +
    + +image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(c(rep(0,14),1), dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25), id = rep(1:5,5)) +fm1 <- "~ s(x)" +randomFormula <- "~(1|id)" +models <- gammVoxel(image = image , mask = mask, formula = fm1, randomFormula = randomFormula, + subjData = covs, ncores = 1, REML=TRUE)
    #> [1] "Created time series to matrix" +#> [1] "Created formula list" +#> [1] "Running test model" +#> [1] "Running parallel models" +#> elapsed +#> 0.414 +#> [1] "Parallel Models Ran"
    +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/index.html b/docs/reference/index.html new file mode 100644 index 0000000..2913cd2 --- /dev/null +++ b/docs/reference/index.html @@ -0,0 +1,252 @@ + + + + + + + + +Function reference • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    All functions

    +

    +
    +

    anovagamVoxel()

    +

    Computes voxelwise analysis of variance (ANOVA) tables for a Generalized Additive Model.

    +

    anovagammVoxel()

    +

    Computes voxelwise analysis of variance (ANOVA) tables for a Generalized Additive Mixed Effects Model.

    +

    anovalmVoxel()

    +

    Computes voxelwise analysis of variance (ANOVA) tables for a Linear Model.

    +

    anovalmerVoxel()

    +

    Computes voxelwise analysis of variance (ANOVA) tables for a Linear Mixed Effects Model.

    +

    gamCluster()

    +

    Run a Generalized Additive Model on the mean intensity over a region of interest

    +

    gamNIfTI()

    +

    Wrapper to run a Generalized Additive model on a NIfTI image and output parametric maps

    +

    gamRandomise()

    +

    Generate FSL Randomise call for a GAM Model

    +

    gammCluster()

    +

    Run a Generalized Additive Mixed Effects Model on the mean intensity over a region of interest

    +

    gammNIfTI()

    +

    Wrapper to run a Generalized Additive Mixed Effects model on an Nifti and output a parametric map

    +

    lmCluster()

    +

    Run a Linear Model on the mean intensity over a region of interest

    +

    lmNIfTI()

    +

    Wrapper to run a model on a NIfTI image and output parametric maps

    +

    lmerCluster()

    +

    Run a Linear Mixed Effects Model on the mean intensity over a region of interest

    +

    lmerNIfTI()

    +

    Run a Linear Mixed Effects Model on a NIfTI image and output a parametric maps

    +

    parMap()

    +

    Create parametric maps

    +

    plotGAM()

    +

    GAM plotting using ggplot2

    +

    plotGAMM()

    +

    GAMM plotting using ggplot2

    +
    + + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/listFormula.html b/docs/reference/listFormula.html new file mode 100644 index 0000000..d5d923e --- /dev/null +++ b/docs/reference/listFormula.html @@ -0,0 +1,175 @@ + + + + + + + + +Create list of Formulas for each voxel — listFormula • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is internal. +This function creates list of formulas that will be passed for analysis.

    + +
    + +
    listFormula(x, formula)
    + +

    Arguments

    + + + + + + + + + + +
    x

    Index of voxels to be analyzed

    formula

    covariates to be included in the analysis

    + + +

    Examples

    +
    + +x <- 1 +fm1 <- "~ x1" +formula <- listFormula(x, formula = fm1)
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/lmCluster.html b/docs/reference/lmCluster.html new file mode 100644 index 0000000..1fae0f7 --- /dev/null +++ b/docs/reference/lmCluster.html @@ -0,0 +1,214 @@ + + + + + + + + +Run a Linear Model on the mean intensity over a region of interest — lmCluster • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is able to run a Linear Model using the stats package. +All clusters must be labeled with integers in the mask passed as an argument.

    + +
    + +
    lmCluster(image, mask, fourdOut = NULL, formula, subjData,
    +  mc.preschedule = TRUE, ncores = 1, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will call mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. All clusters must be labeled with integers in the mask passed as an argument

    fourdOut

    To be passed to mergeNifti. This is the path and file name without the suffix to save the fourd file. Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to lm()

    subjData

    Dataframe containing all the covariates used for the analysis

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use

    ...

    Additional arguments passed to lm()

    + +

    Value

    + +

    Returns list of models fitted to the mean voxel intensity a region or interest.

    + + +

    Examples

    +
    image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(1:4, dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25)) +fm1 <- "~ x" +models <- lmCluster(image=image, mask=mask, + formula=fm1, subjData=covs, ncores = 1)
    #> [1] "Created meanCluster Matrix" +#> [1] "Created formula list" +#> [1] "Running test model" +#> [1] "Running parallel models" +#> elapsed +#> 0.003 +#> [1] "Parallel Models Ran"
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/lmNIfTI.html b/docs/reference/lmNIfTI.html new file mode 100644 index 0000000..031547c --- /dev/null +++ b/docs/reference/lmNIfTI.html @@ -0,0 +1,235 @@ + + + + + + + + +Wrapper to run a model on a NIfTI image and output parametric maps — lmNIfTI • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is able to run a Linear Model using the stats package. +The analysis will run in all voxels in in the mask and will return parametric coefficients. +The function will create parametric maps according to the model selected. +The function will return a p-map, t-map, z-map, p-adjusted-map for parametric terms and p-map, z-map, p-adjusted-map for smooth terms. +You can select which type of p-value correction you want done on the map.

    + +
    + +
    lmNIfTI(image, mask, fourdOut = NULL, formula, subjData,
    +  mc.preschedule = TRUE, ncores = 1, method = "none", residual = FALSE,
    +  outDir = NULL, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will call mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. Must be a binary mask

    fourdOut

    To be passed to mergeNifti, This is the path and file name without the suffix to save the fourd file. Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to lm()

    subjData

    Dataframe containing all the covariates used for the analysis

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use

    method

    which method of correction for multiple comparisons (default is none)

    residual

    If set to TRUE then residuals maps will be returned along parametric maps

    outDir

    Path to the folder where to output parametric maps (Default is Null, only change if you want to write maps out)

    ...

    Additional arguments passed to lm()

    + +

    Value

    + +

    Return parametric maps of the fitted models

    + + +

    Examples

    +
    image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(0:1, dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25), y = runif(25)) +fm1 <- "~ x + y" +Maps <- lmNIfTI(image=image, mask=mask, + formula=fm1, subjData=covs, ncores = 1, method="fdr")
    #> [1] "Created time series to matrix" +#> [1] "Created formula list" +#> [1] "Running test model" +#> [1] "Running parallel models" +#> elapsed +#> 0.029 +#> [1] "Parallel Models Ran" +#> [1] "Creating parametric maps" +#> [1] "Working with output from lm model"
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/lmVoxel.html b/docs/reference/lmVoxel.html new file mode 100644 index 0000000..9a66521 --- /dev/null +++ b/docs/reference/lmVoxel.html @@ -0,0 +1,214 @@ + + + + + + + + +Run a Linear Model on all voxels of a NIfTI image within a mask. — lmVoxel • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is able to run a Linear Model using the stats package. +The analysis will run in all voxels in in the mask and will return the model fit for each voxel.

    + +
    + +
    lmVoxel(image, mask, fourdOut = NULL, formula, subjData,
    +  mc.preschedule = TRUE, ncores = 1, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will all mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. Must be a binary mask

    fourdOut

    To be passed to mergeNifti, This is the path and file name without the suffix to save the fourd file. Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to lm()

    subjData

    Dataframe containing all the covariates used for the analysis

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use

    ...

    Additional arguments passed to lm()

    + +

    Value

    + +

    Returns list of models fitted to each voxel over the masked images passed to function.

    + + +

    Examples

    +
    image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(0:1, dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25)) +fm1 <- "~ x" +models <- lmVoxel(image=image, mask=mask, + formula=fm1, subjData=covs, ncores = 1)
    #> [1] "Created time series to matrix" +#> [1] "Created formula list" +#> [1] "Running test model" +#> [1] "Running parallel models" +#> elapsed +#> 0.021 +#> [1] "Parallel Models Ran"
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/lmerCluster.html b/docs/reference/lmerCluster.html new file mode 100644 index 0000000..f135b34 --- /dev/null +++ b/docs/reference/lmerCluster.html @@ -0,0 +1,216 @@ + + + + + + + + +Run a Linear Mixed Effects Model on the mean intensity over a region of interest — lmerCluster • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is able to run a LME using the lmer() function. +All clusters or region of interest must be labeled with integers in the mask passed as an argument. +The function relies on lmerTest to create p-values using the Satterthwaite Approximation.

    + +
    + +
    lmerCluster(image, mask, fourdOut = NULL, formula, subjData,
    +  mc.preschedule = TRUE, ncores = 1, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will call mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. All clusters must be labeled with integers in the mask passed as an argument

    fourdOut

    To be passed to mergeNifti, This is the path and file name without the suffix to save the fourd file. Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to lmer()

    subjData

    Dataframe containing all the covariates used for the analysis

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use

    ...

    Additional arguments passed to lmer()

    + +

    Value

    + +

    Returns list of models fitted to the mean voxel intensity a region or interest.

    + + +

    Examples

    +
    + +image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(c(rep(0,14),1,2), dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25), id = rep(1:5,5)) +fm1 <- "~ x + (1|id)" +models <- lmerCluster(image, mask, formula = fm1, subjData = covs, ncores = 1, REML=TRUE)
    #> [1] "Created meanCluster Matrix" +#> [1] "Created formula list" +#> [1] "Running test model"
    #> boundary (singular) fit: see ?isSingular
    #> [1] "Running parallel models"
    #> boundary (singular) fit: see ?isSingular
    #> boundary (singular) fit: see ?isSingular
    #> elapsed +#> 0.09 +#> [1] "Parallel Models Ran"
    +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/lmerNIfTI.html b/docs/reference/lmerNIfTI.html new file mode 100644 index 0000000..5a90453 --- /dev/null +++ b/docs/reference/lmerNIfTI.html @@ -0,0 +1,237 @@ + + + + + + + + +Run a Linear Mixed Effects Model on a NIfTI image and output a parametric maps — lmerNIfTI • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is able to run a Linear Mixed Effect Model using the lmer() function. +The function relies on lmerTest to create p-values using the Satterthwaite Approximation. +The analysis will run in all voxels in in the mask and will return parametric coefficients. +The function will create parametric maps according to the model selected. +The function will return a p-map, t-map, z-map, p-adjusted-map for parametric terms and p-map, z-map, p-adjusted-map for smooth terms. +You can select which type of p-value correction you want done on the map.

    + +
    + +
    lmerNIfTI(image, mask, fourdOut = NULL, formula, subjData,
    +  mc.preschedule = TRUE, ncores = 1, method = "none", residual = FALSE,
    +  outDir = NULL, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will call mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. Must be a binary mask

    fourdOut

    To be passed to mergeNifti, This is the path and file name without the suffix to save the fourd file. Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to lmer()

    subjData

    Dataframe containing all the covariates used for the analysis

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use

    method

    which method of correction for multiple comparisons (default is none)

    residual

    If set to TRUE then residuals maps will be returned along parametric maps

    outDir

    Path to the folder where to output parametric maps (Default is Null, only change if you want to write maps out)

    ...

    Additional arguments passed to lmer()

    + +

    Value

    + +

    Returns parametric maps of the fitted models

    + + +

    Examples

    +
    + +image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(c(rep(0,14),1,1), dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25), id = rep(1:5,5)) +fm1 <- "~ x + (1|id)" +Maps <- lmerNIfTI(image, mask, formula = fm1, subjData = covs, method="fdr", ncores = 1)
    #> [1] "Created time series to matrix" +#> [1] "Created formula list" +#> [1] "Running test model"
    #> boundary (singular) fit: see ?isSingular
    #> [1] "Running parallel models"
    #> boundary (singular) fit: see ?isSingular
    #> boundary (singular) fit: see ?isSingular
    #> boundary (singular) fit: see ?isSingular
    #> boundary (singular) fit: see ?isSingular
    #> boundary (singular) fit: see ?isSingular
    #> boundary (singular) fit: see ?isSingular
    #> boundary (singular) fit: see ?isSingular
    #> boundary (singular) fit: see ?isSingular
    #> elapsed +#> 0.465 +#> [1] "Parallel Models Ran" +#> [1] "Creating parametric maps" +#> [1] "Working with output from lmerTest model"
    +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/lmerVoxel.html b/docs/reference/lmerVoxel.html new file mode 100644 index 0000000..745ec9e --- /dev/null +++ b/docs/reference/lmerVoxel.html @@ -0,0 +1,212 @@ + + + + + + + + +Run a Linear Mixed Effects Model on all voxels of a NIfTI image within a mask. — lmerVoxel • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is able to run a Linear Mixed Effect Model using the lmer() function. +The analysis will run in all voxels in in the mask and will return parametric coefficients at each voxel +The function relies on lmerTest to create p-values using the Satterthwaite Approximation.

    + +
    + +
    lmerVoxel(image, mask, fourdOut = NULL, formula = NULL, subjData,
    +  mc.preschedule = TRUE, ncores = 1, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will call mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. Must be a binary mask

    fourdOut

    To be passed to mergeNifti, This is the path and file name without the suffix to save the fourd file. Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to lmer()

    subjData

    Dataframe containing all the covariates used for the analysis

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use

    ...

    Additional arguments passed to lmer()

    + +

    Value

    + +

    returns list of models fitted to each voxel over the masked images passed to function.

    + + +

    Examples

    +
    if (FALSE) { + +image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(0:1, dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25), id = rep(1:5,5)) +fm1 <- "~ x + (1|id)" +models <- lmerVoxel(image, mask, formula = fm1, subjData = covs, ncores = 1, REML=T) +}
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/mergeNiftis.html b/docs/reference/mergeNiftis.html new file mode 100644 index 0000000..37c9f31 --- /dev/null +++ b/docs/reference/mergeNiftis.html @@ -0,0 +1,184 @@ + + + + + + + + +Merge NIfTI Images across specified direction — mergeNiftis • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function merges nifti images together in a specified direction.

    + +
    + +
    mergeNiftis(inputPaths, direction = c("x", "y", "z", "t"), outfile = NULL,
    +  ncores = 1, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + +
    inputPaths

    This is a vector of input filenames (character)

    direction

    This is the direction you want to merge your image over, x, y, z, or t

    outfile

    This is the path and file name to save the Nifti file without the suffix, passed to writeNIfTI

    ncores

    Number of cores to be used for this operation

    ...

    Additional arguments passed to readNIfTI

    + +

    Value

    + +

    Returns a merged NIfTI image

    + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/parMap.html b/docs/reference/parMap.html new file mode 100644 index 0000000..ff74eb3 --- /dev/null +++ b/docs/reference/parMap.html @@ -0,0 +1,201 @@ + + + + + + + + +Create parametric maps — parMap • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function create parametric maps according from model parametric tables or analysis of variance tables. +The function will return a p-map, t-map, signed z-map, p-adjusted-map for parametric terms and p-map, z-map, p-adjusted-map for smooth terms. +Additionally the function will return a p-map, F-map, p-to-z-map, and p-adjusted-map if the input is ANOVA. +You can select which type of p-value correction you want done on the map. The z-maps are signed just like FSL.

    + +
    + +
    parMap(parameters, mask, method = "none", outDir = NULL)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + +
    parameters

    list of parametric and smooth table coefficients or ANOVA (like the output from vlmParam, vgamParam, anovalmVoxel)

    mask

    Input mask of type 'nifti' or path to one. Must be a binary mask or a character. Must match the mask passed to one of vlmParam, vgamParam, vgamm4Param, vlmerParam

    method

    which method of correction for multiple comparisons (default is none)

    outDir

    Path to the folder where to output parametric maps (Default is Null, only change if you want to write maps out)

    + +

    Value

    + +

    Return parametric maps of the fitted models

    + + +

    Examples

    +
    image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(0:1, dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25), y = runif(25)) +fm1 <- "~ x + y" +models <- vlmParam(image=image, mask=mask, + formula=fm1, subjData=covs, ncores = 1)
    #> [1] "Created time series to matrix" +#> [1] "Created formula list" +#> [1] "Running test model" +#> [1] "Running parallel models" +#> elapsed +#> 0.033 +#> [1] "Parallel Models Ran"
    Maps <- parMap(models, mask, method="fdr")
    #> [1] "Working with output from lm model"
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/plotGAM.html b/docs/reference/plotGAM.html new file mode 100644 index 0000000..7527720 --- /dev/null +++ b/docs/reference/plotGAM.html @@ -0,0 +1,209 @@ + + + + + + + + +GAM plotting using ggplot2 — plotGAM • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    GAM plotting using ggplot2

    + +
    + +
    plotGAM(gamFit, smooth.cov, groupCovs = NULL, orderedAsFactor = T,
    +  rawOrFitted = F, plotCI = T)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    gamFit

    fitted gam model as produced by mgcv::gam()

    smooth.cov

    (character) name of smooth term to be plotted

    groupCovs

    (character) name of group variable to plot by, if NULL (default) then there are no groups in plot

    orderedAsFactor

    if TRUE then the model is refitted with ordered variables as factors.

    rawOrFitted

    If FALSE (default) then only smooth terms are plotted; if rawOrFitted = "raw" then raw values are plotted against smooth; if rawOrFitted = "fitted" then fitted values are plotted against smooth

    plotCI

    if TRUE (default) upper and lower confidence intervals are added at 2 standard errors above and below the mean

    + +

    Value

    + +

    Returns a ggplot object that can be visualized using the print() function

    + +

    See also

    + +

    Other Plotting: plotGAMM

    + + +

    Examples

    +
    +data <- data.frame(x = rep(1:20, 2), group = rep(1:2, each = 20)) +set.seed(1) +data$y <- (data$x^2)*data$group*3 + rnorm(40, sd = 200) +data$group <- ordered(data$group) + +gam <- mgcv::gam(y ~ s(x) + group, data=data) + +plot1 <- plotGAM(gamFit = gam, smooth.cov = "x", groupCovs = NULL, + rawOrFitted = "raw", plotCI=TRUE, orderedAsFactor = FALSE)
    #> Warning: There are one or more factors in the model fit, please consider plotting by group since plot might be unprecise
    gam <- mgcv::gam(y ~ s(x) + group + s(x, by=group), data=data) +plot2 <- plotGAM(gamFit = gam, smooth.cov = "x", groupCovs = "group", + rawOrFitted = "raw", orderedAsFactor = FALSE)
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/plotGAMM.html b/docs/reference/plotGAMM.html new file mode 100644 index 0000000..b6a798c --- /dev/null +++ b/docs/reference/plotGAMM.html @@ -0,0 +1,217 @@ + + + + + + + + +GAMM plotting using ggplot2 — plotGAMM • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    GAMM plotting using ggplot2

    + +
    + +
    plotGAMM(gammFit, smooth.cov, groupCovs = NULL, orderedAsFactor = F,
    +  rawOrFitted = F, plotCI = T, grouping = NULL)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    gammFit

    fitted gam model as produced by gamm4::gamm()

    smooth.cov

    (character) name of smooth term to be plotted

    groupCovs

    (character) name of group variable to plot by, if NULL (default) then there are no groups in plot

    orderedAsFactor

    Disabled

    rawOrFitted

    If FALSE (default) then only smooth terms are plotted; if rawOrFitted = "raw" then raw values are plotted against smooth; if rawOrFitted = "fitted" then fitted values are plotted against smooth

    plotCI

    if TRUE (default) upper and lower confidence intervals are added at 2 standard errors above and below the mean

    grouping

    (character) Name of variable that you want to use as the group argument in ggplot2::aes(), useful for better visualization of longitudinal data, (default is NULL)

    + +

    Value

    + +

    Returns a ggplot object that can be visualized using the print() function

    + +

    See also

    + +

    Other Plotting: plotGAM

    + + +

    Examples

    +
    +set.seed(1) +data <- data.frame(x = (seq(.25,25, .25) +rnorm(100)), group = rep(1:2, 5), z=rnorm(100), + index.rnorm = rep(rnorm(50, sd = 50), 2), index.var = rep(1:50, 2)) +data$y <- (data$x)*data$group*10 + rnorm(100, sd = 700) + data$index.rnorm + data$z +data$group <- ordered(data$group) + + +gamm <- gamm4::gamm4(y ~ + s(x) + s(x, by=group) + z + group, data=data, random = ~ (1|index.var)) + + +plot <- plotGAMM(gammFit <- gamm, smooth.cov <- "x", groupCovs = "group", + plotCI <- T, rawOrFitted = "raw", grouping = "index.var") + +plot2 <- plotGAMM(gammFit <- gamm, smooth.cov <- "x", groupCovs = "group", + plotCI <- T, rawOrFitted = "fitted", grouping = "index.var")
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/rgamParam.html b/docs/reference/rgamParam.html new file mode 100644 index 0000000..6bf092e --- /dev/null +++ b/docs/reference/rgamParam.html @@ -0,0 +1,214 @@ + + + + + + + + +Run a Generalized Additive Model on all voxels of a NIfTI image and return coefficients and residuals — rgamParam • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is able to run a Generalized Additive Model (GAM) using the mgcv package. +The analysis will run in all voxels in in the mask and will return parametric and smooth coefficients.

    + +
    + +
    rgamParam(image, mask, fourdOut = NULL, formula, subjData,
    +  mc.preschedule = TRUE, ncores = 1, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will all mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. Must be a binary mask

    fourdOut

    To be passed to mergeNifti, This is the path and file name without the suffix to save the fourd file. Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to gam()

    subjData

    Dataframe containing all the covariates used for the analysis

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use

    ...

    Additional arguments passed to gam()

    + +

    Value

    + +

    Return list of parametric and spline coefficients (include standard errors and p-values) fitted to each voxel over the masked images passed to function.

    + + +

    Examples

    +
    image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(0:1, dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25)) +fm1 <- "~ s(x)" +models <- rgamParam(image=image, mask=mask, + formula=fm1, subjData=covs, ncores = 1, method="REML")
    #> [1] "Created time series to matrix" +#> [1] "Created formula list" +#> [1] "Running test model" +#> [1] "Running parallel models" +#> elapsed +#> 0.78 +#> [1] "Parallel Models Ran"
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/rgamm4Param.html b/docs/reference/rgamm4Param.html new file mode 100644 index 0000000..699c2fd --- /dev/null +++ b/docs/reference/rgamm4Param.html @@ -0,0 +1,222 @@ + + + + + + + + +Run a Generalized Additive Mixed Effects Model on all voxels of a NIfTI image return coefficients and residuals — rgamm4Param • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is able to run a Generalized Mixed Effects Model (GAMM) using the gamm4() function. +The analysis will run in all voxels in in the mask and will return parametric and smooth coefficients.

    + +
    + +
    rgamm4Param(image, mask, fourdOut = NULL, formula, randomFormula, subjData,
    +  mc.preschedule = TRUE, ncores = 1, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will all mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. Must be a binary mask

    fourdOut

    To be passed to mergeNifti, This is the path and file name without the suffix to save the fourd file. Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to gamm4()

    randomFormula

    Random effects formula passed to gamm4()

    subjData

    Dataframe containing all the covariates used for the analysis

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use

    ...

    Additional arguments passed to gamm4()

    + +

    Value

    + +

    Return list of parametric and spline coefficients (include standard errors and p-values) fitted to each voxel over the masked images passed to function.

    + + +

    Examples

    +
    + +image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(c(rep(0,15), 1), dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25), y = runif(25), id = rep(1:5,5)) +fm1 <- "~ s(x) + s(y)" +randomFormula <- "~(1|id)" +models <- rgamm4Param(image, mask, formula = fm1, + randomFormula = randomFormula, subjData = covs, ncores = 1, REML=TRUE)
    #> [1] "Created time series to matrix" +#> [1] "Created formula list" +#> [1] "Running test model" +#> [1] "Running parallel models" +#> elapsed +#> 0.3 +#> [1] "Parallel Models Ran"
    +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/rlmParam.html b/docs/reference/rlmParam.html new file mode 100644 index 0000000..59707ce --- /dev/null +++ b/docs/reference/rlmParam.html @@ -0,0 +1,213 @@ + + + + + + + + +Run a Linear Model on all voxels of a NIfTI and return parametric coefficients and residuals — rlmParam • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is able to run a Linear Model using the stats package. +The analysis will run in all voxels in in the mask and will and will return parametric coefficients at each voxel.

    + +
    + +
    rlmParam(image, mask, fourdOut = NULL, formula, subjData,
    +  mc.preschedule = TRUE, ncores = 1, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will all mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. Must be a binary mask

    fourdOut

    To be passed to mergeNifti, This is the path and file name without the suffix to save the fourd file. Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to lm()

    subjData

    Dataframe containing all the covariates used for the analysis

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use

    ...

    Additional arguments passed to lm()

    + +

    Value

    + +

    Return list of parametric and spline coefficients (include standard errors and p-values) fitted to each voxel over the masked images passed to function.

    + + +

    Examples

    +
    image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(0:1, dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25), y = runif(25)) +fm1 <- "~ x + y" +models <- rlmParam(image=image, mask=mask, formula=fm1, subjData=covs, ncores = 1)
    #> [1] "Created time series to matrix" +#> [1] "Created formula list" +#> [1] "Running test model" +#> [1] "Running parallel models" +#> elapsed +#> 0.045 +#> [1] "Parallel Models Ran"
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/rlmerParam.html b/docs/reference/rlmerParam.html new file mode 100644 index 0000000..6026297 --- /dev/null +++ b/docs/reference/rlmerParam.html @@ -0,0 +1,216 @@ + + + + + + + + +Run a Linear Mixed Effects Model on all voxels of a NIfTI image and return parametric coefficients and residuals — rlmerParam • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is able to run a Linear Mixed Effect Model using the lmer() function. +The analysis will run in all voxels in in the mask and will return the model fit for each voxel. +The function relies on lmerTest to create p-values using the Satterthwaite Approximation.

    + +
    + +
    rlmerParam(image, mask, fourdOut = NULL, formula, subjData,
    +  mc.preschedule = TRUE, ncores = 1, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will all mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. Must be a binary mask

    fourdOut

    To be passed to mergeNifti, This is the path and file name without the suffix to save the fourd file. Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to lmer()

    subjData

    Dataframe containing all the covariates used for the analysis

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use

    ...

    Additional arguments passed to lmer()

    + +

    Value

    + +

    Return list of parametric and spline coefficients (include standard errors and p-values) fitted to each voxel over the masked images passed to function.

    + + +

    Examples

    +
    + +image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(c(rep(0,15),1), dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25), id = rep(1:5,5)) +fm1 <- "~ x + (1|id)" +models <- rlmerParam(image, mask, formula = fm1, subjData = covs, ncores = 1)
    #> [1] "Created time series to matrix" +#> [1] "Created formula list" +#> [1] "Running test model"
    #> boundary (singular) fit: see ?isSingular
    #> [1] "Running parallel models"
    #> boundary (singular) fit: see ?isSingular
    #> boundary (singular) fit: see ?isSingular
    #> boundary (singular) fit: see ?isSingular
    #> boundary (singular) fit: see ?isSingular
    #> elapsed +#> 0.286 +#> [1] "Parallel Models Ran"
    +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/rparMap.html b/docs/reference/rparMap.html new file mode 100644 index 0000000..818c75f --- /dev/null +++ b/docs/reference/rparMap.html @@ -0,0 +1,216 @@ + + + + + + + + +Create parametric maps and residuals — rparMap • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function create parametric maps according from model parametric tables or analysis of variance tables. +The function will return a p-map, t-map, signed z-map, p-adjusted-map for parametric terms and p-map, z-map, p-adjusted-map for smooth terms. +Additionally the function will return a p-map, F-map, p-to-z-map, and p-adjusted-map if the input is ANOVA. +This function will return a residual map that can be used for cluster correction +You can select which type of p-value correction you want done on the map. The z-maps are signed just like FSL.

    + +
    + +
    rparMap(parameters, image, mask, method, ncores, mc.preschedule,
    +  outDir = NULL)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    parameters

    list of parametric and smooth table coefficients or ANOVA (like the output from vlmParam, vgamParam, anovalmVoxel)

    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will all mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to one. Must be a binary mask or a character. Must match the mask passed to one of vlmParam, vgamParam, vgamm4Param, vlmerParam

    method

    which method of correction for multiple comparisons (default is none)

    ncores

    Number of cores to use

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    outDir

    Path to the folder where to output parametric maps (Default is Null, only change if you want to write maps out)

    + +

    Value

    + +

    Return parametric maps of the fitted models

    + + +

    Examples

    +
    image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(0:1, dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25), y = runif(25)) +fm1 <- "~ x + y" +models <- rlmParam(image=image, mask=mask, + formula=fm1, subjData=covs, ncores = 1)
    #> [1] "Created time series to matrix" +#> [1] "Created formula list" +#> [1] "Running test model" +#> [1] "Running parallel models" +#> elapsed +#> 0.046 +#> [1] "Parallel Models Ran"
    Maps <- rparMap(models, image, mask, method="fdr", ncores = 1, mc.preschedule=TRUE)
    #> [1] "Working with output from lm model"
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/ts2matrix.html b/docs/reference/ts2matrix.html new file mode 100644 index 0000000..08b2508 --- /dev/null +++ b/docs/reference/ts2matrix.html @@ -0,0 +1,175 @@ + + + + + + + + +Timeseries to Matrix — ts2matrix • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is able to mask a 4-Dimensional image and create a matrix from it. +Each column represents the same voxel in the xyz array while the rows represent the t-dimension.

    + +
    + +
    ts2matrix(image, mask)
    + +

    Arguments

    + + + + + + + + + + +
    image

    Input image of type 'nifti'

    mask

    Input mask of type 'nifti'. Must be a binary mask

    + + +

    Examples

    +
    + +image <- oro.nifti::nifti(img = array(1:64, dim =c(4,4,4,5))) +mask <- oro.nifti::nifti(img = array(0:1, dim = c(4,4,4))) +matrix <- ts2matrix(image, mask)
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/ts2meanCluster.html b/docs/reference/ts2meanCluster.html new file mode 100644 index 0000000..f45a818 --- /dev/null +++ b/docs/reference/ts2meanCluster.html @@ -0,0 +1,175 @@ + + + + + + + + +Timeseries to Mean Cluster — ts2meanCluster • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is able to output the mean voxel intensity over a cluster. +Each column represents a cluster and the rows represent the t-dimension.

    + +
    + +
    ts2meanCluster(image, mask)
    + +

    Arguments

    + + + + + + + + + + +
    image

    Input image of type 'nifti'

    mask

    Input mask of type 'nifti'. Must have different clusters labeled as integers.

    + + +

    Examples

    +
    + +image <- oro.nifti::nifti(img = array(1:320, dim =c(4,4,4,5))) +mask <- oro.nifti::nifti(img = array(0:15, dim = c(4,4,4,1))) +matrix <- ts2meanCluster(image, mask)
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/vgamParam.html b/docs/reference/vgamParam.html new file mode 100644 index 0000000..bb68d7c --- /dev/null +++ b/docs/reference/vgamParam.html @@ -0,0 +1,214 @@ + + + + + + + + +Run a Generalized Additive Model on all voxels of a NIfTI image within a mask and return parametric and smooth coefficients tables — vgamParam • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is able to run a Generalized Additive Model (GAM) using the mgcv package. +The analysis will run in all voxels in in the mask and will return parametric and smooth coefficients.

    + +
    + +
    vgamParam(image, mask, fourdOut = NULL, formula, subjData,
    +  mc.preschedule = TRUE, ncores = 1, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will all mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. Must be a binary mask

    fourdOut

    To be passed to mergeNifti, This is the path and file name without the suffix to save the fourd file. Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to gam()

    subjData

    Dataframe containing all the covariates used for the analysis

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use

    ...

    Additional arguments passed to gam()

    + +

    Value

    + +

    Return list of parametric and spline coefficients (include standard errors and p-values) fitted to each voxel over the masked images passed to function.

    + + +

    Examples

    +
    image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(0:1, dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25)) +fm1 <- "~ s(x)" +models <- vgamParam(image=image, mask=mask, + formula=fm1, subjData=covs, ncores = 1, method="REML")
    #> [1] "Created time series to matrix" +#> [1] "Created formula list" +#> [1] "Running test model" +#> [1] "Running parallel models" +#> elapsed +#> 0.641 +#> [1] "Parallel Models Ran"
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/vgamm4Param.html b/docs/reference/vgamm4Param.html new file mode 100644 index 0000000..a706f4a --- /dev/null +++ b/docs/reference/vgamm4Param.html @@ -0,0 +1,222 @@ + + + + + + + + +Run a Generalized Additive Mixed Effects Model on all voxels of a NIfTI image and return parametric and smooth coefficients — vgamm4Param • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is able to run a Generalized Mixed Effects Model (GAMM) using the gamm4() function. +The analysis will run in all voxels in in the mask and will return parametric and smooth coefficients.

    + +
    + +
    vgamm4Param(image, mask, fourdOut = NULL, formula, randomFormula, subjData,
    +  mc.preschedule = TRUE, ncores = 1, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will all mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. Must be a binary mask

    fourdOut

    To be passed to mergeNifti, This is the path and file name without the suffix to save the fourd file. Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to gamm4()

    randomFormula

    Random effects formula passed to gamm4()

    subjData

    Dataframe containing all the covariates used for the analysis

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use

    ...

    Additional arguments passed to gamm4()

    + +

    Value

    + +

    Return list of parametric and spline coefficients (include standard errors and p-values) fitted to each voxel over the masked images passed to function.

    + + +

    Examples

    +
    + +image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(c(rep(0,15), 1), dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25), y = runif(25), id = rep(1:5,5)) +fm1 <- "~ s(x) + s(y)" +randomFormula <- "~(1|id)" +models <- vgamm4Param(image, mask, formula = fm1, + randomFormula = randomFormula, subjData = covs, ncores = 1, REML=TRUE)
    #> [1] "Created time series to matrix" +#> [1] "Created formula list" +#> [1] "Running test model" +#> [1] "Running parallel models" +#> elapsed +#> 0.265 +#> [1] "Parallel Models Ran"
    +
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/vlmParam.html b/docs/reference/vlmParam.html new file mode 100644 index 0000000..a7e5236 --- /dev/null +++ b/docs/reference/vlmParam.html @@ -0,0 +1,213 @@ + + + + + + + + +Run a Linear Model on all voxels of a NIfTI image within a mask and and return parametric coefficients tables — vlmParam • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is able to run a Linear Model using the stats package. +The analysis will run in all voxels in in the mask and will and will return parametric coefficients at each voxel.

    + +
    + +
    vlmParam(image, mask, fourdOut = NULL, formula, subjData,
    +  mc.preschedule = TRUE, ncores = 1, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will all mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. Must be a binary mask

    fourdOut

    To be passed to mergeNifti, This is the path and file name without the suffix to save the fourd file. Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to lm()

    subjData

    Dataframe containing all the covariates used for the analysis

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use

    ...

    Additional arguments passed to lm()

    + +

    Value

    + +

    Return list of parametric and spline coefficients (include standard errors and p-values) fitted to each voxel over the masked images passed to function.

    + + +

    Examples

    +
    image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(0:1, dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25), y = runif(25)) +fm1 <- "~ x + y" +models <- vlmParam(image=image, mask=mask, formula=fm1, subjData=covs, ncores = 1)
    #> [1] "Created time series to matrix" +#> [1] "Created formula list" +#> [1] "Running test model" +#> [1] "Running parallel models" +#> elapsed +#> 0.025 +#> [1] "Parallel Models Ran"
    +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/vlmerParam.html b/docs/reference/vlmerParam.html new file mode 100644 index 0000000..fc7cae9 --- /dev/null +++ b/docs/reference/vlmerParam.html @@ -0,0 +1,216 @@ + + + + + + + + +Run a Linear Mixed Effects Model on all voxels of a NIfTI image within a mask and and return parametric coefficients tables — vlmerParam • voxel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    + +

    This function is able to run a Linear Mixed Effect Model using the lmer() function. +The analysis will run in all voxels in in the mask and will return the model fit for each voxel. +The function relies on lmerTest to create p-values using the Satterthwaite Approximation.

    + +
    + +
    vlmerParam(image, mask, fourdOut = NULL, formula, subjData,
    +  mc.preschedule = TRUE, ncores = 1, ...)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    image

    Input image of type 'nifti' or vector of path(s) to images. If multiple paths, the script will all mergeNifti() and merge across time.

    mask

    Input mask of type 'nifti' or path to mask. Must be a binary mask

    fourdOut

    To be passed to mergeNifti, This is the path and file name without the suffix to save the fourd file. Default (NULL) means script won't write out 4D image.

    formula

    Must be a formula passed to lmer()

    subjData

    Dataframe containing all the covariates used for the analysis

    mc.preschedule

    Argument to be passed to mclapply, whether or not to preschedule the jobs. More info in parallel::mclapply

    ncores

    Number of cores to use

    ...

    Additional arguments passed to lmer()

    + +

    Value

    + +

    Return list of parametric and spline coefficients (include standard errors and p-values) fitted to each voxel over the masked images passed to function.

    + + +

    Examples

    +
    + +image <- oro.nifti::nifti(img = array(1:1600, dim =c(4,4,4,25))) +mask <- oro.nifti::nifti(img = array(c(rep(0,15),1), dim = c(4,4,4,1))) +set.seed(1) +covs <- data.frame(x = runif(25), id = rep(1:5,5)) +fm1 <- "~ x + (1|id)" +models <- vlmerParam(image, mask, formula = fm1, subjData = covs, ncores = 1)
    #> [1] "Created time series to matrix" +#> [1] "Created formula list" +#> [1] "Running test model"
    #> boundary (singular) fit: see ?isSingular
    #> [1] "Running parallel models"
    #> boundary (singular) fit: see ?isSingular
    #> boundary (singular) fit: see ?isSingular
    #> boundary (singular) fit: see ?isSingular
    #> boundary (singular) fit: see ?isSingular
    #> elapsed +#> 0.195 +#> [1] "Parallel Models Ran"
    +
    +
    + +
    + + + +
    + + + + + + + +