Search in sources :

Example 31 with Extent

use of org.vcell.util.Extent in project vcell by virtualcell.

the class RunRefSimulationOp method saveExternalData.

private static void saveExternalData(Image image, String varName, ExternalDataIdentifier newROIExtDataID, LocalWorkspace localWorkspace) throws ObjectNotFoundException, ImageException, IOException {
    Extent extent = image.getExtent();
    Origin origin = image.getOrigin();
    ISize isize = image.getISize();
    VCImage vcImage = new VCImageUncompressed(null, new byte[isize.getXYZ()], extent, isize.getX(), isize.getY(), isize.getZ());
    RegionImage regionImage = new RegionImage(vcImage, 0, null, null, RegionImage.NO_SMOOTHING);
    CartesianMesh simpleCartesianMesh = CartesianMesh.createSimpleCartesianMesh(origin, extent, isize, regionImage);
    int NumTimePoints = 1;
    int NumChannels = 1;
    // dimensions: time points, channels, whole image ordered by z slices.
    double[][][] pixData = new double[NumTimePoints][NumChannels][];
    pixData[0][0] = image.getDoublePixels();
    FieldDataFileOperationSpec fdos = new FieldDataFileOperationSpec();
    fdos.opType = FieldDataFileOperationSpec.FDOS_ADD;
    fdos.cartesianMesh = simpleCartesianMesh;
    fdos.doubleSpecData = pixData;
    fdos.specEDI = newROIExtDataID;
    fdos.varNames = new String[] { varName };
    fdos.owner = LocalWorkspace.getDefaultOwner();
    fdos.times = new double[] { 0.0 };
    fdos.variableTypes = new VariableType[] { VariableType.VOLUME };
    fdos.origin = origin;
    fdos.extent = extent;
    fdos.isize = isize;
    localWorkspace.getDataSetControllerImpl().fieldDataFileOperation(fdos);
}
Also used : Origin(org.vcell.util.Origin) CartesianMesh(cbit.vcell.solvers.CartesianMesh) Extent(org.vcell.util.Extent) ISize(org.vcell.util.ISize) FieldDataFileOperationSpec(cbit.vcell.field.io.FieldDataFileOperationSpec) RegionImage(cbit.vcell.geometry.RegionImage) VCImage(cbit.image.VCImage) VCImageUncompressed(cbit.image.VCImageUncompressed)

Example 32 with Extent

use of org.vcell.util.Extent in project vcell by virtualcell.

the class RunRefSimulationOp method runRefSimulation.

