MRIaggr-calcTableHypoReperf: Compute reperfusion and hypoperfusion tables

Description Usage Arguments Details Value See Also Examples

Description

Compute of the reperfusion and hypoperfusion values.

Usage

1
2
3
4
5
## S4 method for signature 'MRIaggr'
calcTableHypoReperf(object, param, timepoint, threshold = 1:10, sep = "_",
     norm_mu = FALSE, norm_sigma = FALSE, mask = NULL, numeric2logical = FALSE,
     param.update = "reperf",
	 verbose = optionsMRIaggr("verbose"), update.object = FALSE, overwrite = FALSE)

Arguments

object

an object of class MRIaggr. REQUIRED.

param

the perfusion parameter(s). character vector. REQUIRED.

timepoint

one or two time points. character vector. REQUIRED.

threshold

the value of the hypoperfusion thresholds. numeric vector.

sep

the separator between the parameter names and the time points. character.

mask

the binary contrast parameter indentifing the lesion at timepoint[1]. character or NULL if no mask is available.

numeric2logical

should mask be converted to logical ? logical.

norm_mu

the type of centering to apply on the parameter values. character.

norm_sigma

the type of scaling to apply on the parameter values. character.

verbose

should the execution of the function be traced ? logical.

param.update

which type of parameter should be stored in the object ? Any of "shift" "reperf" "reperf_pc" "deperf" "deperf_pc".

update.object

should the resulting values be stored in object ? logical.

overwrite

if reperfusion or hypoperfusion values are already stored in object@table_reperfusion or object@table_hypofusion, can they be overwritten ? logical.

Details

ARGUMENTS:
Information about the norm_mu and norm_sigma arguments can be found in the details section of selectContrast.

FUNCTION:
If mask is set to NULL, no mismatch volume will not be computed.

Value

An list containing :

See Also

calcThresholdMRIaggr to process contrast parameters.
selectTable to select the reperfusion/hypoperfusion tables.
calcW to compute the neighboring matrix.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
## load a MRIaggr object
data("MRIaggr.Pat1_red", package = "MRIaggr")

#### 1- directly ####
res <- calcTableHypoReperf(MRIaggr.Pat1_red, param = c("TTP","MTT"), timepoint=c("t0","t1"),
     mask="MASK_DWI_t0", numeric2logical = TRUE,
     update.object = TRUE, overwrite = TRUE)

carto_TTP_t0 <- selectContrast(MRIaggr.Pat1_red, param = "TTP_t0")
carto_TTP_t1 <- selectContrast(MRIaggr.Pat1_red, param = "TTP_t1")

## hypoperfusion
sum( (carto_TTP_t0 >= 4) )
selectTable(MRIaggr.Pat1_red, "hypoperfusion")["4","Vhypo.TTP_t0"]

## mismatch
testN <- (selectContrast(MRIaggr.Pat1_red, param = "MASK_DWI_t0") == 0)

sum( (carto_TTP_t0 >= 4) * testN )
selectTable(MRIaggr.Pat1_red, "hypoperfusion")["4","Vmismatch.TTP"]

sum( (carto_TTP_t0 >= 4) * testN ) / sum( testN == FALSE )
selectTable(MRIaggr.Pat1_red, "hypoperfusion")["4","PCmismatch.TTP"]


## reperfusion
sum((carto_TTP_t0 >= 4) * (carto_TTP_t1 < 4))
selectTable(MRIaggr.Pat1_red, "reperfusion")["4","Vreperf.TTP"]

sum((carto_TTP_t0 >= 4) * (carto_TTP_t1 < 4)) / sum( (carto_TTP_t0>=4) )
selectTable(MRIaggr.Pat1_red, "reperfusion")["4","PCreperf.TTP"]

## W reperfusion
carto_TTPth_t0 <- carto_TTP_t0
carto_TTPth_t0[carto_TTPth_t0 > 10] <- 10
carto_TTPth_t0[carto_TTPth_t0 < 0] <- 0

carto_TTPth_t1 <- carto_TTP_t1
carto_TTPth_t1[carto_TTP_t1 > 10] <- 10
carto_TTPth_t1[carto_TTP_t1 < 0] <- 0

weight <- (carto_TTPth_t0 - carto_TTPth_t1) / carto_TTPth_t0
weight[ ((carto_TTPth_t0 == 0) + (carto_TTP_t0 < 4) + (carto_TTP_t1 >= 4)) > 0 ] <- 0

sum((carto_TTP_t0 >= 4) * (carto_TTP_t1 < 4) * weight)
selectTable(MRIaggr.Pat1_red, "reperfusion")["4","VreperfW.TTP"]

sum((carto_TTP_t0 >= 4) * (carto_TTP_t1 < 4) * weight) / sum( (carto_TTP_t0 >= 4) )
selectTable(MRIaggr.Pat1_red, "reperfusion")["4","PCreperfW.TTP"]


## deperfusion
sum((carto_TTP_t0 < 4) * (carto_TTP_t1 >= 4))
selectTable(MRIaggr.Pat1_red, "reperfusion")["4","Vdeperf.TTP"]

sum((carto_TTP_t0 < 4) * (carto_TTP_t1 >= 4)) / sum( (carto_TTP_t0 >= 4) )
selectTable(MRIaggr.Pat1_red, "reperfusion")["4","PCdeperf.TTP"]

## shift
sum((carto_TTPth_t0 - carto_TTPth_t1 >= 4))
selectTable(MRIaggr.Pat1_red, "reperfusion")["4","Vshift_reperf.TTP"]

sum((carto_TTPth_t0-carto_TTPth_t1 >= 4)) / sum( (carto_TTP_t0>=4) )
selectTable(MRIaggr.Pat1_red, "reperfusion")["4","PCshift_reperf.TTP"]

#### 2- via calcThresholdMRIaggr ####
## perform segmentation  (call mritc)
## Not run: 
calcThresholdMRIaggr(MRIaggr.Pat1_red, param = c("TTP_t0","MTT_t0","TTP_t1","MTT_t1"),
         threshold=1:10, name_newparam = c("TTP.GR_t0","MTT.GR_t0","TTP.GR_t1","MTT.GR_t1"),
         rm.CSF=TRUE, hemisphere = "lesion",
         GRalgo=TRUE, seed = c("MASK_T2_FLAIR_t2","MASK_DWI_t0"), W.range  = sqrt(2),
         update.object = TRUE, overwrite = TRUE)

res <- calcTableHypoReperf(MRIaggr.Pat1_red, param = c("TTP.GR","MTT.GR"),
         timepoint = c("t0","t1"), mask = "MASK_DWI_t0", numeric2logical = TRUE,
         update.object = TRUE, overwrite = TRUE)
		 
## display
selectTable(MRIaggr.Pat1_red, "hypoperfusion")["4","Vhypo.TTP.GR_t0"]

par(mfrow = c(2,4), mar = rep(1.5,4), mgp = c(2,0.5,0))
multiplot(MRIaggr.Pat1_red, param = "TTP_t0", num = 1:3,
             palette = rainbow(10), window = NULL, main = "raw - slice ", 
			 breaks=(0:10)-10^{-10})
multiplot(MRIaggr.Pat1_red, param = "TTP.GR_t0", num = 1:3,
             palette = rainbow(10), window = NULL, main = "GR - slice ", 
			 breaks=(0:10)-10^{-10})

## End(Not run)

bozenne/MRIaggr documentation built on May 13, 2019, 1:39 a.m.