use of org.vcell.vmicro.workflow.data.LocalWorkspace in project vcell by virtualcell.
the class WorkflowTest method main.
public static void main(String[] args) {
if (args.length != 2) {
System.out.println("expecting 2 arguments");
System.out.println("usage: java " + Workflow.class.getSimpleName() + " workingdir workflowInputFile");
System.out.println("workingdir example: " + "D:\\developer\\eclipse\\workspace\\VCell_5.4_vmicro\\datadir");
System.out.println("workflowInputFile example: " + "D:\\developer\\eclipse\\workspace\\VCell_5.4_vmicro\\workflow1.txt");
System.exit(1);
}
try {
// PropertyLoader.loadProperties();
// workflowInputFile "C:\\developer\\eclipse\\workspace\\VCell_5.3_vmicro\\workflow1.txt"
File workingDirectory = new File(args[0]);
LocalWorkspace localWorkspace = new LocalWorkspace(workingDirectory);
Repository repository = new MemoryRepository();
String workflowLanguageText = BeanUtils.readBytesFromFile(new File(args[1]), null);
Workflow workflow = Workflow.parse(repository, localWorkspace, workflowLanguageText);
System.err.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> using hard-coded example instead <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
// File vfrapFile = new File("D:\\Developer\\eclipse\\workspace_refactor\\VCell_5.4_vmicro\\3D_FRAP_2_ZProjection_Simulation1.vfrap");
// Workflow workflow = getVFrapSimpleExample(workingDirectory, vfrapFile);
TaskContext taskContext = new TaskContext(workflow, repository, localWorkspace);
ArrayList<Issue> issues = new ArrayList<Issue>();
IssueContext issueContext = new IssueContext();
workflow.gatherIssues(issueContext, issues);
// WorkflowJGraphProxy workflowJGraphProxy = new WorkflowJGraphProxy(workflow);
// displayWorkflowGraphJGraphX(workflowJGraphProxy);
WorkflowUtilities.displayWorkflowGraph(workflow);
WorkflowUtilities.displayWorkflowTable(taskContext);
workflow.reportIssues(issues, Issue.SEVERITY_INFO, true);
//
// execute the workflow
//
workflow.compute(taskContext, new WorkflowUtilities.Progress());
} catch (Exception e) {
e.printStackTrace(System.out);
}
}
use of org.vcell.vmicro.workflow.data.LocalWorkspace in project vcell by virtualcell.
the class KenworthyWorkflowTest method main.
public static void main(String[] args) {
try {
File baseDir = new File(".");
// File baseDir = new File("/Users/schaff/Documents/workspace/VCell_5.4");
// initialize computing environment
//
File workingDirectory = new File(baseDir, "workingDir");
LocalWorkspace localWorkspace = new LocalWorkspace(workingDirectory);
//
// import raw image time series data from VFRAP file format (can have noise, background, etc ... can be actual microscopy data)
//
ClientTaskStatusSupport progressListener = new ClientTaskStatusSupport() {
String message = "";
int progress = 0;
@Override
public void setProgress(int progress) {
this.progress = progress;
}
@Override
public void setMessage(String message) {
this.message = message;
}
@Override
public boolean isInterrupted() {
return false;
}
@Override
public int getProgress() {
return progress;
}
@Override
public void addProgressDialogListener(ProgressDialogListener progressDialogListener) {
}
};
//
// generate fake data (and save?)
//
// ImageTimeSeries<UShortImage> simulatedFluorescence = generateFakeData(localWorkspace, progressListener);
// new ExportRawTimeSeriesToVFrapOp().exportToVFRAP(vfrapFile, simulatedFluorescence, null);
//
// analyze raw data (from file?) using Keyworthy method.
//
File vfrapFile = new File(baseDir, "vfrapPaper/rawData/sim3/workflow.txt.save");
// File vfrapFile = new File(baseDir, "tryit.vfrap");
ImageTimeSeries<UShortImage> fluorTimeSeriesImages = new ImportRawTimeSeriesFromVFrapOp().importRawTimeSeriesFromVFrap(vfrapFile);
analyzeKeyworthy(fluorTimeSeriesImages, localWorkspace);
} catch (Exception e) {
e.printStackTrace(System.out);
}
}
use of org.vcell.vmicro.workflow.data.LocalWorkspace in project vcell by virtualcell.
the class KenworthyParticleTest method main.
public static void main(String[] args) {
try {
File baseDir = new File(".");
// File baseDir = new File("/Users/schaff/Documents/workspace/VCell_5.4");
// initialize computing environment
//
File workingDirectory = new File(baseDir, "workingDir");
LocalWorkspace localWorkspace = new LocalWorkspace(workingDirectory);
//
// analyze raw data (from file?) using Keyworthy method.
//
// File vfrapFile = new File(baseDir, "vfrapPaper/rawData/sim3/workflow.txt.save");
File vfrapFile = new File(baseDir, "tryit.vfrap");
ImageTimeSeries<UShortImage> fluorTimeSeriesImages = new ImportRawTimeSeriesFromVFrapOp().importRawTimeSeriesFromVFrap(vfrapFile);
RowColumnResultSet reducedData = new CSV().importFrom(new FileReader(new File(baseDir, "tryit.csv")));
analyzeKeyworthy(fluorTimeSeriesImages, reducedData, localWorkspace);
} catch (Exception e) {
e.printStackTrace(System.out);
}
}
use of org.vcell.vmicro.workflow.data.LocalWorkspace in project vcell by virtualcell.
the class WorkflowModelPanel method main.
/**
* main entrypoint - starts the part when it is run as an application
* @param args java.lang.String[]
*/
public static void main(java.lang.String[] args) {
try {
JFrame frame = new javax.swing.JFrame();
WorkflowModelPanel aWorkflowModelPanel;
aWorkflowModelPanel = new WorkflowModelPanel();
frame.setContentPane(aWorkflowModelPanel);
frame.setSize(aWorkflowModelPanel.getSize());
frame.addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(java.awt.event.WindowEvent e) {
System.exit(0);
}
});
LocalWorkspace localWorkspace = new LocalWorkspace(new File("C:\\temp"));
Workflow workflow = new Workflow("temp");
class Task1 extends Task {
final DataInput<Double> in = new DataInput<Double>(Double.class, "in", this);
final DataOutput<Double> out = new DataOutput<Double>(Double.class, "out", this);
public Task1() {
super("t1");
addInput(in);
addOutput(out);
}
@Override
protected void compute0(TaskContext context, ClientTaskStatusSupport clientTaskStatusSupport) throws Exception {
System.out.println("executing task " + getName());
}
}
;
class Task2 extends Task {
final DataInput<Double> in = new DataInput<Double>(Double.class, "in", this);
final DataOutput<Double> out = new DataOutput<Double>(Double.class, "out", this);
public Task2() {
super("t2");
addInput(in);
addOutput(out);
}
@Override
protected void compute0(TaskContext context, ClientTaskStatusSupport clientTaskStatusSupport) throws Exception {
System.out.println("executing task " + getName());
}
}
;
Task1 task1 = new Task1();
workflow.addTask(task1);
Task2 task2 = new Task2();
workflow.addTask(task2);
workflow.connect2(task1.out, task2.in);
aWorkflowModelPanel.setWorkflow(workflow);
frame.setVisible(true);
java.awt.Insets insets = frame.getInsets();
frame.setSize(frame.getWidth() + insets.left + insets.right, frame.getHeight() + insets.top + insets.bottom);
frame.setVisible(true);
} catch (Throwable exception) {
System.err.println("Exception occurred in main() of javax.swing.JPanel");
exception.printStackTrace(System.out);
}
}
use of org.vcell.vmicro.workflow.data.LocalWorkspace in project vcell by virtualcell.
the class RunSimulation2D method compute0.
@Override
protected void compute0(TaskContext context, final ClientTaskStatusSupport clientTaskStatusSupport) throws Exception {
// get input
LocalWorkspace localWorkspace = context.getLocalWorkspace();
Simulation sim = context.getData(simulation_2D);
String dataVar = context.getData(dataVarName);
// do op
RunSimulation2DOp op = new RunSimulation2DOp();
ImageTimeSeries<FloatImage> solution = op.runRefSimulation(localWorkspace, sim, dataVar, clientTaskStatusSupport);
// set output
context.setData(simTimeSeries, solution);
}
Aggregations