public void updateVolume(final Content c) { if (!checkSel(c)) return; if (c.getType() != ContentConstants.VOLUME && c.getType() != ContentConstants.ORTHO) return; if (c.getResamplingFactor() != 1) { IJ.error("Object must be loaded " + "with resamplingfactor 1"); return; } ((VoltexGroup) c.getContent()).update(); }
public void changeSlices(final Content c) { if (!checkSel(c)) return; switch (c.getType()) { case ContentConstants.ORTHO: changeOrthslices(c); break; case ContentConstants.MULTIORTHO: changeMultiOrthslices(c); break; } }
public void fill(final Content c) { if (!checkSel(c)) return; final int type = c.getType(); if (type != ContentConstants.VOLUME && type != ContentConstants.ORTHO) return; new Thread() { { setPriority(Thread.NORM_PRIORITY); } @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(); }
final int t = c.getType();
public List<Map.Entry<Point3d, Float>> getPickPointColumn(final Content c, final int x, final int y) if (c.getType() != ContentConstants.VOLUME) return null; final PickCanvas pickCanvas = new PickCanvas(canvas, c); pickCanvas.setMode(PickInfo.PICK_GEOMETRY);
public static void fillSelection() { final Image3DUniverse univ = getUniv(); if (univ != null && univ.getSelected() != null && univ.getSelected().getType() == ContentConstants.VOLUME) { final VoltexGroup vg = (VoltexGroup) univ.getSelected().getContent(); final ImageCanvas3D canvas = (ImageCanvas3D) univ.getCanvas(); vg.fillRoi(canvas, canvas.getRoi(), (byte) 0); } }
if (c.getType() != ContentConstants.VOLUME) return intersection;
public static void setSlices(final String x, final String y, final String z) { final Image3DUniverse univ = getUniv(); if (univ != null && univ.getSelected() != null && univ.getSelected().getType() == ContentConstants.ORTHO) { final OrthoGroup vg = (OrthoGroup) univ.getSelected().getContent(); vg.setSlice(AxisConstants.X_AXIS, getInt(x)); vg.setSlice(AxisConstants.Y_AXIS, getInt(y)); vg.setSlice(AxisConstants.Z_AXIS, getInt(z)); } }
if (c.getType() != ContentConstants.VOLUME) return intersection;
public void setSaturatedVolumeRendering(final Content c, final boolean b) { if (!checkSel(c)) return; final int t = c.getType(); if (t != ContentConstants.VOLUME) return; if (c.getNumberOfInstants() == 1) { c.setSaturatedVolumeRendering(b); return; } final ContentInstant ci = c.getCurrent(); final GenericDialog gd = new GenericDialog("Saturated volume rendering"); gd.addCheckbox("Apply to all timepoints", true); gd.showDialog(); if (gd.wasCanceled()) return; if (gd.getNextBoolean()) c.setSaturatedVolumeRendering(b); else ci.setSaturatedVolumeRendering(b); }
public void setShaded(final Content c, final boolean b) { if (!checkSel(c)) return; final int t = c.getType(); if (t != ContentConstants.SURFACE && t != ContentConstants.SURFACE_PLOT2D && t != ContentConstants.CUSTOM) return; if (c.getNumberOfInstants() == 1) { c.setShaded(b); return; } final ContentInstant ci = c.getCurrent(); final GenericDialog gd = new GenericDialog("Set shaded"); gd.addCheckbox("Apply to all timepoints", true); gd.showDialog(); if (gd.wasCanceled()) return; if (gd.getNextBoolean()) c.setShaded(b); else ci.setShaded(b); }
else if (canvas.isKeyDown(KeyEvent.VK_Y)) axis = AxisConstants.Y_AXIS; else if (canvas.isKeyDown(KeyEvent.VK_Z)) axis = AxisConstants.Z_AXIS; if (c != null && c.getType() == ContentConstants.ORTHO && axis != -1) { final MouseWheelEvent we = (MouseWheelEvent) e; int units = 0;
if (c.getType() == ContentConstants.SURFACE) { final GenericDialog gd = new GenericDialog("Adjust threshold ...", univ.getWindow());
public void applySurfaceColors(final Content c) { if (!checkSel(c)) return; final int t = c.getType(); if (t != ContentConstants.SURFACE && t != ContentConstants.CUSTOM) return; final GenericDialog gd = new GenericDialog("Apply color from image"); final int[] ids = WindowManager.getIDList(); final String[] titles = new String[ids.length]; for (int i = 0; i < ids.length; i++) titles[i] = WindowManager.getImage(ids[i]).getTitle(); gd.addChoice("Color image", titles, titles[0]); gd.addCheckbox("Apply to all timepoints", true); gd.showDialog(); if (gd.wasCanceled()) return; final ImagePlus colorImage = WindowManager.getImage(gd.getNextChoice()); if (gd.getNextBoolean()) c.applySurfaceColors(colorImage); else if (c.getCurrent() != null) c.getCurrent().applySurfaceColors( colorImage); }
else if (c != null && c.getType() == ContentConstants.ORTHO && axis != -1)