Search in sources :

Example 6 with FRAPStudy

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 });
}
Also used : FRAPStudy(cbit.vcell.microscopy.FRAPStudy)

Example 7 with FRAPStudy

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);
}
Also used : FRAPData(cbit.vcell.microscopy.FRAPData) FRAPStudy(cbit.vcell.microscopy.FRAPStudy)

Example 8 with FRAPStudy

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);
    }
}
Also used : FRAPStudy(cbit.vcell.microscopy.FRAPStudy)

Example 9 with FRAPStudy

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;
    }
}
Also used : EstParams_OneDiffComponentDescriptor(cbit.vcell.microscopy.gui.estparamwizard.EstParams_OneDiffComponentDescriptor) EstParams_ReactionOffRateDescriptor(cbit.vcell.microscopy.gui.estparamwizard.EstParams_ReactionOffRateDescriptor) FRAPStudy(cbit.vcell.microscopy.FRAPStudy) EstParams_TwoDiffComponentDescriptor(cbit.vcell.microscopy.gui.estparamwizard.EstParams_TwoDiffComponentDescriptor) WizardPanelDescriptor(org.vcell.wizard.WizardPanelDescriptor) Wizard(org.vcell.wizard.Wizard) Point(java.awt.Point) EstParams_CompareResultsDescriptor(cbit.vcell.microscopy.gui.estparamwizard.EstParams_CompareResultsDescriptor)

Example 10 with FRAPStudy

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();
                }
            });
        }
    }
}
Also used : FRAPStudy(cbit.vcell.microscopy.FRAPStudy) IOException(java.io.IOException) CannotUndoException(javax.swing.undo.CannotUndoException) ImageException(cbit.image.ImageException) FileNotFoundException(java.io.FileNotFoundException) UserCancelException(org.vcell.util.UserCancelException) Point(java.awt.Point)

Aggregations

FRAPStudy (cbit.vcell.microscopy.FRAPStudy)51 Hashtable (java.util.Hashtable)19 AsynchClientTask (cbit.vcell.client.task.AsynchClientTask)18 File (java.io.File)17 ArrayList (java.util.ArrayList)13 Parameter (cbit.vcell.opt.Parameter)11 Point (java.awt.Point)8 FRAPModel (cbit.vcell.microscopy.FRAPModel)7 UserCancelException (org.vcell.util.UserCancelException)7 ImageException (cbit.image.ImageException)6 MicroscopyXmlReader (cbit.vcell.microscopy.MicroscopyXmlReader)5 FRAPData (cbit.vcell.microscopy.FRAPData)4 FRAPOptData (cbit.vcell.microscopy.FRAPOptData)4 FRAPOptFunctions (cbit.vcell.microscopy.FRAPOptFunctions)4 FileNotFoundException (java.io.FileNotFoundException)4 IOException (java.io.IOException)4 CannotUndoException (javax.swing.undo.CannotUndoException)4 PDEDataManager (cbit.vcell.simdata.PDEDataManager)3 Simulation (cbit.vcell.solver.Simulation)3 Wizard (org.vcell.wizard.Wizard)3