fit_MRMC_versionTWO: Fit and Draw the FROC models (curves) version2.

Description Usage Arguments See Also Examples

View source: R/fit_MRMC_versionTWO.R

Description

Fit and Draw the FROC models (curves). This model is aimed to draw a free-response ROC curves for multiple readers and a single modality.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
fit_MRMC_versionTWO(
  dataList,
  DrawFROCcurve = TRUE,
  DrawCFPCTP = TRUE,
  version = 2,
  mesh.for.drawing.curve = 10000,
  significantLevel = 0.7,
  cha = 1,
  war = floor(ite/5),
  ite = 10000,
  dig = 5,
  see = 1234569
)

Arguments

dataList

A list, specifying an FROC data to be fitted a model. It consists of data of numbers of TPs, FPs, lesions, images. .In addition, if in case of mutiple readers or mutiple modalities, then modaity ID and reader ID are included also.

The dataList will be passed to the function rstan::sampling() of rstan. This is a variable in the function rstan::sampling() in which it is named data.

For the single reader and a single modality data, the dataList is made by the following manner:

dataList.Example <- list(

h = c(41,22,14,8,1), # number of hits for each confidence level

f = c(1,2,5,11,13), # number of false alarms for each confidence level

NL = 124, # number of lesions (signals)

NI = 63, # number of images (trials)

C = 5) # number of confidence, .. the author thinks it can be calculated as the length of h or f ...? ha, why I included this. ha .. should be omitted.

Using this object dataList.Example, we can apply fit_Bayesian_FROC() such as fit_Bayesian_FROC(dataList.Example).

To make this R object dataList representing FROC data, this package provides three functions:

dataset_creator_new_version()

Enter TP and FP data by table .

create_dataset()

Enter TP and FP data by interactive manner.

Before fitting a model, we can confirm our dataset is correctly formulated by using the function viewdata().

—————————————————————————————-

A Single reader and a single modality (SRSC) case.

—————————————————————————————-

In a single reader and a single modality case (srsc), dataList is a list consisting of f, h, NL, NI, C where f, h are numeric vectors and NL, NI, C are positive integers.

f

Non-negative integer vector specifying number of false alarms associated with each confidence level. The first component corresponding to the highest confidence level.

h

Non-negative integer vector specifying number of Hits associated with each confidence level. The first component corresponding to the highest confidence level.

NL

A positive integer, representing Number of Lesions.

NI

A positive integer, representing Number of Images.

C

A positive integer, representing Number of Confidence level.

The detail of these dataset, see the datasets endowed with this package. 'Note that the maximal number of confidence level, denoted by C, are included, however, Note that confidence level vector c should not be specified. If specified, will be ignored , since it is created by c <-c(rep(C:1)) in the inner program and do not refer from user input data, where C is the highest number of confidence levels. So, you should write down your hits and false alarms vector so that it is compatible with this automatically created c vector.

data Format:

A single reader and a single modality case

——————————————————————————————————

NI=63,NL=124 confidence level No. of false alarms No. of hits
In R console -> c f h
----------------------- ----------------------- ----------------------------- -------------
definitely present c[1] = 5 f[1] = F_5 = 1 h[1] = H_5 = 41
probably present c[2] = 4 f[2] = F_4 = 2 h[2] = H_4 = 22
equivocal c[3] = 3 f[3] = F_3 = 5 h[3] = H_3 = 14
subtle c[4] = 2 f[4] = F_2 = 11 h[4] = H_2 = 8
very subtle c[5] = 1 f[5] = F_1 = 13 h[5] = H_1 = 1

—————————————————————————————————

* false alarms = False Positives = FP

* hits = True Positives = TP

Note that in FROC data, all confidence level means present (diseased, lesion) case only, no confidence level indicating absent. Since each reader marks his suspicious location only if he thinks lesions are present, and marked positions generates the hits or false alarms, thus each confidence level represents that lesion is present. In the absent case, reader does not mark any locations and hence, the absent confidence level does not relate this dataset. So, if reader think it is no lesion, then in such case confidence level is not needed.

Note that the first column of confidence level vector c should not be specified. If specified, will be ignored , since it is created by c <-c(rep(C:1)) automatically in the inner program and do not refer from user input data even if it is specified explicitly, where C is the highest number of confidence levels. So you should check the compatibility of your data and the confidence level vector c <-c(rep(C:1)) via a table which can be displayed by the function viewdata().

—————————————————————————————

Multiple readers and multiple modalities case, i.e., MRMC case

—————————————————————————————

In case of multiple readers and multiple modalities, i.e., MRMC case, in order to apply the function fit_Bayesian_FROC(), dataset represented by an R list object representing FROC data must contain components m,q,c,h,f,NL,C,M,Q.

