Search in sources :

Example 1 with Generate2DExpModel_UniformBleach

use of org.vcell.vmicro.workflow.task.Generate2DExpModel_UniformBleach in project vcell by virtualcell.

the class KenworthyTest method getInteractiveModelWorkflow.

public static Workflow getInteractiveModelWorkflow(Repository repository, File workingDirectory) {
    // 
    // construct the dataflow graph
    // 
    LocalWorkspace localWorkspace = new LocalWorkspace(workingDirectory);
    Workflow workflow = new Workflow("main");
    // 
    // workflow parameters
    // 
    WorkflowParameter<Double> bleachThreshold = workflow.addParameter(Double.class, "bleachThreshold", repository, 0.80);
    WorkflowParameter<Double> cellThreshold = workflow.addParameter(Double.class, "cellThreshold", repository, 0.5);
    WorkflowParameter<Double> cellRadius = workflow.addParameter(Double.class, "cellRadius", repository, 10.0);
    WorkflowParameter<String> cytosolName = workflow.addParameter(String.class, "cytosolName", repository, "cytosol");
    WorkflowParameter<String> extracellularName = workflow.addParameter(String.class, "extracellularName", repository, "ec");
    WorkflowParameter<Double> deltaX = workflow.addParameter(Double.class, "deltaX", repository, 0.3);
    WorkflowParameter<Double> outputTimeStep = workflow.addParameter(Double.class, "outputTimeStep", repository, 0.3);
    // 0.3
    WorkflowParameter<Double> psfSigma = workflow.addParameter(Double.class, "psfSigma", repository, 0.01);
    // circular disk (no K
    WorkflowParameter<Double> bleachRadius = workflow.addParameter(Double.class, "bleachRadius", repository, 4.0);
    // 5.0
    WorkflowParameter<Double> bleachRate = workflow.addParameter(Double.class, "bleachRate", repository, 500.0);
    // 0.3
    WorkflowParameter<Double> bleachDuration = workflow.addParameter(Double.class, "bleachDuraction", repository, 0.003);
    // 1.0
    WorkflowParameter<Double> postbleachDelay = workflow.addParameter(Double.class, "postbleachDelay", repository, 0.001);
    WorkflowParameter<Double> postbleachDuration = workflow.addParameter(Double.class, "postbleachDuraction", repository, 25.0);
    // no bleach while monitoring
    WorkflowParameter<Double> bleachMonitorRate = workflow.addParameter(Double.class, "bleachMonitorRate", repository, 0.0000005);
    WorkflowParameter<Double> primaryDiffusionRate = workflow.addParameter(Double.class, "primaryDiffusionRate", repository, 2.0);
    // primary fraction 100%
    WorkflowParameter<Double> primaryFraction = workflow.addParameter(Double.class, "primaryFraction", repository, 1.0);
    // 20.0
    WorkflowParameter<Double> secondaryDiffusionRate = workflow.addParameter(Double.class, "secondaryDiffusionRate", repository, 0.0);
    // 0.2
    WorkflowParameter<Double> secondaryFraction = workflow.addParameter(Double.class, "secondaryFraction", repository, 0.0);
    // no noise to start
    WorkflowParameter<Boolean> bNoise = workflow.addParameter(Boolean.class, "bNoise", repository, true);
    WorkflowParameter<Double> maxIntensity = workflow.addParameter(Double.class, "maxIntensity", repository, 60000.0);
    Generate2DExpModel_UniformBleach generateExpModel = new Generate2DExpModel_UniformBleach("generateExpModel");
    workflow.connectParameter(bleachDuration, generateExpModel.bleachDuration);
    workflow.connectParameter(bleachMonitorRate, generateExpModel.bleachMonitorRate);
    workflow.connectParameter(bleachRadius, generateExpModel.bleachRadius);
    workflow.connectParameter(bleachRate, generateExpModel.bleachRate);
    workflow.connectParameter(cellRadius, generateExpModel.cellRadius);
    workflow.connectParameter(cytosolName, generateExpModel.cytosolName);
    workflow.connectParameter(deltaX, generateExpModel.deltaX);
    workflow.connectParameter(extracellularName, generateExpModel.extracellularName);
    workflow.connectParameter(outputTimeStep, generateExpModel.outputTimeStep);
    workflow.connectParameter(postbleachDelay, generateExpModel.postbleachDelay);
    workflow.connectParameter(postbleachDuration, generateExpModel.postbleachDuration);
    workflow.connectParameter(primaryDiffusionRate, generateExpModel.primaryDiffusionRate);
    workflow.connectParameter(primaryFraction, generateExpModel.primaryFraction);
    workflow.connectParameter(psfSigma, generateExpModel.psfSigma);
    workflow.connectParameter(secondaryDiffusionRate, generateExpModel.secondaryDiffusionRate);
    workflow.connectParameter(secondaryFraction, generateExpModel.secondaryFraction);
    workflow.addTask(generateExpModel);
    // DisplayBioModel displayBioModel = new DisplayBioModel("displayBioModel");
    // displayBioModel.bioModel.setSource(generateExpModel.bioModel_2D);
    // workflow.addTask(displayBioModel);
    RunFakeSim runFakeSim = new RunFakeSim("runFakeSim");
    workflow.connectParameter(bNoise, runFakeSim.bNoise);
    workflow.connectParameter(maxIntensity, runFakeSim.maxIntensity);
    workflow.connect2(generateExpModel.simulation_2D, runFakeSim.simulation_2D);
    workflow.connect2(generateExpModel.bleachBlackoutBeginTime, runFakeSim.bleachBlackoutBeginTime);
    workflow.connect2(generateExpModel.bleachBlackoutEndTime, runFakeSim.bleachBlackoutEndTime);
    workflow.addTask(runFakeSim);
    // DisplayTimeSeries displayRawImages = new DisplayTimeSeries("displayRawImages");
    // displayRawImages.imageTimeSeries.setSource(runFakeSim.simTimeSeries);
    // displayRawImages.title.setSource(workflow.addParameter(String.class, "displayRawImagesTitle", "raw Images from "+runFakeSim.getClass().getSimpleName()));
    // workflow.addTask(displayRawImages);
    KenworthyProcess kenworthyProcess = new KenworthyProcess("kenworthyProcess");
    workflow.connectParameter(bleachThreshold, kenworthyProcess.bleachThreshold);
    workflow.connectParameter(cellThreshold, kenworthyProcess.cellThreshold);
    workflow.connect2(runFakeSim.simTimeSeries, kenworthyProcess.rawTimeSeriesImages);
    workflow.addTask(kenworthyProcess);
    return workflow;
}
Also used : Generate2DExpModel_UniformBleach(org.vcell.vmicro.workflow.task.Generate2DExpModel_UniformBleach) LocalWorkspace(org.vcell.vmicro.workflow.data.LocalWorkspace) KenworthyProcess(org.vcell.vmicro.workflow.task.KenworthyProcess) Workflow(org.vcell.workflow.Workflow) RunFakeSim(org.vcell.vmicro.workflow.task.RunFakeSim)

Aggregations

LocalWorkspace (org.vcell.vmicro.workflow.data.LocalWorkspace)1 Generate2DExpModel_UniformBleach (org.vcell.vmicro.workflow.task.Generate2DExpModel_UniformBleach)1 KenworthyProcess (org.vcell.vmicro.workflow.task.KenworthyProcess)1 RunFakeSim (org.vcell.vmicro.workflow.task.RunFakeSim)1 Workflow (org.vcell.workflow.Workflow)1