• ShapeTools



The ShapeTools library is a collection of Java classes which enable Java programmers to model and manipulate geometric shapes and associated data values. Its purpose is to simplify the process of creating application programs by providing a ready-made set of support routines. Application programs typically devote a substantial amount of programming effort to 'support' functions not directly related to the purpose of the application. These functions include the definition of an internal data model, reading and writing data files - often in various formats, checks for data model consistency, and so on. The ShapeTools library aims to provide many of these needed functions to the application programmer, thereby freeing them to concentrate on what is unique to the tool being created.


  • File format readers that implement ShapeIO interface (modeled after Java ImageIO) are automatically used when appropriate.
  • Storage of additional metadata of arbitrary type (other than shape vertices and interconnections) is enabled by the use of data attributes.
  • Shapes may contain a set of child shapes allowing for the construction and manipulation of complex hierarchies of shapes.
  • The various components of a shape are specified as interfaces with specific implementations, making it easy to create specialized implementations of a shape component when different performance characteristics are required.
  • All ShapeTools functions may be used by Matlab (v6 or greater) users. This allows Matlab users access to all the file formats supported by ShapeTools without having to write Matlab-specific code modules read the file formats. We are also working on provding similiar capabilities to other commonly used computational toolkits.
  • Because ShapeTools is written in java, real world portability to many computer architectures is assured. At present, ShapeTools are tested on Linux, Windows, Mac OS, Irix, and Sun computers without need of architecture specific libraries. This greatly extends the range of computers on which a ShapeTools based application can run without modification.
  • The authors of JSpline+ have licensed inclusion of their powerful java spline library. JSpline+ supports fast spline interpolations of abitrary degree polynomials and sparse matrix computations.
  • ShapeTools includes commonly used computational geometry functions. This include finding the intersection of a line with plane and other similiar tasks. Algorithms developed by mathematical researchers are added to the library at regular intervals. This continuing enrichment of the library extends the capacities of application programmers who make use of ShapeTools.


The ShapeTools library provides a large number of support functions to a Java geometry tool application programmer. The data model is both simple and robust (points, edges and faces) and will model any shape of topological genus 0.

The implementation of the various portions of the data model may be easily extended to allow special purpose, high performance versions of the more generic data model elements.

Extensive documention is provided. Every method of every public class is described. Special cases and assumptions are noted. Many examples of application programs - ranging from trivial examples to complete production-ready code - are provided. User guides for areas of particular interest (i.e. LONI Ucf Files) are available.

Several file formats are supported; as more are added to the core library, applications built on ShapeTools gain access to these file formats without requiring the application programmers to rewrite their applications.

ShapeDistance will run on any computer that supports Java v1.4.1 (or greater).



Portable Java library jar makes library compilation unnecessary.

Installation Instructions

Copy java libary 'jar' file to local disk. Add this jar file to your java program class path.
Example: javac -classpath .:ShapeTools.jar

Grants & Acknowledgments

NIH-NCRR 9P41EB015922-15 and 2-P41-RR-013642-15
NIH-NCRR U54 RR021813


Cortical sulcal atlas construction using a diffeomorphic mapping approach.
Joshi SH; Cabeen RP; Sun B; Joshi AA; Gutman B; Zamanyan A; Chakrapani S; Dinov I; Woods RP; Toga AW;
Medical image computing and computer-assisted intervention : MICCAI ... International Conference on Medical Image Computing and Computer-Assisted Intervention. 2010-Dec;13(357-66):Pt 1
PMID: 20879251    DOI: 10.1109/CVPR.2010.5540177   
Diffeomorphic Sulcal Shape Analysis for Cortical Surface Registration.
Joshi SH; Cabeen RP; Joshi AA; Woods RP; Narr KL; Toga AW;
Proceedings / CVPR, IEEE Computer Society Conference on Computer Vision and Pattern Recognition. IEEE Computer Society Conference on Computer Vision and Pattern Recognition. 2010-Jun-1;13-18 June(475-482)
PMID: 21076690    DOI: 10.1109/CVPR.2010.5540177   
Diffeomorphic sulcal shape analysis on the cortex.
Joshi SH; Cabeen RP; Joshi AA; Sun B; Dinov I; Narr KL; Toga AW; Woods RP;
IEEE transactions on medical imaging. 2012-Jun;31(1195-212):6
PMID: 22328177    DOI: 10.1109/TMI.2012.2186975   
Statistical shape analysis of the corpus callosum in Schizophrenia.
Joshi SH; Narr KL; Philips OR; Nuechterlein KH; Asarnow RF; Toga AW; Woods RP;
NeuroImage. 2013-Jan-1;64(547-59)
PMID: 23000788    DOI: 10.1016/j.neuroimage.2012.09.024    PMCID: NIHMS408986