I cannot refresh the display of remote files . How can I update the list ?
Reloading the remote files displayed in the Virtual File System Browser only upates
filess in the currently opened diectory.
In 'read Directory' mode, in order to reload the directory, you must use a
DOUBLE click to open it,and then press the 'Reload' button.
Why should I use the ShapeViewer instead of OpenDX ?
The ShapeViewer and OpenDX are designed for very different purposes.
OpenDX is a general pupose data visualization and processing toolkit;
ShapeViewer pupose is to display three dimensional shapes in a tool
with an easily used interface, that reads commonly used neurological file formats.
Additional features of ShapeViewer are:
- Reads LONI Ucf, Loni TM, Minc Obj, and GeomView OFF formats (OpenDX does not).
- Portability: the ShapeViewer application binaries are portable as-is. OpenDX requires different binaries for each type of computer.
- Immediately usable. OpenDX requires training, or that a pre-defined display program be supplied.
- Visual Whiteboard - a ShapeViewer display may be propagated to remote , client ShapeViewers.
OpenDX is capable and flexible general purpose toolkit that fulfils a different
usage niche than the ShapeViewer. If you wish to use it with the file formats
previously mentioned please see the ShapeTools application program ShapeToDX.
How may I use the ShapeViewer to display a surface in my Java program ?
The ShapeViewer may be launched from any Java program and used to
display a geometrical surface created by that program. The program
fragment (below) shows one way to construct a surface (IFaceSet) from
the vertices of that surface. A surface is considered to be composed
of one or more faces. Each face is composed of three or more edges. Edges
are a directed connection between two vertices.
In general, therefore, to construct a Shape that represents a surface mesh
you will need to know:
- The locations of the mesh vertices
- The edges of the mesh (e.g. an edge connects vertex 0 with vertex 3)
- The faces of the mesh (e.g. face #4 is composed of edges 4,5,23 - in that order).
These elements corrospond directly to the following classes in the ShapeTools library:
- IPointSet
- IEdgeSet
- IFaceSet
A Shape, then, is a collection of these classes. Shapes need not contain all these classes;
for example, a Shape may contain only points. However, because the classes refer to each
other - eg. an IFaceSet? refers to an IEdgeSet? which, in turn refers to an IPointSet? - a
Shape containing an IFaceSet? must also contain the associated edge and point sets.
All these components of a Shape - Shape, PointSet, EdgeSet and FaceSet - are
defined as Java interfaces. This allows specific implementations of these interfaces
to make different capability/performance tradeoffs.
It is common to define the faces of a mesh only by the an ordered set of vertices; the
edges in this case are implied by the order of the vertices listed as defining a face.
The CGALFaceSet and CGALEdgeSet classes may be used to
simplify construction of a mesh from the vertices of it's faces. Full documentation
is available from the ShapeToolsLibrary. For our purposes here it suffices to
know that - in this particular case only - we do not need to explicitly create
an instance of the edge set - that is done by the CGALFaceSet when it is instantiated.
You will, however, need to tell the Shape class which edge set to use. The example
below shows how to
- Create a set of arbitrarily distributed points (IrregularPointSet)
- Create the lists of which vertices define the faces of a pyramid
- Construct a CGALFaceSet from the points and face definitions
- Create a Shape from these components
- Use the ShapeViewer to display this Shape.
Note:
The ShapeTools library stores vertex coordinates as a 2d float
array whose 1d float array components store all vertices of a
spatial dimension. This is the transpose of how most people
think of a list of vertex coordinates. A different way to
say this is that all the X-coordinates of the vertices are
stored in on float [], all the Y-coordinates in a second float array,
and all the Z-coordinates in a third. These are then collected
as a single 2D array:
float [] x_coords = {0,1,2,3};
float [] y_coords = {0,1,0,1};
float [] z_coords = {0,0,0,0};
float [][] coords = {
x_coords,
y_coords,
z_coords
};
Please see the ShapeToolsLibrary documentation for more explanations and examples.
import edu.ucla.loni.ccb.shape.Shape;
import edu.ucla.loni.ccb.shape.ShapeImpl;
import edu.ucla.loni.ccb.shape.geometry.CGALFaceSet;
import edu.ucla.loni.ccb.shape.geometry.CoordinateArray;
import edu.ucla.loni.ccb.shape.geometry.IFaceSet;
import edu.ucla.loni.ccb.shape.geometry.IPointSet;
import edu.ucla.loni.ccb.shape.geometry.IrregularPointSet;
import edu.ucla.loni.ccb.shapeviewer.IShape;
import edu.ucla.loni.ccb.shapeviewer.ShapeViewer;
/*
* Create a Shape and instruct the ShapeViewer to
* display it.
*/
public static void main(String [] args)
{
// create Shape to hold points, edges, and faces
Shape shape = new ShapeImpl();
// define vertices of pyramid and form into a PointSet
float [][] vertices = {
{ 0.0f, 1.0f, 0.0f,-1.0f, 0.0f},
{-1.0f, 1.0f, 1.0f, 0.0f, 0.0f},
{ 0.5f, 0.5f, 0.5f, 0.5f, 0.0f}
};
CoordinateArray coords = new CoordinateArray(vertices);
IPointSet points = new IrregularPointSet(coords);
// define faces of pyramid by enumerating the vertex indices
int [][] verticesOfFaces = {
{0,1,2,3},
{2,1,4},
{2,4,3},
{4,3,0},
{0,4,1}
};
IFaceSet faces = new CGALFaceSet(points,verticesOfFaces);
// Attach components to Shape. Use a CGALFaceSet
// to enable defining the faces by a list of vertices
// composing each face. Note that in this special case
// the edge set is obtained from the CGALFaceSet.
// If other face set classes are used the IEdgeSet is
// created independently of the IFaceSet.
shape.setVertices(points);
shape.setEdges(faces.getEdges());
shape.setFaces(faces);
// display shape in viewer
IShape iShape = ShapeViewer.display(shape);
}
}
I cannot color the vertex attributes
I
The ColorMapLibrary, used by the ShapeViewer, has a simple color map which supports 3 element vector attributes.
Scalar color maps will use the average of the vector attribute components as the basis for mapping the
vector into a color.
I cannot display my CCBBM file vertex attributes
CCBBM supports per-vertex attributes with multiple values (the "rgb" attribute.
please see: "I cannot color the vertex attributes" in this FAQ listing
Can I run the ShapeViewer from within a command line script ?
You may give the ShapeViewer a list of files to load on the command line.
Be sure to allocate enough memory to the java JVM to display your shape.
For i=1:N
file1 = surface_01.obj
file2 = surface_02.obj
java -Xmx350m -jar ShapeViewer.jar -files file1 file2
Pause
Next
My UCF Surfaces are not shaded
Users of LONI UCF (Universal Contour File) files often use these file to store surface. Although the UCF is not
technically a surface file format, if all contours have the same number of vertices, these these contour may be
assumed to represent a surface, and the connections between the line inferred to form a quadrangular grid.
This dual interpretation of the UCF file format poses a difficulty for the ShapeViewer: should it treat the collection of
lines as a single connected surface, or a set of disjoint lines ? The UCF file format does not store the information needed
to resolve this ambiguity. Thus, the decsion of whether to display a file as lines, or as a surface, must be made by the
user of the ShapeViewer when the file is loaded.
To treat the UCF as a surface, check the [X] Load as Grid UCF checkbox that is found on the right hand side of the
file selection dialog box.
To set this value as a default setting, you may set this as a user preference in the Preferences dialog. This dialog is
displayed by selecting "Preferences" from the ShapeViewer File menu. This is useful when a file is loaded by dragging it's icon
onto the ShapeViewer display.
Setting the startup preference to display all UCF files as a grid, if possible.
Note: it is because of this intrinsic ambiguity that the ShapeTools group does not reccomend UCF as a file format.