本文整理汇总了Java中ij.gui.Overlay.setStrokeColor方法的典型用法代码示例。如果您正苦于以下问题:Java Overlay.setStrokeColor方法的具体用法?Java Overlay.setStrokeColor怎么用?Java Overlay.setStrokeColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ij.gui.Overlay
的用法示例。
在下文中一共展示了Overlay.setStrokeColor方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addRoi
import ij.gui.Overlay; //导入方法依赖的package包/类
public static void addRoi(ImagePlus imp, int slice, PointRoi roi)
{
if (imp != null && slice > 0 && slice <= imp.getStackSize())
{
imp.setSlice(slice);
if (imp.getWindow() != null)
imp.getWindow().toFront();
if (roi != null)
{
//imp.setRoi(roi);
if (imp.getStackSize() > 1)
roi.setPosition(slice);
Overlay o = new Overlay(roi);
o.setStrokeColor(Color.green);
imp.setOverlay(o);
}
else
{
imp.setOverlay(null);
}
}
}
示例2: addToOverlay
import ij.gui.Overlay; //导入方法依赖的package包/类
private void addToOverlay(Overlay mainOverlay, Overlay overlay, Color color)
{
overlay.setFillColor(color);
overlay.setStrokeColor(color);
for (Roi roi : overlay.toArray())
{
mainOverlay.add(roi);
}
}
示例3: showPointsOverlays
import ij.gui.Overlay; //导入方法依赖的package包/类
/**
* Displays the points for each {@link VoxelT2} coordinates over an image as
* a {@link Overlay}
*
* @param notFit The {@link VoxelT2} list
*/
public static void showPointsOverlays(List<VoxelT2> notFit) {
ImagePlus imp = IJ.getImage();
Overlay overlay = createOverlay(notFit);
overlay.setFillColor(new Color(33, 33, 33, 0));
overlay.setStrokeColor(Color.red);
imp.setOverlay(overlay);
}
示例4: paint
import ij.gui.Overlay; //导入方法依赖的package包/类
/**
* Trigger the ROI painter using the selection from the text panel.
*
* @param selectionStart
* the selection start
* @param selectionEnd
* the selection end
*/
public void paint(int selectionStart, int selectionEnd)
{
if (selectionStart < 0 || selectionStart >= textPanel.getLineCount())
return;
if (selectionEnd < selectionStart || selectionEnd >= textPanel.getLineCount())
return;
ImagePlus imp = WindowManager.getImage(title);
if (imp == null)
return;
// Show all
int points = 0;
float[] x = new float[selectionEnd - selectionStart + 1];
float[] y = new float[x.length];
int[] slice = new int[x.length];
while (selectionStart <= selectionEnd)
{
double[] position = coordProvider.getCoordinates(textPanel.getLine(selectionStart));
if (position == null || position.length < 3)
continue;
slice[points] = (int) position[0];
x[points] = (float) position[1];
y[points] = (float) position[2];
points++;
selectionStart++;
}
if (points == 0)
return;
// Simple code to add the ROI onto a single slice: addRoi(imp, slice[0], new PointRoi(x, y, points));
// Add the ROI to each relevant slice
// Sort the slices
int[] indices = new int[points];
for (int i = 0; i < points; i++)
indices[i] = i;
Sort.sort(indices, slice);
Overlay o = new Overlay();
// Create an ROI for each slice
int start = 0;
for (int i = 0; i < points; i++)
{
if (slice[indices[i]] != slice[indices[start]])
{
appendRoi(x, y, slice, indices, o, start, i);
start = i;
}
}
appendRoi(x, y, slice, indices, o, start, points);
// Choose the first slice and add the final overlay
imp.setSlice(slice[indices[start]]);
if (imp.getWindow() != null)
imp.getWindow().toFront();
o.setStrokeColor(Color.green);
imp.setOverlay(o);
}
示例5: createOverlay
import ij.gui.Overlay; //导入方法依赖的package包/类
private static Overlay createOverlay(List<Coordinate> points, ImagePlus imp)
{
int c = imp.getChannel();
int f = imp.getFrame();
boolean isHyperStack = imp.isDisplayedHyperStack();
int[] ox = new int[points.size()];
int[] oy = new int[points.size()];
int[] oz = new int[points.size()];
int i = 0;
for (Coordinate point : points)
{
ox[i] = point.getXint();
oy[i] = point.getYint();
oz[i] = point.getZint();
i++;
}
Overlay overlay = new Overlay();
int remaining = ox.length;
for (int ii = 0; ii < ox.length; ii++)
{
// Find the next unprocessed slice
if (oz[ii] != -1)
{
final int slice = oz[ii];
// Extract all the points from this slice
int[] x = new int[remaining];
int[] y = new int[remaining];
int count = 0;
for (int j = ii; j < ox.length; j++)
{
if (oz[j] == slice)
{
x[count] = ox[j];
y[count] = oy[j];
count++;
oz[j] = -1; // Mark processed
}
}
x = Arrays.copyOf(x, count);
y = Arrays.copyOf(y, count);
PointRoi roi = new PointRoi(x, y, count);
if (isHyperStack)
roi.setPosition(c, slice, f);
else
roi.setPosition(slice);
roi.setShowLabels(false);
overlay.add(roi);
remaining -= count;
}
}
overlay.setStrokeColor(Color.cyan);
return overlay;
}
示例6: drawImage
import ij.gui.Overlay; //导入方法依赖的package包/类
/**
* Draws the passed ImageResult on the ImagePlus of this class. If the image
* is part of a CompositeImageResult then contained lines will also be drawn
*/
protected void drawImage(RandomAccessibleInterval<? extends RealType<?>> img) {
// get ImgLib image as ImageJ image
imp = ImageJFunctions.wrapFloat((RandomAccessibleInterval<T>) img, "TODO");
imagePanel.updateImage(imp);
// set the display range
// check if a LUT should be applied
if (listOfLUTs.containsKey(img)) {
// select linked look up table
IJ.run(imp, listOfLUTs.get(img), null);
}
imp.getProcessor().resetMinAndMax();
boolean overlayModified = false;
Overlay overlay = new Overlay();
// if it is the 2d histogram, we want to show the regression line
if (isHistogram(img)) {
Histogram2D<T> histogram = mapOf2DHistograms.get(img);
/*
* check if we should draw a regression line for the current
* histogram.
*/
if (histogram.getDrawingSettings().contains(Histogram2D.DrawingFlags.RegressionLine)) {
AutoThresholdRegression<T> autoThreshold = dataContainer.getAutoThreshold();
if (histogram != null && autoThreshold != null) {
if (img == histogram.getPlotImage()) {
drawLine(overlay, img, autoThreshold.getAutoThresholdSlope(),
autoThreshold.getAutoThresholdIntercept());
overlayModified = true;
}
}
}
}
if (overlayModified) {
overlay.setStrokeColor(java.awt.Color.WHITE);
imp.setOverlay(overlay);
}
imagePanel.repaint();
}
示例7: voxelsAIFOverlay
import ij.gui.Overlay; //导入方法依赖的package包/类
private void voxelsAIFOverlay() {
Overlay overlay = EventUtils.createOverlay(probAIFs);
overlay.setFillColor(new Color(33, 33, 33, 0));
overlay.setStrokeColor(Color.red);
IJ.getImage().setOverlay(overlay);
}