gamRandomise function

Generate FSL Randomise call for a GAM Model

Generate FSL Randomise call for a GAM Model

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

Returns

Return randomise command

Examples

## Not run: 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) ## End(Not run)