use of cbit.vcell.VirtualMicroscopy.UShortImage in project vcell by virtualcell.
the class PhotoactivationExperimentTest 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/photoactivation/Actin.vfrap");
File vfrapFile = new File(baseDir, "vfrapPaper/photoactivation/Actin_binding_protein.vfrap");
ImageTimeSeries<UShortImage> fluorTimeSeriesImages = new ImportRawTimeSeriesFromVFrapOp().importRawTimeSeriesFromVFrap(vfrapFile);
analyzePhotoactivation(fluorTimeSeriesImages, localWorkspace);
} catch (Exception e) {
e.printStackTrace(System.out);
}
}
use of cbit.vcell.VirtualMicroscopy.UShortImage in project vcell by virtualcell.
the class PhotoactivationExperimentTest method blurTimeSeries.
private static ImageTimeSeries<UShortImage> blurTimeSeries(ImageTimeSeries<UShortImage> rawTimeSeriesImages) throws ImageException {
UShortImage[] blurredImages = new UShortImage[rawTimeSeriesImages.getAllImages().length];
for (int i = 0; i < blurredImages.length; i++) {
blurredImages[i] = new UShortImage(rawTimeSeriesImages.getAllImages()[i]);
blurredImages[i].blur();
blurredImages[i].blur();
}
ImageTimeSeries<UShortImage> blurredRaw = new ImageTimeSeries<UShortImage>(UShortImage.class, blurredImages, rawTimeSeriesImages.getImageTimeStamps(), rawTimeSeriesImages.getSizeZ());
return blurredRaw;
}
use of cbit.vcell.VirtualMicroscopy.UShortImage in project vcell by virtualcell.
the class ExportRawTimeSeriesToVFrap method compute0.
@Override
protected void compute0(TaskContext context, ClientTaskStatusSupport clientTaskStatusSupport) throws Exception {
// get inputs
File outputFile = context.getData(vfrapFile);
ImageTimeSeries imageTimeSeries = context.getData(rawTimeSeriesImages);
// validate that imageTimeSeries is of type ImageTimeSeries<UShortImage>
Image[] images = imageTimeSeries.getAllImages();
UShortImage[] usImages = new UShortImage[images.length];
for (int i = 0; i < usImages.length; i++) {
if (!(images[i] instanceof UShortImage)) {
throw new Exception("type mismatch, expecting only UShortImages in time series");
}
usImages[i] = (UShortImage) images[i];
}
ImageTimeSeries<UShortImage> ushortImageTimeSeries = new ImageTimeSeries<UShortImage>(UShortImage.class, usImages, imageTimeSeries.getImageTimeStamps(), imageTimeSeries.getSizeZ());
ExportRawTimeSeriesToVFrapOp op = new ExportRawTimeSeriesToVFrapOp();
op.exportToVFRAP(outputFile, ushortImageTimeSeries, clientTaskStatusSupport);
// write output (just boolean "done" flag)
context.setData(written, true);
}
use of cbit.vcell.VirtualMicroscopy.UShortImage in project vcell by virtualcell.
the class GenerateNormalizedFrapData method compute0.
@Override
protected void compute0(TaskContext context, final ClientTaskStatusSupport clientTaskStatusSupport) throws Exception {
// get input
ImageTimeSeries<UShortImage> rawTimeSeries = context.getData(rawImageTimeSeries);
ROI backgroundROI = context.getData(backgroundROI_2D);
Integer indexPostbleach = context.getData(indexOfFirstPostbleach);
// do op
GenerateNormalizedFrapDataOp op = new GenerateNormalizedFrapDataOp();
NormalizedFrapDataResults results = op.generate(rawTimeSeries, backgroundROI, indexPostbleach);
// set output
context.setData(normalizedFrapData, results.normalizedFrapData);
context.setData(this.prebleachAverage, results.prebleachAverage);
}
use of cbit.vcell.VirtualMicroscopy.UShortImage in project vcell by virtualcell.
the class ImportRawTimeSeriesFrom2DVCellConcentrations method compute0.
@Override
protected void compute0(TaskContext context, ClientTaskStatusSupport clientTaskStatusSupport) throws Exception {
// set inputs
File vcellSimLog = context.getData(vcellSimLogFile);
String fluorFuncName = context.getData(fluorFunctionName);
Double maximumIntensity = context.getData(maxIntensity);
Boolean enableNoise = context.getData(bNoise);
// do op
ImportRawTimeSeriesFrom2DVCellConcentrationsOp op = new ImportRawTimeSeriesFrom2DVCellConcentrationsOp();
ImageTimeSeries<UShortImage> imageTimeSeries = op.importRawTimeSeries(vcellSimLog, fluorFuncName, maximumIntensity, enableNoise);
// set output
context.setData(rawTimeSeriesImages, imageTimeSeries);
}
Aggregations