private static ImageTimeSeries<FloatImage> runRefSimulation(LocalWorkspace localWorkspace, ROI cellROI, double timeStepVal, TimeBounds timeBounds, FloatImage initRefConc, double baseDiffusionRate, ClientTaskStatusSupport progressListener) throws Exception {
    String INITCONC_EXTDATA_NAME = "initConc";
    String INITCONC_EXTDATA_VARNAME = "conc";
    String VAR_NAME = "species";
    User owner = LocalWorkspace.getDefaultOwner();
    KeyValue simKey = LocalWorkspace.createNewKeyValue();
    ExternalDataInfo initialConcentrationExtData = createNewExternalDataInfo(localWorkspace, INITCONC_EXTDATA_NAME);
    Extent extent = initRefConc.getExtent();
    Origin origin = initRefConc.getOrigin();
    ISize isize = new ISize(initRefConc.getNumX(), initRefConc.getNumY(), initRefConc.getNumZ());
    saveExternalData(initRefConc, INITCONC_EXTDATA_VARNAME, initialConcentrationExtData.getExternalDataIdentifier(), localWorkspace);
    FieldFunctionArguments initConditionFFA = new FieldFunctionArguments(INITCONC_EXTDATA_NAME, INITCONC_EXTDATA_VARNAME, new Expression(0.0), VariableType.VOLUME);
    BioModel bioModel = createRefSimBioModel(simKey, owner, origin, extent, cellROI, timeStepVal, timeBounds, VAR_NAME, new Expression(initConditionFFA.infix()), baseDiffusionRate);
    if (progressListener != null) {
        progressListener.setMessage("Running Reference Simulation...");
    }
    // run simulation
    runFVSolverStandalone(new File(localWorkspace.getDefaultSimDataDirectory()), bioModel.getSimulation(0), initialConcentrationExtData.getExternalDataIdentifier(), progressListener, true);
    VCDataIdentifier vcDataIdentifier = new VCSimulationDataIdentifier(new VCSimulationIdentifier(simKey, owner), 0);
    double[] dataTimes = localWorkspace.getDataSetControllerImpl().getDataSetTimes(vcDataIdentifier);
    FloatImage[] solutionImages = new FloatImage[dataTimes.length];
    for (int i = 0; i < dataTimes.length; i++) {
        SimDataBlock simDataBlock = localWorkspace.getDataSetControllerImpl().getSimDataBlock(null, vcDataIdentifier, VAR_NAME, dataTimes[i]);
        double[] doubleData = simDataBlock.getData();
        float[] floatPixels = new float[doubleData.length];
        for (int j = 0; j < doubleData.length; j++) {
            floatPixels[j] = (float) doubleData[j];
        }
        solutionImages[i] = new FloatImage(floatPixels, origin, extent, isize.getX(), isize.getY(), isize.getZ());
    }
    ImageTimeSeries<FloatImage> solution = new ImageTimeSeries<FloatImage>(FloatImage.class, solutionImages, dataTimes, 1);
    return solution;
}
Also used : Origin(org.vcell.util.Origin) VCSimulationIdentifier(cbit.vcell.solver.VCSimulationIdentifier) User(org.vcell.util.document.User) KeyValue(org.vcell.util.document.KeyValue) FloatImage(cbit.vcell.VirtualMicroscopy.FloatImage) ExternalDataInfo(org.vcell.vmicro.workflow.data.ExternalDataInfo) Extent(org.vcell.util.Extent) FieldFunctionArguments(cbit.vcell.field.FieldFunctionArguments) ISize(org.vcell.util.ISize) VCSimulationDataIdentifier(cbit.vcell.solver.VCSimulationDataIdentifier) SimDataBlock(cbit.vcell.simdata.SimDataBlock) Expression(cbit.vcell.parser.Expression) BioModel(cbit.vcell.biomodel.BioModel) File(java.io.File) VCDataIdentifier(org.vcell.util.document.VCDataIdentifier) ImageTimeSeries(org.vcell.vmicro.workflow.data.ImageTimeSeries)

Example 33 with Extent

use of org.vcell.util.Extent in project vcell by virtualcell.

the class BrownianDynamicsTest method main.

