AFQ.utils.streamlines

Module Contents

Functions

add_bundles(t1, t2)

Combine two bundles, using the second bundles' affine and

bundles_to_tgram(bundles, bundle_dict, reference)

Create a StatefulTractogram object from bundles and their

tgram_to_bundles(tgram, bundle_dict, reference)

Convert a StatefulTractogram object to a dict with StatefulTractogram

split_streamline(streamlines, sl_to_split, split_idx)

Given a Streamlines object, split one of the underlying streamlines

AFQ.utils.streamlines.add_bundles(t1, t2)[source]

Combine two bundles, using the second bundles’ affine and data_per_streamline keys.

Parameters

t1, t2 : nib.streamlines.Tractogram class instances

AFQ.utils.streamlines.bundles_to_tgram(bundles, bundle_dict, reference)[source]

Create a StatefulTractogram object from bundles and their specification.

Parameters
bundles: dict

Each key in the dict is a bundle name and each value in the dict is the stateful tractogram of a particular bundle.

bundle_dict: dict

A bundle specification dictionary. Each key is a bundle name, and each value is another dictionary specifying bundle properties. In this value dictionary, there must be one uid key whose value is a unique integer for that bundle.

referenceNifti

The affine_to_rasmm input to nib.streamlines.Tractogram

AFQ.utils.streamlines.tgram_to_bundles(tgram, bundle_dict, reference)[source]

Convert a StatefulTractogram object to a dict with StatefulTractogram objects for each bundle.

Parameters
tgramStatefulTractogram class instance.

Requires a data_per_streamline[‘bundle’][bundle_name][‘uid’] attribute.

bundle_dict: dict

A bundle specification dictionary. Each item includes in particular a uid key that is a unique integer for that bundle.

AFQ.utils.streamlines.split_streamline(streamlines, sl_to_split, split_idx)[source]

Given a Streamlines object, split one of the underlying streamlines

Parameters
streamlinesa Streamlines class instance

The group of streamlines, one of which is being split.

sl_to_splitint

The index of the streamline that is being split

split_idxint

Where is the streamline being split