AFQ.definitions.mapping#

Module Contents#

Classes#

FnirtMap

Use an existing FNIRT map. Expects a warp file

SynMap

Calculate a Syn registration for each subject/session

SlrMap

Calculate a SLR registration for each subject/session

AffMap

Calculate an affine registration for each subject/session

class AFQ.definitions.mapping.FnirtMap(warp_path=None, space_path=None, warp_suffix=None, space_suffix=None, warp_filters={}, space_filters={})[source]#

Bases: AFQ.definitions.utils.Definition

Use an existing FNIRT map. Expects a warp file and an image file for each subject / session; image file is used as src space for warp.

Parameters
warp_pathstr, optional

path to file to get warp from. Use this or warp_suffix. Default: None

space_pathstr, optional

path to file to get warp from. Use this or space_suffix. Default: None

warp_suffixstr, optional

suffix to pass to bids_layout.get() to identify the warp file. Default: None

space_suffixstr, optional

suffix to pass to bids_layout.get() to identify the space file. Default: None

warp_filtersstr, optional

Additional filters to pass to bids_layout.get() to identify the warp file. Default: {}

space_filtersstr, optional

Additional filters to pass to bids_layout.get() to identify the space file. Default: {}

Notes

If you have an existing mapping calculated using Fnirt, you can pass bids filters to AFQ.definitions.mapping.FnirtMap and pyAFQ will find and use that mapping.

Examples

fnirt_map = FnirtMap(

warp_suffix=”warp”, space_suffix=”MNI”, warp_filters={“scope”: “TBSS”}, space_filters={“scope”: “TBSS”})

api.GroupAFQ(mapping=fnirt_map)

find_path(bids_layout, from_path, subject, session, required=True)[source]#
get_for_subses(base_fname, dwi, dwi_data_file, reg_subject, reg_template)[source]#
class AFQ.definitions.mapping.SynMap(use_prealign=True, affine_kwargs={}, syn_kwargs={})[source]#

Bases: GeneratedMapMixin, AFQ.definitions.utils.Definition

Calculate a Syn registration for each subject/session using reg_subject and reg_template.

Parameters
use_prealignbool

Whether to perform a linear pre-registration. Default: True

affine_kwargsdictionary, optional

Parameters to pass to affine_registration in dipy.align, which does the linear pre-alignment. Only used if use_prealign is True. Default: {}

syn_kwargsdictionary, optional

Parameters to pass to syn_registration in dipy.align, which does the SyN alignment. Default: {}

Notes

The default mapping class is to use Symmetric Diffeomorphic Image Registration (SyN). This is done with an optional linear pre-alignment by default. The parameters of the pre-alginment can be specified when initializing the SynMap.

Examples

api.GroupAFQ(mapping=SynMap())

gen_mapping(base_fname, reg_subject, reg_template, subject_sls, template_sls, reg_prealign)[source]#
class AFQ.definitions.mapping.SlrMap(slr_kwargs={})[source]#

Bases: GeneratedMapMixin, AFQ.definitions.utils.Definition

Calculate a SLR registration for each subject/session using reg_subject and reg_template.

Parameters
slr_kwargsdictionary, optional

Parameters to pass to whole_brain_slr in dipy, which does the SLR alignment. Default: {}

Notes

Use this class to tell pyAFQ to use Streamline-based Linear Registration (SLR) for registration. Note that the reg_template and reg_subject parameters passed to AFQ.api.group.GroupAFQ should be streamlines when using this registration.

Examples

api.GroupAFQ(mapping=SlrMap())

gen_mapping(base_fname, reg_template, reg_subject, subject_sls, template_sls, reg_prealign)[source]#
class AFQ.definitions.mapping.AffMap(affine_kwargs={})[source]#

Bases: GeneratedMapMixin, AFQ.definitions.utils.Definition

Calculate an affine registration for each subject/session using reg_subject and reg_template.

Parameters
affine_kwargsdictionary, optional

Parameters to pass to affine_registration in dipy.align, which does the linear pre-alignment. Default: {}

Notes

This will only perform a linear alignment for registration.

Examples

api.GroupAFQ(mapping=AffMap())

gen_mapping(base_fname, reg_subject, reg_template, subject_sls, template_sls, reg_prealign)[source]#