use of uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog in project GDSC-SMLM by aherbert.
the class CameraModelManager method runLoadFromDirectory.
private static void runLoadFromDirectory() {
final ExtendedGenericDialog gd = new ExtendedGenericDialog(TITLE);
gd.addMessage("Load camera models from a directory.");
gd.addDirectoryField("Directory", directory.get());
gd.addHelp(HelpUrls.getUrl("camera-model-manager-load-dir"));
gd.showDialog();
if (gd.wasCanceled()) {
return;
}
final String dir = gd.getNextString();
directory.set(dir);
final File[] fileList = (new File(dir)).listFiles(File::isFile);
if (!ArrayUtils.isEmpty(fileList)) {
for (final File file : fileList) {
loadFromFileAndSaveResource(file.getPath());
}
}
}
use of uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog in project GDSC-SMLM by aherbert.
the class CameraModelManager method runLoadFromFile.
private static void runLoadFromFile() {
final ExtendedGenericDialog gd = new ExtendedGenericDialog(TITLE);
gd.addMessage("Load a camera model from file.");
gd.addFilenameField("Filename", filename.get());
gd.addHelp(HelpUrls.getUrl("camera-model-manager-load-file"));
gd.showDialog();
if (gd.wasCanceled()) {
return;
}
final String file = gd.getNextString();
filename.set(file);
loadFromFileAndSaveResource(file);
}
use of uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog in project GDSC-SMLM by aherbert.
the class CropResults method showCropDialog.
private boolean showCropDialog() {
final ExtendedGenericDialog gd = new ExtendedGenericDialog(TITLE);
gd.addHelp(HelpUrls.getUrl("crop-results"));
final Rectangle bounds = results.getBounds(true);
results.is3D();
gd.addMessage(String.format("Current bounds: x=%d,y=%d,w=%d,h=%d", bounds.x, bounds.y, bounds.width, bounds.height));
gd.addNumericField("Border", settings.getBorder(), 2);
gd.addCheckbox("Select_region", settings.getSelectRegion());
gd.addNumericField("X", settings.getX(), 2);
gd.addNumericField("Y", settings.getY(), 2);
gd.addNumericField("Width", settings.getWidth(), 2);
gd.addNumericField("Height", settings.getHeight(), 2);
if (!titles.isEmpty()) {
gd.addCheckbox("Use_ROI", settings.getUseRoi());
final String[] items = titles.toArray(new String[0]);
gd.addChoice("Image", items, settings.getRoiImage());
}
addStandardFields(gd);
gd.addCheckbox("Reset_origin", settings.getResetOrigin());
gd.showDialog();
if (gd.wasCanceled()) {
return false;
}
settings.setBorder(Math.max(0, gd.getNextNumber()));
settings.setSelectRegion(gd.getNextBoolean());
settings.setX(gd.getNextNumber());
settings.setY(gd.getNextNumber());
settings.setWidth(Math.max(0, gd.getNextNumber()));
settings.setHeight(Math.max(0, gd.getNextNumber()));
if (!titles.isEmpty()) {
myUseRoi = gd.getNextBoolean();
settings.setUseRoi(myUseRoi);
settings.setRoiImage(gd.getNextChoice());
}
readStandardFields(gd);
settings.setResetOrigin(gd.getNextBoolean());
gd.collectOptions();
return validateOutputName();
}
use of uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog in project GDSC-SMLM by aherbert.
the class CubicSplineManager method runLoadFromDirectory.
private static void runLoadFromDirectory() {
final ExtendedGenericDialog gd = new ExtendedGenericDialog(TITLE);
gd.addMessage("Load spline models from a directory.");
gd.addDirectoryField("Directory", directory.get());
gd.addHelp(HelpUrls.getUrl("cubic-spline-manager-load-dir"));
gd.showDialog();
if (gd.wasCanceled()) {
return;
}
final String dir = gd.getNextString();
directory.set(dir);
final File[] fileList = (new File(dir)).listFiles(File::isFile);
if (!ArrayUtils.isEmpty(fileList)) {
for (final File file : fileList) {
loadFromFileAndSaveResource(file.getPath());
}
}
}
use of uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog in project GDSC-SMLM by aherbert.
the class CubicSplineManager method runLoadFromFile.
private static void runLoadFromFile() {
final ExtendedGenericDialog gd = new ExtendedGenericDialog(TITLE);
gd.addMessage("Load a spline model from file.");
gd.addFilenameField("Filename", filename.get());
gd.addHelp(HelpUrls.getUrl("cubic-spline-manager-load-file"));
gd.showDialog();
if (gd.wasCanceled()) {
return;
}
final String file = gd.getNextString();
filename.set(file);
loadFromFileAndSaveResource(file);
}
Aggregations