Skip to content

Testing LESYMAP installation

dorianps edited this page Mar 16, 2019 · 6 revisions

LESYMAP is not a standalone package, it depends on ANTsR functions and other system software, which change from time to time. Occasionally these upstream changes cause anomalies in LESYMAP outputs. For this reason, you should always check the current LESYMAP installation with the following examples.

Before starting R, set the number of threads used by ITK at a low number.

export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1

Run a mass-univariate example using Brunner-Munzel tests (~2 minutes)

library(LESYMAP)
lesydata = file.path(find.package('LESYMAP'),'extdata')
filenames = Sys.glob(file.path(lesydata, 'lesions', 'Subject*.nii.gz'))
behavior = Sys.glob(file.path(lesydata, 'behavior', 'behavior.txt'))

lsm = lesymap(filenames, behavior, method = 'BMfast')

template = antsImageRead(Sys.glob(file.path(lesydata, 'template', 'ch2.nii.gz')))
plot(template, lsm$stat.img)

22:14:19 Running LESYMAP 0.0.0.9210
22:14:19 Checking a few things...
22:14:19 Loading behavioral data...131 scores found.
22:14:20 Filenames as input, checking lesion values on 1st image...
22:14:22 Searching voxels lesioned >= 10% subjects...326828 found
22:15:20 Computing unique patches...
22:15:58 Found 195102 patches in 326828 voxels - 1.7 times more voxels
22:15:58 Using existing lesion matrix... 131x195102
22:15:58 Running analysis: BMfast ...
22:16:02 Correcting p-values: fdr ...
22:16:02 Preparing images...
22:16:03 Logging call details...
22:16:03 Done! 1.7 mins

The plotted result should look like this:
BMfast

Run a multivariate example using SCCAN (~7 minutes)

library(LESYMAP)
lesydata = file.path(find.package('LESYMAP'),'extdata')
filenames = Sys.glob(file.path(lesydata, 'lesions', 'Subject*.nii.gz'))
behavior = Sys.glob(file.path(lesydata, 'behavior', 'behavior.txt'))

lsm = lesymap(filenames, behavior, method = 'sccan', 
         sparseness=0.19, validateSparseness=FALSE)

template = antsImageRead(Sys.glob(file.path(lesydata, 'template', 'ch2.nii.gz')))
plot(template, lsm$stat.img)

22:24:49 Running LESYMAP 0.0.0.9210
22:24:49 Checking a few things...
22:24:49 Loading behavioral data...131 scores found.
22:24:50 Filenames as input, checking lesion values on 1st image...
22:24:51 SCCAN method: ignoring patch, nperm, and multiple comparison...
22:24:51 Searching voxels lesioned >= 10% subjects...326828 found
22:25:41 noPatch true - Patches will not be used...
22:25:42 Computing lesion matrix... 131x326828
22:26:10 Running analysis: sccan ...
Calling SCCAN with:
Components: 1
Use ranks: 1
Sparseness: 0.19
Cluster threshold: 150
Smooth sigma: 0.4
Iterations: 20
maxBased: FALSE
directionalSCCAN: TRUE
optimizeSparseness: FALSE
validateSparseness: FALSE
22:31:19 Preparing images...
22:31:19 Logging call details...
22:31:19 Done! 6.5 mins

The plotted result should look like this:
sccan2


If you notice a substantial difference with the maps you see on your screen, open a Github issue and post some screeshots.