public void setLocked(final Content c, final boolean b) { if (!checkSel(c)) return; c.setLocked(b); if (b) record(LOCK); else record(UNLOCK); }
public static void unlock() { final Image3DUniverse univ = getUniv(); if (univ != null && univ.getSelected() != null) { univ.getSelected().setLocked(false); } }
public static void lock() { final Image3DUniverse univ = getUniv(); if (univ != null && univ.getSelected() != null) { univ.getSelected().setLocked(true); } }
|| paths3DDisplay == SimpleNeuriteTracer.DISPLAY_PATHS_LINES_AND_DISCS) { content3D = addAsLinesTo3DViewer(univ, realColor, colorImage); content3D.setLocked(true); nameWhenAddedToViewer = content3D.getName(); if (paths3DDisplay == SimpleNeuriteTracer.DISPLAY_PATHS_LINES_AND_DISCS) { nameWhenAddedToViewerExtra = null; } else { content3DExtra.setLocked(true); nameWhenAddedToViewerExtra = content3DExtra.getName(); content3D.setLocked(true); content3DMultiColored = colorImage;
/** Expects uncalibrated wx,wy,wz, (i.e. pixel values), to be calibrated by @param ls calibration. */ static public final Future<Content> addFatPoint(final String title, final LayerSet ls, final double wx, final double wy, final double wz, final double wr, final Color color) { final Display3D d3d = Display3D.get(ls); d3d.universe.removeContent(title); final Content ct = d3d.universe.createContent(new CustomTriangleMesh(d3d.createFatPoint(wx, wy, wz, wr, ls.getCalibrationCopy()), new Color3f(color), 0), title); ct.setLocked(true); return d3d.addContent(ct); }
static public void showOrthoslices(final ImagePlus imp, final String title, final int wx, final int wy, final float scale2D, final Layer first) { final Display3D d3d = get(first.getParent()); d3d.universe.removeContent(title); final Content ct = d3d.universe.addOrthoslice(imp, null, title, 0, new boolean[]{true, true, true}, 1); final Calibration cal = imp.getCalibration(); final Transform3D t = new Transform3D(new double[]{1, 0, 0, wx * cal.pixelWidth * scale2D, 0, 1, 0, wy * cal.pixelHeight * scale2D, 0, 0, scale2D, first.getZ() * cal.pixelWidth * scale2D, // not pixelDepth! 0, 0, 0, 1}); // why scale2D has to be there at all reflects a horrible underlying setting of the calibration, plus of the scaling in the Display3D. Utils.log(t); ct.applyTransform(t); ct.setLocked(true); }
static public void showOrthoslices(final Patch p) { final Display3D d3d = get(p.getLayerSet()); d3d.adjustResampling(); //d3d.universe.resetView(); final String title = makeTitle(p) + " orthoslices"; // remove if present d3d.universe.removeContent(title); final PatchStack ps = p.makePatchStack(); final ImagePlus imp = get8BitStack(ps); final Content ct = d3d.universe.addOrthoslice(imp, null, title, 0, new boolean[]{true, true, true}, d3d.resample); setTransform(ct, ps.getPatch(0)); ct.setLocked(true); // locks the added content }
static public void showVolume(final Patch p) { final Display3D d3d = get(p.getLayerSet()); d3d.adjustResampling(); //d3d.universe.resetView(); final String title = makeTitle(p) + " volume"; // remove if present d3d.universe.removeContent(title); final PatchStack ps = p.makePatchStack(); final ImagePlus imp = get8BitStack(ps); final Content ct = d3d.universe.addVoltex(imp, null, title, 0, new boolean[]{true, true, true}, d3d.resample); setTransform(ct, ps.getPatch(0)); ct.setLocked(true); // locks the added content }
public Content asContent(final Display3D d3d) { double[] wi = widths; if (null == widths) { wi = new double[vs.getPoints(0).length]; Arrays.fill(wi, 2.0); } else if (widths.length != vs.length()) { Utils.log("ERROR: widths.length != VectorString3D.length()"); return null; } float transp = 1 - alpha; if (transp < 0) transp = 0; if (transp > 1) transp = 1; if (1 == transp) { Utils.log("WARNING: adding a 3D object fully transparent."); } final List<Point3f> triangles = Pipe.generateTriangles(Pipe.makeTube(vs.getPoints(0), vs.getPoints(1), vs.getPoints(2), wi, 1, 12, null), d3d.scale); final Content ct = d3d.universe.createContent(new CustomTriangleMesh(triangles, new Color3f(color), 0), title); ct.setTransparency(transp); ct.setLocked(true); return ct; } }
ct.setLocked(true);
univ.addContent(colourImage, c, colourImage.getTitle(), 40, // threshold channels, resamplingFactor, ContentConstants.SURFACE); content.setLocked(true);
c.setLocked(true); c.setTransparency(0.5f); if (!reusing)