use of org.vcell.optimization.gui.ProfileDataPanel in project vcell by virtualcell.
the class FRAPDiffOneParamPanel method showParameterEvaluation.
public void showParameterEvaluation() {
AsynchClientTask evaluateTask = new AsynchClientTask("Prepare to evaluate parameters ...", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {
public void run(Hashtable<String, Object> hashTable) throws Exception {
String errorStr = checkParameters();
if (!errorStr.equals("")) {
throw new IllegalArgumentException(errorStr);
}
}
};
AsynchClientTask showResultTask = new AsynchClientTask("Showing profile likelihood and confidence intervals ...", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {
public void run(Hashtable<String, Object> hashTable) throws Exception {
ProfileData[] profileData = frapOptData.getExpFrapStudy().getProfileData_oneDiffComponent();
if (profileData != null && profileData.length > 0) {
// put plotpanes of different parameters' profile likelihoods into a base panel
JPanel basePanel = new JPanel();
basePanel.setLayout(new BoxLayout(basePanel, BoxLayout.Y_AXIS));
for (int i = 0; i < profileData.length; i++) {
ConfidenceIntervalPlotPanel plotPanel = new ConfidenceIntervalPlotPanel();
plotPanel.setProfileSummaryData(FRAPOptimizationUtils.getSummaryFromProfileData(profileData[i]));
plotPanel.setBorder(new EtchedBorder());
String paramName = "";
if (profileData[i].getProfileDataElements().size() > 0) {
paramName = profileData[i].getProfileDataElements().get(0).getParamName();
}
ProfileDataPanel profileDataPanel = new ProfileDataPanel(plotPanel, paramName);
basePanel.add(profileDataPanel);
}
JScrollPane scrollPane = new JScrollPane(basePanel);
scrollPane.setAutoscrolls(true);
scrollPane.setPreferredSize(new Dimension(620, 600));
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
// show plots in a dialog
DialogUtils.showComponentCloseDialog(FRAPDiffOneParamPanel.this, scrollPane, "Profile Likelihood of Parameters");
}
}
};
// dispatch
ClientTaskDispatcher.dispatch(FRAPDiffOneParamPanel.this, new Hashtable<String, Object>(), new AsynchClientTask[] { evaluateTask, showResultTask }, false, true, null, true);
}
use of org.vcell.optimization.gui.ProfileDataPanel in project vcell by virtualcell.
the class FRAPDiffTwoParamPanel method showParameterEvaluation.
public void showParameterEvaluation() {
AsynchClientTask evaluateTask = new AsynchClientTask("Prepare to evaluate parameters ...", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {
public void run(Hashtable<String, Object> hashTable) throws Exception {
String errorStr = checkParameters();
if (!errorStr.equals("")) {
throw new IllegalArgumentException(errorStr);
}
}
};
AsynchClientTask showResultTask = new AsynchClientTask("Showing profile likelihood and confidence intervals ...", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {
public void run(Hashtable<String, Object> hashTable) throws Exception {
ProfileData[] profileData = frapOptData.getExpFrapStudy().getProfileData_twoDiffComponents();
if (profileData != null && profileData.length > 0) {
JPanel basePanel = new JPanel();
// put plotpanes of different parameters' profile likelihoods into a base panel
basePanel.setLayout(new BoxLayout(basePanel, BoxLayout.Y_AXIS));
for (int i = 0; i < profileData.length; i++) {
ConfidenceIntervalPlotPanel plotPanel = new ConfidenceIntervalPlotPanel();
plotPanel.setProfileSummaryData(FRAPOptimizationUtils.getSummaryFromProfileData(profileData[i]));
plotPanel.setBorder(new EtchedBorder());
String paramName = "";
if (profileData[i].getProfileDataElements().size() > 0) {
paramName = profileData[i].getProfileDataElements().get(0).getParamName();
}
ProfileDataPanel profileDataPanel = new ProfileDataPanel(plotPanel, paramName);
basePanel.add(profileDataPanel);
}
JScrollPane scrollPane = new JScrollPane(basePanel);
scrollPane.setAutoscrolls(true);
scrollPane.setPreferredSize(new Dimension(620, 600));
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
// show plots in a dialog
DialogUtils.showComponentCloseDialog(FRAPDiffTwoParamPanel.this, scrollPane, "Profile Likelihood of Parameters");
}
}
};
// dispatch
ClientTaskDispatcher.dispatch(FRAPDiffTwoParamPanel.this, new Hashtable<String, Object>(), new AsynchClientTask[] { evaluateTask, showResultTask }, false, true, null, true);
}
use of org.vcell.optimization.gui.ProfileDataPanel in project vcell by virtualcell.
the class FRAPReacOffRateParametersPanel method showParameterEvaluation.
public void showParameterEvaluation() {
AsynchClientTask evaluateTask = new AsynchClientTask("Prepare to evaluate parameters ...", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {
public void run(Hashtable<String, Object> hashTable) throws Exception {
String errorStr = checkParameters();
if (!errorStr.equals("")) {
throw new IllegalArgumentException(errorStr);
}
}
};
AsynchClientTask showResultTask = new AsynchClientTask("Showing profile likelihood and confidence intervals ...", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {
public void run(Hashtable<String, Object> hashTable) throws Exception {
ProfileData[] profileData = frapWorkspace.getWorkingFrapStudy().getProfileData_reactionOffRate();
if (profileData != null && profileData.length > 0) {
// put plotpanes of different parameters' profile likelihoods into a base panel
JPanel basePanel = new JPanel();
basePanel.setLayout(new BoxLayout(basePanel, BoxLayout.Y_AXIS));
for (int i = 0; i < profileData.length; i++) {
ConfidenceIntervalPlotPanel plotPanel = new ConfidenceIntervalPlotPanel();
plotPanel.setProfileSummaryData(FRAPOptimizationUtils.getSummaryFromProfileData(profileData[i]));
plotPanel.setBorder(new EtchedBorder());
String paramName = "";
if (profileData[i].getProfileDataElements().size() > 0) {
paramName = profileData[i].getProfileDataElements().get(0).getParamName();
}
ProfileDataPanel profileDataPanel = new ProfileDataPanel(plotPanel, paramName);
basePanel.add(profileDataPanel);
}
JScrollPane scrollPane = new JScrollPane(basePanel);
scrollPane.setAutoscrolls(true);
scrollPane.setPreferredSize(new Dimension(620, 600));
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
// show plots in a dialog
DialogUtils.showComponentCloseDialog(FRAPReacOffRateParametersPanel.this, scrollPane, "Profile Likelihood of Parameters");
}
}
};
// dispatch
ClientTaskDispatcher.dispatch(FRAPReacOffRateParametersPanel.this, new Hashtable<String, Object>(), new AsynchClientTask[] { evaluateTask, showResultTask }, false, true, null, true);
}
use of org.vcell.optimization.gui.ProfileDataPanel in project vcell by virtualcell.
the class AnalysisResultsTablePanel method propertyChange.
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals(FRAPSingleWorkspace.PROPERTY_CHANGE_CONFIDENCEINTERVAL_DETAILS)) {
if (((Integer) evt.getNewValue()).intValue() == AnalysisTableModel.COLUMN_DIFF_ONE_CI_PLOT && getTable().getSelectedRow() < FRAPModel.NUM_MODEL_PARAMETERS_ONE_DIFF) {
if (frapWorkspace.getWorkingFrapStudy() != null && frapWorkspace.getWorkingFrapStudy().getProfileData_oneDiffComponent() != null) {
int paramIdx = getTable().getSelectedRow();
ProfileData[] profileData = frapWorkspace.getWorkingFrapStudy().getProfileData_oneDiffComponent();
// put plotpanes of different parameters' profile likelihoods into a base panel
JPanel basePanel = new JPanel();
basePanel.setLayout(new BoxLayout(basePanel, BoxLayout.Y_AXIS));
ConfidenceIntervalPlotPanel plotPanel = new ConfidenceIntervalPlotPanel();
plotPanel.setProfileSummaryData(FRAPOptimizationUtils.getSummaryFromProfileData(profileData[paramIdx]));
plotPanel.setBorder(new EtchedBorder());
String paramName = "";
if (profileData[paramIdx].getProfileDataElements().size() > 0) {
paramName = profileData[paramIdx].getProfileDataElements().get(0).getParamName();
}
ProfileDataPanel profileDataPanel = new ProfileDataPanel(plotPanel, paramName);
profileDataPanel.setProfileDataPlotDetailsVisible(true);
basePanel.add(profileDataPanel);
JScrollPane scrollPane = new JScrollPane(basePanel);
scrollPane.setAutoscrolls(true);
scrollPane.setPreferredSize(new Dimension(600, 600));
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
// show plots in a dialog
DialogUtils.showComponentCloseDialog(parent, scrollPane, "Profile Likelihood of Parameters");
} else {
DialogUtils.showErrorDialog(parent, "Confidence Intervals haven't been evaluated.");
}
} else if (((Integer) evt.getNewValue()).intValue() == AnalysisTableModel.COLUMN_DIFF_TWO_CI_PLOT && getTable().getSelectedRow() < FRAPModel.NUM_MODEL_PARAMETERS_TWO_DIFF) {
if (frapWorkspace.getWorkingFrapStudy() != null && frapWorkspace.getWorkingFrapStudy().getProfileData_twoDiffComponents() != null) {
int paramIdx = getTable().getSelectedRow();
ProfileData[] profileData = frapWorkspace.getWorkingFrapStudy().getProfileData_twoDiffComponents();
// put plotpanes of different parameters' profile likelihoods into a base panel
JPanel basePanel = new JPanel();
basePanel.setLayout(new BoxLayout(basePanel, BoxLayout.Y_AXIS));
ConfidenceIntervalPlotPanel plotPanel = new ConfidenceIntervalPlotPanel();
plotPanel.setProfileSummaryData(FRAPOptimizationUtils.getSummaryFromProfileData(profileData[paramIdx]));
plotPanel.setBorder(new EtchedBorder());
String paramName = "";
if (profileData[paramIdx].getProfileDataElements().size() > 0) {
paramName = profileData[paramIdx].getProfileDataElements().get(0).getParamName();
}
ProfileDataPanel profileDataPanel = new ProfileDataPanel(plotPanel, paramName);
profileDataPanel.setProfileDataPlotDetailsVisible(true);
basePanel.add(profileDataPanel);
JScrollPane scrollPane = new JScrollPane(basePanel);
scrollPane.setAutoscrolls(true);
scrollPane.setPreferredSize(new Dimension(620, 600));
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
// show plots in a dialog
DialogUtils.showComponentCloseDialog(parent, scrollPane, "Profile Likelihood of Parameters");
} else {
DialogUtils.showErrorDialog(parent, "Confidence Intervals haven't been evaluated.");
}
} else if (((Integer) evt.getNewValue()).intValue() == AnalysisTableModel.COLUMN_KOFF_CI_PLOT) {
if (frapWorkspace.getWorkingFrapStudy() != null && frapWorkspace.getWorkingFrapStudy().getProfileData_reactionOffRate() != null) {
ProfileData[] profileData = frapWorkspace.getWorkingFrapStudy().getProfileData_reactionOffRate();
ProfileData tempProfileData = null;
if (getTable().getSelectedRow() == FRAPModel.INDEX_BLEACH_MONITOR_RATE) {
for (ProfileData pData : profileData) {
if (pData.getProfileDataElements().size() > 0 && pData.getProfileDataElements().get(0).getParamName().equals(FRAPModel.MODEL_PARAMETER_NAMES[FRAPModel.INDEX_BLEACH_MONITOR_RATE])) {
tempProfileData = pData;
}
}
} else if (getTable().getSelectedRow() == FRAPModel.INDEX_OFF_RATE) {
for (ProfileData pData : profileData) {
if (pData.getProfileDataElements().size() > 0 && pData.getProfileDataElements().get(0).getParamName().equals(FRAPModel.MODEL_PARAMETER_NAMES[FRAPModel.INDEX_OFF_RATE])) {
tempProfileData = pData;
}
}
}
// put plotpanes of different parameters' profile likelihoods into a base panel
JPanel basePanel = new JPanel();
basePanel.setLayout(new BoxLayout(basePanel, BoxLayout.Y_AXIS));
ConfidenceIntervalPlotPanel plotPanel = new ConfidenceIntervalPlotPanel();
plotPanel.setProfileSummaryData(FRAPOptimizationUtils.getSummaryFromProfileData(tempProfileData));
plotPanel.setBorder(new EtchedBorder());
String paramName = "";
if (tempProfileData.getProfileDataElements().size() > 0) {
paramName = tempProfileData.getProfileDataElements().get(0).getParamName();
}
ProfileDataPanel profileDataPanel = new ProfileDataPanel(plotPanel, paramName);
profileDataPanel.setProfileDataPlotDetailsVisible(true);
basePanel.add(profileDataPanel);
JScrollPane scrollPane = new JScrollPane(basePanel);
scrollPane.setAutoscrolls(true);
scrollPane.setPreferredSize(new Dimension(600, 600));
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
// show plots in a dialog
DialogUtils.showComponentCloseDialog(parent, scrollPane, "Profile Likelihood of Parameters");
} else {
DialogUtils.showErrorDialog(parent, "Confidence Intervals haven't been evaluated.");
}
}
}
}
use of org.vcell.optimization.gui.ProfileDataPanel in project vcell by virtualcell.
the class DisplayProfileLikelihoodPlotsOp method displayProfileLikelihoodPlots.
public void displayProfileLikelihoodPlots(ProfileData[] profileData, String title, WindowListener listener) {
// put plotpanes of different parameters' profile likelihoods into a base panel
JPanel basePanel = new JPanel();
basePanel.setLayout(new BoxLayout(basePanel, BoxLayout.Y_AXIS));
for (int i = 0; i < profileData.length; i++) {
ConfidenceIntervalPlotPanel plotPanel = new ConfidenceIntervalPlotPanel();
plotPanel.setProfileSummaryData(getSummaryFromProfileData(profileData[i]));
plotPanel.setBorder(new EtchedBorder());
String paramName = "";
if (profileData[i].getProfileDataElements().size() > 0) {
paramName = profileData[i].getProfileDataElements().get(0).getParamName();
}
ProfileDataPanel profileDataPanel = new ProfileDataPanel(plotPanel, paramName);
basePanel.add(profileDataPanel);
}
JScrollPane scrollPane = new JScrollPane(basePanel);
scrollPane.setAutoscrolls(true);
scrollPane.setPreferredSize(new Dimension(620, 600));
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
// show plots in a dialog
JFrame jframe = new JFrame();
jframe.setTitle(title);
jframe.getContentPane().add(scrollPane);
jframe.setSize(500, 500);
if (listener != null) {
jframe.addWindowListener(listener);
}
jframe.setVisible(true);
}
Aggregations