Search in sources :

Example 1 with RunFakeSimOp

use of org.vcell.vmicro.op.RunFakeSimOp in project vcell by virtualcell.

the class KenworthyParticleTest method generateFakeData.

private static ImageTimeSeries<UShortImage> generateFakeData(LocalWorkspace localWorkspace, ClientTaskStatusSupport progressListener) throws Exception {
    // 
    // technical simulation parameters
    // 
    double deltaX = 0.3;
    double outputTimeStep = 0.3;
    // 
    // circular 2D cell geometry
    // 
    double cellRadius = 50.0;
    String extracellularName = "ec";
    String cytosolName = "cytosol";
    // 
    // bleaching experimental protocol
    // 
    double bleachRadius = 1.5;
    double bleachDuration = 0.003;
    double bleachRate = 500.0;
    double postbleachDelay = 0.001;
    double postbleachDuration = 25.0;
    double psfSigma = 0.01;
    // 
    // underlying physiological model
    // 
    double primaryDiffusionRate = 2.0;
    double primaryFraction = 1.0;
    double bleachMonitorRate = 0.0000005;
    double secondaryDiffusionRate = 0.0;
    double secondaryFraction = 0.0;
    // 
    // generate corresponding BioModel with Application and Simulation ready for simulation.
    // 
    Context context = new Context() {

        @Override
        public User getDefaultOwner() {
            return LocalWorkspace.getDefaultOwner();
        }

        @Override
        public KeyValue createNewKeyValue() {
            return LocalWorkspace.createNewKeyValue();
        }
    };
    GeneratedModelResults results = new Generate2DExpModel_GaussianBleachOp().generateModel(deltaX, bleachRadius, cellRadius, bleachDuration, bleachRate, postbleachDelay, postbleachDuration, psfSigma, outputTimeStep, primaryDiffusionRate, primaryFraction, bleachMonitorRate, secondaryDiffusionRate, secondaryFraction, extracellularName, cytosolName, context);
    Simulation simulation = results.simulation_2D;
    double bleachBlackoutStartTime = results.bleachBlackoutBeginTime;
    double bleachBlackoutStopTime = results.bleachBlackoutEndTime;
    // 
    // run simulation to get simulated fluorescence (with noise)
    // 
    boolean hasNoise = true;
    double maxIntensity = 60000.0;
    ImageTimeSeries<UShortImage> simulatedFluorescence = new RunFakeSimOp().runRefSimulation(localWorkspace, simulation, maxIntensity, bleachBlackoutStartTime, bleachBlackoutStopTime, hasNoise, progressListener);
    return simulatedFluorescence;
}
Also used : OptContext(org.vcell.vmicro.workflow.data.OptContext) Context(org.vcell.vmicro.op.Generate2DExpModelOpAbstract.Context) RunFakeSimOp(org.vcell.vmicro.op.RunFakeSimOp) Simulation(cbit.vcell.solver.Simulation) GeneratedModelResults(org.vcell.vmicro.op.Generate2DExpModelOpAbstract.GeneratedModelResults) Generate2DExpModel_GaussianBleachOp(org.vcell.vmicro.op.Generate2DExpModel_GaussianBleachOp) UShortImage(cbit.vcell.VirtualMicroscopy.UShortImage)

Example 2 with RunFakeSimOp

use of org.vcell.vmicro.op.RunFakeSimOp in project vcell by virtualcell.

the class RunFakeSim method compute0.

