kwneuro.tractseg ================ .. py:module:: kwneuro.tractseg Functions --------- .. autoapisummary:: kwneuro.tractseg.extract_tractseg Module Contents --------------- .. py:function:: extract_tractseg(dwi: kwneuro.dwi.Dwi, mask: kwneuro.resource.VolumeResource, response: kwneuro.resource.ResponseFunctionResource | None = None, output_type: str = 'tract_segmentation', csd_peaks: tuple[kwneuro.resource.VolumeResource, kwneuro.resource.VolumeResource] | None = None) -> kwneuro.resource.VolumeResource Run TractSeg on a DWI dataset to segment white matter tracts. :param dwi: The Diffusion Weighted Imaging (DWI) dataset. :param mask: A binary brain mask volume. :param response: The single-fiber response function. If `None`, the response function is estimated automatically. Ignored when ``csd_peaks`` is provided. :type response: Optional :param output_type: TractSeg can segment not only bundles, but also the end regions of bundles. Moreover it can create Tract Orientation Maps (TOM). 'tract_segmentation' [DEFAULT]: Segmentation of bundles (72 bundles). 'endings_segmentation': Segmentation of bundle end regions (72 bundles). 'TOM': Tract Orientation Maps (20 bundles). :param csd_peaks: Pre-computed CSD peaks as a ``(directions, values)`` tuple of VolumeResources. When provided the CSD computation step is skipped. :type csd_peaks: Optional Returns: A volume resource containing a 4D numpy array with the output of tractseg for tract_segmentation: [x, y, z, nr_of_bundles] for endings_segmentation: [x, y, z, 2*nr_of_bundles] for TOM: [x, y, z, 3*nr_of_bundles]