@Override public void colorChanged(final Color3f color) { ci.setLandmarkColor(color); univ.fireContentChanged(c); }
@Override public synchronized final void setValue(final ContentInstant ci, final int v) { ci.setThreshold(v); univ.fireContentChanged(c); } };
@Override public synchronized final void setValue(final ContentInstant ci, final int v) { ci.setTransparency(v / 100f); univ.fireContentChanged(c); } };
@Override public void colorChanged(final Color3f color) { ci.setColor(color); univ.fireContentChanged(c); }
@Override public void applied() { c.setLUT(r, g, b, a); univ.fireContentChanged(c); } });
@Override public void adjustmentValueChanged(final AdjustmentEvent e) { os.setSlice(dirs[i], sl[i].getValue()); univ.fireContentChanged(c); } });
static public final void randomizeColors(final Image3DUniverse univ) { final ArrayList<Content> cs = new ArrayList<Content>(getOrderedContents(univ)); for (int i=0; i<cs.size(); ++i) { if (i < colors.length) { cs.get(i).setColor(new Color3f(colors[i])); } else { cs.get(i).setColor(new Color3f((float)Math.random(), (float)Math.random(), (float)Math.random())); } } // Update the color bars if something is selected: final Content content = univ.getSelected(); if (null != content) univ.fireContentChanged(content); }
@Override public void ok(final GenericDialog gd) { // TODO: record // gd.wasOKed: apply to all time points if (gd.getNextBoolean()) c.setLandmarkColor(ci.getLandmarkColor()); univ.fireContentChanged(c); } };
@Override public void run() { final ImageCanvas3D canvas = (ImageCanvas3D) univ.getCanvas(); ((VoltexGroup) c.getContent()).fillRoi(canvas, canvas.getRoi(), (byte) 0); univ.fireContentChanged(c); record(FILL_SELECTION); } }.start();
@Override public void windowClosed(final WindowEvent e) { if (null != transp_adjuster) transp_adjuster.quit(); if (gd.wasCanceled()) { final float newTr = oldTr / 100f; ci.setTransparency(newTr); univ.fireContentChanged(c); return; } // apply to all instants of the content if (aBox.getState()) c.setTransparency(ci.getTransparency()); record(SET_TRANSPARENCY, Float.toString(((Scrollbar) gd.getSliders() .get(0)).getValue() / 100f)); } });
@Override public void windowClosed(final WindowEvent e) { if (gd.wasCanceled()) { os.setSlice(AxisConstants.X_AXIS, ind1); os.setSlice(AxisConstants.Y_AXIS, ind2); os.setSlice(AxisConstants.Z_AXIS, ind3); os.setVisible(AxisConstants.X_AXIS, vis1); os.setVisible(AxisConstants.Y_AXIS, vis2); os.setVisible(AxisConstants.Z_AXIS, vis3); univ.fireContentChanged(c); return; } record(SET_SLICES, Integer.toString(sl[0].getValue()), Integer .toString(sl[1].getValue()), Integer.toString(sl[2].getValue())); } });
@Override public void windowClosed(final WindowEvent e) { try { if (gd.wasCanceled()) { ci.setThreshold(oldTr); univ.fireContentChanged(c); return; } // apply to other time points if (aBox.getState()) c.setThreshold(ci.getThreshold()); record(SET_THRESHOLD, Integer.toString(c.getThreshold())); } finally { // [ This code block executes even when // calling return above ] // // clean up if (null != thresh_adjuster) thresh_adjuster.quit(); } } });
@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 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])); }
if (gd.getNextBoolean()) c.setThreshold(th); else ci.setThreshold(th); univ.fireContentChanged(c); record(SET_THRESHOLD, Integer.toString(th)); return;