Package Specification

The customnode package aims to provide classes which facilitate to add new (custom) 3D objects to the viewer.

If you only want to display some basic shapes

In addition to the classes provided by this package, you may consider to use the helper methods of ij3d.Image3DUniverse, which are in particular:

The first three methods are intended to add a 3D object which displays an ImagePlus - either as volume rendering, orthoslice or as isosurface. The next two methods, addLineMesh and addTriangleMesh are for displaying custom meshes, whose vertices are given in a list. (Refer to the documentation of these methods for more detail).

More advanced meshes

For this purpose, ImageJ3DUniverse has the method {@link ij3d.Image3DUniverse#addCustomMesh Image3DUniverse.addCustomMesh(CustomMesh)}. CustomMesh is an abstract base class, which is extended by Each of these methods take a list of Point3f, which specify the corresponding mesh. To facilitate the mesh creation of some basic shapes, {@link customnode.Mesh_Maker MeshMaker} offers a few static methods:

For total freedom about what to display

If you need total freedom about what you display and how you display it, there is a simple recipe for doing so:
First, create a new Content:
	Content content = new Content("My example Content");
	content.color = new Color3f(1, 0, 0);
	content.showCoordinateSystem(false);

Then, create your own class, and let it extend {@link ij3d.ContentNode ContentNode}. A ContentNode is the displayed unit of a Content, the actual 3D object. It belongs to a Content, and gets informed by this Content when the color, transparency, etc of the Content was updated. To enable this mechanism, your class has to implement the abstract methods of ContentNode. If you are looking for an example, have a look at {@link customnode.CustomMeshNode CustomMeshNode}. Now, display the content:
	Image3DUniverse universe = new Image3DUniverse(512, 512);
	content.display(myContentNode);
	universe.addContent(content);