Welcome to Diffusion Profile Realignment’s documentation!

This is the documentation detailing the internal of ‘Reducing variability in along-tract analysis with diffusion profile realignment’, which is available at https://github.com/samuelstjean/dpr.

It is most easily understood by looking at the code of each function since it contains comments about design choices and usage.

You can find the original paper and full details of the algorithm as presented in

Samuel St-Jean, Maxime Chamberland, Max A. Viergever, Alexander Leemans,
Reducing variability in along-tract analysis with diffusion profile realignment,
NeuroImage, Volume 199, 2019, Pages 663-679

Which you can grab an open access copy from Neuroimage.

The datasets are also available at zenodo.

You can find below the documentation for each modules.

dpr

Submodules

dpr.register

Module Contents
Functions

align_bundles(bundles[, percent, padding, order, eps, ...])

resample_bundles_to_same(bundles[, num_points])

apply_shift(bundles, shifts[, order, padding])

flip_fibers(bundles, coordinates[, padding, template])

bundle - 2D array of M bundles with each metrics of size N as a column

truncate(bundles[, mode, trimval, axis])

filter_pairs(allpairs, mode)

get_shift_from_fft(x, y[, normalize])

get_ffts(bundles[, whiten, remove_baseline])

crosscorr(ffta, fftb[, normalize])

extrapolate(x, y[, return_value])

dpr.register.align_bundles(bundles, percent=15, padding=0.0, order=1, eps=1e-05, mode='full_template', remove_outliers=True, remove_baseline=True, whiten=True, normalize=False, return_shifts_matrix=False, rematch_outliers=True)
dpr.register.resample_bundles_to_same(bundles, num_points=None)
dpr.register.apply_shift(bundles, shifts, order=1, padding=np.nan)
dpr.register.flip_fibers(bundles, coordinates, padding=np.nan, template=None)

bundle - 2D array of M bundles with each metrics of size N as a column coordinates - list of points of size whatever x 3 template - Use this streamline to set the coordinate system.

If not set, we use the first one from coordinates.

dpr.register.truncate(bundles, mode='shortest', trimval=np.nan, axis=0)
dpr.register.filter_pairs(allpairs, mode)
dpr.register.get_shift_from_fft(x, y, normalize=False)
dpr.register.get_ffts(bundles, whiten=True, remove_baseline=True)
dpr.register.crosscorr(ffta, fftb, normalize=False)
dpr.register.extrapolate(x, y, return_value=False)

dpr.utils

Module Contents
Functions

read_per_line(fname[, maxlines])

strip_first_col(fname[, delimiter])

strip_header(filename[, columns, delimiter])

colorbar(mappable)

draw_fancy_graph(pval, coords1, coords2, ...[, ...])

Attributes

blue

green

dpr.utils.read_per_line(fname, maxlines=50000)
dpr.utils.strip_first_col(fname, delimiter=None)
dpr.utils.strip_header(filename, columns=0, delimiter=None)
dpr.utils.blue
dpr.utils.green
dpr.utils.colorbar(mappable)
dpr.utils.draw_fancy_graph(pval, coords1, coords2, truncated_coords1, truncated_coords2, average1, average2, coord1_label='X', coord2_label='Y', pval_threshold=1.0, pval_cmap=plt.cm.hot, mean_fiber_cmap=green, bundle_cmap=blue, shadow_cmap='gray', title=None, draw_colorbar=True)

Indices and tables