Search in sources :

Example 11 with DataSymbol

use of cbit.vcell.data.DataSymbol in project vcell by virtualcell.

the class DataSymbolsSpecPanel method onSelectedObjectsChange.

@Override
protected void onSelectedObjectsChange(Object[] selectedObjects) {
    DataSymbol dataSymbol = null;
    if (selectedObjects != null && selectedObjects.length == 1 && selectedObjects[0] instanceof DataSymbol) {
        dataSymbol = (DataSymbol) selectedObjects[0];
    }
    setDataSymbol(dataSymbol);
}
Also used : DataSymbol(cbit.vcell.data.DataSymbol)

Example 12 with DataSymbol

use of cbit.vcell.data.DataSymbol in project vcell by virtualcell.

the class MicroscopeMeasurementPanel method refreshInterface.

protected void refreshInterface() {
    if (simulationContext == null) {
        return;
    }
    MicroscopeMeasurement microscopeMeasurement = simulationContext.getMicroscopeMeasurement();
    nameTextField.setText(microscopeMeasurement.getName());
    refreshFluorescenceSpeciesList(microscopeMeasurement);
    refreshAllSpeciesList();
    ConvolutionKernel ck = microscopeMeasurement.getConvolutionKernel();
    if (ck instanceof ProjectionZKernel) {
        rdbtnZprojection.setSelected(true);
        BeanUtils.enableComponents(gaussianPsfPanel, false);
        BeanUtils.enableComponents(experimentalPsfPanel, false);
    } else if (ck instanceof GaussianConvolutionKernel) {
        radioButtonGaussian.setSelected(true);
        BeanUtils.enableComponents(gaussianPsfPanel, true);
        BeanUtils.enableComponents(experimentalPsfPanel, false);
        sigmaXYTextField.setText(((GaussianConvolutionKernel) ck).getSigmaXY_um().infix());
        sigmaZTextField.setText(((GaussianConvolutionKernel) ck).getSigmaZ_um().infix());
    } else if (ck instanceof ExperimentalPSF) {
        rdbtnExperimental.setSelected(true);
        BeanUtils.enableComponents(gaussianPsfPanel, false);
        BeanUtils.enableComponents(experimentalPsfPanel, true);
    }
    pointSpreadFunctionsComboModel.removeAllElements();
    if (simulationContext.getDataContext() != null) {
        for (DataSymbol dataSymbol : simulationContext.getDataContext().getDataSymbols()) {
            if (dataSymbol.getDataSymbolType().equals(DataSymbolType.POINT_SPREAD_FUNCTION)) {
                pointSpreadFunctionsComboModel.addElement(dataSymbol.getName());
            }
        }
    }
}
Also used : DataSymbol(cbit.vcell.data.DataSymbol) GaussianConvolutionKernel(cbit.vcell.mapping.MicroscopeMeasurement.GaussianConvolutionKernel) ConvolutionKernel(cbit.vcell.mapping.MicroscopeMeasurement.ConvolutionKernel) ExperimentalPSF(cbit.vcell.mapping.MicroscopeMeasurement.ExperimentalPSF) MicroscopeMeasurement(cbit.vcell.mapping.MicroscopeMeasurement) GaussianConvolutionKernel(cbit.vcell.mapping.MicroscopeMeasurement.GaussianConvolutionKernel) ProjectionZKernel(cbit.vcell.mapping.MicroscopeMeasurement.ProjectionZKernel)

Example 13 with DataSymbol

use of cbit.vcell.data.DataSymbol in project vcell by virtualcell.

the class DataSymbolsSpecPanel method setDataSymbol.

