kwneuro.masks¶
Functions¶
|
Run brain extraction on a batch of cases. |
|
Run brain extraction on a single case. |
Module Contents¶
- kwneuro.masks.brain_extract_batch(cases: list[tuple[kwneuro.dwi.Dwi, pathlib.Path]]) list[kwneuro.io.NiftiVolumeResource]¶
Run brain extraction on a batch of cases. HD-BET does not run in parallel, but it does have some initialization time so it helps to run cases in batches.
- Parameters:
cases – A list of pairs each consisting of an input Dwi and desired output path for the mask.
Returns a list of computed brain masks that is in correspondence with the list of input cases.
- kwneuro.masks.brain_extract_single(dwi: kwneuro.dwi.Dwi, output_path: kwneuro.util.PathLike) kwneuro.io.NiftiVolumeResource¶
Run brain extraction on a single case.
HD-BET has significant initialization time, so it is not advised to run this function in a loop; see brain_extract_batch.
- Parameters:
dwi – Input DWI
output_path – Output path for brain mask
Returns the computed brain mask.