Abstract
We present a Python library (Phybers) for analyzing brain tractography data. Tractography datasets contain streamlines (also called fibers) composed of 3D points representing the main white matter pathways. Several algorithms have been proposed to analyze this data, including clustering, segmentation, and visualization methods. The manipulation of tractography data is not straightforward due to the geometrical complexity of the streamlines, the file format, and the size of the datasets, which may contain millions of fibers. Hence, we collected and structured state-of-the-art methods for the analysis of tractography and packed them into a Python library, to integrate and share tools for tractography analysis. Due to the high computational requirements, the most demanding modules were implemented in C/C++. Available functions include brain Bundle Segmentation (FiberSeg), Hierarchical Fiber Clustering (HClust), Fast Fiber Clustering (FFClust), normalization to a reference coordinate system, fiber sampling, calculation of intersection between sets of brain fibers, tools for cluster filtering, calculation of measures from clusters, and fiber visualization. The library tools were structured into four principal modules: Segmentation, Clustering, Utils, and Visualization (Fibervis). Phybers is freely available on a GitHub repository under the GNU public license for non-commercial use and open-source development, which provides sample data and extensive documentation. In addition, the library can be easily installed on both Windows and Ubuntu operating systems through the pip library.
1 Introduction
Structural brain connectivity can be studied using Diffusion Magnetic Resonance Imaging (dMRI), (Le Bihan and Breton, ). This is a non-invasive, in vivo technique that provides microscopic-scale information on brain white matter (WM) by measuring the movement of water molecules in brain tissues. Using diffusion local model reconstruction (Basser et al., ; Tuch, ; Wedeen et al., ; Tournier et al., ; Yeh et al., ; Fick et al., ) and tractography algorithms on dMRI data (Basser et al., ; Malcolm et al., ; Smith et al., ; Tournier et al., ; Wasserthal et al., ), it is possible to calculate the main trajectory of 3-dimensional (3D) WM fascicles as a set of 3D polylines. These sets of streamlines, for simplicity, are also known as “fibers” even though they do not represent single axons.
Over the years, the tools for analyzing tractography datasets have evolved along with improvements in MRI equipment and reconstruction, and tractography algorithms. Today, brain tractography data are quite complex, containing long and short fibers, as well as noise, and intricate geometrical configurations. In addition, these datasets can contain several million fibers for probabilistic tractography, yielding additional computational requirements, especially when performing multi-subject analysis. This is why there are numerous tractography data analysis algorithms that seek to cluster (O'Donnell et al., ; Garyfallidis et al., ; Siless et al., ; Vázquez et al., ; Chen et al., ), identify patterns (Guevara et al., , ; Kumar and Desrosiers, ; Román et al., ), segment (Donnell and Westin, ; Wassermann et al., ; Labra et al., ; Garyfallidis et al., ; Wasserthal et al., ; Zhang et al., ; Vindas et al., ), filter (Garyfallidis et al., ; Mendoza et al., ), visualize (Wang et al., ; Riviére et al., ; Garyfallidis et al., ; Chamberland et al., ; Norton et al., ; Tournier et al., ; Zhang et al., ; Franke et al., ), and calculate measures on these data (Yeh et al., ; Garyfallidis et al., ). Due to the complexity of tractography data, the algorithms are usually difficult to use and require a deep understanding of the file formats, input parameters, and results. Hence, to simplify and promote its use, several groups have created and distributed software packages for the processing of dMRI images. Such tools include algorithms for different stages of the dMRI processing pipeline, from image distortion correction to tractography analysis. The final goal is to have methods for the processing of tractography data, for a better description of WM fibers based on high-quality data (Zhang et al., ; Radwan et al., ; Román et al., ) and the study of WM microstructure on healthy subjects (Lebel et al., ; Li et al., ; Schilling et al., ; Zekelman et al., ) and pathological brains (O'Donnell et al., ; Zhao et al., ; Goldsmith et al., ; Mito et al., ; Roy et al., ; Buyukturkoglu et al., ).
There are a wide variety of tools available for the processing of dMRI data. Tables 1, 2 summarize and describe the main software packages used by the medical imaging research community. The table lists the main features and functionalities of the tools, such as programming language, operating system (OS), distribution license, dMRI format, tractography format, diffusion-weighted (DW) model reconstruction, fiber tracking, fiber clustering, bundle segmentation, visualization, and calculation of fiber measures. The software considered are: BrainSUITE (Shattuck and Leahy, ), Camino (Cook et al., ), Diffusion toolkit (Wang et al., ), ExploreDTI (Leemans et al., ), FSL (Smith et al., ; Woolrich et al., ; Jenkinson et al., ), MRtrix (Tournier et al., ), Freesurfer (Fischl, ), DSI Studio (Yeh et al., ), Dipy (Garyfallidis et al., ), DiffusionKit (Xie et al., ), and SlicerDMRI (Norton et al., ; Zhang et al., ).
Table 1
| Software | Lenguaje | OS | Distribution license | dMRI format | Tractography format |
|---|---|---|---|---|---|
| BrainSUITE | C++, Matlab | Multi. | Open-source | DICOM, NIfTI, Analyze | TRK |
| Camino | Java | Linux MacOs | Open-source | DICOM, NIfTI | VTK |
| Diffusion toolkit | C++ | Multi. | Open-source | DICOM, NIfTI, Analyze | TRK |
| ExploreDTI | Matlab | Multi. | Non-commercial package | DICOM, NIfTI Analyze, Matlab formats | MAT |
| FSL | C++/Unix | Linux MacOs Windows | Non-commercial package | NIfTI | NIfTI |
| MRtrix | C++, OpenGL | Linux MacOs | open-source | DICOM, Analize NIfTI, MGH MRtrix formats | TCK |
| FreeSurfer | C/C++, Python, Matlab | Linux | Open-source | DICOM, Analyze NIfTI, MINC | - |
| DSI Studio | C++ | Multi. | Open-source | DICOM, NIfTI | TRK |
| Dipy | Pyhton, Cython | Multi. | Open-source | Analyze, NIfTI, DICOM | TCK, TRK |
| DiffusionKit | C/C++ | Windows Linux | Freely available | DICOM, NIfTI | TRK |
| SlicerDMRI | C++, Python | Multi. | Open-source | DICOM, Analyze, NIfTI, nrrd/nhdr | VTK |
Summary of the main software used for the study of dMRIs.
The order of the columns is as follows: Software, Lenguaje, OS, Distribution License, dMRI Format, and Tractography Format. OpenGL, Open graphics library; Multi., Multiplatform; NIfTI, Neuroimaging informatics technology initiative; DICOM, Digital imaging and communications in Medicine; MGH, FreeSurfer format; MINC, FreeSurfer format; VTK, Visualization ToolKit; TRK, Track File; Analyze, Image data format; TCK, Tracks file format; and MAT, Matlab file.
Table 2
| Software | DW Model Reconst. | Fiber Track. | Fiber Clustering | Bundle Segment. | Visual-ization | Fiber Measur. |
|---|---|---|---|---|---|---|
| BrainSUITE | DTI | Det. | - | - | Slice/Volume, DW model, tractography | - |
| Camino | DTI/ multifiber HARDI, QBall, PASMRI | Det. Prob. | - | - | Slice/Volume, DW model, tractography | - |
| Diffusion toolkit | DTI, DSI, QBI | Det. | - | - | Uses TrackVis | - |
| ExploreDTI | DTI, QBI, CSD | Det. Prob. | - | Using ROIs | Slice/Volume, DW model, tractography | Mean length |
| FSL | DTI | Prob. | - | - | Slice/Volume, Meshes | - |
| MRtrix | DTI, Single-tissue CSD, Multi-tissue CSD | Det. Prob. | - | - | Slice/Volume, DW model, tractography | - |
| FreeSurfer | TRACULA | Prob. | Anato-micCuts | TRACULA | Slice/Volume, Meshes | - |
| DSI Studio | DTI, DSI, QBI | Det. | - | Using ROIs | Slice/Volume, DW model, Tractography, Meshes | Count, mean length |
| Dipy | DTI, DSI, QBI, CSD | Det. Prob. | Quick-Bundles | Reco- | ||
| Bundles | Slice/Volume, DW model, Tractography, Meshes | Count, mean length | ||||
| DiffusionKit | DTI, CSD, dec. -based SPFI | Det. | - | - | Slice/Volume, DW model, Tractography | - |
| SlicerDMRI | DTI, Multi-tensor UKF | Det. | - | Using ROIs | Slice/Volume, DW model, Tractography | Points numbers, count, mean length |
Summary of the main software used for the study of dMRIs.
The order of the columns is as follows: Software, DW (diffusion-weighted) Model Reconstruction, Fiber Tracking, Fiber Clustering, Bundle Segmentation, Visualization, and Fiber Measures. DTI, Diffusion tensor imaging; HARDI, High angular resolution diffusion Imaging; DSI, Diffusion spectrum imaging; QBI, Q-Ball imaging; CSD, Constrained spherical deconvolution; SPFI, Spherical polar Fourier imaging; TRACULA, TRActs Constrained by UnderLying Anatomy; Det., Deterministic; Prob., Probabilistic; ROIs, Regions of interest; QuickBundles, (Garyfallidis et al., ); AnatomicCuts, (Siless et al., ) RecoBundles (Garyfallidis et al., ); DW, Diffusion weighted; and UKF, unscented Kalman filter (Malcolm et al., ).
As shown in Tables 1, 2, the tool packages have different functionalities. Some of them are more focused on dMRI pre-processing, model reconstruction, and tractography, and others include fiber tractography analysis methods. It is common for users to employ more than one software to implement their processing pipeline, where special attention should be paid to file formats, the reference coordinate system (Tournier et al., ), and the common 3D space, when required. Of course, no tool contains all the existing algorithms, although there are some fairly comprehensive ones.
There are fewer software packages dedicated to analyzing tractography data, such as fiber clustering and segmentation, as well as filtering fiber clusters. Hence, we present a toolkit for the analysis of brain tractography data. The package combines several tools for tractography analysis that are available in the literature, developed by our group. These include the optimized fiber bundle segmentation algorithm using a brain fiber atlas (Guevara et al., ; Labra et al., ; Vázquez et al., ), the hierarchical fiber clustering (Román et al., , ) and Fast Fiber Clustering (FFClust) based on K-Means (Vázquez et al., ). These tools are difficult to apply for external users due to the lack of unified code, the multiplicity of programming languages, the plurality of library dependencies, and the lack of example code/data and documentation. To overcome these issues, we developed an open-source library, called Phybers, that integrates all these algorithms, along with other fiber cluster analysis and visualization tools.
The algorithms included in the library were implemented in C/C++ and Python 3.9. It was structured into four modules: Segmentation, Clustering, Utils, and Visualization. The library was implemented in Python to efficiently provide easy manipulation of data and input parameters, to users without computer science background. Also, Python allows better interoperability with software such as the Dipy package (Garyfallidis et al., ). The library includes several internal functions written in C/C++ to reduce the execution time of computationally intensive calculations, such as Euclidean distances between pairs of fibers, which are accessible through Cython. Phybers is freely available and provides the documentation and test data for its execution.
2 Materials and methods
Phybers contains four modules that include algorithms for different pre-processing stages. The suite of Utils contains tools for pre-processing the tractography data prior to fiber segmentation or clustering, such as the transformation of fibers (bundles format) to another space using a deformation field (NIfTI format). The analysis modules include a fiber bundle segmentation algorithm based on a brain fiber bundle atlas (Guevara et al., ; Labra et al., ; Vázquez et al., ), and two clustering algorithms, Fast Fiber Clustering (FFClust) (Vázquez et al., ) and Hierarchical Clustering (HClust) (Román et al., , ). Also, a set of post-processing tools is provided for the analysis of the results of the fiber bundle segmentation and fiber clustering algorithms (bundles format). The Visualization module supports different types of data such as volume (NIfTI), mesh (mesh and GIfTI formats), and fibers (TRK, TCK, and bundles). In addition, it integrates an interactive graphical user interface (GUI) that allows the user to manipulate 3D objects in real-time. For example, manual segmentation of brain fibers can be performed by positioning two or more 3D regions.
Phybers was developed in Python to distribute and update in a PyPI repository. We implemented the algorithms in C/C++ and Python 3.9, which used Python dependencies such as numpy (Harris et al., ), nibabel, pandas, and subprocess. However, all dependencies are automatically installed with the package. Library installation can be performed using the command $ pip install phybers, and the software distribution includes sample data with code examples for all supported functionalities. Phybers is compatible with Python versions higher than Python 3.9 and supports Python platforms such as Jupyter Notebook and Spyder, providing greater flexibility to cater to the specific needs of each user. Additionally, it functions seamlessly on both Ubuntu and Windows systems and can also be utilized on macOS via a virtual machine. Finally, the library documentation was generated with Sphinx. Phybers library was structured into four modules (Figure 1) defined as Segmentation, Clustering, Utils, and Visualization. The following sections describe the library modules.
Figure 1
The data used to showcase the examples correspond to a random subject from the HCP database (Glasser et al., ). Specifically, preprocessed diffusion images (“data.nii.gz”) and deformations to the MNI (Montreal Neurological Institute) space (“acpc_dc2standard.nii”) were utilized. Deterministic tractography calculations were performed using DSI Studio software (Yeh et al., ) with GQI model reconstruction. Two datasets of brain tractography were calculated. The first dataset was generated using the following fiber tracking parameters: angular threshold = 60°, step size = 0.5 mm, smoothing = 0.5, minimum length = 30 mm, maximum length = 300 mm, and a tract count of 1.5 million fibers. The second brain tractography dataset was obtained by placing ROIs, in this case, using the postcentral region from the FreeSurfer Aseg Atlas (Fischl et al., ), with the same fiber tracking parameters, except for the minimum length = 90 mm, maximum length = 130 mm, and a tract count of 4,000 fibers.
2.1 Data structure and format
2.1.1 Tractography datasets
Brain tractography datasets are sets of 3D polylines, also called streamlines or fibers. A tractography file contains arrays with the coordinates of the fiber 3D points and may include other metadata, such as an affine transformation. These files can be read in Python through different libraries, depending on the file format, as a list of numpy arrays. The most commonly used formats are TRK, TCK and bundles. In the proposed library, we use the bundles format. Several functions are provided to read and write fibers in this format. The advantage of bundles format is the support of the labeling of bundles, i.e., a single file can contain several bundles or clusters, reducing the computational cost for reading/writing and visualization. This format uses two files: the text metadata file .bundles that contains the bundle labels, and the binary .bundlesdata file, which contains the 3D coordinates of the fiber points. Using available readers and writers of other formats, it is possible to convert fiber tractography datasets from different formats. Therefore, we included a source code in the Phybers documentation that enables the conversion of brain tractography dataset from the TRK format (used by TrackVis and DSI Studio, among others) to the bundles format. Additionally, this code facilitates the conversion of TCK format (used by MRtrix and others) to the bundles format. We also shared source code for converting from bundles format to TRK and TCK formats. More information and access to these codes can be found in the Phybers documentation.
2.1.2 MRI
MRI volumes are 3D arrays, which can be read in Python as a 3-dimensional numpy array. The most commonly used formats are NIfTI, Analyze, and DICOM. In the proposed library, the NIfTI format is used to read MRI images.
2.1.3 Mesh
Meshes are geometric surface objects, that can be read in Python as an array of vertices and an array of triangles (vertex indices). The most commonly used formats are GIfTI and mesh. The proposed library uses the GIfTI and mesh formats for the meshes.
2.2 Library hierarchy
2.2.1 Segmentation module
This module includes a white matter fiber bundle segmentation algorithm (Guevara et al., ; Labra et al., ; Vázquez et al., ) based on a multi-subject atlas (Figure 2). The method uses as a measure of similarity between pairs of fibers the maximum Euclidean distance between corresponding points (dME), defined as:
Figure 2
Where ai and bi represent the 3D coordinates of the points in fibers A and B, respectively, both having an equal number of points (Np), listed in direct order. Here the points of fiber A are sequentially traversed as ai = [a1, a2, …, aNp], and those of B are similarly defined as bi = [b1, b2, …, bNp]. Therefore, the reverse order of fiber B is expressed as bNp−i = [bNp, bNp−1, …, b1].
The original version was written in Python and presented in Guevara et al. (). It aims at classifying the subject fibers according to a multi-subject bundle atlas. The bundle atlas consists of a set of representative bundles and additional information. The fibers of the atlas bundles are called centroids. We include one atlas of deep white matter (DWM) bundles (Guevara et al., ) and two atlases of superficial white matter (SWM) bundles (Román et al., , ). These atlases are located in the MNI space (aligned with “ICBM 2009a Nonlinear Symmetric” template) and are available for download from the Phybers github repository. We have also tested the algorithm using the DWM and SWM bundle atlas of Zhang et al. ().
The fibers of each subject are classified using a maximum dME distance threshold for each bundle between the subject's fibers and the atlas centroids. The fibers are labeled with the closest atlas bundle, given that the distance is smaller than the distance threshold (in mm). The algorithm was progressively improved first by Labra et al. () that developed a fast fiber discarding algorithm in C language. Then, it was optimized by Vázquez et al. () using a C++ parallel implementation.
The white matter fiber bundle segmentation algorithm based on a multi-subject atlas included in Phybers is called FiberSeg (Figure 2A1) and is based on the implementation by Vázquez et al. (). Among the noteworthy enhancements is that this algorithm is compatible with both Ubuntu and Windows, unlike the previous version that only supported Ubuntu. New functionalities have been added, allowing for the extraction of bundle centroids and indices of original fibers per bundle. This addition proves beneficial for fiber bundle segmentation on the subject space and facilitates the calculation of diffusion tensor-derived measures (Basser et al., ) (FA, MD, AD, RD). In this version, the algorithm accepts fibers with a variable number of points, unlike the previous version that fixed the point count at 21 for input data. Furthermore, the data structure has been improved, enabling the loading of larger input tractography datasets and brain fiber atlases. Overall, enhanced data structures have been defined to optimize memory usage.
The implementation of FiberSeg in the Segmentation module of Phybers has the following inputs (Figure 2):
file_in: the whole-brain tractography dataset file of a subject. The fibers must be in the same reference system as the used bundle atlas and be in bundles format.
subj_name: subject name, used to label the results.
atlas_dir: the bundle atlas folder, with bundles in separate files, sampled at 21 equidistant points.
atlas_info: a text file associated to the used atlas, that stores information needed to apply the segmentation algorithm, i.e., a list of the atlas fascicles, containing the name, the segmentation threshold (in mm) and the size of each fascicle. Note that the segmentation threshold can be adjusted depending on the database to be used.
dir_out: the directory name to store all the results generated by the algorithm.
FiberSeg outputs are:
final_bundles: the directory with the segmented fibers, i.e., the atlas fascicles extracted from the subject's tractography dataset, which are labeled and saved in separate files in bundles format.
centroids: a directory that contains the centroid of each segmented fascicle, saved in a single file in bundles format.
bundles_id: a text file containing, for each segmented bundle, the indexes of the fibers in the subject's tractography dataset file.
Figure 3 displays the results of the bundle segmentation using the DWM bundle atlas Guevara et al. () for a subject from the HCP database. The segmented bundles shown are Thalamic radiations (B), Corpus callosum segments (C), Arcuate fasciculus (D), Cingulum fibers (E), Inferior longitudinal fasciculus, Inferior fronto-occipital fasciculus, Uncinate fasciculus, Corticospinal tract, and Fornix (F). Figure 4 shows the segmentation results using a SWM bundle atlas (Román et al., ). This atlas comprises 93 fascicles, labeled based on anatomical ROIs extracted from the Desikan-Killiany atlas (Desikan et al., ). Four groups of short association fiber bundles are presented in more detail: Caudal middle frontal (B), Rostral middle frontal (C), Lateral occipital (D), and Supramarginal (E) bundles.
Figure 3
Figure 4