@Override
protected void compute0(TaskContext context, final ClientTaskStatusSupport clientTaskStatusSupport) throws Exception {
    // set input
    Simulation sim = context.getData(simulation_2D);
    Double max_intensity = context.getData(maxIntensity);
    Double bleachLockingBegin = context.getData(bleachBlackoutBeginTime);
    Double bleachLockoutEnd = context.getData(bleachBlackoutEndTime);
    Boolean hasNoise = context.getData(bNoise);
    // do op
    RunFakeSimOp op = new RunFakeSimOp();
    ImageTimeSeries<UShortImage> solution = op.runRefSimulation(context.getLocalWorkspace(), sim, max_intensity, bleachLockingBegin, bleachLockoutEnd, hasNoise, clientTaskStatusSupport);
    // set output
    context.setData(simTimeSeries, solution);
}
Also used : RunFakeSimOp(org.vcell.vmicro.op.RunFakeSimOp) Simulation(cbit.vcell.solver.Simulation) UShortImage(cbit.vcell.VirtualMicroscopy.UShortImage)

Example 3 with RunFakeSimOp

use of org.vcell.vmicro.op.RunFakeSimOp in project vcell by virtualcell.

the class KenworthyWorkflowTest method generateFakeData.

private static ImageTimeSeries<UShortImage> generateFakeData(LocalWorkspace localWorkspace, ClientTaskStatusSupport progressListener) throws Exception {
    // 
    // technical simulation parameters
    // 
    double deltaX = 0.3;
    double outputTimeStep = 0.3;
    // 
    // circular 2D cell geometry
    // 
    double cellRadius = 50.0;
    String extracellularName = "ec";
    String cytosolName = "cytosol";
    // 
    // bleaching experimental protocol
    // 
    double bleachRadius = 1.5;
    double bleachDuration = 0.003;
    double bleachRate = 500.0;
    double postbleachDelay = 0.001;
    double postbleachDuration = 25.0;
    double psfSigma = 0.01;
    // 
    // underlying physiological model
    // 
    double primaryDiffusionRate = 2.0;
    double primaryFraction = 1.0;
    double bleachMonitorRate = 0.0000005;
    double secondaryDiffusionRate = 0.0;
    double secondaryFraction = 0.0;
    // 
    // generate corresponding BioModel with Application and Simulation ready for simulation.
    // 
    Context context = new Context() {

        @Override
        public User getDefaultOwner() {
            return LocalWorkspace.getDefaultOwner();
        }

        @Override
        public KeyValue createNewKeyValue() {
            return LocalWorkspace.createNewKeyValue();
        }
    };
    GeneratedModelResults results = new Generate2DExpModel_GaussianBleachOp().generateModel(deltaX, bleachRadius, cellRadius, bleachDuration, bleachRate, postbleachDelay, postbleachDuration, psfSigma, outputTimeStep, primaryDiffusionRate, primaryFraction, bleachMonitorRate, secondaryDiffusionRate, secondaryFraction, extracellularName, cytosolName, context);
    Simulation simulation = results.simulation_2D;
    double bleachBlackoutStartTime = results.bleachBlackoutBeginTime;
    double bleachBlackoutStopTime = results.bleachBlackoutEndTime;
    // 
    // run simulation to get simulated fluorescence (with noise)
    // 
    boolean hasNoise = true;
    double maxIntensity = 60000.0;
    ImageTimeSeries<UShortImage> simulatedFluorescence = new RunFakeSimOp().runRefSimulation(localWorkspace, simulation, maxIntensity, bleachBlackoutStartTime, bleachBlackoutStopTime, hasNoise, progressListener);
    return simulatedFluorescence;
}
Also used : OptContext(org.vcell.vmicro.workflow.data.OptContext) Context(org.vcell.vmicro.op.Generate2DExpModelOpAbstract.Context) RunFakeSimOp(org.vcell.vmicro.op.RunFakeSimOp) Simulation(cbit.vcell.solver.Simulation) GeneratedModelResults(org.vcell.vmicro.op.Generate2DExpModelOpAbstract.GeneratedModelResults) Generate2DExpModel_GaussianBleachOp(org.vcell.vmicro.op.Generate2DExpModel_GaussianBleachOp) UShortImage(cbit.vcell.VirtualMicroscopy.UShortImage)

Example 4 with RunFakeSimOp