C

A positive integer, representing the highest number of confidence level, this is a scalar.

M

A positive integer vector, representing the number of modalities.

Q

A positive integer, representing the number of readers.

m

A vector of positive integers, representing the modality ID vector.

q

A vector of positive integers, representing the reader ID vector.

c

A vector of positive integers, representing the confidence level. This vector must be made by rep(rep(C:1), M*Q)

h

A vector of non-negative integers, representing the number of hits.

f

A vector of non-negative integers, representing the number of false alarms.

NL

A positive integer, representing the Total number of lesions for all images, this is a scalar.

Note that the maximal number of confidence level (denoted by C) are included in the above R object. However, each confidence level vector is not included in the data, because it is created automatically from C. To confirm false positives and hits are correctly ordered with respect to the automatically generated confidence vector,

the function viewdata() shows the table. Revised 2019 Nov 27 Revised 2019 Dec 5

Example data.

Multiple readers and multiple modalities ( i.e., MRMC)

—————————————————————————————————

Modality ID Reader ID Confidence levels No. of false alarms No. of hits.
m q c f h
-------------- ------------- ------------------------ ------------------- ----------------
1 1 3 20 111
1 1 2 29 55
1 1 1 21 22
1 2 3 6 100
1 2 2 15 44
1 2 1 22 11
2 1 3 6 66
2 1 2 24 55
2 1 1 23 1
2 2 3 5 66
2 2 2 30 55
2 2 1 40 44

—————————————————————————————————

* false alarms = False Positives = FP

* hits = True Positives = TP

DrawFROCcurve

Logical: TRUE of FALSE. Whether the FROC curve is to be drawn.

DrawCFPCTP

Logical: TRUE of FALSE. Whether the CFP and CTP points are to be drawn. CFP: Cumulative false positive per lesion (or image) which is also called False Positive Fraction (FPF). CTP Cumulative True Positive per lesion which is also called True Positive Fraction (TPF)..

version

2 or 3

mesh.for.drawing.curve

A positive large integer, indicating number of dots drawing the curves, Default =10000.

significantLevel

This is a number between 0 and 1. The results are shown if posterior probabilities are greater than this quantity.

cha

A variable to be passed to the function rstan::sampling() of rstan in which it is named chains. A positive integer representing the number of chains generated by Hamiltonian Monte Carlo method, and, Default = 1.

war

A variable to be passed to the function rstan::sampling() of rstan in which it is named warmup. A positive integer representing the Burn in period, which must be less than ite. Defaults to war = floor(ite/5)=10000/5=2000,

ite

A variable to be passed to the function rstan::sampling() of rstan in which it is named iter. A positive integer representing the number of samples synthesized by Hamiltonian Monte Carlo method, and, Default = 1111

dig

A variable to be passed to the function rstan::sampling() of rstan in which it is named ...??. A positive integer representing the Significant digits, used in stan Cancellation. Default = 5,

see

A variable to be passed to the function rstan::sampling() of rstan in which it is named seed. A positive integer representing seed used in stan, Default = 1234.

See Also

Example data:

BayesianFROC::dataList.one.modality

This dataset is a single modality dataset with multiple readers.

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

#================The first example======================================
#(1)First, we prepare the data from this package.

    dat  <- BayesianFROC::dataList.one.modality



#(2)Second, we run fit_Bayesian_FROC() in which the rstan::stan() is implemented.
#with data named "dat"  and the author's Bayesian model.


 #        fit <-  fit_MRMC_versionTWO(dat,see = 12,ite=111)

 #      It needs a lot of memory and so, in this example we take the small iteration,
 #      i.e., ite =2222. However if user execute this, then the ite =30000 is recommended
 #      for getting reliable estimates.







#Note that we change the seed from default to 12 to get a convergence model.
#If users enconter the convergence issues,
#then please consider changing the seed like this example.

#The resulting FROC curve means the summarizing curve over all readers

#================The Second example======================================
#(1)First, we prepare the data from this package.

        dat  <- BayesianFROC::dataList.Chakra.Web



#(2)Second, we run fit_Bayesian_FROC() in which the rstan::stan() is implemented.
#with data named "dat"  and the author's Bayesian model.


  #       fit <-  fit_MRMC_versionTWO(dataList.Chakra.Web ,ite=111)

#The resulting FROC curve means the summarizing curve over all readers

 #      It needs a lot of memory and so, in this example we take the small iteration,
 #      i.e., ite =2222. However if user execute this, then the ite =30000 is recommended
 #      for getting reliable estimates.







#      Close the graphic device to avoid errors in R CMD check.


    Close_all_graphic_devices()

     
## End(Not run)#dontrun

BayesianFROC documentation built on Jan. 23, 2022, 9:06 a.m.