AFQ.tasks.viz#

Module Contents#

Functions#

_viz_prepare_vol(vol, xform, mapping, scalar_dict)

viz_bundles(base_fname, viz_backend, data_imap, ...[, ...])

figure for the visualizaion of the recognized

viz_indivBundle(base_fname, output_dir, viz_backend, ...)

list of full paths to html or gif files

plot_tract_profiles(base_fname, scalars, ...)

list of full paths to png files,

init_viz_backend([viz_backend_spec, virtual_frame_buffer])

An instance of the AFQ.viz.utils.viz_backend class.

get_viz_plan(kwargs)

Attributes#

AFQ.tasks.viz.logger[source]#
AFQ.tasks.viz._viz_prepare_vol(vol, xform, mapping, scalar_dict)[source]#
AFQ.tasks.viz.viz_bundles(base_fname, viz_backend, data_imap, mapping_imap, segmentation_imap, tracking_params, segmentation_params, best_scalar, sbv_lims_bundles=[None, None], volume_opacity_bundles=0.3, n_points_bundles=40)[source]#

figure for the visualizaion of the recognized bundles in the subject’s brain.

Parameters
sbv_lims_bundlesndarray

Of the form (lower bound, upper bound). Shading based on shade_by_volume will only differentiate values within these bounds. If lower bound is None, will default to 0. If upper bound is None, will default to the maximum value in shade_by_volume. Default: [None, None]

volume_opacity_bundlesfloat, optional

Opacity of volume slices. Default: 0.3

n_points_bundlesint or None

n_points to resample streamlines to before plotting. If None, no resampling is done. Default: 40

Returns
List of Figure, String or just the Figure:
If file can be generated, returns a tuple including the figure and the
path to the file.
Otherwise, returns the figure.
AFQ.tasks.viz.viz_indivBundle(base_fname, output_dir, viz_backend, data_imap, mapping_imap, segmentation_imap, tracking_params, segmentation_params, best_scalar, sbv_lims_indiv=[None, None], volume_opacity_indiv=0.3, n_points_indiv=40)[source]#

list of full paths to html or gif files containing visualizaions of individual bundles

Parameters
sbv_lims_indivndarray

Of the form (lower bound, upper bound). Shading based on shade_by_volume will only differentiate values within these bounds. If lower bound is None, will default to 0. If upper bound is None, will default to the maximum value in shade_by_volume. Default: [None, None]

volume_opacity_indivfloat, optional

Opacity of volume slices. Default: 0.3

n_points_indivint or None

n_points to resample streamlines to before plotting. If None, no resampling is done. Default: 40

AFQ.tasks.viz.plot_tract_profiles(base_fname, scalars, tracking_params, segmentation_params, segmentation_imap)[source]#

list of full paths to png files, where files contain plots of the tract profiles

AFQ.tasks.viz.init_viz_backend(viz_backend_spec='plotly_no_gif', virtual_frame_buffer=False)[source]#

An instance of the AFQ.viz.utils.viz_backend class.

Parameters
virtual_frame_bufferbool, optional

Whether to use a virtual fram buffer. This is neccessary if generating GIFs in a headless environment. Default: False

viz_backend_specstr, optional

Which visualization backend to use. See Visualization Backends page in documentation for details: https://tractometry.org/pyAFQ/usage/viz_backend.html One of {“fury”, “plotly”, “plotly_no_gif”}. Default: “plotly_no_gif”

AFQ.tasks.viz.get_viz_plan(kwargs)[source]#