unravel.utils

Created on Sat Jun 4 22:17:13 2022

@author: DELINTE Nicolas

Functions

fuse_trk(trk_file_1, trk_file_2, output_file)

Creates a new .trk file with all streamlines contained in the two input .trk files.

get_streamline_angle(trk[, resolution_increase])

Get the fixel weights from a tract specified in trk_file.

get_streamline_count(trk)

Returns the number of streamlines in a tractogram.

get_streamline_density(trk[, ...])

Get the total segment length from a tract specified in trk.

get_streamline_lengths(trk)

Returns an array with the lengths of the n streamlines in a tractogram.

load_sift2_weights(weights_file[, mu_file])

normalize_color(rgb[, norm_all_voxels])

Sets values in RGB array (x,y,z,3) to be within [0,1].

peaks_to_RGB(peaks[, frac, fvf, order, ...])

Returns a RGB map of shape (x,y,z,3) representing the main direction of of the peaks.

peaks_to_peak(peaks, fixel_weights[, frac, fvf])

Fuse peaks into a single peak based on fixel weight and fvf, intensity is then weighted with frac.

plot_streamline_trajectory(trk[, ...])

Produces a graph of the streamline density of tract 'trk', the streamline specified with 'streamline_number' is highlighted along 'axis'.

spherical_to_xyz(theta, phi[, r])

tensor_to_DTI(t)

Creates fractional anisotropy (FA), axial diffusivity (AD), radial diffusivity (RD) and mean diffusivity (MD) maps from a tensor array.

tract_to_ROI(trk_file)

Returns a binary mask of each voxel containing a tractography node.The voxels containing streamlines segments but no nodes will not be selected.

xyz_to_spherical(xyz)

X,y,z coordinates to spherical coordinates.