Search in sources :

Example 1 with ImportRawTimeSeriesFromVFrapOp

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

the class VFrapProcess 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");
        ImageTimeSeries<UShortImage> fluorTimeSeriesImages = new ImportRawTimeSeriesFromVFrapOp().importRawTimeSeriesFromVFrap(vfrapFile);
        VFrapProcessResults results = compute(fluorTimeSeriesImages, 0.85, 0.4, localWorkspace, progressListener);
        new DisplayTimeSeriesOp().displayImageTimeSeries(fluorTimeSeriesImages, "raw data", null);
        new DisplayImageOp().displayImage(results.cellROI_2D.getRoiImages()[0], "cell ROI", null);
        new DisplayImageOp().displayImage(results.bleachROI_2D.getRoiImages()[0], "bleach ROI", null);
        new DisplayDependentROIsOp().displayDependentROIs(results.imageDataROIs, results.cellROI_2D, "data rois", null);
        new DisplayTimeSeriesOp().displayImageTimeSeries(results.normalizedTimeSeries, "normalized data", null);
        new DisplayProfileLikelihoodPlotsOp().displayProfileLikelihoodPlots(results.profileDataOne, "one fluorescent pool", null);
        new DisplayProfileLikelihoodPlotsOp().displayProfileLikelihoodPlots(results.profileDataTwoWithPenalty, "too pools", null);
    } catch (Exception e) {
        e.printStackTrace(System.out);
    }
}
Also used : DisplayProfileLikelihoodPlotsOp(org.vcell.vmicro.op.display.DisplayProfileLikelihoodPlotsOp) LocalWorkspace(org.vcell.vmicro.workflow.data.LocalWorkspace) UShortImage(cbit.vcell.VirtualMicroscopy.UShortImage) DisplayImageOp(org.vcell.vmicro.op.display.DisplayImageOp) ProgressDialogListener(org.vcell.util.ProgressDialogListener) DisplayTimeSeriesOp(org.vcell.vmicro.op.display.DisplayTimeSeriesOp) ClientTaskStatusSupport(org.vcell.util.ClientTaskStatusSupport) ImportRawTimeSeriesFromVFrapOp(org.vcell.vmicro.op.ImportRawTimeSeriesFromVFrapOp) DisplayDependentROIsOp(org.vcell.vmicro.op.display.DisplayDependentROIsOp) File(java.io.File)

Example 2 with ImportRawTimeSeriesFromVFrapOp

use of org.vcell.vmicro.op.ImportRawTimeSeriesFromVFrapOp 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);
    }
}
Also used : LocalWorkspace(org.vcell.vmicro.workflow.data.LocalWorkspace) ProgressDialogListener(org.vcell.util.ProgressDialogListener) ClientTaskStatusSupport(org.vcell.util.ClientTaskStatusSupport) ImportRawTimeSeriesFromVFrapOp(org.vcell.vmicro.op.ImportRawTimeSeriesFromVFrapOp) UShortImage(cbit.vcell.VirtualMicroscopy.UShortImage) File(java.io.File) ImageException(cbit.image.ImageException)

Example 3 with ImportRawTimeSeriesFromVFrapOp

use of org.vcell.vmicro.op.ImportRawTimeSeriesFromVFrapOp 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);
    }
}
Also used : LocalWorkspace(org.vcell.vmicro.workflow.data.LocalWorkspace) ProgressDialogListener(org.vcell.util.ProgressDialogListener) ClientTaskStatusSupport(org.vcell.util.ClientTaskStatusSupport) ImportRawTimeSeriesFromVFrapOp(org.vcell.vmicro.op.ImportRawTimeSeriesFromVFrapOp) UShortImage(cbit.vcell.VirtualMicroscopy.UShortImage) File(java.io.File)

Example 4 with ImportRawTimeSeriesFromVFrapOp

use of org.vcell.vmicro.op.ImportRawTimeSeriesFromVFrapOp 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);
    }
}
Also used : LocalWorkspace(org.vcell.vmicro.workflow.data.LocalWorkspace) CSV(cbit.vcell.math.CSV) ImportRawTimeSeriesFromVFrapOp(org.vcell.vmicro.op.ImportRawTimeSeriesFromVFrapOp) UShortImage(cbit.vcell.VirtualMicroscopy.UShortImage) FileReader(java.io.FileReader) File(java.io.File) RowColumnResultSet(cbit.vcell.math.RowColumnResultSet)

Example 5 with ImportRawTimeSeriesFromVFrapOp

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

the class ImportRawTimeSeriesFromVFrap method compute0.

@Override
protected void compute0(TaskContext context, ClientTaskStatusSupport clientTaskStatusSupport) throws Exception {
    // get input
    File vfrap_file = context.getData(vfrapFile);
    // do op
    ImportRawTimeSeriesFromVFrapOp op = new ImportRawTimeSeriesFromVFrapOp();
    ImageTimeSeries<UShortImage> imageTimeSeries = op.importRawTimeSeriesFromVFrap(vfrap_file);
    // set output
    context.setData(rawTimeSeriesImages, imageTimeSeries);
}
Also used : ImportRawTimeSeriesFromVFrapOp(org.vcell.vmicro.op.ImportRawTimeSeriesFromVFrapOp) UShortImage(cbit.vcell.VirtualMicroscopy.UShortImage) File(java.io.File)

Aggregations

UShortImage (cbit.vcell.VirtualMicroscopy.UShortImage)5 File (java.io.File)5 ImportRawTimeSeriesFromVFrapOp (org.vcell.vmicro.op.ImportRawTimeSeriesFromVFrapOp)5 LocalWorkspace (org.vcell.vmicro.workflow.data.LocalWorkspace)4 ClientTaskStatusSupport (org.vcell.util.ClientTaskStatusSupport)3 ProgressDialogListener (org.vcell.util.ProgressDialogListener)3 ImageException (cbit.image.ImageException)1 CSV (cbit.vcell.math.CSV)1 RowColumnResultSet (cbit.vcell.math.RowColumnResultSet)1 FileReader (java.io.FileReader)1 DisplayDependentROIsOp (org.vcell.vmicro.op.display.DisplayDependentROIsOp)1 DisplayImageOp (org.vcell.vmicro.op.display.DisplayImageOp)1 DisplayProfileLikelihoodPlotsOp (org.vcell.vmicro.op.display.DisplayProfileLikelihoodPlotsOp)1 DisplayTimeSeriesOp (org.vcell.vmicro.op.display.DisplayTimeSeriesOp)1