use of cbit.vcell.client.task.AsynchClientTask in project vcell by virtualcell.
the class ChooseModel_ModelTypesDescriptor method preNextProcess.
public ArrayList<AsynchClientTask> preNextProcess() {
ArrayList<AsynchClientTask> tasks = new ArrayList<AsynchClientTask>();
AsynchClientTask aTask1 = new AsynchClientTask("Saving selected model types...", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {
public void run(Hashtable<String, Object> hashTable) throws Exception {
FRAPStudy fStudy = frapWorkspace.getWorkingFrapStudy();
if (fStudy == null) {
throw new Exception("FRAPStudy is null. Please load data.");
}
boolean[] models = modelTypesPanel.getModelTypes();
// perform checkings...is one selected, is koffRatemodel selected(in this case force to use bleached ROI only)
if (modelTypesPanel.getNumUserSelectedModelTypes() < 1) {
throw new Exception("At least one model type has to be selected.");
}
// if reaction dominant off rate model is selected, we have to make sure that the bleached ROI should be selected.
if (models[FRAPModel.IDX_MODEL_REACTION_OFF_RATE] && !fStudy.getSelectedROIsForErrorCalculation()[FRAPData.VFRAP_ROI_ENUM.ROI_BLEACHED.ordinal()]) {
String choice = DialogUtils.showWarningDialog(modelTypesPanel, "To evaluate Reaction Dominant Off Rate model, bleached ROI must be selected. \n\nSelecte 'Continue' to have bleached ROI automatically added and proceed. Or,\nSelecte 'Cancel' to stop proceeding.", new String[] { UserMessage.OPTION_CONTINUE, UserMessage.OPTION_CANCEL }, UserMessage.OPTION_CONTINUE);
if (choice.equals(UserMessage.OPTION_CONTINUE)) {
fStudy.getSelectedROIsForErrorCalculation()[FRAPData.VFRAP_ROI_ENUM.ROI_BLEACHED.ordinal()] = true;
} else {
throw UserCancelException.CANCEL_GENERIC;
}
}
// update selected models in FrapStudy
fStudy.refreshModels(models);
}
};
tasks.add(aTask1);
return tasks;
}
use of cbit.vcell.client.task.AsynchClientTask in project vcell by virtualcell.
the class DefineROI_BackgroundROIDescriptor method postNextProcess.
public ArrayList<AsynchClientTask> postNextProcess() {
// create AsynchClientTask arraylist
ArrayList<AsynchClientTask> taskArrayList = new ArrayList<AsynchClientTask>();
AsynchClientTask ifNeedROIAssistTask = new AsynchClientTask("", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {
public void run(Hashtable<String, Object> hashTable) throws Exception {
if ((((DefineROI_Panel) imgPanel).getCenterPanel()).getOverlayEditorPanelJAI().isROIAssistVisible() && ((DefineROI_Panel) imgPanel).getFrapWorkspace().getWorkingFrapStudy().getFrapData().getRoi(FRAPData.VFRAP_ROI_ENUM.ROI_BACKGROUND.name()).getNonzeroPixelsCount() < 1) {
DialogUtils.showWarningDialog((imgPanel), "Background ROI is not applied. Please complete the following actions to apply: \n \'Resolve...\' -> \'Fill Voids\' -> \'Apply and Close\'. ");
}
}
};
taskArrayList.add(ifNeedROIAssistTask);
return taskArrayList;
}
use of cbit.vcell.client.task.AsynchClientTask in project vcell by virtualcell.
the class DefineROI_BackgroundROIDescriptor method preNextProcess.
public ArrayList<AsynchClientTask> preNextProcess() {
// create AsynchClientTask arraylist
ArrayList<AsynchClientTask> taskArrayList = new ArrayList<AsynchClientTask>();
final String nextROIStr = null;
AsynchClientTask setCurrentROITask = new AsynchClientTask("", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {
public void run(Hashtable<String, Object> hashTable) throws Exception {
// save current ROI and load ROI in the panel it goes next to
((DefineROI_Panel) imgPanel).setCurrentROI(nextROIStr, true);
FRAPData fData = ((DefineROI_Panel) imgPanel).getFrapWorkspace().getWorkingFrapStudy().getFrapData();
fData.setCurrentlyDisplayedROI(fData.getRoi(FRAPData.VFRAP_ROI_ENUM.ROI_CELL.name()), true);
}
};
taskArrayList.add(setCurrentROITask);
return taskArrayList;
}
use of cbit.vcell.client.task.AsynchClientTask in project vcell by virtualcell.
the class DefineROI_BackgroundROIDescriptor method preBackProcess.
public ArrayList<AsynchClientTask> preBackProcess() {
// create AsynchClientTask arraylist
ArrayList<AsynchClientTask> taskArrayList = new ArrayList<AsynchClientTask>();
final String backROIStr = FRAPData.VFRAP_ROI_ENUM.ROI_BLEACHED.name();
AsynchClientTask setCurrentROITask = new AsynchClientTask("", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {
public void run(Hashtable<String, Object> hashTable) throws Exception {
// save current ROI and load ROI in the panel it backs to
((DefineROI_Panel) imgPanel).setCurrentROI(backROIStr, true);
}
};
taskArrayList.add(setCurrentROITask);
return taskArrayList;
}
use of cbit.vcell.client.task.AsynchClientTask in project vcell by virtualcell.
the class DefineROI_BleachedROIDescriptor method postNextProcess.
public ArrayList<AsynchClientTask> postNextProcess() {
// create AsynchClientTask arraylist
ArrayList<AsynchClientTask> taskArrayList = new ArrayList<AsynchClientTask>();
AsynchClientTask ifNeedROIAssistTask = new AsynchClientTask("", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {
public void run(Hashtable<String, Object> hashTable) throws Exception {
if ((((DefineROI_Panel) imgPanel).getCenterPanel()).getOverlayEditorPanelJAI().isROIAssistVisible() && ((DefineROI_Panel) imgPanel).getFrapWorkspace().getWorkingFrapStudy().getFrapData().getRoi(FRAPData.VFRAP_ROI_ENUM.ROI_BLEACHED.name()).getNonzeroPixelsCount() < 1) {
DialogUtils.showWarningDialog((imgPanel), "Bleached ROI is not applied. Please complete the following actions to apply: \n \'Resolve...\' -> \'Fill Voids\' -> \'Apply and Close\'. ");
}
}
};
taskArrayList.add(ifNeedROIAssistTask);
return taskArrayList;
}
Aggregations