use of uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog in project GDSC-SMLM by aherbert.
the class PeakFit method showMaximaDialog.
private boolean showMaximaDialog() {
final int size = MemoryPeakResults.countMemorySize();
if (size == 0) {
IJ.error(TITLE, "There are no fitting results in memory");
return false;
}
settings = Settings.load();
final ExtendedGenericDialog gd = new ExtendedGenericDialog(TITLE);
gd.addHelp(HelpUrls.getUrl("fit-maxima"));
gd.addMessage("Select identified maxima for fitting");
ResultsManager.addInput(gd, settings.inputOption, InputSource.MEMORY);
gd.addCheckbox("Fit_across_all_frames", settings.fitAcrossAllFrames);
gd.showDialog();
if (gd.wasCanceled()) {
return false;
}
settings.inputOption = ResultsManager.getInputSource(gd);
settings.fitAcrossAllFrames = gd.getNextBoolean();
settings.save();
return true;
}
use of uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog in project GDSC-SMLM by aherbert.
the class TraceExporter method showDialog.
private boolean showDialog() {
settings = Settings.load();
final ExtendedGenericDialog gd = new ExtendedGenericDialog(TITLE);
gd.addMessage("Export traces to a directory");
gd.addDirectoryField("Directory", settings.directory, 30);
gd.addNumericField("Min_length", settings.minLength, 0);
gd.addNumericField("Max_length", settings.maxLength, 0);
gd.addMessage("Specify the maximum jump allowed within a trace.\n" + "Traces with larger jumps will be split.");
gd.addNumericField("Max_jump", settings.maxJump, 0);
gd.addMessage("Specify localistion precision (wobble) to add");
gd.addNumericField("Wobble", settings.wobble, 0, 6, "nm");
gd.addChoice("Format", Settings.formatNames, settings.format);
gd.addCheckbox("Histogram_trace_lengths", settings.showTraceLengths);
gd.addHelp(HelpUrls.getUrl("trace-exporter"));
gd.showDialog();
if (gd.wasCanceled()) {
return false;
}
settings.directory = gd.getNextString();
settings.minLength = Math.max(0, (int) gd.getNextNumber());
settings.maxLength = Math.max(0, (int) gd.getNextNumber());
settings.maxJump = Math.max(0, (int) gd.getNextNumber());
settings.wobble = Math.max(0, gd.getNextNumber());
settings.format = gd.getNextChoiceIndex();
settings.showTraceLengths = gd.getNextBoolean();
settings.save();
return true;
}
use of uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog in project GDSC-SMLM by aherbert.
the class TcPalmAnalysis method showLoopSettingsDialog.
/**
* Show a dialog to change the loop settings.
*
* @param event the event
*/
private void showLoopSettingsDialog(ActionEvent event) {
final ExtendedGenericDialog gd = new ExtendedGenericDialog(TITLE);
// Require results settings to use the standard ResultsManager image options
final ResultsSettings.Builder tmp = ResultsSettings.newBuilder();
tmp.setResultsImageSettings(settings.getLoopImageSettingsBuilder());
final int flags = ResultsManager.FLAG_NO_SECTION_HEADER;
ResultsManager.addImageResultsOptions(gd, tmp, flags);
gd.addHelp(HelpUrls.getUrl("tc-palm-analysis"));
gd.showDialog();
if (gd.wasCanceled()) {
return;
}
final ResultsImageSettings.Builder newImgSettings = tmp.getResultsImageSettingsBuilder();
newImgSettings.setImageTypeValue(gd.getNextChoiceIndex());
settings.setLoopImageSettings(newImgSettings);
SettingsManager.writeSettings(settings);
addWork(previous.roi);
}
use of uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog in project GDSC-SMLM by aherbert.
the class PulseActivationAnalysis method showCrossTalkAnalysisDialog.
private boolean showCrossTalkAnalysisDialog() {
final ExtendedGenericDialog gd = new ExtendedGenericDialog(title);
gd.addMessage(TextUtils.wrap("Crosstalk analysis requires a sample singly labelled with only one photo-switchable" + " probe and imaged with the full pulse lifecycle. The probe should be activated by" + " the pulse in the target channel. Activations from the pulse in other channels" + " is crosstalk.", 80));
final String[] ch = new String[settings.channels];
for (int i = 0; i < ch.length; i++) {
ch[i] = "Channel " + (i + 1);
}
gd.addChoice("Target", ch, "Channel " + settings.targetChannel);
gd.addHelp(HelpUrls.getUrl(helpKey));
gd.showDialog();
if (gd.wasCanceled()) {
return false;
}
settings.targetChannel = gd.getNextChoiceIndex() + 1;
return true;
}
use of uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog in project GDSC-SMLM by aherbert.
the class ShowResultsHeader method run.
@Override
public void run(String arg) {
SmlmUsageTracker.recordPlugin(this.getClass(), arg);
final Settings settings = Settings.load();
final ExtendedGenericDialog gd = new ExtendedGenericDialog(TITLE);
gd.addMessage("Show the results header in the ImageJ log");
gd.addFilenameField("Filename", settings.inputFilename, 30);
gd.addCheckbox("Raw", settings.raw);
gd.addHelp(HelpUrls.getUrl("show-results-header"));
gd.showDialog();
if (gd.wasCanceled()) {
return;
}
settings.inputFilename = gd.getNextString();
settings.raw = gd.getNextBoolean();
settings.save();
final PeakResultsReader reader = new PeakResultsReader(settings.inputFilename);
final String header = reader.getHeader();
if (header == null) {
IJ.error(TITLE, "No header found in file: " + settings.inputFilename);
return;
}
if (settings.raw) {
// The ImageJ TextPanel class correctly stores lines with tab characters.
// However when it is drawn in ij.text.TextCanvas using java.awt.Graphics.drawChars(...)
// the instance of this class is sun.java2d.SunGraphics2D which omits '\t' chars.
// This may be a problem specific to the Linux JRE.
// TODO - Find out if this is a Linux specific bug.
// Output the raw text. This preserves the tabs in the Cut/Copy commands.
IJ.log(header);
// IJ.log(header.replace("\t", " "));
return;
}
// Output what information we can extract
boolean found = false;
found |= show("Format", reader.getFormat().toString());
found |= show("Name", reader.getName());
found |= show("Bounds", reader.getBounds());
found |= show("Source", reader.getSource());
found |= show("Calibration", reader.getCalibration());
found |= show("PSF", reader.getPsf());
found |= show("Configuration", reader.getConfiguration());
if (!found) {
IJ.error(TITLE, "No header information found in file: " + settings.inputFilename);
}
}
Aggregations