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') -> 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 using an ROI in the center of the brain mask. :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). 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]