Libcurvecollection: Difference between revisions
New page: <span style="color:red">{{infobox|This page is incomplete and currently under development.}}</span> The '''Curve Collection Library''' ('''<tt>libcurvecollection</tt>''') provides a repre... |
No edit summary |
||
| Line 11: | Line 11: | ||
==Introduction== | ==Introduction== | ||
<!-- From: Job_Jar/Streamline_library --> | <!-- From: Job_Jar/Streamline_library --> | ||
[[Tubegen]] represents streamlines/tubes in several different formats in memory and on disk, | [[Tubegen]] represents streamlines/tubes in several different formats in memory and on disk, which are distinct from the representations used by well-established [[3rd Party Diffusion MRI Software|third parties]], for example [http://www.fmrib.ox.ac.uk/fsl/ FSL], [http://www.cs.ucl.ac.uk/research/medic/camino/ Camino], and [http://www.trackvis.org/ 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) | * the whole collection (for example, the average length of the streamlines) | ||
* each individual streamline (ex: the length of the streamline) | * each individual streamline (ex: the length of the streamline) | ||
* each segment of each streamline (ex: distance to the nearest segment; color values related to the orientation of the segment) | <!-- | ||
* each segment of each streamline (ex: distance to the nearest segment; color values related to the orientation of the segment)--> | |||
* each vertex point of each streamline (ex: the interpolated FA value at that point) | * each vertex point of each streamline (ex: the interpolated FA value at that point) | ||
| Line 20: | Line 21: | ||
<tt>libcurvecollection</tt> 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. | <tt>libcurvecollection</tt> 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== | ==Structure== | ||
| Line 29: | Line 29: | ||
==CurveVertex== | ==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=== | |||
<code>CurveVertex(double, double, double)</code><br /> | |||
The main constructor takes three doubles: the x, y, and z coordinates of the point. | |||
<code>CurveVertex(CurveVertex const & v)</code><br /> | |||
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 <code>property(int)</code> (and not <code>property(string)</code>). | |||
==Curve== | ==Curve== | ||
==CurveCollection== | ==CurveCollection== | ||
Revision as of 21:11, 14 June 2010
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:
- DTK/TrackVis
- Tubegen's custom format (.data and .nocr files)
- CCF
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:
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)).