AFQ.api.bundle_dict#

Module Contents#

Classes#

BundleDict

PediatricBundleDict

class AFQ.api.bundle_dict.BundleDict(bundle_info=BUNDLES, seg_algo='afq', resample_to=None, resample_subject_to=None, keep_in_memory=False)[source]#

Bases: collections.abc.MutableMapping

load_templates(self)[source]#

Loads templates for generating bundle dictionaries from bundle names.

_gen(self, bundle_name)[source]#

Given a bundle name, load its bundle’s dictionary describing the bundle.

gen_all(self)[source]#

If bundle_info is a list of names, this will load each bundle’s dictionary describing the bundle.

__getitem__(self, key)[source]#
__setitem__(self, key, item)[source]#
__len__(self)[source]#
__delitem__(self, key)[source]#
__iter__(self)[source]#
copy(self)[source]#

Generates a copy of this BundleDict where the internal dictionary is a copy of this BundleDict’s internal dictionary. Useful if you want to add or remove bundles from a copy of a BundleDict.

Returns
bundle_dictBundleDict

Euclidean norms of vectors.

apply_to_rois(self, b_name, func, *args, **kwargs)[source]#

Applies some transformation to all ROIs (include, exclude, end, start) and the prob_map in a given bundle.

Parameters
b_namename

bundle name of bundle whose ROIs will be transformed.

funcfunction

function whose first argument must be a Nifti1Image and which returns a Nifti1Image

*args

Additional arguments for func

**kwargs

Optional arguments for func

Returns
Dictionary containing the old values of all ROIs and prob_map
_resample_roi(self, b_name)[source]#

Given a bundle name, resample all ROIs and prob maps into either template or subject space for that bundle, depending on its “space” attribute.

Parameters
b_namestr

Name of the bundle to be resampled.

__add__(self, other)[source]#
class AFQ.api.bundle_dict.PediatricBundleDict(bundle_info=PEDIATRIC_BUNDLES, seg_algo='afq', resample_to=None, resample_subject_to=None, keep_in_memory=False)[source]#

Bases: BundleDict

load_templates(self)[source]#

Loads templates for generating bundle dictionaries from bundle names.