Search in sources :

Example 1 with ExportSpecs

use of cbit.vcell.export.server.ExportSpecs in project vcell by virtualcell.

the class PDEDataViewer method sendTimeSeriesImageJ.

// private Hashtable<String, JLabel> sendTimeSeriesLabels = new Hashtable<>();
// @Override
// public void exportMessage(ExportEvent event) {
// super.exportMessage(event);
// if(sendTimeSeriesLabels.size() > 0){
// JLabel messgLabel = sendTimeSeriesLabels.values().iterator().next();
// SwingUtilities.invokeLater(new Runnable() {
// @Override
// public void run() {
// messgLabel.setText(event.getMessageData().toString());
// }
// });
// }
// }
private void sendTimeSeriesImageJ() {
    final JPanel mainJPanel = new JPanel();
    BoxLayout mainBL = new BoxLayout(mainJPanel, BoxLayout.Y_AXIS);
    mainJPanel.setLayout(mainBL);
    final boolean[] response = new boolean[] { false };
    MiniTimePanel timeJPanel = new MiniTimePanel();
    final JLabel messgLabel = new JLabel("time points to export:" + (timeJPanel.jcb_time_end.getSelectedIndex() - timeJPanel.jcb_time_begin.getSelectedIndex() + 1));
    JRadioButton slicebtn = new JRadioButton("Slice " + getPDEDataContextPanel1().getSlice() + " only");
    slicebtn.setSelected(true);
    JPanel messageAndSlicePanel = null;
    if (getPdeDataContext().getCartesianMesh().getGeometryDimension() == 3) {
        messageAndSlicePanel = new JPanel();
        ((FlowLayout) messageAndSlicePanel.getLayout()).setAlignment(FlowLayout.LEFT);
        ButtonGroup buttonGroup = new ButtonGroup();
        JRadioButton allslicebtn = new JRadioButton("All slices");
        buttonGroup.add(slicebtn);
        buttonGroup.add(allslicebtn);
        messageAndSlicePanel.add(messgLabel);
        messageAndSlicePanel.add(slicebtn);
        messageAndSlicePanel.add(allslicebtn);
    }
    ActionListener okAction = new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            if (((Double) timeJPanel.jcb_time_begin.getSelectedItem()).compareTo((Double) timeJPanel.jcb_time_end.getSelectedItem()) > 0) {
                PopupGenerator.showErrorDialog(PDEDataViewer.this, "Selected 'Begin Time' must be less than or equal to 'End Time'");
                return;
            }
            response[0] = true;
            BeanUtils.disposeParentWindow(mainJPanel);
        }
    };
    ActionListener cancelAction = new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            BeanUtils.disposeParentWindow(mainJPanel);
        }
    };
    final OkCancelSubPanel okCancelJPanel = new OkCancelSubPanel(okAction, cancelAction);
    ActionListener rangeListener = new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            int range = timeJPanel.jcb_time_end.getSelectedIndex() - timeJPanel.jcb_time_begin.getSelectedIndex() + 1;
            okCancelJPanel.okButton.setEnabled(range > 0);
            messgLabel.setText((range < 0 ? "Error: begin time must be < end time" : "time points to export:" + (range)));
        }
    };
    timeJPanel.jcb_time_end.addActionListener(rangeListener);
    timeJPanel.jcb_time_begin.addActionListener(rangeListener);
    okCancelJPanel.okButton.setEnabled(true);
    mainJPanel.add(timeJPanel);
    mainJPanel.add((messageAndSlicePanel == null ? messgLabel : messageAndSlicePanel));
    mainJPanel.add(okCancelJPanel);
    Frame dialogOwner = JOptionPane.getFrameForComponent(this);
    JOptionPane inputDialog = new JOptionPane(mainJPanel, JOptionPane.PLAIN_MESSAGE, 0, null, new Object[0]);
    final JDialog d = inputDialog.createDialog(dialogOwner, "'" + getSimulationModelInfo().getContextName() + "':'" + getSimulationModelInfo().getSimulationName() + "':'" + getPdeDataContext().getVariableName() + "'");
    d.setResizable(true);
    d.setModal(true);
    d.pack();
    d.setVisible(true);
    // }
    if (!response[0]) {
        return;
    }
    ExportSpecs exportSpecs = new ExportSpecs(getPdeDataContext().getVCDataIdentifier(), ExportFormat.IMAGEJ, new VariableSpecs(new String[] { getPdeDataContext().getDataIdentifier().getName() }, ExportConstants.VARIABLE_MULTI), new TimeSpecs(timeJPanel.jcb_time_begin.getSelectedIndex(), timeJPanel.jcb_time_end.getSelectedIndex(), getPdeDataContext().getTimePoints(), ExportConstants.TIME_RANGE), new GeometrySpecs(null, getPDEDataContextPanel1().getNormalAxis(), getPDEDataContextPanel1().getSlice(), (slicebtn.isSelected() ? ExportConstants.GEOMETRY_SLICE : ExportConstants.GEOMETRY_FULL)), new RasterSpecs(ExportConstants.NRRD_BY_VARIABLE, false), getSimulationModelInfo().getSimulationName(), getSimulationModelInfo().getContextName());
    getDataViewerManager().startExport(this, ((ClientPDEDataContext) getPdeDataContext()).getDataManager().getOutputContext(), exportSpecs);
}
Also used : JPanel(javax.swing.JPanel) Frame(java.awt.Frame) JRadioButton(javax.swing.JRadioButton) FlowLayout(java.awt.FlowLayout) RasterSpecs(cbit.vcell.export.server.RasterSpecs) ActionEvent(java.awt.event.ActionEvent) ExportSpecs(cbit.vcell.export.server.ExportSpecs) BoxLayout(javax.swing.BoxLayout) JLabel(javax.swing.JLabel) GeometrySpecs(cbit.vcell.export.server.GeometrySpecs) JOptionPane(javax.swing.JOptionPane) Point(java.awt.Point) SinglePoint(cbit.vcell.geometry.SinglePoint) VariableSpecs(cbit.vcell.export.server.VariableSpecs) ActionListener(java.awt.event.ActionListener) ButtonGroup(javax.swing.ButtonGroup) ClientPDEDataContext(cbit.vcell.simdata.ClientPDEDataContext) TimeSpecs(cbit.vcell.export.server.TimeSpecs) JDialog(javax.swing.JDialog)

