use of ij.gui.PointRoi in project GDSC-SMLM by aherbert.
the class ImageROIPainter method appendRoi.
/**
* Adds a new ROI to the overlay using the coordinates from start to end (non-inclusive)
*
* @param x
* @param y
* @param slice
* @param indices
* @param o
* @param start
* @param end
*/
private void appendRoi(float[] x, float[] y, int[] slice, int[] indices, Overlay o, int start, int end) {
int p = end - start;
float[] x2 = new float[p];
float[] y2 = new float[p];
for (int j = start, ii = 0; j < end; j++, ii++) {
x2[ii] = x[indices[j]];
y2[ii] = y[indices[j]];
}
PointRoi roi = new PointRoi(x2, y2, p);
roi.setPosition(slice[indices[start]]);
o.add(roi);
}
use of ij.gui.PointRoi in project GDSC-SMLM by aherbert.
the class GaussianFit method setOverlay.
/**
* Show the points as an overlay
*
* @param nMaxima
* @param xpoints
* @param ypoints
*/
private void setOverlay(int nMaxima, int[] xpoints, int[] ypoints) {
PointRoi roi = new PointRoi(xpoints, ypoints, nMaxima);
Color strokeColor = Color.yellow;
Color fillColor = Color.green;
roi.setStrokeColor(strokeColor);
roi.setFillColor(fillColor);
roi.setShowLabels(false);
imp.setOverlay(roi, strokeColor, 2, fillColor);
}
use of ij.gui.PointRoi in project GDSC-SMLM by aherbert.
the class BenchmarkSmartSpotRanking method addToOverlay.
private void addToOverlay(Overlay o, int frame, int[] x, int[] y, int c, Color color) {
PointRoi roi = new PointRoi(x, y, c);
roi.setFillColor(color);
roi.setStrokeColor(color);
roi.setPosition(frame);
roi.setShowLabels(false);
o.add(roi);
}
use of ij.gui.PointRoi in project GDSC-SMLM by aherbert.
the class PeakFit method addSingleFrameOverlay.
private void addSingleFrameOverlay() {
// If a single frame was processed add the peaks as an overlay if they are in memory
ImagePlus imp = this.imp;
if (fitMaxima && singleFrame > 0) {
if (source instanceof IJImageSource) {
String title = source.getName();
imp = WindowManager.getImage(title);
}
}
if (singleFrame > 0 && imp != null) {
MemoryPeakResults results = null;
for (PeakResults r : this.results.toArray()) if (r instanceof MemoryPeakResults) {
results = (MemoryPeakResults) r;
break;
}
if (results == null || results.size() == 0)
return;
ExtendedGenericDialog gd = new ExtendedGenericDialog(TITLE);
gd.enableYesNoCancel();
gd.hideCancelButton();
gd.addMessage("Add the fitted localisations as an overlay?");
gd.showDialog();
if (!gd.wasOKed())
return;
LUT lut = LUTHelper.createLUT(LutColour.ICE);
Overlay o = new Overlay();
ArrayList<PeakResult> list = (ArrayList<PeakResult>) results.getResults();
for (int i = 0, j = results.size() - 1; i < results.size(); i++, j--) {
PeakResult r = list.get(i);
PointRoi roi = new PointRoi(r.getXPosition(), r.getYPosition());
Color c = LUTHelper.getColour(lut, j, results.size());
roi.setStrokeColor(c);
roi.setFillColor(c);
if (imp.getStackSize() > 1)
roi.setPosition(singleFrame);
o.add(roi);
}
imp.setOverlay(o);
imp.getWindow().toFront();
}
}
use of ij.gui.PointRoi in project GDSC-SMLM by aherbert.
the class SpotFinderPreview method addRoi.
public static void addRoi(int frame, Overlay o, float[] x, float[] y, int n, Color colour, int pointType) {
if (n == 0)
return;
PointRoi roi = new PointRoi(x, y, n);
roi.setPointType(pointType);
roi.setFillColor(colour);
roi.setStrokeColor(colour);
if (frame != 0)
roi.setPosition(frame);
o.add(roi);
}
Aggregations