AFQ.tasks.segmentation#

Module Contents#

Functions#

segment(data_imap, mapping_imap, tractography_imap, ...)

full path to a trk/trx file containing containing

export_bundles(base_fname, output_dir, bundles, ...)

dictionary of paths, where each path is

export_sl_counts(bundles)

full path to a JSON file containing streamline counts

export_bundle_lengths(bundles)

full path to a JSON file containing median bundle lengths

export_density_maps(bundles, data_imap)

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

tract_profiles(bundles, scalar_dict, data_imap[, ...])

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#

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

full path to a trk/trx file containing containing 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.export_bundles(base_fname, output_dir, bundles, 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.

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

full path to a JSON file containing streamline counts

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

full path to a JSON file containing median bundle lengths

AFQ.tasks.segmentation.export_density_maps(bundles, 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(bundles, scalar_dict, data_imap, profile_weights='gauss', n_points_profile=100)[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”

n_points_profileint, optional

Number of points to resample each streamline to before calculating the tract-profiles. Default: 100

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]#