Libcurvecollection

From VrlWiki
Revision as of 21:11, 14 June 2010 by Nathan Malkin (talk | contribs)
Jump to navigation Jump to search
This page is incomplete and currently under development.

The Curve Collection Library (libcurvecollection) provides a representation streamlines/curves in memory and an interface to access this information in a convenient but memory-safe manner. It can also read and write to disk, freely converting between several file formats.

Currently, the supported formats are:


Introduction

Tubegen represents streamlines/tubes in several different formats in memory and on disk, which are distinct from the representations used by well-established third parties, for example FSL, Camino, and DTK. The core of any representation, though, is quite simple: a collection of streamlines, in which each streamline is just an ordered list of vertex points in 3-space. The tricky bit is that we want to be able to associate scalars with these datasets at many levels:

  • the whole collection (for example, the average length of the streamlines)
  • each individual streamline (ex: the length of the streamline)
  • each vertex point of each streamline (ex: the interpolated FA value at that point)

Some of the data formats also include a description (i.e., a string) for each scalar value.

libcurvecollection provides a unified interface for handling these various formats, while simplifying access to the information in memory by presenting it in a object-oriented fashion.

Structure

The library consists of three mutually dependent components, each with a header (.h) and a .cpp file:

  1. CurveVertex
  2. Curve
  3. CurveCollection

CurveVertex

A CurveVertex represents a point in 3D space. It holds the point's coordinates and any metadata (in the form of doubles) that the point may have.

Constructors

CurveVertex(double, double, double)
The main constructor takes three doubles: the x, y, and z coordinates of the point.

CurveVertex(CurveVertex const & v)
A vertex instantiated using a copy constructor will have the same coordinates and properties as the source, but will not belong to any Curve. Thus, the properties can only be accessed by calling property(int) (and not property(string)).


Curve

CurveCollection