Search in sources :

Example 6 with OptModel

use of org.vcell.vmicro.workflow.data.OptModel in project vcell by virtualcell.

the class GenerateRefSimOptModel method compute0.

@Override
protected void compute0(TaskContext context, final ClientTaskStatusSupport clientTaskStatusSupport) throws Exception {
    RowColumnResultSet refSimDataset = context.getData(refSimData);
    double[] refSimTimePoints = refSimDataset.extractColumn(0);
    int numRois = refSimDataset.getDataColumnCount() - 1;
    int numRefSimTimes = refSimDataset.getRowCount();
    double[][] refSimData = new double[numRois][numRefSimTimes];
    for (int roi = 0; roi < numRois; roi++) {
        double[] roiData = refSimDataset.extractColumn(roi + 1);
        for (int t = 0; t < numRefSimTimes; t++) {
            refSimData[roi][t] = roiData[t];
        }
    }
    ModelType modelType = ModelType.valueOf(context.getData(this.modelType));
    OptModel optModel = null;
    Double refSimDiff = context.getData(refSimDiffusionRate);
    switch(modelType) {
        case DiffOne:
            {
                optModel = new OptModelOneDiff(refSimData, refSimTimePoints, refSimDiff);
                break;
            }
        case DiffTwoWithoutPenalty:
            {
                optModel = new OptModelTwoDiffWithoutPenalty(refSimData, refSimTimePoints, refSimDiff);
                break;
            }
        case DiffTwoWithPenalty:
            {
                optModel = new OptModelTwoDiffWithPenalty(refSimData, refSimTimePoints, refSimDiff);
                break;
            }
        default:
            {
                throw new RuntimeException("model type " + modelType + " not supported");
            }
    }
    context.setData(this.optModel, optModel);
}
Also used : OptModelOneDiff(org.vcell.vmicro.workflow.data.OptModelOneDiff) OptModelTwoDiffWithPenalty(org.vcell.vmicro.workflow.data.OptModelTwoDiffWithPenalty) RowColumnResultSet(cbit.vcell.math.RowColumnResultSet) OptModel(org.vcell.vmicro.workflow.data.OptModel) OptModelTwoDiffWithoutPenalty(org.vcell.vmicro.workflow.data.OptModelTwoDiffWithoutPenalty)

Aggregations

OptModel (org.vcell.vmicro.workflow.data.OptModel)6 RowColumnResultSet (cbit.vcell.math.RowColumnResultSet)5 Generate2DOptContextOp (org.vcell.vmicro.op.Generate2DOptContextOp)4 ErrorFunction (org.vcell.vmicro.workflow.data.ErrorFunction)4 OptContext (org.vcell.vmicro.workflow.data.OptContext)4 DisplayInteractiveModelOp (org.vcell.vmicro.op.display.DisplayInteractiveModelOp)3 DisplayTimeSeriesOp (org.vcell.vmicro.op.display.DisplayTimeSeriesOp)3 OptModelKenworthyUniformDisk2P (org.vcell.vmicro.workflow.data.OptModelKenworthyUniformDisk2P)3 OptModelKenworthyUniformDisk3P (org.vcell.vmicro.workflow.data.OptModelKenworthyUniformDisk3P)3 FloatImage (cbit.vcell.VirtualMicroscopy.FloatImage)2 ROI (cbit.vcell.VirtualMicroscopy.ROI)2 ComputeMeasurementErrorOp (org.vcell.vmicro.op.ComputeMeasurementErrorOp)2 GenerateReducedDataOp (org.vcell.vmicro.op.GenerateReducedDataOp)2 DisplayImageOp (org.vcell.vmicro.op.display.DisplayImageOp)2 DisplayPlotOp (org.vcell.vmicro.op.display.DisplayPlotOp)2 ErrorFunctionKenworthy (org.vcell.vmicro.workflow.data.ErrorFunctionKenworthy)2 NormalizedSampleFunction (org.vcell.vmicro.workflow.data.NormalizedSampleFunction)2 UShortImage (cbit.vcell.VirtualMicroscopy.UShortImage)1 Parameter (cbit.vcell.opt.Parameter)1 ProfileData (org.vcell.optimization.ProfileData)1