fmriu.thresh_graphs: Graph Thresholding

Description Usage Arguments Value Author(s) Examples

Description

A utility function for easily applying various methods of thresholding to graphs.

Usage

1
fmriu.thresh_graphs(graphs, method = NaN, t = 0.5, binarize = FALSE)

Arguments

graphs:

[[n]][nroi, nroi] graphs to threshold.

method=NaN:

the method to use for thresholding the graphs.

'cutoff'

use a cutoff value. Sets all elements in the graph below this value to zero.

'ptile'

use a percentile. Calculates the cutoff for each list element given the appropriate percentile, and sets elements under this percentile to zero.

NaN

do not apply any thresholding to the graphs.

t=0.5:

the threshold to use for the thresholding method selected. Behavior depends on the method above chosen:

method == 'cutoff'

$t$ corresponds to the cutoff value. All values in the graphs less than $t$ will be set to zero.

method == 'ptile'

$t$ corresponds to the normalized percentile between 0 and 1. The value of $t$ corresponds to the $100*t$ percentile.

method == NaN

$t$ does nothing.

binarize='FALSE':

whether to binarize the graphs after the thresholding has been applied.

FALSE

do not binarize the graphs.

TRUE

binarize the graphs by setting all nonzero values to 1, and leaving all zero values as 0.

Value

tgraphs: [[n]][nroi, nroi] the thresholded graphs.

Author(s)

Eric Bridgeford

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
graphs <- list()
graphs[[1]] <- matrix(runif(25), nrow=5, ncol=5)
graphs[[2]] <- matrix(runif(25), nrow=5, ncol=5)
graphs[[3]] <- matrix(runif(25), nrow=5, ncol=5)
# I want to binarize my graphs without applying any thresholding
# setting all edges nonzero to connected (1) and zero edges to disconnected (0).
fmriu.thresh_graphs(graphs, binarize=TRUE)

# For each graph, I want to threshold the botton 70% of edges
# and then binarize such that the bottom 70% of edges are disconnected (0)
# and the top 30% of edges are connected (1).
fmriu.thresh_graphs(graphs, method='ptile', t=0.7, binarize=TRUE)

# For each graph, remove all edges less than 0.5.
fmriu.thresh_graphs(graphs, method='cutoff', t=0.5)

neurodata/fmriutils documentation built on May 14, 2019, 2:30 p.m.