AFQ.tasks.segmentation#

Module Contents#

Functions#

segment(dwi, data_imap, mapping_imap, ...)

full path to a trk file containing containting

clean_bundles(bundles, data_imap[, clean_params])

full path to a trk file containting segmented

export_bundles(base_fname, results_dir, clean_bundles, ...)

dictionary of paths, where each path is

export_sl_counts(data_imap, clean_bundles, bundles)

full path to a JSON file containing streamline counts

export_bundle_lengths(data_imap, clean_bundles, bundles)

full path to a JSON file containing median bundle lengths

export_density_maps(clean_bundles, dwi, data_imap)

full path to 4d nifti file containing streamline counts per voxel

tract_profiles(clean_bundles, data_imap, scalar_dict, ...)

full path to a CSV file containing tract profiles

get_scalar_dict(data_imap, mapping_imap[, scalars])

dicionary mapping scalar names

get_segmentation_plan(kwargs)

Attributes#

logger

AFQ.tasks.segmentation.logger[source]#
AFQ.tasks.segmentation.segment(dwi, data_imap, mapping_imap, tractography_imap, segmentation_params)[source]#

full path to a trk file containing containting segmented streamlines, labeled by bundle

Parameters
segmentation_paramsdict, optional

The parameters for segmentation. Default: use the default behavior of the seg.Segmentation object.

AFQ.tasks.segmentation.clean_bundles(bundles, data_imap, clean_params=None)[source]#

full path to a trk file containting segmented streamlines, cleaned using the Mahalanobis distance, and labeled by bundle

Parameters
clean_params: dict, optional

The parameters for cleaning. Default: use the default behavior of the seg.clean_bundle function.

AFQ.tasks.segmentation.export_bundles(base_fname, results_dir, clean_bundles, bundles, data_imap, tracking_params, segmentation_params)[source]#

dictionary of paths, where each path is a full path to a trk file containing the streamlines of a given bundle, cleaned or uncleaned

AFQ.tasks.segmentation.export_sl_counts(data_imap, clean_bundles, bundles)[source]#

full path to a JSON file containing streamline counts

AFQ.tasks.segmentation.export_bundle_lengths(data_imap, clean_bundles, bundles)[source]#

full path to a JSON file containing median bundle lengths

AFQ.tasks.segmentation.export_density_maps(clean_bundles, dwi, data_imap)[source]#

full path to 4d nifti file containing streamline counts per voxel per bundle, where the 4th dimension encodes the bundle

AFQ.tasks.segmentation.tract_profiles(clean_bundles, data_imap, scalar_dict, dwi_affine, profile_weights='gauss')[source]#

full path to a CSV file containing tract profiles

Parameters
profile_weightsstr, 1D array, 2D array callable, optional

How to weight each streamline (1D) or each node (2D) when calculating the tract-profiles. If callable, this is a function that calculates weights. If None, no weighting will be applied. If “gauss”, gaussian weights will be used. If “median”, the median of values at each node will be used instead of a mean or weighted mean. Default: “gauss”

AFQ.tasks.segmentation.get_scalar_dict(data_imap, mapping_imap, scalars=['dti_fa', 'dti_md'])[source]#

dicionary mapping scalar names to their respective file paths

Parameters
scalarslist of strings and/or scalar definitions, optional

List of scalars to use. Can be any of: “dti_fa”, “dti_md”, “dki_fa”, “dki_md”, “dki_awf”, “dki_mk”. Can also be a scalar from AFQ.definitions.image. Default: [“dti_fa”, “dti_md”]

AFQ.tasks.segmentation.get_segmentation_plan(kwargs)[source]#