Ejemplo n.º 1
0
 public void actionPerformed(ActionEvent e) {
   // If input file is loaded, then show ROC curves
   // Otherwise as for pilot study to be inpu
   if (InputFile1.isLoaded()) {
     JPanel panel = new JPanel();
     int modalitynum = InputFile1.getModalityIDs().size();
     JCheckBox[] jCheckboxArray = new javax.swing.JCheckBox[modalitynum];
     for (int i = 0; i < modalitynum; i++) {
       String modID = InputFile1.getModalityIDs().get(i);
       jCheckboxArray[i] = new JCheckBox("" + modID);
       panel.add(jCheckboxArray[i]);
     }
     Object[] message = {"Which modality would you like view?\n", panel};
     JOptionPane.showMessageDialog(
         GUI.MRMCobject.getFrame(),
         message,
         "Choose Modality",
         JOptionPane.INFORMATION_MESSAGE,
         null);
     int checkedmod = 0;
     for (int i = 0; i < modalitynum; i++) {
       if (jCheckboxArray[i].isSelected()) {
         checkedmod++;
       }
     }
     String[] rocMod = new String[checkedmod];
     String roctitle = "";
     int selectmod = 0;
     for (int i = 0; i < modalitynum; i++) {
       if (jCheckboxArray[i].isSelected()) {
         String modID = InputFile1.getModalityIDs().get(i);
         rocMod[selectmod] = modID;
         roctitle = roctitle + modID + " ";
         selectmod++;
       }
     }
     if (selectmod > 0) {
       final ROCCurvePlot roc =
           new ROCCurvePlot(
               "ROC Curve: Modality " + roctitle,
               "FPF (1 - Specificity), legend shows symbols for each modalityID:readerID",
               "TPF (Sensitivity)",
               InputFile1.generateROCpoints(rocMod),
               InputFile1.filename);
       roc.addData(InputFile1.generatePooledROC(rocMod), "Pooled Average");
       roc.pack();
       RefineryUtilities.centerFrameOnScreen(roc);
       roc.setVisible(true);
     } else {
       JOptionPane.showMessageDialog(
           GUI.MRMCobject.getFrame(),
           "Please choose at list one Modality.",
           "Error",
           JOptionPane.ERROR_MESSAGE);
     }
   } else {
     JOptionPane.showMessageDialog(
         GUI.MRMCobject.getFrame(),
         "Pilot study data has not yet been input.",
         "Error",
         JOptionPane.ERROR_MESSAGE);
   }
 }