Converts ratings arrays, ROC or FROC, but not LROC, to an RJafroc dataset, thereby allowing the user to leverage the file I/O, plotting and analyses capabilities of RJafroc.

Df2RJafrocDataset(NL, LL, InputIsCountsTable = FALSE, ...)

Arguments

NL

Non-lesion localizations array (or FP array for ROC data).

LL

Lesion localizations array (or TP array for ROC data).

InputIsCountsTable

If TRUE, the NL and LL arrays are rating-counts tables, with common lengths equal to the number of ratings R, if FALSE, the default, these are arrays of lengths K1, the number of non-diseased cases, and K2, the number of diseased cases, respectively.

...

Other elements of RJafroc dataset that may, depending on the context, need to be specified. perCase must be specified if an FROC dataset is to be returned. It is a K2-length array specifying the numbers of lesions in each diseased case in the dataset.

Value

A dataset with the structure described in

RJafroc-package.

Details

The function "senses" the data type (ROC or FROC) from the the absence or presence of perCase.

  • ROC data can be NL[1:K1] and LL[1:K2] or NL[1:I,1:J,1:K1] and LL[1:I,1:J,1:K2].

  • FROC data can be NL[1:K1,1:maxNL] and LL[1:K2, 1:maxLL] or NL[1:I,1:J,1:K1,1:maxNL] and LL[1:I,1:J,1:K2,1:maxLL].

Here maxNL/maxLL = maximum numbers of NLs/LLs, per case, over entire dataset. Equal weights are assigned to every lesion (FROC data). Consecutive characters/integers starting with "1" are assigned to IDs, modalityID and readerID.

Examples

## Input as ratings arrays
set.seed(1);NL <- rnorm(5);LL <- rnorm(7)*1.5 + 2
dataset <- Df2RJafrocDataset(NL, LL)

## Input as counts tables
K1t <- c(30, 19, 8, 2, 1)
K2t <- c(5,  6, 5, 12, 22)
dataset <- Df2RJafrocDataset(K1t, K2t, InputIsCountsTable = TRUE)