S7 Data Structures for Diffusion MRI Tractography
Overview
Provides three S7 classes — streamline, bundle, and bundle_set — for representing diffusion MRI tractography data in R, together with a concise set of methods for computing shape descriptors (arc-length, curvature, torsion, sinuosity), the Hausdorff distance between streamlines, arc-length reparametrization of streamlines and bundles onto uniform grids, combination of streamlines or bundles into a single bundle, combination of bundles from multiple subjects or sessions into a bundle_set, and coercion to and from the dwiFiber S4 class of the 'dti' package. See Dell'Acqua, F., Descoteaux, M. and Leemans, A. (2024) "Handbook of Diffusion MR Tractography" doi:10.1016/C2018-0-02520-7 for more about the mathematical and computational underpinnings of diffusion MRI tractography.
Breaking changes
streamline:@point_dataholds **numeric-only** attributes (e.g. fractional anisotropy).bundle:@bundle_datais now restricted to named lists of **scalars** (length-1 values, any type). Previously arbitrary R objects were accepted. Non-scalar values (e.g. affine matrices stored as a single@bundle_dataentry) must be split into individual scalar entries or moved elsewhere.bundle_set:@set_datais now restricted to named lists of **scalars** (length-1 values, any type), consistent with@bundle_dataat the bundle level.
Improvements
format()andprint()methods forstreamline,bundle, andbundle_setnow use {cli} for styled, ANSI-aware console output. Unknown shape descriptors passed toadd_shape_descriptors()now emit structuredcli::cli_warn()messages instead of base-R warnings.
Show all changes in 0.2.0Hide the rest of the changes in 0.2.0
New features
bundlegains a@streamline_dataslot — a named list of vectors of length $S$ (one entry per streamline) — for per-streamline attributes aggregated at the bundle level.add_shape_descriptors()now stores scalar descriptors (euclidean_length,curvilinear_length,sinuosity) directly inbundle@streamline_datarather than in each individual streamline.bundle_setgains a@bundle_dataslot — a named list of vectors of length $B$ (one entry per bundle) — for per-bundle attributes aggregated at the set level.- **Automatic attribute lifting**: when constructing a
bundle, any@streamline_datakey present in *all* supplied streamlines is automatically copied intobundle@streamline_dataas a length-$S$ vector. The same happens one level up: common@bundle_datakeys are lifted intobundle_set@bundle_datawhen constructing abundle_set. Individual child slots are dropped; parent-level values take precedence on conflict. - **Subsetting push-down**:
bundle[[i]]now pushes the correspondingbundle@streamline_datavalues back into the extracted streamlines'@streamline_data. Likewisebundle_set[[i]]and pushesbundle_set@bundle_datavalues into the extracted bundles'@bundle_data. bundle_set:@bundlesno longer needs to be a named list. Names are used to populate a bundle attribute vector calledid_from_input_listand names are then dropped from the input list.bundle()constructor gains astreamline_dataargument for supplying per-streamline data explicitly (overrides automatic lifting).bind_bundles()gains astreamline_dataargument.bind_bundle_sets()gains abundle_dataargument. Barebundlearguments no longer need to be named.as_bundle_set()method forbundle: thenameargument is now optional (defaultNULL); omitting it creates an unnamed single-elementbundle_set.
From NEWS.md in the release
Install
Health
NOTERd contentsr-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc
Rd files without \usage: ‘add_shape_descriptors-fiber-bundle-method.Rd’ ‘add_shape_descriptors-fiber-streamline-method.Rd’ ‘as_bundle-fiber-bundle-method.Rd’ ‘as_bundle-fiber-streamline-method.Rd’ ‘as_dwifiber-fiber-bundle-method.Rd’ ‘as_dwifiber-fiber-streamline-method.Rd’ ‘as_streamline-fiber-bundle-method.Rd’ ‘as_streamline-fiber-streamline-method.Rd’ ‘compute_hausdorff_distance-fiber-bundle-method.Rd’ ‘compute_hausdorff_distance-fiber-streamline-method.Rd’ ‘reparametrize-fiber-bundle-method.Rd’ ‘reparametrize-fiber-streamline-method.Rd’ \arguments should not be documented without \usage.
- NOTE11 OK, 2 NOTENow
- NOTE12 OK, 1 NOTE2026-07-11
- OK5 OK2026-05-31
Documentation
- Help pages
- 34 (1 internal)includes a package overview page
- Examples that run
- 100%24 run in a plain check (1 of them under a condition)
- Exported functions with examples
- 100%
- Documented parameters
- 98%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 16
- Median days to close, 50 most recently updated closed PRs
- 0
12 development-tooling and community-health practices detected across 6 families in the upstream repository
Checks run against github.com/tractoverse/fiber on 2026-10-18.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-07-13 · The repository has a site deploy workflow
pkgdown site last built 2026-07-13
Show all practicesHide 2 practices
Dependencies
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 0.2.0Latest
- 0.1.22026-05-30
- RR 4.6.0 released · 2026-04-24
Package metadata
- First published
- 2026-05-30
- Total releases
- 2 / 1 yrs
- License
- MIT + file LICENSE OSI
- Download size
- 601 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("fiber")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.