// public void createDataSymbol() throws Exception, UserCancelException{
// final int VFRAP_DATASET = 0;
// final int VFRAP_SPECIALS = 1;
// final int ASSOCIATE_EXISTING_FD = 2;
// final int POINT_SPREAD_FUNCTION = 3;
// final int IMAGE_FILE = 4;
// final int COPY_FROM_BIOMODEL = 5;
// int[] dataSymbolSource = null;
// 
// String[][] choices = new String[][] {{ADD_VFRAP_DATASET_MENU},{ADD_VFRAP_SPECIALS_MENU},{ADD_ASSOCIATE_EXISTING_FD_MENU},
// {ADD_PSF_MENU},{ADD_IMAGE_FILE_MENU},{ADD_COPY_FROM_BIOMODEL_MENU} };
// 
// dataSymbolSource = DialogUtils.showComponentOKCancelTableList(
// getComponent(),
// "Choose a source for the data symbol.",
// new String[] {"Available Sources:"},
// choices, ListSelectionModel.SINGLE_SELECTION);
// 
// if(dataSymbolSource[0] == VFRAP_DATASET){
// getDataSymbolsPanel().addVFrapOriginalImages();
// }else if(dataSymbolSource[0] == VFRAP_SPECIALS){
// getDataSymbolsPanel().addVFrapDerivedImages();
// }else if(dataSymbolSource[0] == ASSOCIATE_EXISTING_FD){
// Component requesterComponent = DataSymbolsSpecPanel.this;
// DocumentWindow documentWindow = (DocumentWindow)BeanUtils.findTypeParentOfComponent(requesterComponent, DocumentWindow.class);
// documentWindow.getTopLevelWindowManager().getRequestManager().showFieldDataWindow(new FieldDataWindowManager.DataSymbolCallBack() {
// public void createDataSymbol(ExternalDataIdentifier dataSetID,
// String fieldDataVarName, VariableType fieldDataVarType,
// double fieldDataVarTime) {
// 
// System.out.println(dataSetID+" "+fieldDataVarName+" "+fieldDataVarType+" "+fieldDataVarTime);
// // ex: incomplete 51780592 danv(26766043)      fluor     Volume_VariableType     23.680419921875
// 
// DecimalFormat df = new  DecimalFormat("###000.00");		// max time interval we can display is about 11 days
// String fluorName = fieldDataVarName + "_" + df.format(fieldDataVarTime).substring(0, df.format(fieldDataVarTime).indexOf(".")) + "s" + df.format(fieldDataVarTime).substring(1+df.format(fieldDataVarTime).indexOf(".")) + "_" + dataSetID.getName();
// // TODO:  symbol names may not be unique, must check for unicity and prompt the user
// FieldDataSymbol dataSymbol = new FieldDataSymbol(fluorName, DataSymbolType.GENERIC_SYMBOL,
// getSimulationContext().getDataContext(), VCUnitDefinition.UNIT_TBD,
// dataSetID,
// fieldDataVarName, fieldDataVarType.getTypeName(), fieldDataVarTime);
// getSimulationContext().getDataContext().addDataSymbol(dataSymbol);
// 
// }
// });
// }else if(dataSymbolSource[0] == POINT_SPREAD_FUNCTION){
// PointSpreadFunctionManagement psfManager = new PointSpreadFunctionManagement(DataSymbolsSpecPanel.this,
// getSimulationContext());
// psfManager.importPointSpreadFunction();
// }else if(dataSymbolSource[0] == IMAGE_FILE){
// throw new RuntimeException("Option not yet implemented.");
// }else if(dataSymbolSource[0] == COPY_FROM_BIOMODEL){
// throw new RuntimeException("Option not yet implemented.");
// }else{
// throw new IllegalArgumentException("Error selecting data symbol, Unknown Source type " + dataSymbolSource[0]);
// }
// }
public void setDataSymbol(Object object) {
    if (object == null) {
        // TODO: display empty image
        return;
    }
    if (((DataSymbol) object).equals(ivjCurrentSymbol)) {
        return;
    } else {
        ivjCurrentSymbol = (DataSymbol) object;
    }
    // manage checkbox status depending on type of current data symbol
    DataSymbolType dsType = ivjCurrentSymbol.getDataSymbolType();
    switch(dsType) {
        case GENERIC_SYMBOL:
            getChckbxPointSpreadFunction().setEnabled(true);
            getChckbxPointSpreadFunction().setSelected(false);
            break;
        case POINT_SPREAD_FUNCTION:
            getChckbxPointSpreadFunction().setEnabled(true);
            getChckbxPointSpreadFunction().setSelected(true);
            break;
        default:
            getChckbxPointSpreadFunction().setEnabled(false);
            getChckbxPointSpreadFunction().setSelected(false);
            break;
    }
    // displays iconized image for the current (field?) data symbol
    getImagePlaneManagerPanel().setMode(ImagePaneModel.MESH_MODE);
    int w = Integer.valueOf(30).intValue() + 5 * (countW % 5);
    int h = Integer.valueOf(20).intValue() + 3 * (countH % 7);
    String type = "double";
    System.out.println("  " + w + ", " + h);
    SourceDataInfo sdi = ImagePaneScrollerTest.getExampleSDI(type, w, h);
    getImagePlaneManagerPanel().setSourceDataInfo(sdi);
    countW++;
    countH++;
}
Also used : DataSymbol(cbit.vcell.data.DataSymbol) DataSymbolType(cbit.vcell.data.DataSymbol.DataSymbolType) SourceDataInfo(cbit.image.SourceDataInfo)

Example 14 with DataSymbol

use of cbit.vcell.data.DataSymbol in project vcell by virtualcell.