Example 2 with ExportSpecs

use of cbit.vcell.export.server.ExportSpecs in project vcell by virtualcell.

the class PDEDataViewerPostProcess method createPostProcessPDEDataContext.

public static PostProcessDataPDEDataContext createPostProcessPDEDataContext(final ClientPDEDataContext parentPDEDataContext) throws Exception {
    final DataOperationResults.DataProcessingOutputInfo dataProcessingOutputInfo = (DataOperationResults.DataProcessingOutputInfo) parentPDEDataContext.doDataOperation(new DataOperation.DataProcessingOutputInfoOP(parentPDEDataContext.getVCDataIdentifier(), false, parentPDEDataContext.getDataManager().getOutputContext()));
    if (dataProcessingOutputInfo == null) {
        return null;
    }
    DataSetControllerProvider dataSetControllerProvider = new DataSetControllerProvider() {

        @Override
        public DataSetController getDataSetController() throws DataAccessException {
            return new DataSetController() {

                // DataIdentifier[] dataIdentifiers;
                @Override
                public ExportEvent makeRemoteFile(OutputContext outputContext, ExportSpecs exportSpecs) throws DataAccessException, RemoteProxyException {
                    throw new DataAccessException("Not implemented");
                }

                @Override
                public TimeSeriesJobResults getTimeSeriesValues(OutputContext outputContext, VCDataIdentifier vcdataID, TimeSeriesJobSpec timeSeriesJobSpec) throws RemoteProxyException, DataAccessException {
                    // return parentPDEDataContext.getDataManager().getTimeSeriesValues(timeSeriesJobSpec);
                    DataOperation.DataProcessingOutputTimeSeriesOP dataProcessingOutputTimeSeriesOP = new DataOperation.DataProcessingOutputTimeSeriesOP(vcdataID, timeSeriesJobSpec, outputContext, getDataSetTimes(vcdataID));
                    DataOperationResults.DataProcessingOutputTimeSeriesValues dataopDataProcessingOutputTimeSeriesValues = (DataOperationResults.DataProcessingOutputTimeSeriesValues) parentPDEDataContext.doDataOperation(dataProcessingOutputTimeSeriesOP);
                    return dataopDataProcessingOutputTimeSeriesValues.getTimeSeriesJobResults();
                }

                @Override
                public SimDataBlock getSimDataBlock(OutputContext outputContext, VCDataIdentifier vcdataID, String varName, double time) throws RemoteProxyException, DataAccessException {
                    // return parentPDEDataContext.getDataManager().getSimDataBlock(varName, time);
                    DataOperationResults.DataProcessingOutputDataValues dataProcessingOutputValues = (DataOperationResults.DataProcessingOutputDataValues) parentPDEDataContext.doDataOperation(new DataOperation.DataProcessingOutputDataValuesOP(vcdataID, varName, TimePointHelper.createSingleTimeTimePointHelper(time), DataIndexHelper.createAllDataIndexesDataIndexHelper(), outputContext, null));
                    PDEDataInfo pdeDataInfo = new PDEDataInfo(vcdataID.getOwner(), vcdataID.getID(), varName, time, Long.MIN_VALUE);
                    SimDataBlock simDataBlock = new SimDataBlock(pdeDataInfo, dataProcessingOutputValues.getDataValues()[0], VariableType.POSTPROCESSING);
                    return simDataBlock;
                }

                @Override
                public boolean getParticleDataExists(VCDataIdentifier vcdataID) throws DataAccessException, RemoteProxyException {
                    // TODO Auto-generated method stub
                    return false;
                }

                @Override
                public ParticleDataBlock getParticleDataBlock(VCDataIdentifier vcdataID, double time) throws DataAccessException, RemoteProxyException {
                    // TODO Auto-generated method stub
                    return null;
                }

                @Override
                public ODESimData getODEData(VCDataIdentifier vcdataID) throws DataAccessException, RemoteProxyException {
                    // TODO Auto-generated method stub
                    return null;
                }

                @Override
                public CartesianMesh getMesh(VCDataIdentifier vcdataID) throws RemoteProxyException, DataAccessException {
                    // throw new DataAccessException("PostProcessData mesh not available at this level");
                    return null;
                }

                @Override
                public PlotData getLineScan(OutputContext outputContext, VCDataIdentifier vcdataID, String variable, double time, SpatialSelection spatialSelection) throws RemoteProxyException, DataAccessException {
                    throw new DataAccessException("Remote getLineScan method should not be called for PostProcess");
                }

                @Override
                public AnnotatedFunction[] getFunctions(OutputContext outputContext, VCDataIdentifier vcdataID) throws DataAccessException, RemoteProxyException {
                    return outputContext.getOutputFunctions();
                }

                @Override
                public double[] getDataSetTimes(VCDataIdentifier vcdataID) throws RemoteProxyException, DataAccessException {
                    return dataProcessingOutputInfo.getVariableTimePoints();
                }

                @Override
                public DataSetTimeSeries getDataSetTimeSeries(VCDataIdentifier vcdataID, String[] variableNames) throws DataAccessException, RemoteProxyException {
                    // TODO Auto-generated method stub
                    return null;
                }

                @Override
                public DataSetMetadata getDataSetMetadata(VCDataIdentifier vcdataID) throws DataAccessException, RemoteProxyException {
                    // TODO Auto-generated method stub
                    return null;
                }

                @Override
                public DataIdentifier[] getDataIdentifiers(OutputContext outputContext, VCDataIdentifier vcdataID) throws RemoteProxyException, DataAccessException {
                    // return parentPDEDataContext.getDataIdentifiers();
                    ArrayList<DataIdentifier> postProcessDataIDs = new ArrayList<DataIdentifier>();
                    if (outputContext != null && outputContext.getOutputFunctions() != null) {
                        for (int i = 0; i < outputContext.getOutputFunctions().length; i++) {
                            if (outputContext.getOutputFunctions()[i].isPostProcessFunction()) {
                                postProcessDataIDs.add(new DataIdentifier(outputContext.getOutputFunctions()[i].getName(), VariableType.POSTPROCESSING, null, false, outputContext.getOutputFunctions()[i].getDisplayName()));
                            }
                        }
                    }
                    // get 'state' variables
                    for (int i = 0; i < dataProcessingOutputInfo.getVariableNames().length; i++) {
                        if (dataProcessingOutputInfo.getPostProcessDataType(dataProcessingOutputInfo.getVariableNames()[i]).equals(PostProcessDataType.image)) {
                            DataIdentifier dataIdentifier = new DataIdentifier(dataProcessingOutputInfo.getVariableNames()[i], VariableType.POSTPROCESSING, null, false, dataProcessingOutputInfo.getVariableNames()[i]);
                            postProcessDataIDs.add(dataIdentifier);
                        }
                    }
                    if (postProcessDataIDs.size() > 0) {
                        return postProcessDataIDs.toArray(new DataIdentifier[0]);
                    }
                    return null;
                }

                @Override
                public FieldDataFileOperationResults fieldDataFileOperation(FieldDataFileOperationSpec fieldDataFileOperationSpec) throws RemoteProxyException, DataAccessException {
                    // TODO Auto-generated method stub
                    return null;
                }

                @Override
                public DataOperationResults doDataOperation(DataOperation dataOperation) throws DataAccessException, RemoteProxyException {
                    // TODO Auto-generated method stub
                    return parentPDEDataContext.doDataOperation(dataOperation);
                }

                @Override
                public VtuFileContainer getEmptyVtuMeshFiles(VCDataIdentifier vcdataID, int timeIndex) throws DataAccessException {
                    // TODO Auto-generated method stub
                    return null;
                }

                @Override
                public double[] getVtuMeshData(OutputContext outputContext, VCDataIdentifier vcdataID, VtuVarInfo var, double time) throws RemoteProxyException, DataAccessException {
                    // TODO Auto-generated method stub
                    return null;
                }

                @Override
                public VtuVarInfo[] getVtuVarInfos(OutputContext outputContext, VCDataIdentifier vcDataIdentifier) {
                    // TODO Auto-generated method stub
                    return null;
                }

                @Override
                public double[] getVtuTimes(VCDataIdentifier vcdataID) throws RemoteProxyException, DataAccessException {
                    // TODO Auto-generated method stub
                    return null;
                }

                @Override
                public NFSimMolecularConfigurations getNFSimMolecularConfigurations(VCDataIdentifier vcdataID) throws RemoteProxyException, DataAccessException {
                    // TODO Auto-generated method stub
                    return null;
                }
            };
        }
    };
    VCDataManager postProcessVCDataManager = new VCDataManager(dataSetControllerProvider);
    PDEDataManager postProcessPDEDataManager = new PDEDataManager(((ClientPDEDataContext) parentPDEDataContext).getDataManager().getOutputContext(), postProcessVCDataManager, parentPDEDataContext.getVCDataIdentifier());
    PostProcessDataPDEDataContext postProcessDataPDEDataContext = new PostProcessDataPDEDataContext(postProcessPDEDataManager);
    return postProcessDataPDEDataContext;
}
Also used : VtuVarInfo(org.vcell.vis.io.VtuVarInfo) VCDataIdentifier(org.vcell.util.document.VCDataIdentifier) DataIdentifier(cbit.vcell.simdata.DataIdentifier) TimeSeriesJobSpec(org.vcell.util.document.TimeSeriesJobSpec) ExportSpecs(cbit.vcell.export.server.ExportSpecs) FieldDataFileOperationSpec(cbit.vcell.field.io.FieldDataFileOperationSpec) DataProcessingOutputInfo(cbit.vcell.simdata.DataOperationResults.DataProcessingOutputInfo) ArrayList(java.util.ArrayList) DataProcessingOutputInfoOP(cbit.vcell.simdata.DataOperation.DataProcessingOutputInfoOP) PDEDataInfo(cbit.vcell.simdata.PDEDataInfo) DataSetControllerProvider(cbit.vcell.server.DataSetControllerProvider) SimDataBlock(cbit.vcell.simdata.SimDataBlock) SpatialSelection(cbit.vcell.simdata.SpatialSelection) VCDataManager(cbit.vcell.simdata.VCDataManager) DataAccessException(org.vcell.util.DataAccessException) AnnotatedFunction(cbit.vcell.solver.AnnotatedFunction) DataOperation(cbit.vcell.simdata.DataOperation) DataSetController(cbit.vcell.server.DataSetController) OutputContext(cbit.vcell.simdata.OutputContext) PDEDataManager(cbit.vcell.simdata.PDEDataManager) DataProcessingOutputInfo(cbit.vcell.simdata.DataOperationResults.DataProcessingOutputInfo) DataOperationResults(cbit.vcell.simdata.DataOperationResults) ClientPDEDataContext(cbit.vcell.simdata.ClientPDEDataContext) VCDataIdentifier(org.vcell.util.document.VCDataIdentifier)

