use of cbit.vcell.microscopy.FRAPStudy in project vcell by virtualcell.
the class FRAPDataPanel method plotROI.
protected void plotROI() {
FRAPStudy fStudy = getFrapWorkspace().getWorkingFrapStudy();
if (fStudy == null || fStudy.getFrapData() == null) {
return;
}
saveROI();
double[] averageFluor = FRAPDataAnalysis.getAverageROIIntensity(fStudy.getFrapData(), fStudy.getFrapData().getCurrentlyDisplayedROI(), null, null);
showCurve(new String[] { "f" }, fStudy.getFrapData().getImageDataset().getImageTimeStamps(), new double[][] { averageFluor });
}
use of cbit.vcell.microscopy.FRAPStudy in project vcell by virtualcell.
the class FRAPDataPanel method crop.
// There are two FRAPDataPanel instances, one is in MainFrame and antoher is in DefineROIWizard
// The crop function is called in DefineROIWizard, the image change will only be reflected in the
// FRAPDataPanel in DefineROIWizard. The newFrapStudy will only be set to FrapdataPanel in Mainframe
// when FINISH button is pressed.
protected void crop(Rectangle cropRectangle) throws ImageException {
FRAPStudy fStudy = getFrapWorkspace().getWorkingFrapStudy();
if (fStudy == null || fStudy.getFrapData() == null) {
return;
}
getOverlayEditorPanelJAI().saveUserChangesToROI();
FRAPData frapData = fStudy.getFrapData();
FRAPData newFrapData = frapData.crop(cropRectangle);
FRAPStudy newFrapStudy = new FRAPStudy();
newFrapStudy.setFrapData(newFrapData);
newFrapStudy.setXmlFilename(fStudy.getXmlFilename());
newFrapStudy.setFrapDataExternalDataInfo(fStudy.getFrapDataExternalDataInfo());
newFrapStudy.setRoiExternalDataInfo(fStudy.getRoiExternalDataInfo());
newFrapStudy.setStoredRefData(fStudy.getStoredRefData());
newFrapStudy.setModels(fStudy.getModels());
newFrapStudy.setStartingIndexForRecovery(fStudy.getStartingIndexForRecovery());
getFrapWorkspace().setFrapStudy(newFrapStudy, false);
}
use of cbit.vcell.microscopy.FRAPStudy in project vcell by virtualcell.
the class FRAPStudyPanel method clearMovieBuffer.
public void clearMovieBuffer() {
FRAPStudy fStudy = getFrapWorkspace().getWorkingFrapStudy();
if (fStudy != null) {
fStudy.setMovieURLString(null);
fStudy.setMovieFileString(null);
}
}
use of cbit.vcell.microscopy.FRAPStudy in project vcell by virtualcell.
the class FRAPStudyPanel method getEstimateParametersWizard.
public Wizard getEstimateParametersWizard() {
FRAPStudy fStudy = getFrapWorkspace().getWorkingFrapStudy();
if (fStudy == null || fStudy.getSelectedModels().size() == 0) {
return null;
} else {
if (estimateParamWizard == null) {
estimateParamWizard = new Wizard(JOptionPane.getFrameForComponent(this));
estimateParamWizard.getDialog().setTitle("Estimate Parameters");
// initialize the wizard panels
diffOneDescriptor = new EstParams_OneDiffComponentDescriptor();
diffOneDescriptor.setFrapWorkspace(getFrapWorkspace());
diffTwoDescriptor = new EstParams_TwoDiffComponentDescriptor();
diffTwoDescriptor.setFrapWorkspace(getFrapWorkspace());
offRateDescriptor = new EstParams_ReactionOffRateDescriptor();
offRateDescriptor.setFrapWorkspace(getFrapWorkspace());
compareResultsDescriptor = new EstParams_CompareResultsDescriptor();
compareResultsDescriptor.setFrapWorkspace(getFrapWorkspace());
}
// Dynamicly link the wizard pages according to the selected models.
// clear all first
estimateParamWizard.clearAllPanels();
WizardPanelDescriptor lastDescriptor = null;
for (int i = 0; i < fStudy.getSelectedModels().size(); i++) {
int modelType = fStudy.getSelectedModels().get(i).intValue();
if (modelType == FRAPModel.IDX_MODEL_DIFF_ONE_COMPONENT) {
estimateParamWizard.registerWizardPanel(EstParams_OneDiffComponentDescriptor.IDENTIFIER, diffOneDescriptor);
diffOneDescriptor.setBackPanelDescriptorID((lastDescriptor == null) ? null : lastDescriptor.getPanelDescriptorIdentifier());
if (// not the first wizard page
lastDescriptor != null) {
lastDescriptor.setNextPanelDescriptorID(EstParams_OneDiffComponentDescriptor.IDENTIFIER);
}
lastDescriptor = diffOneDescriptor;
} else if (modelType == FRAPModel.IDX_MODEL_DIFF_TWO_COMPONENTS) {
estimateParamWizard.registerWizardPanel(EstParams_TwoDiffComponentDescriptor.IDENTIFIER, diffTwoDescriptor);
diffTwoDescriptor.setBackPanelDescriptorID((lastDescriptor == null) ? null : lastDescriptor.getPanelDescriptorIdentifier());
if (lastDescriptor != null) {
lastDescriptor.setNextPanelDescriptorID(EstParams_TwoDiffComponentDescriptor.IDENTIFIER);
}
lastDescriptor = diffTwoDescriptor;
} else if (modelType == FRAPModel.IDX_MODEL_REACTION_OFF_RATE) {
estimateParamWizard.registerWizardPanel(EstParams_ReactionOffRateDescriptor.IDENTIFIER, offRateDescriptor);
offRateDescriptor.setBackPanelDescriptorID((lastDescriptor == null) ? null : lastDescriptor.getPanelDescriptorIdentifier());
if (lastDescriptor != null) {
lastDescriptor.setNextPanelDescriptorID(EstParams_ReactionOffRateDescriptor.IDENTIFIER);
}
lastDescriptor = offRateDescriptor;
}
}
// the last one should always be the compare page
estimateParamWizard.registerWizardPanel(EstParams_CompareResultsDescriptor.IDENTIFIER, compareResultsDescriptor);
lastDescriptor.setNextPanelDescriptorID(EstParams_CompareResultsDescriptor.IDENTIFIER);
compareResultsDescriptor.setBackPanelDescriptorID(lastDescriptor.getPanelDescriptorIdentifier());
// each time when load the wizard, it should start from the first possible page.
if (fStudy.getModels()[FRAPModel.IDX_MODEL_DIFF_ONE_COMPONENT] != null) {
estimateParamWizard.setCurrentPanel(EstParams_OneDiffComponentDescriptor.IDENTIFIER);
} else if (fStudy.getModels()[FRAPModel.IDX_MODEL_DIFF_TWO_COMPONENTS] != null) {
estimateParamWizard.setCurrentPanel(EstParams_TwoDiffComponentDescriptor.IDENTIFIER);
} else if (fStudy.getModels()[FRAPModel.IDX_MODEL_REACTION_OFF_RATE] != null) {
estimateParamWizard.setCurrentPanel(EstParams_ReactionOffRateDescriptor.IDENTIFIER);
}
return estimateParamWizard;
}
}
use of cbit.vcell.microscopy.FRAPStudy in project vcell by virtualcell.
the class FRAPStudyPanel method propertyChange.
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals(FRAPSingleWorkspace.PROPERTY_CHANGE_FRAPSTUDY_NEW) || evt.getPropertyName().equals(FRAPSingleWorkspace.PROPERTY_CHANGE_FRAPSTUDY_UPDATE)) {
if (evt.getNewValue() instanceof FRAPStudy) {
FRAPStudy fStudy = (FRAPStudy) evt.getNewValue();
// set status for save button
VirtualFrapMainFrame.enableSave(!(fStudy == null || fStudy.getFrapData() == null));
// update analysis stage and results
updateWorkflowStage(fStudy);
updateAnalysisResult(fStudy);
// undoable support
try {
undoableEditSupport.postEdit(FRAPStudyPanel.CLEAR_UNDOABLE_EDIT);
} catch (Exception e) {
e.printStackTrace(System.out);
}
}
}
if (evt.getPropertyName().equals(FRAPSingleWorkspace.PROPERTY_CHANGE_BEST_MODEL)) {
clearBestModelData();
getAnalysisResultsPanel().clearBestModelDisplay();
if (evt.getNewValue() != null && evt.getNewValue() instanceof Integer) {
int newBestModelIdx = ((Integer) evt.getNewValue()).intValue();
(getAnalysisResultsPanel()).setBestModel(newBestModelIdx, getLocalWorkspace());
} else {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
getAnalysisResultsPanel().clearResultTable();
}
});
}
}
}
Aggregations