use of org.vcell.vmicro.op.RunFakeSimOp in project vcell by virtualcell.

the class PhotoactivationExperimentTest method generateFakeData.

private static ImageTimeSeries<UShortImage> generateFakeData(LocalWorkspace localWorkspace, ClientTaskStatusSupport progressListener) throws Exception {
    // 
    // technical simulation parameters
    // 
    double deltaX = 0.3;
    double outputTimeStep = 0.3;
    // 
    // circular 2D cell geometry
    // 
    double cellRadius = 50.0;
    String extracellularName = "ec";
    String cytosolName = "cytosol";
    // 
    // bleaching experimental protocol
    // 
    double bleachRadius = 1.5;
    double bleachDuration = 0.003;
    double bleachRate = 500.0;
    double postbleachDelay = 0.001;
    double postbleachDuration = 25.0;
    double psfSigma = 0.01;
    // 
    // underlying physiological model
    // 
    double primaryDiffusionRate = 2.0;
    double primaryFraction = 1.0;
    double bleachMonitorRate = 0.0000005;
    double secondaryDiffusionRate = 0.0;
    double secondaryFraction = 0.0;
    // 
    // generate corresponding BioModel with Application and Simulation ready for simulation.
    // 
    Context context = new Context() {

        @Override
        public User getDefaultOwner() {
            return LocalWorkspace.getDefaultOwner();
        }

        @Override
        public KeyValue createNewKeyValue() {
            return LocalWorkspace.createNewKeyValue();
        }
    };
    GeneratedModelResults results = new Generate2DExpModel_GaussianBleachOp().generateModel(deltaX, bleachRadius, cellRadius, bleachDuration, bleachRate, postbleachDelay, postbleachDuration, psfSigma, outputTimeStep, primaryDiffusionRate, primaryFraction, bleachMonitorRate, secondaryDiffusionRate, secondaryFraction, extracellularName, cytosolName, context);
    Simulation simulation = results.simulation_2D;
    double bleachBlackoutStartTime = results.bleachBlackoutBeginTime;
    double bleachBlackoutStopTime = results.bleachBlackoutEndTime;
    // 
    // run simulation to get simulated fluorescence (with noise)
    // 
    boolean hasNoise = true;
    double maxIntensity = 60000.0;
    ImageTimeSeries<UShortImage> simulatedFluorescence = new RunFakeSimOp().runRefSimulation(localWorkspace, simulation, maxIntensity, bleachBlackoutStartTime, bleachBlackoutStopTime, hasNoise, progressListener);
    return simulatedFluorescence;
}
Also used : OptContext(org.vcell.vmicro.workflow.data.OptContext) Context(org.vcell.vmicro.op.Generate2DExpModelOpAbstract.Context) RunFakeSimOp(org.vcell.vmicro.op.RunFakeSimOp) Simulation(cbit.vcell.solver.Simulation) GeneratedModelResults(org.vcell.vmicro.op.Generate2DExpModelOpAbstract.GeneratedModelResults) Generate2DExpModel_GaussianBleachOp(org.vcell.vmicro.op.Generate2DExpModel_GaussianBleachOp) UShortImage(cbit.vcell.VirtualMicroscopy.UShortImage)

Aggregations

UShortImage (cbit.vcell.VirtualMicroscopy.UShortImage)4 Simulation (cbit.vcell.solver.Simulation)4 RunFakeSimOp (org.vcell.vmicro.op.RunFakeSimOp)4 Context (org.vcell.vmicro.op.Generate2DExpModelOpAbstract.Context)3 GeneratedModelResults (org.vcell.vmicro.op.Generate2DExpModelOpAbstract.GeneratedModelResults)3 Generate2DExpModel_GaussianBleachOp (org.vcell.vmicro.op.Generate2DExpModel_GaussianBleachOp)3 OptContext (org.vcell.vmicro.workflow.data.OptContext)3