Example 3 with ExportSpecs

use of cbit.vcell.export.server.ExportSpecs in project vcell by virtualcell.

the class PDEExportDataPanel method getExportSpecs.

/**
 * This method was created in VisualAge.
 * @return cbit.vcell.export.server.ExportSpecs
 */
private ExportSpecs getExportSpecs() {
    @SuppressWarnings("deprecation") Object[] variableSelections = getJListVariables().getSelectedValues();
    String[] variableNames = new String[variableSelections.length];
    for (int i = 0; i < variableSelections.length; i++) {
        variableNames[i] = (String) variableSelections[i];
    }
    VariableSpecs variableSpecs = new VariableSpecs(variableNames, ExportConstants.VARIABLE_MULTI);
    TimeSpecs timeSpecs = new TimeSpecs(getJSlider1().getValue(), getJSlider2().getValue(), getPdeDataContext().getTimePoints(), ExportConstants.TIME_RANGE);
    int geoMode = ExportConstants.GEOMETRY_SELECTIONS;
    if (getJRadioButtonSlice().isSelected()) {
        geoMode = ExportConstants.GEOMETRY_SLICE;
    } else if (getJRadioButtonFull().isSelected()) {
        geoMode = ExportConstants.GEOMETRY_FULL;
    }
    Object[] selectionsArr = getROISelections().getSelectedValuesList().toArray();
    SpatialSelection[] selections = new SpatialSelection[selectionsArr.length];
    for (int i = 0; i < selections.length; i++) {
        selections[i] = (SpatialSelection) selectionsArr[i];
    }
    GeometrySpecs geometrySpecs = new GeometrySpecs(selections, getNormalAxis(), getSlice(), geoMode);
    return new ExportSpecs(getPdeDataContext().getVCDataIdentifier(), getExportSettings1().getSelectedFormat(), variableSpecs, timeSpecs, geometrySpecs, getExportSettings1().getFormatSpecificSpecs(), dataInfoProvider.getSimulationModelInfo().getSimulationName(), dataInfoProvider.getSimulationModelInfo().getContextName());
}
Also used : VariableSpecs(cbit.vcell.export.server.VariableSpecs) SpatialSelection(cbit.vcell.simdata.SpatialSelection) ExportSpecs(cbit.vcell.export.server.ExportSpecs) GeometrySpecs(cbit.vcell.export.server.GeometrySpecs) TimeSpecs(cbit.vcell.export.server.TimeSpecs)