the class DataSymbolsTableModel method simulationContextChange.

/**
 * Sets the simulationContext property (cbit.vcell.mapping.SimulationContext) value.
 * @param simulationContext The new value for the property.
 * @see #getSimulationContext
 */
@Override
protected void simulationContextChange(java.beans.PropertyChangeEvent evt) {
    super.simulationContextChange(evt);
    SimulationContext oldValue = (SimulationContext) evt.getOldValue();
    if (oldValue != null) {
        oldValue.getDataContext().removePropertyChangeListener(this);
        for (DataSymbol ds : oldValue.getDataContext().getDataSymbols()) {
            ds.removePropertyChangeListener(this);
        }
    }
    SimulationContext newValue = (SimulationContext) evt.getNewValue();
    if (newValue != null) {
        newValue.getDataContext().addPropertyChangeListener(this);
        for (DataSymbol ds : newValue.getDataContext().getDataSymbols()) {
            ds.addPropertyChangeListener(this);
        }
    }
}
Also used : DataSymbol(cbit.vcell.data.DataSymbol) FieldDataSymbol(cbit.vcell.data.FieldDataSymbol) SimulationContext(cbit.vcell.mapping.SimulationContext)

Example 15 with DataSymbol

use of cbit.vcell.data.DataSymbol in project vcell by virtualcell.

the class VFrapXmlHelper method CreateSaveVFrapDataSymbols.

public static void CreateSaveVFrapDataSymbols(Hashtable<String, Object> hashTable, BioModel bioModel, ExternalDataIdentifier vfrapMisc) {
    String[] channelNames = (String[]) hashTable.get("channelNames");
    DataSymbolType[] channelVFrapImageType = (DataSymbolType[]) hashTable.get("channelVFrapImageType");
    String initialFieldDataName = (String) hashTable.get("initialFieldDataName");
    SimulationContext simContext = bioModel.getSimulationContexts()[0];
    ModelUnitSystem modelUnitSystem = bioModel.getModel().getUnitSystem();
    for (int i = 0; i < channelNames.length; i++) {
        // TODO: construct dataSymbolName from vFrapConstants::nameFromToken()
        // item name postfixed with field data name
        String dataSymbolName = channelNames[i] + "_" + initialFieldDataName;
        DataSymbol dataSymbol = new FieldDataSymbol(dataSymbolName, channelVFrapImageType[i], simContext.getDataContext(), modelUnitSystem.getInstance_TBD(), vfrapMisc, channelNames[i], VariableType.VOLUME.getTypeName(), 0D);
        simContext.getDataContext().addDataSymbol(dataSymbol);
    }
}
Also used : FieldDataSymbol(cbit.vcell.data.FieldDataSymbol) DataSymbol(cbit.vcell.data.DataSymbol) DataSymbolType(cbit.vcell.data.DataSymbol.DataSymbolType) SimulationContext(cbit.vcell.mapping.SimulationContext) ModelUnitSystem(cbit.vcell.model.ModelUnitSystem) FieldDataSymbol(cbit.vcell.data.FieldDataSymbol)

Aggregations

DataSymbol (cbit.vcell.data.DataSymbol)15 FieldDataSymbol (cbit.vcell.data.FieldDataSymbol)10 SimulationContext (cbit.vcell.mapping.SimulationContext)5 Element (org.jdom.Element)4 ExperimentalPSF (cbit.vcell.mapping.MicroscopeMeasurement.ExperimentalPSF)3 GaussianConvolutionKernel (cbit.vcell.mapping.MicroscopeMeasurement.GaussianConvolutionKernel)3 ProjectionZKernel (cbit.vcell.mapping.MicroscopeMeasurement.ProjectionZKernel)3 Component (java.awt.Component)3 ExternalDataIdentifier (org.vcell.util.document.ExternalDataIdentifier)3 ImageException (cbit.image.ImageException)2 VCImageUncompressed (cbit.image.VCImageUncompressed)2 ImageDataset (cbit.vcell.VirtualMicroscopy.ImageDataset)2 DocumentWindow (cbit.vcell.client.desktop.DocumentWindow)2 AsynchClientTask (cbit.vcell.client.task.AsynchClientTask)2 DocumentManager (cbit.vcell.clientdb.DocumentManager)2 DataSymbolType (cbit.vcell.data.DataSymbol.DataSymbolType)2 FieldFunctionArguments (cbit.vcell.field.FieldFunctionArguments)2 FieldDataFileOperationSpec (cbit.vcell.field.io.FieldDataFileOperationSpec)2 GeometryClass (cbit.vcell.geometry.GeometryClass)2 RegionImage (cbit.vcell.geometry.RegionImage)2