public Color3f getColor() { return getCurrent().getColor(); }
public void changeColor(final Content c) { if (!checkSel(c)) return; final ContentInstant ci = c.getCurrent(); final Color3f oldC = ci.getColor(); final ColorListener colorListener = new ColorListener() { @Override public void colorChanged(final Color3f color) { ci.setColor(color); univ.fireContentChanged(c); } @Override public void ok(final GenericDialog gd) { if (gd.getNextBoolean()) record(SET_COLOR, "null", "null", "null"); else record(SET_COLOR, "" + (int) gd.getNextNumber(), "" + (int) gd.getNextNumber(), "" + (int) gd.getNextNumber()); // gd.wasOKed: apply to all time points if (gd.getNextBoolean()) c.setColor(ci.getColor()); univ.fireContentChanged(c); } }; showColorDialog("Change color...", oldC, colorListener, true, true); }
@Override public void ok(final GenericDialog gd) { if (gd.getNextBoolean()) record(SET_COLOR, "null", "null", "null"); else record(SET_COLOR, "" + (int) gd.getNextNumber(), "" + (int) gd.getNextNumber(), "" + (int) gd.getNextNumber()); // gd.wasOKed: apply to all time points if (gd.getNextBoolean()) c.setColor(ci.getColor()); univ.fireContentChanged(c); } };
public MeshGroup(final ContentInstant c) { super(); this.c = c; Color3f color = c.getColor(); final List tri = triangulator.getTriangles(c.getImage(), c.getThreshold(), c.getChannels(), c.getResamplingFactor()); if (color == null) { final int value = c.getImage().getProcessor().getColorModel().getRGB(c.getThreshold()); color = new Color3f(new Color(value)); } mesh = new CustomTriangleMesh(tri, color, c.getTransparency()); calculateMinMaxCenterPoint(); addChild(mesh); }
/** * Construct a OrthoGroup from the given ContentInstant. * * @param c */ public OrthoGroup(final ContentInstant c) { super(); this.c = c; final ImagePlus imp = c.getResamplingFactor() == 1 ? c.getImage() : NaiveResampler.resample(c .getImage(), c.getResamplingFactor()); renderer = new Orthoslice(imp, c.getColor(), c.getTransparency(), c.getChannels()); renderer.fullReload(); calculateMinMaxCenterPoint(); addChild(renderer.getVolumeNode()); }
/** * Construct a MultiOrthoGroup from the given ContentInstant. * * @param c */ public MultiOrthoGroup(final ContentInstant c) { super(); this.c = c; final ImagePlus imp = c.getResamplingFactor() == 1 ? c.getImage() : NaiveResampler.resample(c .getImage(), c.getResamplingFactor()); renderer = new MultiOrthoslice(imp, c.getColor(), c.getTransparency(), c .getChannels()); renderer.fullReload(); calculateMinMaxCenterPoint(); addChild(renderer.getVolumeNode()); }
.getImage(), c.getResamplingFactor()); renderer = new VolumeRenderer(imp, c.getColor(), c.getTransparency(), c .getChannels()); final int[] rLUT = new int[256];
/** * Constructs a surface plot for the given Content. * * @param c */ public SurfacePlotGroup(final ContentInstant c) { super(); this.c = c; final int res = c.getResamplingFactor(); final ImagePlus imp = res == 1 ? c.getImage() : NaiveResampler.resample(c.getImage(), res, res, 1); final Volume volume = new Volume(imp); volume.setChannels(c.getChannels()); surfacep = new SurfacePlot(volume, c.getColor(), c.getTransparency(), c.getImage() .getSlice() - 1); surfacep.calculateMinMaxCenterPoint(min, max, center); addChild(surfacep); if (c.getImage().getStackSize() == 1) return; final StackWindow win = (StackWindow) c.getImage().getWindow(); if (win == null) return; final Component[] co = win.getComponents(); for (int i = 0; i < co.length; i++) { if (co[i] instanceof Scrollbar) { ((Scrollbar) co[i]).addAdjustmentListener(this); } } }