Example 4 with ExportSpecs

use of cbit.vcell.export.server.ExportSpecs in project vcell by virtualcell.

the class DisplayTimeSeriesOp method getDataSetControllerProvider.

private DataSetControllerProvider getDataSetControllerProvider(final ImageTimeSeries<? extends Image> imageTimeSeries, final PDEDataViewer pdeDataViewer) throws ImageException, IOException {
    ISize size = imageTimeSeries.getISize();
    int dimension = (size.getZ() > 0) ? (3) : (2);
    Extent extent = imageTimeSeries.getExtent();
    Origin origin = imageTimeSeries.getAllImages()[0].getOrigin();
    // don't care ... no surfaces
    double filterCutoffFrequency = 0.5;
    VCImage vcImage = new VCImageUncompressed(null, new byte[size.getXYZ()], extent, size.getX(), size.getY(), size.getZ());
    RegionImage regionImage = new RegionImage(vcImage, dimension, extent, origin, filterCutoffFrequency);
    final CartesianMesh mesh = CartesianMesh.createSimpleCartesianMesh(origin, extent, size, regionImage);
    final DataIdentifier dataIdentifier = new DataIdentifier("var", VariableType.VOLUME, new Domain("domain"), false, "var");
    final DataSetController dataSetController = new DataSetController() {

        @Override
        public ExportEvent makeRemoteFile(OutputContext outputContext, ExportSpecs exportSpecs) throws DataAccessException, RemoteProxyException {
            throw new RuntimeException("not yet implemented");
        }

        @Override
        public TimeSeriesJobResults getTimeSeriesValues(OutputContext outputContext, VCDataIdentifier vcdataID, TimeSeriesJobSpec timeSeriesJobSpec) throws RemoteProxyException, DataAccessException {
            pdeDataViewer.dataJobMessage(new DataJobEvent(timeSeriesJobSpec.getVcDataJobID(), MessageEvent.DATA_START, vcdataID.getDataKey(), vcdataID.getID(), new Double(0)));
            if (!timeSeriesJobSpec.isCalcSpaceStats() && !timeSeriesJobSpec.isCalcTimeStats()) {
                int[][] indices = timeSeriesJobSpec.getIndices();
                double[] timeStamps = imageTimeSeries.getImageTimeStamps();
                // [var][dataindex+1][timeindex]
                double[][][] dataValues = new double[1][indices[0].length + 1][timeStamps.length];
                for (int timeIndex = 0; timeIndex < timeStamps.length; timeIndex++) {
                    // index 0 is time
                    dataValues[0][0][timeIndex] = timeStamps[timeIndex];
                }
                for (int timeIndex = 0; timeIndex < timeStamps.length; timeIndex++) {
                    float[] pixelValues = imageTimeSeries.getAllImages()[timeIndex].getFloatPixels();
                    for (int samplePointIndex = 0; samplePointIndex < indices[0].length; samplePointIndex++) {
                        int pixelIndex = indices[0][samplePointIndex];
                        dataValues[0][samplePointIndex + 1][timeIndex] = pixelValues[pixelIndex];
                    }
                }
                TSJobResultsNoStats timeSeriesJobResults = new TSJobResultsNoStats(new String[] { "var" }, indices, timeStamps, dataValues);
                pdeDataViewer.dataJobMessage(new DataJobEvent(timeSeriesJobSpec.getVcDataJobID(), MessageEvent.DATA_COMPLETE, vcdataID.getDataKey(), vcdataID.getID(), new Double(0)));
                return timeSeriesJobResults;
            }
            return null;
        }

        @Override
        public SimDataBlock getSimDataBlock(OutputContext outputContext, VCDataIdentifier vcdataID, String varName, double time) throws RemoteProxyException, DataAccessException {
            double timePoint = time;
            double[] timePoints = getDataSetTimes(vcdataID);
            int index = -1;
            for (int i = 0; i < timePoints.length; i++) {
                if (timePoint == timePoints[i]) {
                    index = i;
                    break;
                }
            }
            double[] data = imageTimeSeries.getAllImages()[index].getDoublePixels();
            PDEDataInfo pdeDataInfo = new PDEDataInfo(null, null, varName, time, 0);
            VariableType varType = VariableType.VOLUME;
            return new SimDataBlock(pdeDataInfo, data, varType);
        }

        @Override
        public boolean getParticleDataExists(VCDataIdentifier vcdataID) throws DataAccessException, RemoteProxyException {
            return false;
        }

        @Override
        public ParticleDataBlock getParticleDataBlock(VCDataIdentifier vcdataID, double time) throws DataAccessException, RemoteProxyException {
            return null;
        }

        @Override
        public ODESimData getODEData(VCDataIdentifier vcdataID) throws DataAccessException, RemoteProxyException {
            return null;
        }

        @Override
        public CartesianMesh getMesh(VCDataIdentifier vcdataID) throws RemoteProxyException, DataAccessException {
            return mesh;
        }

        @Override
        public PlotData getLineScan(OutputContext outputContext, VCDataIdentifier vcdataID, String variable, double time, SpatialSelection spatialSelection) throws RemoteProxyException, DataAccessException {
            throw new RuntimeException("not yet implemented");
        }

        @Override
        public AnnotatedFunction[] getFunctions(OutputContext outputContext, VCDataIdentifier vcdataID) throws DataAccessException, RemoteProxyException {
            return new AnnotatedFunction[0];
        }

        @Override
        public double[] getDataSetTimes(VCDataIdentifier vcdataID) throws RemoteProxyException, DataAccessException {
            return imageTimeSeries.getImageTimeStamps();
        }

        @Override
        public DataSetTimeSeries getDataSetTimeSeries(VCDataIdentifier vcdataID, String[] variableNames) throws DataAccessException, RemoteProxyException {
            throw new RuntimeException("not yet implemented");
        }

        @Override
        public DataSetMetadata getDataSetMetadata(VCDataIdentifier vcdataID) throws DataAccessException, RemoteProxyException {
            throw new RuntimeException("not yet implemented");
        }

        @Override
        public DataIdentifier[] getDataIdentifiers(OutputContext outputContext, VCDataIdentifier vcdataID) throws RemoteProxyException, DataAccessException {
            return new DataIdentifier[] { dataIdentifier };
        }

        @Override
        public FieldDataFileOperationResults fieldDataFileOperation(FieldDataFileOperationSpec fieldDataFileOperationSpec) throws RemoteProxyException, DataAccessException {
            throw new RuntimeException("not yet implemented");
        }

        @Override
        public DataOperationResults doDataOperation(DataOperation dataOperation) throws DataAccessException, RemoteProxyException {
            throw new RuntimeException("not yet implemented");
        }

        @Override
        public VtuFileContainer getEmptyVtuMeshFiles(VCDataIdentifier vcdataID, int timeIndex) throws RemoteProxyException, DataAccessException {
            throw new RuntimeException("not yet implemented");
        }

        @Override
        public double[] getVtuTimes(VCDataIdentifier vcdataID) throws RemoteProxyException, DataAccessException {
            throw new RuntimeException("not yet implemented");
        }

        @Override
        public double[] getVtuMeshData(OutputContext outputContext, VCDataIdentifier vcdataID, VtuVarInfo var, double time) throws RemoteProxyException, DataAccessException {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public VtuVarInfo[] getVtuVarInfos(OutputContext outputContext, VCDataIdentifier vcDataIdentifier) throws DataAccessException, RemoteProxyException {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public NFSimMolecularConfigurations getNFSimMolecularConfigurations(VCDataIdentifier vcdataID) throws RemoteProxyException, DataAccessException {
            // TODO Auto-generated method stub
            return null;
        }
    };
    DataSetControllerProvider dataSetControllerProvider = new DataSetControllerProvider() {

        @Override
        public DataSetController getDataSetController() throws DataAccessException {
            return dataSetController;
        }
    };
    return dataSetControllerProvider;
}
Also used : Origin(org.vcell.util.Origin) VtuVarInfo(org.vcell.vis.io.VtuVarInfo) VCDataIdentifier(org.vcell.util.document.VCDataIdentifier) DataIdentifier(cbit.vcell.simdata.DataIdentifier) TimeSeriesJobSpec(org.vcell.util.document.TimeSeriesJobSpec) Extent(org.vcell.util.Extent) ISize(org.vcell.util.ISize) ExportSpecs(cbit.vcell.export.server.ExportSpecs) FieldDataFileOperationSpec(cbit.vcell.field.io.FieldDataFileOperationSpec) VCImage(cbit.image.VCImage) PDEDataInfo(cbit.vcell.simdata.PDEDataInfo) DataSetControllerProvider(cbit.vcell.server.DataSetControllerProvider) SimDataBlock(cbit.vcell.simdata.SimDataBlock) SpatialSelection(cbit.vcell.simdata.SpatialSelection) AnnotatedFunction(cbit.vcell.solver.AnnotatedFunction) DataOperation(cbit.vcell.simdata.DataOperation) VariableType(cbit.vcell.math.VariableType) DataSetController(cbit.vcell.server.DataSetController) VCImageUncompressed(cbit.image.VCImageUncompressed) OutputContext(cbit.vcell.simdata.OutputContext) DataJobEvent(cbit.rmi.event.DataJobEvent) CartesianMesh(cbit.vcell.solvers.CartesianMesh) RegionImage(cbit.vcell.geometry.RegionImage) Domain(cbit.vcell.math.Variable.Domain) VCDataIdentifier(org.vcell.util.document.VCDataIdentifier) TSJobResultsNoStats(org.vcell.util.document.TSJobResultsNoStats)

Example 5 with ExportSpecs

use of cbit.vcell.export.server.ExportSpecs in project vcell by virtualcell.

the class DisplayTimeSeriesOp method displayImageTimeSeries.

public void displayImageTimeSeries(final ImageTimeSeries<? extends Image> imageTimeSeries, final String title, final WindowListener windowListener) throws ImageException, IOException {
    try {
        System.out.println("starting to prepare data for time series viewing");
        final PDEDataViewer pdeDataViewer = new PDEDataViewer();
        DataSetControllerProvider dataSetControllerProvider;
        try {
            dataSetControllerProvider = getDataSetControllerProvider(imageTimeSeries, pdeDataViewer);
        } catch (ImageException | IOException e1) {
            e1.printStackTrace();
            throw new RuntimeException(e1.getMessage(), e1);
        }
        VCDataManager vcDataManager = new VCDataManager(dataSetControllerProvider);
        OutputContext outputContext = new OutputContext(new AnnotatedFunction[0]);
        final VCDataIdentifier vcDataIdentifier = new VCDataIdentifier() {

            public User getOwner() {
                return new User("nouser", null);
            }

            public KeyValue getDataKey() {
                return null;
            }

            public String getID() {
                return "mydata";
            }
        };
        PDEDataManager pdeDataManager = new PDEDataManager(outputContext, vcDataManager, vcDataIdentifier);
        final ClientPDEDataContext myPdeDataContext = new ClientPDEDataContext(pdeDataManager);
        final RequestManager requestManager = new RequestManagerAdapter() {
        };
        final DataViewerManager dataViewerManager = new DataViewerManager() {

            public void dataJobMessage(DataJobEvent event) {
            }

            public void exportMessage(ExportEvent event) {
            }

            public void addDataListener(DataListener newListener) {
            }

            public UserPreferences getUserPreferences() {
                // getRequestManager().getUserPreferences();
                return null;
            }

            public void removeDataListener(DataListener newListener) {
            }

            public void startExport(Component requester, OutputContext outputContext, ExportSpecs exportSpecs) {
            // getLocalRequestManager().startExport(outputContext, FieldDataWindowManager.this, exportSpecs);
            }

            public void simStatusChanged(SimStatusEvent simStatusEvent) {
            }

            public User getUser() {
                return new User("dummy", new KeyValue("123"));
            // return getRequestManager().getDocumentManager().getUser();
            }

            public RequestManager getRequestManager() {
                return requestManager;
            }
        };
        System.out.println("ready to display time series");
        SwingUtilities.invokeAndWait(new Runnable() {

            @Override
            public void run() {
                JFrame jframe = new TopLevelFrame();
                jframe.setTitle(title);
                jframe.getContentPane().add(pdeDataViewer);
                jframe.setSize(1000, 600);
                jframe.setVisible(true);
                if (windowListener != null) {
                    jframe.addWindowListener(windowListener);
                }
                try {
                    pdeDataViewer.setDataViewerManager(dataViewerManager);
                } catch (PropertyVetoException e) {
                    e.printStackTrace();
                }
                pdeDataViewer.setPdeDataContext(myPdeDataContext);
            }
        });
    } catch (InvocationTargetException | InterruptedException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
Also used : ImageException(cbit.image.ImageException) User(org.vcell.util.document.User) KeyValue(org.vcell.util.document.KeyValue) ExportEvent(cbit.rmi.event.ExportEvent) ExportSpecs(cbit.vcell.export.server.ExportSpecs) DataSetControllerProvider(cbit.vcell.server.DataSetControllerProvider) RequestManager(cbit.vcell.client.RequestManager) JFrame(javax.swing.JFrame) Component(java.awt.Component) VCDataManager(cbit.vcell.simdata.VCDataManager) IOException(java.io.IOException) OutputContext(cbit.vcell.simdata.OutputContext) InvocationTargetException(java.lang.reflect.InvocationTargetException) PropertyVetoException(java.beans.PropertyVetoException) RequestManagerAdapter(cbit.vcell.client.RequestManagerAdapter) DataViewerManager(cbit.vcell.client.DataViewerManager) DataJobEvent(cbit.rmi.event.DataJobEvent) PDEDataManager(cbit.vcell.simdata.PDEDataManager) SimStatusEvent(cbit.vcell.client.server.SimStatusEvent) ClientPDEDataContext(cbit.vcell.simdata.ClientPDEDataContext) DataListener(cbit.vcell.simdata.DataListener) VCDataIdentifier(org.vcell.util.document.VCDataIdentifier) PDEDataViewer(cbit.vcell.client.data.PDEDataViewer)

Aggregations

ExportSpecs (cbit.vcell.export.server.ExportSpecs)9 ClientPDEDataContext (cbit.vcell.simdata.ClientPDEDataContext)6 OutputContext (cbit.vcell.simdata.OutputContext)6 VCDataIdentifier (org.vcell.util.document.VCDataIdentifier)6 ExportEvent (cbit.rmi.event.ExportEvent)4 TimeSpecs (cbit.vcell.export.server.TimeSpecs)4 DataSetControllerProvider (cbit.vcell.server.DataSetControllerProvider)4 DataIdentifier (cbit.vcell.simdata.DataIdentifier)4 PDEDataManager (cbit.vcell.simdata.PDEDataManager)4 AnnotatedFunction (cbit.vcell.solver.AnnotatedFunction)4 DataJobEvent (cbit.rmi.event.DataJobEvent)3 PDEDataViewer (cbit.vcell.client.data.PDEDataViewer)3 AsynchClientTask (cbit.vcell.client.task.AsynchClientTask)3 GeometrySpecs (cbit.vcell.export.server.GeometrySpecs)3 VariableSpecs (cbit.vcell.export.server.VariableSpecs)3 FieldDataFileOperationSpec (cbit.vcell.field.io.FieldDataFileOperationSpec)3 DataSetController (cbit.vcell.server.DataSetController)3 SpatialSelection (cbit.vcell.simdata.SpatialSelection)3 CartesianMesh (cbit.vcell.solvers.CartesianMesh)3 Hashtable (java.util.Hashtable)3