----------------------------------- FP ------------------------------------------
A sheet named FP consists of four columns precisely
named from the right hand side: ReaderID, ModalityID, CaseID, FP_Rating
An Example of a sheet named FP in a file of extension ".xlsx" file for the Jafroc software
Interpretation of table
For example, the first row means that the first reader (ReaderID=1) makes a false alarm location in the first image (CaseID = 1) taken by the first modality (ModalityID = 1) with his rating 2 (TP_Rating =2).
Similarly, the second row means that the first reader (ReaderID=1) makes a false alarm location in the second image (CaseID = 2) taken by the 2-nd modality (ModalityID = 2) with his rating 1 (TP_Rating = 1).
Similarly, the 6-th and 7-th rows mean that the first reader (ReaderID=1) makes two false alarm location in the second patient (CaseID = 2). The first false alarm is in the image taken by the 1-st modality (ModalityID = 1) with his rating 1 (TP_Rating = 1). The second false alarm is in the image taken by the 3-rd modality (ModalityID = 3) with his rating 2 (TP_Rating = 2).
| ReaderID | ModalityID | CaseID | FP_Rating. |
| ------------------- | ------------------- | ------------------- | ------------------ |
| 1 | 1 | 1 | 2 |
| 1 | 2 | 2 | 1 |
| 1 | 3 | 3 | 1 |
| 1 | 1 | 5 | 2 |
| 1 | 2 | 7 | 1 |
| 1 | 3 | 7 | 2 |
| 1 | 1 | 9 | 3 |
| 1 | 2 | 9 | 4 |
| 1 | 3 | 10 | 1 |
| 2 | 1 | 1 | 2 |
| 2 | 2 | 2 | 3 |
| 2 | 3 | 3 | 4 |
| 2 | 1 | 8 | 1 |
| 2 | 2 | 9 | 1 |
| 2 | 3 | 11 | 1 |
| 2 | 1 | 14 | 1 |
| 2 | 2 | 15 | 1 |
| 2 | 3 | 21 | 2 |
| : | : | : | : |
| : | : | : | : |
----------------------------------- Truth ------------------------------------------
A sheet named Truth consists of three columns precisely named from the right hand side:CaseID, LesionID, Weight .
An Example of a sheet named Truth in a .xlsx file for the Jafroc software
Interpretation of table
For example, the first image (CaseID = 1) contains three lesions each of which is named 1,2,3, namely LesionID = 1,2,3. For example, the second image (CaseID = 2) contains two lesions each of which is named 1,2, namely LesionID = 1,2. For example, the third image (CaseID = 3) contains a sinle lesion named 1, namely LesionID = 1.
| CaseID | LesionID | Weight |
| ------------------- | ------------------- | ------------------ |
| 1 | 1 | 0.3333... |
| 1 | 2 | 0.3333... |
| 1 | 3 | 0.3333... |
| 2 | 1 | 0.5 |
| 2 | 2 | 0.5 |
| 3 | 1 | 1 |
| 4 | 1 | 0.25 |
| 4 | 2 | 0.25 |
| 4 | 3 | 0.25 |
| 4 | 4 | 0.25 |
| 5 | 1 | 0.5 |
| 5 | 2 | 0.5 |
| 6 | 1 | 0.3333... |
| 6 | 2 | 0.3333... |
| 6 | 3 | 0.3333... |
| 7 | 1 | 0.3333... |
| 7 | 2 | 0.3333... |
| 7 | 3 | 0.3333... |
| 8 | 1 | 0.25 |
| 8 | 2 | 0.25 |
| 8 | 3 | 0.25 |
| 8 | 4 | 0.25 |
| : | : | : |
| : | : | : |
Note that the weght are used such that each image influences a same effect on the esimates. Without weight, the images including many targets (lesions) will have very strong effect on the estimates. To avoid such bias, Jafroc uses weight. In another context, weight would be used to specify more important lesions in each image.
In this package, we do not use the information of weight. Since the theory of the author of this package did not consider such weight. In the future I have to include the notion of weight. Jafroc use the notion fo figure of metric as non parametric manner. So, it seems difficult to include it in the Bayesian model, since generally speaking, Bayesian methodology is parametric.
# NOT RUN {
## Only run examples in interactive R sessions
if (interactive()) {
#========================================================================================
# Example for convert the Jafroc data
#========================================================================================
# Work Flow
# step 0) Make an .xlsx file "JafrocDatasetExample.xlsx" as example data
# to be passed to the function by an interactive manner.
# step 1) Convert the "JafrocDatasetExample.xlsx" file to an R object
# In the following code, when dialog box asks users to select a file, then
# Select "JafrocDatasetExample.xlsx" in working directory.
# This is important, so I write twice, again.
# In the following code, when dialog box asks you to select a file, then
# Select "JafrocDatasetExample.xlsx" in Working directory.
# In the following code, when dialog box asks you to select a file, then
# Select "JafrocDatasetExample.xlsx" in Working directory.
#========================================================================================
# step 0) Make a Jafroc data as an example dataset
#========================================================================================
# If you can find the xlsx file named JAFROC_data.xlsx
# in the director "inst/extdata" of this package,
# Then this step 0) is redundant. The author prepares this example for the people who
# cannot find the xlsx file in the "inst/extdata" of this package.
# Using an xlsx file ( which is named JAFROC_data.xlsx and
# included in the director "inst/extdata" of this package,)
# we can reconstruct it as follows:(If someone can obtain the Excel file
# from the path tpfp/inst/extdata/JAFROC_data.xlsx, then the following code
# is not required to run, because the same xlsx file is created.
Truth <- readxl::read_excel(system.file("extdata",
"JAFROC_data.xlsx",
package="tpfp"),
sheet = "Truth")
##### utils::View(Truth)
TP <- readxl::read_excel( system.file("extdata",
"JAFROC_data.xlsx",
package="tpfp"),
sheet = "TP")
#### utils::View(TP)
FP <- readxl::read_excel( system.file("extdata",
"JAFROC_data.xlsx",
package="tpfp"),
sheet = "FP")
#### utils::View(FP)
sample <- list(TP=TP,FP=FP,Truth=Truth)
openxlsx::write.xlsx(sample,"JafrocDatasetExample.xlsx")
tcltk::tkmessageBox(
message="A file named
JafrocDatasetExample.xlsx
is created in the working directory")
# Now, we obtain an excel file named "JafrocDatasetExample.xlsx", which is same as
# the JAFROC_data.xlsx.
# whose format is available in the Jafroc software developed by Chakraborty.
# Note that if you have an excel file
# which is formulated correctolly for our package,
# then the above process does not be required.
# (0) From the above, we obtain "JafrocDatasetExample.xlsx"
# which is the multiple reader and multiple modality dataset
# for Jafroc analysis which is Chakraborty's software Jafroc or the R package Rjafroc
# but NOT implemented in our package,.
#========================================================================================
# step 1) Convert the Jafroc data obtained in the above
#========================================================================================
# (1) Using "JafrocDatasetExample.xlsx" as an example excel file,
# we run the function to convert the excel file from Jafroc format
# to our format:
dataList <- convertFromJafroc(
No.of.Modalities =5,
No.of.readers =4,
No.of.confidence.levels = 5
)
# In the variable, there is no xlsx files, since it is selected by interactive manner.
# So, please select the xlsx file, i.e., "JafrocDatasetExample.xlsx" obtained
# in step 0) or your own Jafroc .xlsx file.
}### Only run examples in interactive R sessions
# }
Run the code above in your browser using DataLab