Ignore:
Timestamp:
12/19/11 01:35:32 (8 years ago)
Author:
aivar
Message:

Continued work on histogram, add fields to user interface.

Location:
trunk/projects/slim-plugin/src/main/java/loci/slim/ui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/projects/slim-plugin/src/main/java/loci/slim/ui/IUserInterfacePanel.java

    r7804 r7838  
    5959    } 
    6060 
     61    public static enum NoiseModel { 
     62        POISSON 
     63    } 
     64 
    6165 
    6266    /** 
     
    97101     */ 
    98102    public FitFunction getFunction(); 
     103 
     104    /** 
     105     * Gets noise model for fit. 
     106     * 
     107     * @return 
     108     */ 
     109    public NoiseModel getNoiseModel(); 
     110 
     111    /** 
     112     * Returns list of fitted images to display. 
     113     * 
     114     * @return 
     115     */ 
     116    public String[] getImages(); 
    99117 
    100118    /** 
     
    164182    public String getBinning(); 
    165183 
     184    public double getChiSquareTarget(); 
     185 
    166186    /** 
    167187     * Gets pixel x. 
  • trunk/projects/slim-plugin/src/main/java/loci/slim/ui/UserInterfacePanel.java

    r7837 r7838  
    102102    private static final String STRETCHED_EXPONENTIAL = "Stretched Exponential"; 
    103103 
     104    private static final String GAUSSIAN = "Gaussian"; 
     105    private static final String POISSON = "Poisson"; 
     106    private static final String MAXIMUM_LIKELIHOOD = "Maximum Likelihood"; 
     107 
     108    private static final String A_T_Z_X2 = "A " + TAU + " Z " + CHI + SQUARE; 
     109    private static final String A_T_X2 = "A " + TAU + " " + CHI +  SQUARE; 
     110    private static final String A_T = "A " + TAU; 
     111    private static final String T_X2 = TAU + " " + CHI + SQUARE; 
     112    private static final String T = TAU + ""; 
     113    private static final String F_UPPER = "F"; 
     114    private static final String F_LOWER = "f"; 
     115 
     116    private static final String CHI_SQ_TARGET = "" + CHI + SQUARE + " Target"; 
     117 
    104118    private static final String EXCITATION_NONE = "None"; 
    105119    private static final String EXCITATION_FILE = "Load from File"; 
     
    115129    private static final String ALGORITHM_ITEMS[] = { JAOLHO_LMA_ALGORITHM, GRAY_RLD_ALGORITHM, GRAY_LMA_ALGORITHM, SLIM_CURVE_RLD_ALGORITHM, SLIM_CURVE_LMA_ALGORITHM, SLIM_CURVE_RLD_LMA_ALGORITHM }; 
    116130    private static final String FUNCTION_ITEMS[] = { SINGLE_EXPONENTIAL, DOUBLE_EXPONENTIAL, TRIPLE_EXPONENTIAL, STRETCHED_EXPONENTIAL }; 
     131    private static final String NOISE_MODEL_ITEMS[] = { GAUSSIAN, POISSON, MAXIMUM_LIKELIHOOD }; 
     132    private static final String FITTED_IMAGE_ITEMS[] = { A_T_Z_X2, A_T_X2, A_T, T_X2, T, F_UPPER, F_LOWER }; 
    117133 
    118134    private static final String EXCITATION_ITEMS[] = { EXCITATION_NONE, EXCITATION_FILE, EXCITATION_CREATE }; 
     
    130146    JComboBox m_algorithmComboBox; 
    131147    JComboBox m_functionComboBox; 
     148    JComboBox m_noiseModelComboBox; 
     149    JComboBox m_fittedImagesComboBox; 
    132150    JCheckBox[] m_analysisCheckBoxList; 
    133151    JCheckBox m_fitAllChannels; 
     
    139157    JTextField m_stopField; 
    140158    JTextField m_thresholdField; 
     159    JTextField m_chiSqTargetField; 
    141160    JComboBox m_binningComboBox; 
    142161    JComboBox m_excitationComboBox; 
     
    343362        fitPanel.add(m_functionComboBox); 
    344363 
     364        JLabel noiseModelLabel = new JLabel("Noise Model"); 
     365        noiseModelLabel.setHorizontalAlignment(SwingConstants.RIGHT); 
     366        fitPanel.add(noiseModelLabel); 
     367        m_noiseModelComboBox = new JComboBox(NOISE_MODEL_ITEMS); 
     368        fitPanel.add(m_noiseModelComboBox); 
     369 
     370        JLabel fittedImagesLabel = new JLabel("Fitted Images"); 
     371        fittedImagesLabel.setHorizontalAlignment(SwingConstants.RIGHT); 
     372        fitPanel.add(fittedImagesLabel); 
     373        m_fittedImagesComboBox = new JComboBox(FITTED_IMAGE_ITEMS); 
     374        fitPanel.add(m_fittedImagesComboBox); 
     375 
    345376        int choices = analysisChoices.length; 
    346377        if (choices > 0) { 
     
    361392         
    362393        // rows, cols, initX, initY, xPad, yPad 
    363         SpringUtilities.makeCompactGrid(fitPanel, 3 + choices, 2, 4, 4, 4, 4); 
     394        SpringUtilities.makeCompactGrid(fitPanel, 5 + choices, 2, 4, 4, 4, 4); 
    364395 
    365396        JPanel panel = new JPanel(new BorderLayout()); 
     
    410441        m_thresholdField = new JTextField(9); 
    411442        controlPanel.add(m_thresholdField); 
     443 
     444        JLabel chiSqTargetLabel = new JLabel(CHI_SQ_TARGET); 
     445        chiSqTargetLabel.setHorizontalAlignment(SwingConstants.RIGHT); 
     446        controlPanel.add(chiSqTargetLabel); 
     447        m_chiSqTargetField = new JTextField(9); 
     448        controlPanel.add(m_chiSqTargetField); 
    412449 
    413450        JLabel binningLabel = new JLabel("Bin"); 
     
    456493 
    457494        // rows, cols, initX, initY, xPad, yPad 
    458         SpringUtilities.makeCompactGrid(controlPanel, 7, 2, 4, 4, 4, 4); 
     495        SpringUtilities.makeCompactGrid(controlPanel, 8, 2, 4, 4, 4, 4); 
    459496 
    460497        JPanel panel = new JPanel(new BorderLayout()); 
     
    9741011    } 
    9751012 
     1013    /** 
     1014     * Get noise model for fit. 
     1015     * 
     1016     * @return 
     1017     */ 
     1018    public NoiseModel getNoiseModel() { 
     1019        return NoiseModel.POISSON; 
     1020    } 
     1021 
     1022    /** 
     1023     * Returns list of fitted images to display. 
     1024     * 
     1025     * @return 
     1026     */ 
     1027    public String[] getImages() { 
     1028        return new String[0]; 
     1029    } 
     1030 
    9761031    public boolean getFitAllChannels() { 
    9771032        return m_fitAllChannels.isSelected(); 
     
    10271082        String selected = (String) m_binningComboBox.getSelectedItem(); 
    10281083        return selected; 
     1084    } 
     1085 
     1086    public double getChiSquareTarget() { 
     1087        return 1.0; 
    10291088    } 
    10301089 
Note: See TracChangeset for help on using the changeset viewer.