public static void main(String[] args) {
    try {
        Options commandOptions = new Options();
        Option noiseOption = new Option(OPTION_NOISE, false, "sampled images use Poisson statistics for photons, default is to count particles");
        commandOptions.addOption(noiseOption);
        Option psfOption = new Option(OPTION_PSF, false, "sampled images are convolve with microscope psf, default is to bin");
        commandOptions.addOption(psfOption);
        Option imageFileOption = new Option(OPTION_IMAGEFILE, true, "file to store image time series");
        imageFileOption.setArgName("filename");
        imageFileOption.setValueSeparator('=');
        commandOptions.addOption(imageFileOption);
        Option plotFileOption = new Option(OPTION_PLOTFILE, true, "file to store CSV time series (reduced data for ROIs)");
        plotFileOption.setArgName("filename");
        plotFileOption.setValueSeparator('=');
        commandOptions.addOption(plotFileOption);
        Option displayImageOption = new Option(OPTION_DISPLAY_IMAGE, false, "display image time series");
        commandOptions.addOption(displayImageOption);
        Option displayPlotOption = new Option(OPTION_DISPLAY_PLOT, false, "display plot of bleach roi");
        commandOptions.addOption(displayPlotOption);
        Option extentOption = new Option(OPTION_EXTENT, true, "extent of entire domain (default " + DEFAULT_EXTENT_SCALE + ")");
        extentOption.setArgName("extent");
        extentOption.setValueSeparator('=');
        commandOptions.addOption(extentOption);
        Option imageSizeOption = new Option(OPTION_IMAGE_SIZE, true, "num pixels in x and y (default " + DEFAULT_IMAGE_SIZE + ")");
        imageSizeOption.setArgName("numPixels");
        imageSizeOption.setValueSeparator('=');
        commandOptions.addOption(imageSizeOption);
        Option numParticlesOption = new Option(OPTION_NUM_PARTICLES, true, "num particles (default " + DEFAULT_NUM_PARTICLES + ")");
        numParticlesOption.setArgName("num");
        numParticlesOption.setValueSeparator('=');
        commandOptions.addOption(numParticlesOption);
        Option diffusionOption = new Option(OPTION_DIFFUSION, true, "diffusion rate (default " + DEFAULT_DIFFUSION + ")");
        diffusionOption.setArgName("rate");
        diffusionOption.setValueSeparator('=');
        commandOptions.addOption(diffusionOption);
        Option bleachRadiusOption = new Option(OPTION_BLEACH_RADIUS, true, "bleach radius (default " + DEFAULT_BLEACH_RADIUS + ")");
        bleachRadiusOption.setArgName("radius");
        bleachRadiusOption.setValueSeparator('=');
        commandOptions.addOption(bleachRadiusOption);
        Option psfRadiusOption = new Option(OPTION_PSF_RADIUS, true, "psf radius (default " + DEFAULT_PSF_RADIUS + ")");
        psfRadiusOption.setArgName("radius");
        psfRadiusOption.setValueSeparator('=');
        commandOptions.addOption(psfRadiusOption);
        Option bleachDurationOption = new Option(OPTION_BLEACH_DURATION, true, "psf radius (default " + DEFAULT_BLEACH_DURATION + ")");
        bleachDurationOption.setArgName("duration");
        bleachDurationOption.setValueSeparator('=');
        commandOptions.addOption(bleachDurationOption);
        Option endTimeOption = new Option(OPTION_ENDTIME, true, "end time (default " + DEFAULT_ENDTIME + ")");
        endTimeOption.setArgName("time");
        endTimeOption.setValueSeparator('=');
        commandOptions.addOption(endTimeOption);
        CommandLine cmdLine = null;
        try {
            Parser parser = new BasicParser();
            cmdLine = parser.parse(commandOptions, args);
        } catch (ParseException e1) {
            e1.printStackTrace();
            HelpFormatter hf = new HelpFormatter();
            hf.printHelp("BrownianDynamicsTest", commandOptions);
            System.exit(2);
        }
        boolean bNoise = cmdLine.hasOption(OPTION_NOISE);
        boolean bConvolve = cmdLine.hasOption(OPTION_PSF);
        File imageFile = null;
        if (cmdLine.hasOption(OPTION_IMAGEFILE)) {
            imageFile = new File(cmdLine.getOptionValue(OPTION_IMAGEFILE));
        }
        File plotFile = null;
        if (cmdLine.hasOption(OPTION_PLOTFILE)) {
            plotFile = new File(cmdLine.getOptionValue(OPTION_PLOTFILE));
        }
        boolean bDisplayImage = cmdLine.hasOption(OPTION_DISPLAY_IMAGE);
        boolean bDisplayPlot = cmdLine.hasOption(OPTION_DISPLAY_PLOT);
        double extentScale = DEFAULT_EXTENT_SCALE;
        if (cmdLine.hasOption(OPTION_EXTENT)) {
            extentScale = Double.parseDouble(cmdLine.getOptionValue(OPTION_EXTENT));
        }
        int imageSize = DEFAULT_IMAGE_SIZE;
        if (cmdLine.hasOption(OPTION_IMAGE_SIZE)) {
            imageSize = Integer.parseInt(cmdLine.getOptionValue(OPTION_IMAGE_SIZE));
        }
        int numParticles = DEFAULT_NUM_PARTICLES;
        if (cmdLine.hasOption(OPTION_NUM_PARTICLES)) {
            numParticles = Integer.parseInt(cmdLine.getOptionValue(OPTION_NUM_PARTICLES));
        }
        double diffusionRate = DEFAULT_DIFFUSION;
        if (cmdLine.hasOption(OPTION_DIFFUSION)) {
            diffusionRate = Double.parseDouble(cmdLine.getOptionValue(OPTION_DIFFUSION));
        }
        double bleachRadius = DEFAULT_BLEACH_RADIUS;
        if (cmdLine.hasOption(OPTION_BLEACH_RADIUS)) {
            bleachRadius = Double.parseDouble(cmdLine.getOptionValue(OPTION_BLEACH_RADIUS));
        }
        double psfRadius = DEFAULT_PSF_RADIUS;
        if (cmdLine.hasOption(OPTION_PSF_RADIUS)) {
            psfRadius = Double.parseDouble(cmdLine.getOptionValue(OPTION_PSF_RADIUS));
        }
        double bleachDuration = DEFAULT_BLEACH_DURATION;
        if (cmdLine.hasOption(OPTION_BLEACH_DURATION)) {
            bleachDuration = Double.parseDouble(cmdLine.getOptionValue(OPTION_BLEACH_DURATION));
        }
        double endTime = DEFAULT_ENDTIME;
        if (cmdLine.hasOption(OPTION_ENDTIME)) {
            endTime = Double.parseDouble(cmdLine.getOptionValue(OPTION_BLEACH_DURATION));
        }
        // 
        // hard coded parameters
        // 
        Origin origin = new Origin(0, 0, 0);
        Extent extent = new Extent(extentScale, extentScale, 1);
        int numX = imageSize;
        int numY = imageSize;
        double psfVar = psfRadius * psfRadius;
        BrownianDynamicsTest test = new BrownianDynamicsTest();
        ImageTimeSeries<UShortImage> rawTimeSeries = test.generateTestData(origin, extent, numX, numY, numParticles, diffusionRate, psfVar, bleachRadius * bleachRadius, bNoise, bConvolve, bleachDuration, endTime);
        // 
        if (imageFile != null) {
            new ExportRawTimeSeriesToVFrapOp().exportToVFRAP(imageFile, rawTimeSeries, null);
        }
        // 
        if (bDisplayImage) {
            new DisplayTimeSeriesOp().displayImageTimeSeries(rawTimeSeries, "time series", null);
        }
        // 
        // compute reduced data if needed for plotting or saving.
        // 
        RowColumnResultSet reducedData = null;
        if (bDisplayPlot || plotFile != null) {
            double muX = origin.getX() + 0.5 * extent.getX();
            double muY = origin.getY() + 0.5 * extent.getY();
            double sigma = Math.sqrt(psfVar);
            NormalizedSampleFunction gaussian = NormalizedSampleFunction.fromGaussian("psf", origin, extent, new ISize(numX, numY, 1), muX, muY, sigma);
            reducedData = new GenerateReducedDataOp().generateReducedData(rawTimeSeries, new NormalizedSampleFunction[] { gaussian });
        }
        // 
        if (plotFile != null) {
            FileOutputStream fos = new FileOutputStream(plotFile);
            new CSV().exportTo(fos, reducedData);
        }
        if (bDisplayPlot) {
            new DisplayPlotOp().displayPlot(reducedData, "bleached roi", null);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : Origin(org.vcell.util.Origin) Options(org.apache.commons.cli.Options) Extent(org.vcell.util.Extent) ISize(org.vcell.util.ISize) HelpFormatter(org.apache.commons.cli.HelpFormatter) DisplayPlotOp(org.vcell.vmicro.op.display.DisplayPlotOp) DisplayTimeSeriesOp(org.vcell.vmicro.op.display.DisplayTimeSeriesOp) NormalizedSampleFunction(org.vcell.vmicro.workflow.data.NormalizedSampleFunction) GenerateReducedDataOp(org.vcell.vmicro.op.GenerateReducedDataOp) RowColumnResultSet(cbit.vcell.math.RowColumnResultSet) CSV(cbit.vcell.math.CSV) UShortImage(cbit.vcell.VirtualMicroscopy.UShortImage) ExportRawTimeSeriesToVFrapOp(org.vcell.vmicro.op.ExportRawTimeSeriesToVFrapOp) ImageException(cbit.image.ImageException) ParseException(org.apache.commons.cli.ParseException) Parser(org.apache.commons.cli.Parser) BasicParser(org.apache.commons.cli.BasicParser) BasicParser(org.apache.commons.cli.BasicParser) CommandLine(org.apache.commons.cli.CommandLine) FileOutputStream(java.io.FileOutputStream) Option(org.apache.commons.cli.Option) ParseException(org.apache.commons.cli.ParseException) File(java.io.File)

Example 34 with Extent

use of org.vcell.util.Extent 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 35 with Extent

use of org.vcell.util.Extent in project vcell by virtualcell.

the class Generate2DSimBioModel method compute0.

@Override
protected void compute0(TaskContext context, final ClientTaskStatusSupport clientTaskStatusSupport) throws Exception {
    // get inputs
    Extent extent = context.getData(this.extent);
    ROI cellROI_2D = context.getData(this.cellROI_2D);
    double[] timeStamps = context.getData(this.timeStamps);
    Integer indexFirstPostbleach = context.getData(this.indexFirstPostbleach);
    double primaryDiffusionRate = context.getData(this.primaryDiffusionRate);
    double primaryFraction = context.getData(this.primaryFraction);
    double bleachMonitorRate = context.getData(this.bleachMonitorRate);
    Double secondaryDiffusionRate = context.getData(this.secondaryDiffusionRate);
    double secondaryFraction = context.getData(this.secondaryFraction);
    double bindingSiteConcentration = context.getData(this.bindingSiteConcentration);
    double bindingOnRate = context.getData(this.bindingOnRate);
    double bindingOffRate = context.getData(this.bindingOffRate);
    String extracellularName = context.getData(this.extracellularName);
    String cytosolName = context.getData(this.cytosolName);
    User owner = context.getData(this.owner);
    KeyValue simKey = context.getData(this.simKey);
    // do op
    Generate2DSimBioModelOp op = new Generate2DSimBioModelOp();
    BioModel bioModel = op.generateBioModel(extent, cellROI_2D, timeStamps, indexFirstPostbleach, primaryDiffusionRate, primaryFraction, bleachMonitorRate, secondaryDiffusionRate, secondaryFraction, bindingSiteConcentration, bindingOnRate, bindingOffRate, extracellularName, cytosolName, owner, simKey);
    // set output
    context.setData(this.bioModel_2D, bioModel);
}
Also used : User(org.vcell.util.document.User) KeyValue(org.vcell.util.document.KeyValue) Extent(org.vcell.util.Extent) BioModel(cbit.vcell.biomodel.BioModel) ROI(cbit.vcell.VirtualMicroscopy.ROI) Generate2DSimBioModelOp(org.vcell.vmicro.op.Generate2DSimBioModelOp)

Aggregations

Extent (org.vcell.util.Extent)96 Origin (org.vcell.util.Origin)58 ISize (org.vcell.util.ISize)52 VCImageUncompressed (cbit.image.VCImageUncompressed)23 ImageException (cbit.image.ImageException)19 VCImage (cbit.image.VCImage)19 CartesianMesh (cbit.vcell.solvers.CartesianMesh)19 RegionImage (cbit.vcell.geometry.RegionImage)17 Geometry (cbit.vcell.geometry.Geometry)16 Expression (cbit.vcell.parser.Expression)16 FieldDataFileOperationSpec (cbit.vcell.field.io.FieldDataFileOperationSpec)15 IOException (java.io.IOException)15 UShortImage (cbit.vcell.VirtualMicroscopy.UShortImage)13 BioModel (cbit.vcell.biomodel.BioModel)13 SubVolume (cbit.vcell.geometry.SubVolume)13 File (java.io.File)12 ArrayList (java.util.ArrayList)12 UserCancelException (org.vcell.util.UserCancelException)12 ExpressionException (cbit.vcell.parser.ExpressionException)10 ImageDataset (cbit.vcell.VirtualMicroscopy.ImageDataset)9