Exemplo n.º 1
0
    public void actionPerformed(ActionEvent e) {
      // System.out.println("study design button pressed");
      if (InputFile1.isLoaded()) {
        JComboBox<String> choose1 = new JComboBox<String>();

        for (String Modality : InputFile1.getModalityIDs()) {
          choose1.addItem(Modality);
        }
        choose1.setSelectedIndex(0);
        Object[] message = {"Which modality would you like view?\n", choose1};
        JOptionPane.showMessageDialog(
            GUI.MRMCobject.getFrame(),
            message,
            "Choose Modality",
            JOptionPane.INFORMATION_MESSAGE,
            null);
        designMod1 = (String) choose1.getSelectedItem();
        TreeMap<String, String[][]> StudyDesignData =
            InputFile1.getStudyDesign((String) choose1.getSelectedItem());
        final StudyDesignPlot chart =
            new StudyDesignPlot(
                "Study Design: Modality " + designMod1,
                designMod1,
                "Case Index",
                "Reader",
                StudyDesignData,
                InputFile1.filename);
        chart.pack();
        RefineryUtilities.centerFrameOnScreen(chart);
        chart.setVisible(true);

      } else {
        JOptionPane.showMessageDialog(
            GUI.MRMCobject.getFrame(),
            "Pilot study data has not yet been input.",
            "Error",
            JOptionPane.ERROR_MESSAGE);
      }
    }
Exemplo n.º 2
0
    public void actionPerformed(ActionEvent e) {
      // System.out.println("graph button pressed");
      if (InputFile1 != null && InputFile1.isLoaded()) {
        final BarGraph cpr =
            new BarGraph("Cases per Reader", "Readers", "Cases", InputFile1.casesPerReader());
        cpr.pack();
        RefineryUtilities.centerFrameOnScreen(cpr);
        cpr.setVisible(true);

        final BarGraph rpc =
            new BarGraph("Readers per Case", "Cases", "Readers", InputFile1.readersPerCase());
        rpc.pack();
        RefineryUtilities.centerFrameOnScreen(rpc);
        RefineryUtilities.positionFrameOnScreen(rpc, 0.6, 0.6);
        rpc.setVisible(true);
      } else {
        JOptionPane.showMessageDialog(
            GUI.MRMCobject.getFrame(),
            "Pilot study data has not yet been input.",
            "Error",
            JOptionPane.ERROR_MESSAGE);
      }
    }
Exemplo n.º 3
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);
   }
 }