/** * Add a new image as a content, displaying it as a volume rendering. Default * parameters are used for its attributes: * <ul> * <li>color: null * <li>name: title of the image * <li>threshold: the default threshold, as returned by * Content.getDefaultTreshold() * <li>channels: all color channels r, g, b * </ul> * * @param image the image to display * @return the Content which was added, null if any error occurred. */ public Content addVoltex(final ImagePlus image, final int res) { return addContent(image, ContentConstants.VOLUME, res); }
/** * Add a new image as a content, displaying it as orthoslices. Default * parameters are used for its attributes: * <ul> * <li>color: null * <li>name: title of the image * <li>threshold: the default threshold, as returned by * Content.getDefaultTreshold() * <li>channels: all color channels r, g, b * </ul> * * @param image the image to display * @return the Content which was added, null if any error occurred. */ public Content addOrthoslice(final ImagePlus image, final int res) { return addContent(image, ContentConstants.ORTHO, res); }
/** * Add a new image as a content, displaying it as a 2D surface plot. Default * parameters are used for its attributes: * <ul> * <li>color: null * <li>name: title of the image * <li>threshold: the default threshold, as returned by * Content.getDefaultTreshold() * <li>channels: all color channels r, g, b * </ul> * * @param image the image to display * @return the Content which was added, null if any error occurred. */ public Content addSurfacePlot(final ImagePlus image, final int res) { return addContent(image, ContentConstants.SURFACE_PLOT2D, res); }
/** * Add a new image as a content, displaying it as an isosurface. Default * parameters are used for its attributes: * <ul> * <li>color: null * <li>name: title of the image * <li>threshold: the default threshold, as returned by * Content.getDefaultTreshold() * <li>channels: all color channels r, g, b * </ul> * * @param img the image to display * @param res * @return the Content which was added, null if any error occurred. */ public Content addMesh(final ImagePlus img, final int res) { return addContent(img, ContentConstants.SURFACE, res); }
/** * Add a new image as a content, displaying it as orthoslices. Default * parameters are used for its attributes: * <ul> * <li>color: null * <li>name: title of the image * <li>threshold: the default threshold, as returned by * Content.getDefaultTreshold() * <li>channels: all color channels r, g, b * <li>resampling factor: the default resampling factor, as returned by * Content.getDefaultResamplingFactor()</li> * </ul> * * @param image the image to display * @return the Content which was added, null if any error occurred. */ public Content addOrthoslice(final ImagePlus image) { return addContent(image, ContentConstants.ORTHO); }
/** * Add a new image as a content, displaying it as an isosurface. Default * parameters are used for its attributes: * <ul> * <li>color: null * <li>name: title of the image * <li>threshold: the default threshold, as returned by * Content.getDefaultTreshold() * <li>channels: all color channels r, g, b * <li>resampling factor: the default resampling factor, as returned by * Content.getDefaultResamplingFactor()</li> * </ul> * * @param img the image to display * @return the Content which was added, null if any error occurred. */ public Content addMesh(final ImagePlus img) { return addContent(img, ContentConstants.SURFACE); }
/** * Add a new image as a content, displaying it as a volume rendering. For the * meaning of color, threshold, channels, resampling factor etc see the * documentation of Content. * * @param image the image to display * @param color the color in which this volume rendering is displayed. * @param name the name of the displayed Content. * @param thresh the threshold used for the displayed volume rendering * @param channels the displayed color channels, must be a boolean array of * length 3 * @param resamplingF a resampling factor. * @return the added Content, null if any error occurred */ public Content addVoltex(final ImagePlus image, final Color3f color, final String name, final int thresh, final boolean[] channels, final int resamplingF) { return addContent(image, color, name, thresh, channels, resamplingF, ContentConstants.VOLUME); }
/** * Add a new image as a content, displaying it as an iso-surface. For the * meaning of color, threshold, channels, resampling factor etc see the * documentation of Content. * * @param image the image to display * @param color the color in which this surface is displayed. * @param name the name of the displayed Content. * @param threshold the threshold used for generating the surface * @param channels the displayed color channels, must be a boolean array of * length 3 * @param resamplingF a resampling factor. * @return the added Content, null if any error occurred */ public Content addMesh(final ImagePlus image, final Color3f color, final String name, final int threshold, final boolean[] channels, final int resamplingF) { return addContent(image, color, name, threshold, channels, resamplingF, ContentConstants.SURFACE); }
/** * Add a new image as a content, displaying it as orthoslices. For the meaning * of color, threshold, channels, resampling factor etc see the documentation * of Content. * * @param image the image to display * @param color the color in which these orthoslices are displayed. * @param name the name of the displayed Content. * @param thresh the threshold used for the displayed orthoslices * @param channels the displayed color channels, must be a boolean array of * length 3 * @param resamplingF a resampling factor. * @return the added Content, null if any error occurred */ public Content addOrthoslice(final ImagePlus image, final Color3f color, final String name, final int thresh, final boolean[] channels, final int resamplingF) { return addContent(image, color, name, thresh, channels, resamplingF, ContentConstants.ORTHO); }
/** * Add a new image as a content, displaying it as a volume rendering. Default * parameters are used for its attributes: * <ul> * <li>color: null * <li>name: title of the image * <li>threshold: the default threshold, as returned by * Content.getDefaultTreshold() * <li>channels: all color channels r, g, b * <li>resampling factor: the default resampling factor, as returned by * Content.getDefaultResamplingFactor()</li> * </ul> * * @param image the image to display * @return the Content which was added, null if any error occurred. */ public Content addVoltex(final ImagePlus image) { return addContent(image, ContentConstants.VOLUME); }
/** * Add a new image as a content, displaying it as a 2D surface plot. Default * parameters are used for its attributes: * <ul> * <li>color: null * <li>name: title of the image * <li>threshold: the default threshold, as returned by * Content.getDefaultTreshold() * <li>channels: all color channels r, g, b * <li>resampling factor: the default resampling factor, as returned by * Content.getDefaultResamplingFactor()</li> * </ul> * * @param image the image to display * @return the Content which was added, null if any error occurred. */ public Content addSurfacePlot(final ImagePlus image) { return addContent(image, ContentConstants.SURFACE_PLOT2D); }
/** * Add a new image as a content, displaying it as a 2D surface plot. For the * meaning of color, threshold, channels, resampling factor etc see the * documentation of Content. * * @param image the image to display * @param color the color in which this surface plot is displayed. * @param name the name of the displayed Content. * @param thresh the threshold used for the displayed surface plot * @param channels the displayed color channels, must be a boolean array of * length 3 * @param resamplingF a resampling factor. * @return the added Content, null if any error occurred */ public Content addSurfacePlot(final ImagePlus image, final Color3f color, final String name, final int thresh, final boolean[] channels, final int resamplingF) { return addContent(image, color, name, thresh, channels, resamplingF, ContentConstants.SURFACE_PLOT2D); }
/** * Add a custom mesh to the universe. For more details on custom meshes, read * the package API docs of the package customnode. * * @param mesh the CustomMesh to display * @param name the name for the added Content * @return the added Content */ public Content addCustomMesh(final CustomMesh mesh, final String name) { if (contents.containsKey(name)) { IJ.error("Mesh named '" + name + "' exists already"); return null; } final Content content = createContent(mesh, name); return addContent(content); }
/** * Add a CustomMultiMesh to the universe. For more details on custom meshes, * read the package API docs of the package customnode. * * @param mesh the CustomMultiMesh to display * @param name the name for the added Content * @return the added Content */ public Content addCustomMesh(final CustomMultiMesh mesh, final String name) { if (contents.containsKey(name)) { IJ.error("Mesh named '" + name + "' exists already"); return null; } final Content content = createContent(mesh, name); return addContent(content); }
/** * Add the specified image as a new Content to the universe. The specified * type is one of the constants defined in Content, e.g. VOLUME, SURFACE etc. * For meaning about color, threshold, channels, ... see the documentation for * Content. Default parameters are used for its attributes: * <ul> * <li>color: null * <li>name: title of the image * <li>threshold: the default threshold, as returned by * Content.getDefaultTreshold() * <li>channels: all color channels r, g, b * </ul> * * @param image the image to display * @param type the type which determines how the image is displayed. * @return The Content which is added, null if any error occurred. */ public Content addContent(final ImagePlus image, final int type, final int res) { final int thr = Content.getDefaultThreshold(image, type); return addContent(image, null, image.getTitle(), thr, new boolean[] { true, true, true }, res, type); }
/** * Add the specified image as a new Content to the universe. The specified * type is one of the constants defined in Content, e.g. VOLUME, SURFACE etc. * For meaning about color, threshold, channels, ... see the documentation for * Content. * * @param image the image to display * @param color the color in which the Content is displayed * @param name a name for the Content to be added * @param thresh a threshold * @param channels the color channels to display. * @param resf a resampling factor. * @param type the type which determines how the image is displayed. * @return The Content which is added, null if any error occurred. */ public Content addContent(final ImagePlus image, final Color3f color, final String name, final int thresh, final boolean[] channels, final int resf, final int type) { if (contents.containsKey(name)) { IJ.error("Content named '" + name + "' exists already"); return null; } final Content c = ContentCreator.createContent(name, image, type, resf, 0, color, thresh, channels); return addContent(c); }
public static void loadScene(final Image3DUniverse univ, final String path) throws IOException { final BufferedReader in = new BufferedReader(new FileReader(path)); final SaveSession sase = new SaveSession(); univ.removeAllContents(); final HashMap<String, String> view = sase.readView(in, univ); final boolean b = univ.getAutoAdjustView(); Content c = null; while ((c = sase.readContent(in)) != null) { // TODO c.setPointListDialog(univ.getPointListDialog()); univ.addContent(c); } in.close(); sase.apply(view, univ); }
/** * Add the specified image as a new Content to the universe. The specified * type is one of the constants defined in Content, e.g. VOLUME, SURFACE etc. * For meaning about color, threshold, channels, ... see the documentation for * Content. Default parameters are used for its attributes: * <ul> * <li>color: null * <li>name: title of the image * <li>threshold: the default threshold, as returned by * Content.getDefaultTreshold() * <li>channels: all color channels r, g, b * <li>resampling factor: the default resampling factor, as returned by * Content.getDefaultResamplingFactor()</li> * </ul> * * @param image the image to display * @param type the type which determines how the image is displayed. * @return The Content which is added, null if any error occurred. */ public Content addContent(final ImagePlus image, final int type) { final int res = Content.getDefaultResamplingFactor(image, type); final int thr = Content.getDefaultThreshold(image, type); return addContent(image, null, image.getTitle(), thr, new boolean[] { true, true, true }, res, type); }
private Content addC(final ImagePlus image, final File file) { final ContentCreatorDialog gui = new ContentCreatorDialog(); final Content c = gui.showDialog(univ, image, file); if (c == null) return null; univ.addContent(c); // record final String title = gui.getFile() != null ? gui.getFile().getAbsolutePath() : gui.getImage() .getTitle(); final boolean[] channels = gui.getChannels(); final String[] arg = new String[] { title, ColorTable.getColorName(gui.getColor()), gui.getName(), Integer.toString(gui.getThreshold()), Boolean.toString(channels[0]), Boolean.toString(channels[1]), Boolean.toString(channels[2]), Integer.toString(gui.getResamplingFactor()), Integer.toString(gui.getType()) }; record(ADD, arg); return c; }
public static void add(final String image, final String c, final String name, final String th, final String r, final String g, final String b, final String resamplingF, final String type) { final Image3DUniverse univ = getUniv(); final ImagePlus grey = WindowManager.getImage(image); final Color3f color = ColorTable.getColor(c); final int factor = getInt(resamplingF); final int thresh = getInt(th); final boolean[] channels = new boolean[] { getBoolean(r), getBoolean(g), getBoolean(b) }; final int ty = getInt(type); univ.addContent(grey, color, name, thresh, channels, factor, ty); }