public boolean[] getChannels() { return getCurrent().getChannels(); }
@Override public void thresholdUpdated(final int threshold) { if (c.getImage() == null) { IJ.error("Mesh was not calculated of a grayscale " + "image. Can't change threshold"); return; } final List tri = triangulator.getTriangles(c.getImage(), c.getThreshold(), c.getChannels(), c.getResamplingFactor()); mesh.setMesh(tri); }
@Override public void channelsUpdated(final boolean[] channels) { if (c.getImage() == null) { IJ.error("Mesh was not calculated of a grayscale " + "image. Can't change channels"); return; } final List tri = triangulator.getTriangles(c.getImage(), c.getThreshold(), c.getChannels(), c.getResamplingFactor()); mesh.setMesh(tri); }
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); }
public void changeChannels(final Content c) { if (!checkSel(c)) return; final ContentInstant ci = c.getCurrent(); final GenericDialog gd = new GenericDialog("Adjust channels ...", univ.getWindow()); gd.addMessage("Channels"); gd.addCheckboxGroup(1, 3, new String[] { "red", "green", "blue" }, ci .getChannels()); gd.addCheckbox("Apply to all timepoints", true); gd.showDialog(); if (gd.wasCanceled()) return; final boolean[] channels = new boolean[] { gd.getNextBoolean(), gd.getNextBoolean(), gd.getNextBoolean() }; if (gd.getNextBoolean()) c.setChannels(channels); else ci.setChannels(channels); univ.fireContentChanged(c); record(SET_CHANNELS, Boolean.toString(channels[0]), Boolean .toString(channels[1]), Boolean.toString(channels[2])); }
/** * 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()); }
renderer = new VolumeRenderer(imp, c.getColor(), c.getTransparency(), c .getChannels()); final int[] rLUT = new int[256]; final int[] gLUT = 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); } } }