Bundle segmentation results for a subject using the SWM bundle atlas (Román et al.,
2.2.2 Clustering module
2.2.2.1 HClust sub-module
HClust (Hierarchical Clustering) (Román et al.,
Where dij is the distance between the elements i and j, and σ is a parameter that defines the similarity scale in mm.
From the affinity graph, the hierarchical tree is generated using an agglomerative average-link hierarchical clustering algorithm. The tree is adaptively partitioned using an intra-cluster distance threshold (partition_thr) in mm.
The version of the Hierarchical Clustering developed in Phybers is based on the work of Román et al. (
The inputs of HClust are the following (Figure 5B1):
file_in: the input tractography data file.
dir_out: the directory to store all the results generated by the algorithm.
fiber_thr: a maximum distance threshold (in mm), default 30mm.
partition_thr: an adaptive partition threshold (in mm), default 40 mm.
variance: a similarity scale (in mm), default 60 mm.
Figure 5

Diagram representing the Clustering module. (B1) Describes the HClust algorithm. On the left is represented the input data, which includes the brain fibers to be clustered (file_in), the result directory for saving the outputs (dir_out), the maximum distance threshold (fiber_thr, in mm), the threshold for dendrogram partitioning (partition_thr, in mm), and variance is measured on a similarity scale in mm. On the right are the output folders, which include the obtained fiber clusters, the centroids of the clusters, the index of the fibers of each cluster, and the temporal directory with intermediate results. (B2) Describes the FFClust algorithm. On the left is represented the input data, including the brain fibers to be clustered (file_in), the result directory for saving the outputs (dir_out), the numbers of fiber points to be used in the clustering (points), the number of clusters used by Minibatch K-Means for each chosen fiber point (ks), the threshold distance for reassigning points to a cluster (assign_thr, in mm), and the threshold distance for merging clusters (join_thr, in mm). On the right are the output folders, which include the obtained fiber clusters, the centroids of the clusters, the index of the fibers of each cluster, and the temporal directory with intermediate results.
HClust outputs are:
final_bundles: the directory that stores all the generated fiber clusters that are labeled with the cluster number and saved in separate files in bundles format.
centroids: a directory that contains the centroids for each created cluster, saved in a single file in bundles format.
bundles_id: a text file storing for each cluster the indexes of the fibers in the subject's tractography dataset file.
outputs: a temporal directory with intermediate results.
Figure 6 illustrates the results of applying the HClust algorithm to a tractography dataset of 4,000 fibers. On the left, the tractography with 4,000 fibers is presented in blue before clustering, and on the right, eight detected fiber clusters are shown, manually chosen and using a palette of random colors. In this case, the size of the brain tractography dataset has been reduced due to the high computational cost associated with the HClust algorithm. This challenge is attributed to the distance matrix calculated at the start of the algorithm, serving as its primary limitation. We recommend using HClust on tractography datasets of a maximum of 40,000 fibers. If applying it to the entire brain with a larger dataset is desired, one can consider the strategy of first utilizing the intra-subject clustering of FFClust and then applying HClust to the centroids of FFClust (Román et al.,
Figure 6

Results of the HClust algorithm for the calculated tractography dataset of the postcentral region. (Left) In blue, the reconstructed fibers for the postcentral region are shown before applying clustering. (Right) Displays eight clusters manually chosen from the total detected fiber clusters with random colors.
2.2.2.2 FFClust sub-module
FFClust (Fast Fiber Clustering) (Vázquez et al.,
The implementation of FFClust in Phybers is based on the work of Vázquez et al. (
file_in: the input tractography dataset file.
dir_out: the directory to store all the results generated by the algorithm.
points: the index of the points to be used in the point clustering (Stage 1), default: 0, 3, 10, 17, 20.
ks: the number of clusters to be computed for each point using K-Means (Stage 1), default: 300, 200, 200, 200, 300.
assing_thr: a maximum distance threshold for the cluster reassignment in mm (Stage 3), default: 6.0 mm.
join_tht: a maximum distance threshold for the cluster merge in mm (Stage 4), default: 6.0 mm.
The structure of FFClust outputs is similar to HClust module.
Figure 7 shows the results of applying FFClust to the whole-brain tractography dataset with 1.5 million streamlines. The detected clusters were filtered using the PostProcessing sub-module of the Utils module (Section 2.2.3) to simplify result visualization. Clusters with a size greater than 150 and a length between 50 and 60 mm are shown on the left side of the figure, while clusters with a size greater than 100 and a length greater than 150 mm are shown on the right side of the figure.
Figure 7

Results obtained with the FFClust algorithm. Fiber colors are randomly distributed, and all fibers within a cluster are assigned the same color. (Left) Clusters with a size greater than 150 and a length ranging from 50 to 60 mm. (Right) Clusters with a size greater than 100 and a length exceeding 150 mm.
2.2.3 Utils module
The Utils module is a set of tools used for tractography dataset pre-processing and the analysis of brain fiber clustering and segmentation results. The module includes tools for reading and writing brain fiber files in bundles format, transform the fibers to a reference coordinate system based on a deformation field, sampling of fibers at a defined number of equidistant points, calculation of intersection between sets of brain fibers, and tools for extracting measures and filtering fiber clusters or segmented bundles. We considered the extraction of measures such as size, mean length (in mm), and the distance between fibers of each cluster (or fascicle), in mm. The set of tools implemented in Utils is being introduced for the first time in Phybers, and the source code is mostly developed in C/C++.
2.2.3.1 Deform sub-module
The deformation sub-module (Figure 8C1) transforms a tractography dataset file to another space using a non-linear deformation file. The maps must be stored in NIfTI format, where the voxels contain the transformation to be applied to each voxel 3D space location. The Deform sub-module applies the deformation to the 3D coordinates of the fiber points. Deform needs as input data the deformation map, the file path of the fibers to be transformed, and the path of the output file, containing the tractography dataset file in the transformed space.
Figure 8

Diagram representing the Utils module. (C1) Deform sub-module, which has the inputs: deform_file (image in NIfTI format containing the deformations), file_in (path of the input tractography dataset), and file_out (path to the transformed tractography dataset). The output consists of a tractography dataset transformed into the MNI space. (C2) Sampling sub-module, which has the file_in (path input tractography dataset), file_out (path to save the sub-sampled fibers), and npoint (number of sampling points). The output is a tractography dataset sampled at n equidistant points. (C3) Intersection sub-module, which has as input the file1_in (path of the first fiber bundle), file2_in (path of the second fiber bundle), and distance_thr (in mm) used to consider similar two fibers. The output is a tuple object of Python with the percentage of intersections between the bundles. (C4) PostProcessing sub-module that has as input the dir_in where the segmentation or clustering result is located. The algorithm output includes information about the fiber size, bundle length (in mm), and intra-bundle fiber distance (in mm), all of which can be accessed through a DataFrame (Pandas object of Python).
Figure 9 shows the result of applying the deformation function on a tractography dataset, using an anatomical image as visualization reference. The left side of the figure shows the tractography dataset before applying the transformation, and the right side shows the tractography dataset transformed to the MNI space. On the left side, there is a disalignment between the image and the tractography dataset, which is corrected on the right side.
Figure 9

Example of fiber transformation using Deform sub-module. The tractography dataset before (left) and after (right) applying the transformation to the MNI space of a subject.
2.2.3.2 Sampling sub-module
Tractography datasets are usually composed of a large number of 3D polylines with a variable number of points. The Sampling sub-module (Figure 8C2) performs a sampling of the fibers, recalculating their points using a defined number of equidistant points. The input data of the algorithm are the path of the tractography dataset file to be sampled, the output file with the fibers with n points, and the number of points (npoints). The Sampling sub-module is used in the pre-processing stage of the segmentation and clustering algorithms.
2.2.3.3 Intersection sub-module
The Intersection sub-module (Figure 8C3) calculates a similarity measure between two sets of brain fibers, that could be generated with other algorithms, such as fiber clustering (fiber clusters) and bundle segmentation (segmented bundles). It uses a maximum distance threshold (in mm) to consider two fibers as similar. Both sets of fibers must be in the same space. First, an Euclidean distance matrix is calculated between the fibers of the two sets. The number of fibers from one set that have a similar fiber in the other set are counted, for both sets. The similarity measure yields a value between 0 and 100%. The input data of the intersection algorithm are the two sets of fibers and the maximum distance threshold, while the output is the similarity percentage.
2.2.3.4 PostProcessing sub-module
The PostProcessing sub-module (Figure 8C4) contains a set of algorithms that can be applied to the results of clustering and segmentation algorithms. This algorithm constructs a Pandas library object (Dataframe), where each key corresponds to the name of the fiber set (cluster or segmented fascicle), followed by measures defined on the fiber set such as number of fibers (size), intra-fiber bundle distance (in mm) and mean length (in mm). It can be used to perform single or multiple feature filtering on the clustering or segmentation results. The input of the algorithm is the directory with the bundle sets to be analyzed, and the output is a Pandas Dataframe object with the calculated metrics (Figure 8C4).
2.2.4 Visualization module
The Visualization module can render multiple types of 3D objects, including tractography dataset, meshes, and MRI scans as slices or volumes. The module was designed with a focus on scalability, utilizing dictionaries to store the objects to be displayed, thus enabling the rendering of multiple objects simultaneously. For each object, a set of functionalities is defined that can be accessed through a graphical user interface (GUI). The GUI enables visualization of multiple objects at once, performing camera operations such as zooming, rotating, and panning, modifying object material properties such as color and transparency, and applying linear transformations to brain tractography dataset. Figure 10 illustrates the flow diagram of the visualization module. The input data is read into RAM and processed by the CPU. This data is then loaded into the VRAM and rendered using shaders. MRI volumes are loaded as VBOs (Vertex Buffer Objects), EBOs (Element Buffer Objects), and textures, which are accessed during the rendering process. Tractography dataset files are loaded according to the bundle dataset format (bundles, TRK, TCK). ROI inputs are created through the user interface. MRI volume inputs consist of 3D images in the NIfTI format. Mesh inputs are loaded from GIfTI and mesh files. The GPU renders the objects using geometric primitives such as points, lines, and triangles, and it can also accept buffer objects as input. The EBO contains geometrical information, specifying which vertices form which primitives. The OpenGL pipeline and shaders are employed to offload computational tasks from the CPU to the GPU.
Figure 10

The flowchart illustrates the main components and interactions of the Visualization module: User Interface, CPU Interface, and Visualization Backend GPU. The graphical user interface defines the supported file formats for each object type (tractography datase, slice or volume images, and meshes), as well as the available interactions (including rotation, zoom, and panning) and segmentation (3D ROI-based fiber segmentation). The CPU interface facilitates the loading of objects and interactions into memory, which can be displayed through the Visualization Backend GPU using OpenGL pipeline shaders.
2.2.4.1 Algorithms for visualization
The tractography dataset files can be rendered with lines or cylinders. In the case of lines, the software loads the streamlines, defining a fixed normal per vertex, which corresponds to the normalized direction for the particular segment of the streamline. Furthermore, a Phong lighting algorithm (Osorio et al.,
2.2.4.2 Interactive 3D ROI-based fiber segmentation
This function allows users to interactively extract fiber bundles using spherical ROIs. Internally, it creates a point-based data structure (Octree) for fast queries, based on storing points inside a bounding box with a capacity of N. When a node is filled, and a new point is added, the node subdivides its bounding box into eight new non-overlapping nodes, and the points are moved into the new nodes.
For the query, different 3D objects check whether the node collides with or is inside the bounding box. In the first case, the algorithm continues recursively through the branch nodes until it reaches a leaf node, where the points are tested and added to the validator buffer if selected. In the latter case, all the points contained in the subnodes are translated into the corresponding fiber and marked as selected in the fiber validator buffer. The resulting selected fibers for each object can be used in logical mathematical operations (AND, OR, XOR, NOT). This allows for the use of multiple ROIs to find fibers connecting specific areas while excluding those selected by other areas. Figure 11 displays a selection of fibers that intersect two ROIs (green and purple), while excluding fibers that intersect the blue ROI.
Figure 11

Interactive 3D ROI-based fiber segmentation using the Visualization Module. (A) Within the Visualization Tool window, the first quadrant is utilized to interact with objects loaded by the software. It shows a loaded tractograohy file (“fiber_test.bundles”) containing 1.5 million fibers. This fiber bundle dataset has undergone ROI segmentation, highlighted in blue. The ROIs object consists of three spheres organized in order of creation (0: purple, 1: green, and 2: blue). In the second quadrant of the Visualization Tool, various spatial manipulations, such as rotation, translation, and scaling, can be applied manually or through a text file (Apply Transforms Matrix from File and Reset Transforms). The manipulation options displayed depend on the selected object. (B) This section illustrates the segmentation of brain fibers connecting the purple and green spheres. Within the Extraction Tool window, you have access to various tools for interacting with the segmentation process, including Always Detect (real-time segmentation), Add ROI, Remove ROI, Alpha for not colliding fibers (for adding transparency to unsegmented fibers), Logic (for logical operations between the ROIs), Detect (for a one-time segmentation execution), and Export (to save the segmented fibers). In this case of Logic option, the “0&1” operation is employed to identify fibers intersecting both sphere 0 (purple) and sphere 1 (green). (C) It shows the segmentation of the brain fibers that intersect the purple and green spheres while excluding those that pass through the blue sphere. In this case, we specified the logical operation (Logic) as “0&1&!2” within the Extraction Tool window.
3 Results
We executed the Phybers package on eight computers, each with different hardware and software configurations, as outlined in Table 3, listing features such as the CPU, graphics card, RAM, OpenGL version, OS, and Python version. The computers were sorted by CPU generation. To conduct the tests, we applied the following procedure: first, we installed Anaconda and created two virtual environments, one with Python 3.9 and another with Python 3.11. Subsequently, we installed the Phybers package from the repository using the command $ pip install phybers. Finally, we executed all the library commands to assess the different modules of the package (available as supplementary material). For each module execution, we randomly selected two subjects. One subject was sourced from the HCP database, while the second subject was derived from the ARCHI database. Additionally, a test was conducted in a Python 3.10 environment on the PC8 listed in Table 3.
Table 3
| Computer | CPU | Graphics card | RAM | OpenGL Version | OS | Python Version |
|---|---|---|---|---|---|---|
| PC1 | Intel Core i9-12900 | NVIDIA GeForce RTX 3060 | 128 GB | 4.6.0 | Ubuntu 22.04.1 LTS/ Windows 11 | 3.9 & 3.11 |
| PC2 | Intel Core i7-9700KF | NVIDIA Quadro P620 | 32 GB | 4.6.0 | Ubuntu 20.04.5 LTS | 3.9 & 3.11 |
| PC3 | AMD Ryzen 9 5900HX | NVIDIA GeForce RTX 3060 | 24 GB | 4.6.0 | Windows 10 | 3.9 & 3.11 |
| PC4 | Intel Core i7 -8700K | NVIDIA GeForce GTX 1050 Ti | 64 GB | 4.6.0 | Windows 10 | 3.9 & 3.11 |
| PC5 | Intel Core i7-7700HQ | Intel HD Graphics 630 | 64 GB | 4.6.0 | Ubuntu 20.04.2 LTS | 3.9 & 3.11 |
| PC6 | Intel Core i7-12700K | NVIDIA GeForce GTX 1650 | 16GB | 4.6.0 | Ubuntu 22.04.2 LTS | 3.9 & 3.11 |
| PC7 | Intel Core i5-8600K | NVIDIA GeForce GTX 1050 Ti | 16 GB | 3.0 | Ubuntu 18.04.6 LTS | 3.9 & 3.11 |
| PC8 | Intel Core i5-6600k | NVIDIA GTX 1660 | 16 GB | 4.1.0 | Windows 10 | 3.10 |
Provides an overview of the primary hardware and software characteristics evaluated while running the Phybers package, categorized by CPU generation.
The first column assigns a unique number to each computer employed. Hardware resources are examined through the CPU, Graphics card, and RAM columns, whereas software resources are appraised via the columns for OpenGL version, OS (Operating System), and Python version. Phybers runs smoothly for all these listed features except for the Visualization module, which requires OpenGL versions higher than 3.0.
The installation of Phybers is straightforward via the $ pip install phybers command. The Segmentation, Clustering, and Utils modules function optimally across all the tested hardware and software configurations. Nonetheless, for the Visualization module, it is required to use OpenGL versions equal to or greater than 4.1.0, as earlier versions, such as 3.0 (PC7 in Table 3), lack support for certain functions. This hardware limitation extends to the graphics card, necessitating compatibility with OpenGL versions equal to or exceeding 4.1.0. Fortunately, OpenGL version 4.1.0 has been available since 2010, ensuring compatibility with graphics cards released thereafter. Regarding software prerequisites, Phybers offers compatibility with both Windows and Ubuntu systems. Users opting for MacOS are recommended to install a virtual machine. The recommended Windows versions include Windows 10 and Windows 11. Ubuntu users are encouraged to select from the following Long Term Support (LTS) versions: Ubuntu 18.04.6, Ubuntu 20.04.2, Ubuntu 20.04.5, Ubuntu 22.04.1, and Ubuntu 22.04.2. Lastly, Phybers seamlessly supports Python versions 3.9 and higher. Phybers' source code is publicly available on the GitHub repository. Additionally, it features a website that offers extensive and detailed documentation, along with examples and test data.
4 Discussion
In this study, we conducted the testing of the Phybers package on real neuroimaging data on eight computers with different configurations (Table 3). By conducting tests on computers with varying hardware and software configurations, we could fix some compatibility errors and ensure a comprehensive coverage of scenarios. This approach allowed us to identify potential strengths and weaknesses of the Phybers package, shedding light on its versatility and adaptability to different computing environments.
The Segmentation module enables fast segmentation of white matter fiber bundles from tractography dataset using a multi-subject atlas. The algorithm has been implemented with multicore processors and graphics processing units (GPUs), which allows for the segmentation of massive tractography datasets, and it has been tested with datasets containing up to 5.2 million fibers. To achieve this, the algorithm rapidly discards noisy fibers, leading to improved execution time and reduced memory usage (Vázquez et al.,
The Clustering module contains two exploratory fiber clustering algorithms that have proven their utility for analyzing fiber tractography datasets. These methods can be used as an initial exploration procedure to identify the main groups of fibers in a tractography dataset. Since the algorithms do not rely on anatomical data, they can be applied to any fiber configuration, as in Guevara et al. (
HClust is an automatic hierarchical method that can be applied to individual or multi-subject tractography dataset analysis. It is based on a distance metric between fibers and a threshold for dividing the dendrogram. The dendrogram is adaptively partitioned to get clusters with a maximum intra-clustering distance, a procedure that has proven to have a high power for disentangling WM fibers (Guevara et al.,
FFClust is capable of capturing regular and compact clusters on a tractography dataset (Vázquez et al.,
Users should evaluate which clustering method is more convenient, depending on their goal. Of course, results depend on the quality of tractography dataset and the registration method for the case of multi-subject analysis.
The Utils module provides a set of tools for tractography dataset analysis. Some of these tools are used internally by the other modules of the library, e.g., the tools for reading and saving fibers are used in all modules. However, we consider it necessary to provide the possibility to use these tools individually for any purpose of the user. The Deform sub-module allows the user to transform a tractography dataset to another space of a database providing a deformation image, such as the HCP database that provides the transformation to MNI space calculated with FSL software. Respecting the Sampling sub-module, both the segmentation and the clustering algorithms require that all fibers have the same number of points, which can be achieved using this module. The number of points depends on the application, and various numbers have been used, including 21 points (Guevara et al.,
The Visualization module allows for the visualization of multiple objects in a single scene. This module enables the visualization of MRI images in NIfTI format, mesh data in mesh format, and brain tractography dataset in bundles and TRK formats. Various operations can be performed on each object, such as rotation, zoom, and panning. This module features a simple and user-friendly graphical interface. Furthermore, it provides a tool for the interactive segmentation of a set of brain fibers by placing two or more spherical ROIs. This tool is quite useful when exploring brain tractography dataset quickly and in real-time. It was implemented with an optimal use of OpenGL features to perform well on personal computers, and even some simplified components can execute on Mobile devices (Osorio et al.,
In neuroscience, there is a wide variety of formats for tractography dataset files, MRI volumes, and meshes. The presented library has the limitation of supporting only a few input and output formats. It currently supports just four formats: bundles for tractography dataset, NIfTI for MRI, and mesh and GIfTI for meshes. In the state-of-the-art there are libraries that support other formats, for example: ExploreDTI, SliceDMRI, DSI Studio, and MRtrix. Future updates to our library may incorporate flexibility to read more formats or provide tools in the Utils module to convert among formats.
Respecting the library documentation, the choice of Sphinx as the primary tool for creating our documentation was based on several factors. Firstly, Sphinx offers remarkable ease of use and configuration, since its reStructuredText markup language is intuitive, enabling an efficient focus on content. Another notable advantage of Sphinx is its ability to generate documentation in multiple output formats, being selected HTML for our library. The inclusion of Sphinx in our development workflow played a significant role. The tool effortlessly fits into our current tools and processes, guaranteeing that the documentation remains up-to-date alongside source code changes. This ensures that users will always have access to the most recent information.
Finally, we packaged the library using the Python Package Index (PyPI), a widely used repository for software related to the Python programming language. This repository hosts a vast collection of projects, and facilitates easy installation of the library through the Python package manager (pip).
5 Conclusion
We propose a software library (Phybers) with state-of-the-art tools for analyzing brain fibers aiming to facilitate their use by the scientific community. It integrates tools such as fiber bundle segmentation, fiber clustering, and visualization algorithms that have been used separately in different studies. In addition, we integrated utility tools for sampling and transforming tractography datasets, calculating the intersection between fiber bundles and post-process brain fiber sets. The library provides sample data and extensive documentation. Furthermore, the library was developed with scalability in mind, therefore it is possible to integrate other existing state-of-the-art algoritmhs.
We believe that the generated library will facilitate the use of the included algorithms, achieving better sharing of state-of-the-art tools. As future work, we plan to integrate other methods such as the intersection of fibers with cortical meshes and a diffusion-based parcellation (López-López et al.,
Statements
Data availability statement
Publicly available datasets were analyzed in this study. This data can be found here: Phybers is freely available on a GitHub repository: https://github.com/phybers/phybers, under the GNU public license for non-commercial use and open-source development, which provides sample data. Extensive documentation is provided at: https://phybers.github.io/phybers.
Ethics statement
Ethical approval was not required for the study involving humans in accordance with the local legislation and institutional requirements. Written informed consent to participate in this study was not required from the participants or the participants' legal guardians/next of kin in accordance with the national legislation and the institutional requirements.
Author contributions
LG: Conceptualization, Methodology, Software, Writing—original draft, Writing—review & editing, Investigation, Visualization. IO: Software, Writing—review & editing. AC: Software, Writing—review & editing. HH: Investigation, Writing—original draft, Writing—review & editing. CR: Resources, Software, Writing—review & editing. CP: Writing—review & editing. J-FM: Writing—review & editing. CH: Conceptualization, Methodology, Supervision, Writing—original draft, Writing—review & editing. PG: Conceptualization, Funding acquisition, Methodology, Software, Supervision, Writing—original draft, Writing—review & editing.
Funding
The author(s) declare financial support was received for the research, authorship, and/or publication of this article. The authors acknowledge the financial support of ANID (Agencia Nacional de Investigación y Desarrollo), Chile: Doctorado Nacional/2019-21191506 (Doctoral scholarship, LG), FONDECYT 1221665 (Research grant, PG, AC, CH), ANILLO ACT210053 (Research grant, PG), FONDECYT Postdoctorado 3220729 (Postdoctoral fellowship, CR), Basal Centers FB0008 (AC3E, Research Center, PG), FB210017 (CENIA, Research Center, PG), and FB0001 (CeBiB, Research Center, CH).
Acknowledgments
HCP Data were provided by the Human Connectome Project, WUMinn Consortium (Principal Investigators: David Van Essen and Kamil Ugurbil; 1U54MH091657), funded by the 16 NIH Institutes and Centers that support the NIH Blueprint for Neuroscience Research; and by the McDonnell Center for Systems Neuroscience at Washington University.
Conflict of interest
The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest. The reviewer FZ declared a past co-authorship with the author J-FM to the handling editor.
Publisher’s note
All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.
References
1
BasserP. J.MattielloJ.Le BihanD. (1994). MR diffusion tensor spectroscopy and imaging. Biophys. J. 66, 259–267. 10.1016/S0006-3495(94)80775-1
2
BasserP. J.PajevicS.PierpaoliC.DudaJ.AldroubiA. (2000). In vivo fiber tractography using DT?MRI data. Magn. Reson. Med. 44, 625–632. 10.1002/1522-2594(200010)44:4<625::AID-MRM17>3.0.CO;2-O
3
BuyukturkogluK.VergaraC.FuentealbaV.TozluC.DahanJ. B.CarrollB. E.et al. (2022). Machine learning to investigate superficial white matter integrity in early multiple sclerosis. J. Neuroimag. 32, 36–47. 10.1111/jon.12934
4
ChamberlandM.BernierM.FortinD.WhittingstallK.DescoteauxM. (2015). 3D interactive tractography-informed resting-state fMRI connectivity. Front. Neurosci. 9:275. 10.3389/fnins.2015.00275
5
ChenY.ZhangC.XueT.SongY.MakrisN.RathiY.et al. (2023). Deep fiber clustering: anatomically informed fiber clustering with self-supervised deep learning for fast and effective tractography parcellation. NeuroImage273:120086. 10.1016/j.neuroimage.2023.120086
6
CookP. A.BaiY.HallM. G.Nedjati-GilaniS.SeunarineK. K.AlexanderD. C. (2006). “Camino: Diffusion MRI reconstruction and processing,” in 14th Scientific Meeting of the International Society for Magnetic Resonance in Medicine (Seattle, WA, USA), 2759. 10.54294/fgfrtv
7
DaviesD. L.BouldinD. W. (1979). “A cluster separation measure,” in IEEE Transactions on Pattern Analysis and Machine Intelligence, PAMI-1, 224–227. 10.1109/TPAMI.1979.4766909
8
DesikanR. S.SgonneF.FischlB.QuinnB. T.DickersonB. C.BlackerD.et al. (2006). An automated labeling system for subdividing the human cerebral cortex on MRI scans into gyral based regions of interest. NeuroImage31, 968–980. 10.1016/j.neuroimage.2006.01.021
9
DonnellL. J. O.WestinC. F. (2007). Automatic tractography segmentation using a high-dimensional white matter atlas. IEEE Trans. Med. Imaging26, 1562–1575. 10.1109/TMI.2007.906785
10
FickR. H. J.WassermannD.DericheR. (2019). The dmipy toolbox: diffusion MRI multi-compartment modeling and microstructure recovery made easy. Front. Neuroinform. 13:64. 10.3389/fninf.2019.00064
11
FischlB. (2012). FreeSurfer. NeuroImage62, 774–781. 10.1016/j.neuroimage.2012.01.021
12
FischlB.SalatD. H.BusaE.AlbertM.DieterichM.HaselgroveC.et al. (2002). Whole brain segmentation: automated labeling of neuroanatomical structures in the human brain. Neuron33, 341–355. 10.1016/S0896-6273(02)00569-X
13
FrankeL.WeideleD. K. I.ZhangF.Cetin-KarayumakS.PieperS.O'DonnellL. J.et al. (2021). “FiberStars: visual comparison of diffusion tractography data between multiple subjects,” in 2021 IEEE 14th Pacific Visualization Symposium (PacificVis), 116–125. 10.1109/PacificVis52677.2021.00023
14
GaryfallidisE.BrettM.AmirbekianB.RokemA.van der WaltS.DescoteauxM.et al. (2014). Dipy, a library for the analysis of diffusion MRI data. Front. Neuroinform. 8:8. 10.3389/fninf.2014.00008
15
GaryfallidisE.BrettM.CorreiaM. M.WilliamsG. B.Nimmo-SmithI. (2012). QuickBundles, a method for tractography simplification. Front. Neurosci. 6:175. 10.3389/fnins.2012.00175
16
GaryfallidisE.Cĉt,éM.-A.RheaultF.SidhuJ.HauJ.PetitL.et al. (2018). Recognition of white matter bundles using local and global streamline-based registration and clustering. NeuroImage170, 283–295. 10.1016/j.neuroimage.2017.07.015
17
GlasserM. F.SotiropoulosS. N.WilsonJ. A.CoalsonT. S.FischlB.AnderssonJ. L.et al. (2013). The minimal preprocessing pipelines for the human connectome project. NeuroImage80, 105–124. 10.1016/j.neuroimage.2013.04.127
18
GoldsmithD. R.CrooksC. L.WalkerE. F.CotesR. O. (2018). An update on promising biomarkers in schizophrenia. Focus16, 153–163. 10.1176/appi.focus.20170046
19
GuevaraM.RománC.HouenouJ.DuclapD.PouponC.ManginJ. F.et al. (2017). Reproducibility of superficial white matter tracts using diffusion-weighted imaging tractography. NeuroImage147, 703–725. 10.1016/j.neuroimage.2016.11.066
20
GuevaraM.SunZ.-Y.GuevaraP.RiviéreD.GrigisA.PouponC.et al. (2022). Disentangling the variability of the superficial white matter organization using regional-tractogram-based population stratification. NeuroImage255:119197. 10.1016/j.neuroimage.2022.119197
21
GuevaraP.DuclapD.PouponC.Marrakchi-KacemL.FillardP.Le BihanD.et al. (2012). Automatic fiber bundle segmentation in massive tractography datasets using a multi-subject bundle atlas. NeuroImage61, 1083–1099. 10.1016/j.neuroimage.2012.02.071
22
GuevaraP.PouponC.RivireD.CointepasY.DescoteauxM.ThirionB.et al. (2011). Robust clustering of massive tractography datasets. NeuroImage54, 1975–1993. 10.1016/j.neuroimage.2010.10.028
23
HarrisC. R.MillmanK. J.van der WaltS. J.GommersR.VirtanenP.CournapeauD.et al. (2020). Array programming with NumPy. Nature585, 357–362. 10.1038/s41586-020-2649-2
24
JenkinsonM.BeckmannC. F.BehrensT. E. J.WoolrichM. W.SmithS. M. (2012). FSL. NeuroImage62, 782–790. 10.1016/j.neuroimage.2011.09.015
25
JiE.GuevaraP.GuevaraM.GrigisA.LabraN.SarrazinS.et al. (2019). Increased and decreased superficial white matter structural connectivity in schizophrenia and bipolar disorder. Schizophr. Bull. 45, 1367–1378. 10.1093/schbul/sbz015
26
KumarK.DesrosiersC. (2016). “A sparse coding approach for the efficient representation and segmentation of white matter fibers,” in 2016 IEEE 13th International Symposium on Biomedical Imaging (ISBI), 915–919. 10.1109/ISBI.2016.7493414
27
LabraN.GuevaraP.DuclapD.HouenouJ.PouponC.ManginJ.-F.et al. (2017). Fast automatic segmentation of white matter streamlines based on a multi-subject bundle atlas. Neuroinformatics15, 71–86. 10.1007/s12021-016-9316-7
28
Le BihanD.BretonE. (1985). Imagerie de diffusion in-vivo par rsonance magntique nuclaire. Comptes-Rendus l'Acad. Sci. 93, 27–34.
29
LebelC.TreitS.BeaulieuC. (2019). A review of diffusion MRI of typical white matter development from early childhood to young adulthood. NMR Biomed. 32:e3778. 10.1002/nbm.3778
30
LeemansA.JeurissenB.SijbersJ.JonesD. K. (2009). “ExploreDTI: A graphical toolbox for processing, analyzing, and visualizing diffusion MR data,” in 17th Annual Meeting of International Social Magnetic Resonance Medicine, 17.
31
LiX.WangY.WangW.HuangW.ChenK.XuK.et al. (2020). Age-related decline in the topological efficiency of the brain structural connectome and cognitive aging. Cerebr. Cortex30, 4651–4661. 10.1093/cercor/bhaa066
32
López-LópezN.VázquezA.HouenouJ.PouponC.ManginJ.-F.LadraS.et al. (2020). From coarse to fine-grained parcellation of the cortical surface using a fiber-bundle atlas. Front. Neuroinform. 14:32. 10.3389/fninf.2020.00032
33
MalcolmJ. G.ShentonM. E.RathiY. (2010). Filtered multitensor tractography. IEEE Trans. Med. Imaging29, 1664–1675. 10.1109/TMI.2010.2048121
34
MendozaC.RománC.VázquezA.PouponC.ManginJ. F.HernándezC.et al. (2021). “Enhanced automatic segmentation for superficial white matter fiber bundles for probabilistic tractography datasets,” in 2021 43rd Annual International Conference of the IEEE Engineering in Medicine &Biology Society (EMBC), 3654–3658. 10.1109/EMBC46164.2021.9630529
35
MitoR.RaffeltD.DhollanderT.VaughanD. N.TournierJ.-D.SalvadoO.et al. (2018). Fibre-specific white matter reductions in Alzheimer's disease and mild cognitive impairment. Brain141, 888–902. 10.1093/brain/awx355
36
NortonI.EssayedI.ZhangF.PujolS.YarmarkovichA.GolbyA.et al. (2017). SlicerDMRI: open source diffusion MRI software for brain cancer research. Cancer Res. 77, e101–e103. 10.1158/0008-5472.CAN-17-0332
37
O'DonnellL. J.KubickiM.ShentonM. E.DreusickeM. H.GrimsonW. E. L.WestinC.-F. (2006). A method for clustering white matter fiber tracts. Am. J. Neuroradiol. 27, 1032–1036.
38
O'DonnellL. J.SuterY.RigoloL.KahaliP.ZhangF.NortonI.et al. (2017). Automated white matter fiber tract identification in patients with brain tumors. NeuroImage13, 138–153. 10.1016/j.nicl.2016.11.023
39
OsorioI.GuevaraM.BonomettiD.CarrascoD.DescoteauxM.PouponC.et al. (2021). ABrainVis: an android brain image visualization tool. Biomed. Eng. Online20, 72. 10.1186/s12938-021-00909-0
40
PouponC.RieulB.KezeleI.PerrinM.PouponF.ManginJ.-F. (2008). New diffusion phantoms dedicated to the study and validation of high-angular-resolution diffusion imaging (HARDI) models. Magn. Reson. Med. 60, 1276–1283. 10.1002/mrm.21789
41
RadwanA. M.SunaertS.SchillingK.DescoteauxM.LandmanB. A.VandenbulckeM.et al. (2022). An atlas of white matter anatomy, its variability, and reproducibility based on constrained spherical deconvolution of diffusion MRI. NeuroImage254:119029. 10.1016/j.neuroimage.2022.119029
42
RiviéreD.GeffroyI.DenghienN.SouedetN.CointepasY. (2011). “Anatomist: a python framework for interactive 3D visualization of neuroimaging data,” in Python in Neuroscience Workshop.
43
RománC.GuevaraM.ValenzuelaR.FigueroaM.HouenouJ.DuclapD.et al. (2017). Clustering of whole-brain white matter short association bundles using HARDI data. Front. Neuroinform. 11:73. 10.3389/fninf.2017.00073
44
RománC.HernándezC.FigueroaM.HouenouJ.PouponC.ManginJ.-F.et al. (2022). Superficial white matter bundle atlas based on hierarchical fiber clustering over probabilistic tractography data. NeuroImage262:119550. 10.1016/j.neuroimage.2022.119550
45
RoyM.RheaultF.CroteauE.CastellanoC.-A.FortierM.St-PierreV.et al. (2020). Fascicle- and glucose-specific deterioration in white matter energy supply in alzheimer's disease. J. Alzheimer's Dis. 76, 863–881. 10.3233/JAD-200213
46
SchillingK. G.RheaultF.PetitL.HansenC. B.NathV.YehF.-C.et al. (2021). Tractography dissection variability: what happens when 42 groups dissect 14 white matter bundles on the same dataset?NeuroImage243:118502. 10.1016/j.neuroimage.2021.118502
47
ShattuckD. W.LeahyR. M. (2002). BrainSuite: An automated cortical surface identification tool. Med. Image Anal. 6, 129–142. 10.1016/S1361-8415(02)00054-3
48
SilessV.ChangK.FischlB.YendikiA. (2018). AnatomiCuts: hierarchical clustering of tractography streamlines based on anatomical similarity. NeuroImage166, 32–45. 10.1016/j.neuroimage.2017.10.058
49
SmithR. E.TournierJ.-D.CalamanteF.ConnellyA. (2012). Anatomically-constrained tractography: improved diffusion MRI streamlines tractography through effective use of anatomical information. NeuroImage62, 1924–1938. 10.1016/j.neuroimage.2012.06.005
50
SmithS. M.JenkinsonM.WoolrichM. W.BeckmannC. F.BehrensT. E. J.Johansen-BergH.et al. (2004). Advances in functional and structural MR image analysis and implementation as FSL. NeuroImage23:208–219. 10.1016/j.neuroimage.2004.07.051
51
TournierJ.-D.CalamanteF.ConnellyA. (2012). MRtrix: diffusion tractography in crossing fiber regions. Int. J. Imag. Syst. Technol. 22, 53–66. 10.1002/ima.22005
52
TournierJ. D.CalamanteF.ConnellyA. (2007). Robust determination of the fibre orientation distribution in diffusion MRI: non-negativity constrained super-resolved spherical deconvolution. NeuroImage35, 1459–1472. 10.1016/j.neuroimage.2007.02.016
53
TournierJ. D.SmithR.RaffeltD.TabbaraR.DhollanderT.PietschM.et al. (2019). MRtrix3: Amazon.com fast, flexible and open software framework for medical image processing and visualisation. NeuroImage202:116137. 10.1016/j.neuroimage.2019.116137
54
TuchD. S. (2004). Q-ball imaging. Magn. Reson. Med. 52, 1358–1372. 10.1002/mrm.20279
55
VázquezA.López-LópezN.LabraN.FigueroaM.PouponC.ManginJ.-F.et al. (2019). “Parallel optimization of fiber bundle segmentation for massive tractography datasets,” in 2019 IEEE 16th International Symposium on Biomedical Imaging (ISBI 2019) (IEEE), 178–181. 10.1109/ISBI.2019.8759208
56
VázquezA.López-LópezN.SánchezA.HouenouJ.PouponC.ManginJ. F.et al. (2020). FFClust: fast fiber clustering for large tractography datasets for a detailed study of brain connectivity. NeuroImage220:117070. 10.1016/j.neuroimage.2020.117070
57
VindasN.AvilaN. L.ZhangF.XueT.O'DonnellL. J.ManginJ. F. (2023). “GeoLab: geometry-based tractography parcellation of superficial white matter,” in 2023 IEEE 20th International Symposium on Biomedical Imaging (ISBI), 1–5. 10.1109/ISBI53787.2023.10230336
58
WangR.BennerT.SorensenA. G.WedeenV. J. (2007). “Diffusion toolkit: a software package for diffusion imaging data processing and tractography,” in Proceedings of the International Social Magnetic Resonance Medicine (Berlin), 3720.
59
WassermannD.MakrisN.RathiY.ShentonM.KikinisR.KubickiM.et al. (2016). The white matter query language: a novel approach for describing human white matter anatomy. Brain Struct. Funct. 221, 4705–4721. 10.1007/s00429-015-1179-4
60
WasserthalJ.NeherP.Maier-HeinK. H. (2018). TractSeg - Fast and accurate white matter tract segmentation. NeuroImage183, 239–253. 10.1016/j.neuroimage.2018.07.070
61
WasserthalJ.NeherP. F.HirjakD.Maier-HeinK. H. (2019). Combined tract segmentation and orientation mapping for bundle-specific tractography. Med. Image Analy. 58:101559. 10.1016/j.media.2019.101559
62
WedeenV. J.HagmannP.TsengW.-Y. I.ReeseT. G.WeisskoffR. M. (2005). Mapping complex tissue architecture with diffusion spectrum Magnetic Resonance imaging. Magn. Reson. Med. 54, 1377–1386. 10.1002/mrm.20642
63
WoolrichM. W.JbabdiS.PatenaudeB.ChappellM.MakniS.BehrensT.et al. (2009). Bayesian analysis of neuroimaging data in FSL. NeuroImage45, 173–186. 10.1016/j.neuroimage.2008.10.055
64
XieS.ChenL.ZuoN.JiangT. (2016). DiffusionKit: a light one-stop solution for diffusion MRI data analysis. J. Neurosci. Methods273, 107–119. 10.1016/j.jneumeth.2016.08.011
65
YehF.WedeenV. J.TsengW. I. (2010). Generalized q-sampling imaging. IEEE Trans. Med. Imag. 29, 1626–1635. 10.1109/TMI.2010.2045126
66
YehF.-C.VerstynenT. D.WangY.Fernández-MirandaJ. C.TsengW.-Y. I. (2013). Deterministic diffusion fiber tracking improved by quantitative anisotropy. PLoS ONE8:e80713. 10.1371/journal.pone.0080713
67
ZekelmanL. R.ZhangF.MakrisN.HeJ.ChenY.XueT.et al. (2022). White matter association tracts underlying language and theory of mind: an investigation of 809 brains from the human connectome project. NeuroImage246:118739. 10.1016/j.neuroimage.2021.118739
68
ZhangF.Cetin KarayumakS.HoffmannN.RathiY.GolbyA. J.O'DonnellL. J. (2020a). Deep white matter analysis (DeepWMA): fast and consistent tractography segmentation. Med. Image Anal. 65:101761. 10.1016/j.media.2020.101761
69
ZhangF.NohT.JuvekarP.FriskenS.RigoloL.NortonI.et al. (2020b). “SlicerDMRI: a suite of clinician-accessible tools for neurosurgical planning research using diffusion MRI and tractography,” in Proceedings of the International Society for Magnetic Resonance in Medicine, 4489.
70
ZhangF.WuY.NortonI.RigoloL.RathiY.MakrisN.et al. (2018). An anatomically curated fiber clustering white matter atlas for consistent white matter tract parcellation across the lifespan. NeuroImage179, 429–447. 10.1016/j.neuroimage.2018.06.027
71
ZhaoT.ShengC.BiQ.NiuW.ShuN.HanY. (2017). Age-related differences in the topological efficiency of the brain structural connectome in amnestic mild cognitive impairment. Neurobiol. Aging59, 144–155. 10.1016/j.neurobiolaging.2017.08.005
Summary
Keywords
diffusion MRI, tractography, python, white matter segmentation, fiber clustering, bundle atlas
Citation
González Rodríguez LL, Osorio I, Cofre G. A, Hernandez Larzabal H, Román C, Poupon C, Mangin J-F, Hernández C and Guevara P (2024) Phybers: a package for brain tractography analysis. Front. Neurosci. 18:1333243. doi: 10.3389/fnins.2024.1333243
Received
04 November 2023
Accepted
09 February 2024
Published
11 March 2024
Volume
18 - 2024
Edited by
Kurt G. Schilling, Vanderbilt University Medical Center, United States
Reviewed by
Fan Zhang, University of Electronic Science and Technology of China, China
Michael Kim, Vanderbilt University, United States
Updates

Check for updates
Copyright
© 2024 González Rodríguez, Osorio, Cofre G., Hernandez Larzabal, Román, Poupon, Mangin, Hernández and Guevara.
This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.
*Correspondence: Pamela Guevara pamela.guevara@biomedica.udec.cl
Disclaimer
All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article or claim that may be made by its manufacturer is not guaranteed or endorsed by the publisher.