|
1 | 1 | """Base anatomical preprocessing."""
|
2 | 2 | import warnings
|
| 3 | +from pathlib import Path |
| 4 | +from typing import Literal, Optional, Union |
3 | 5 |
|
4 | 6 | from nipype.interfaces import utility as niu
|
5 | 7 | from nipype.pipeline import engine as pe
|
| 8 | +from niworkflows.engine.workflows import LiterateWorkflow |
| 9 | +from niworkflows.utils.spaces import Reference, SpatialReferences |
6 | 10 |
|
7 | 11 | from ... import config
|
8 | 12 |
|
9 | 13 |
|
10 | 14 | def init_infant_anat_wf(
|
11 | 15 | *,
|
12 |
| - age_months, |
13 |
| - ants_affine_init, |
14 |
| - t1w, |
15 |
| - t2w, |
16 |
| - anat_modality, |
17 |
| - bids_root, |
18 |
| - existing_derivatives, |
19 |
| - freesurfer, |
20 |
| - hires, |
21 |
| - longitudinal, |
22 |
| - omp_nthreads, |
23 |
| - output_dir, |
24 |
| - segmentation_atlases, |
25 |
| - skull_strip_mode, |
26 |
| - skull_strip_template, |
27 |
| - sloppy, |
28 |
| - spaces, |
29 |
| - cifti_output=False, |
30 |
| - name="infant_anat_wf", |
31 |
| -): |
| 16 | + age_months: Optional[int], |
| 17 | + ants_affine_init: bool, |
| 18 | + t1w: list, |
| 19 | + t2w: list, |
| 20 | + anat_modality: str, |
| 21 | + bids_root: Optional[Union[str, Path]], |
| 22 | + existing_derivatives: dict, |
| 23 | + freesurfer: bool, |
| 24 | + hires: Optional[bool], |
| 25 | + longitudinal: bool, |
| 26 | + omp_nthreads: int, |
| 27 | + output_dir: Union[str, Path], |
| 28 | + segmentation_atlases: Optional[Union[str, Path]], |
| 29 | + skull_strip_mode: str, |
| 30 | + skull_strip_template: Reference, |
| 31 | + sloppy: bool, |
| 32 | + spaces: Optional[SpatialReferences], |
| 33 | + cifti_output: Optional[Literal['91k', '170k']], |
| 34 | + name: str = "infant_anat_wf", |
| 35 | +) -> LiterateWorkflow: |
32 | 36 | """
|
33 | 37 |
|
34 | 38 | - T1w reference: realigning and then averaging anatomical images.
|
@@ -79,7 +83,6 @@ def init_infant_anat_wf(
|
79 | 83 | GIFTI surfaces (gray/white boundary, midthickness, pial, inflated)
|
80 | 84 | """
|
81 | 85 | from nipype.interfaces.ants.base import Info as ANTsInfo
|
82 |
| - from niworkflows.engine.workflows import LiterateWorkflow as Workflow |
83 | 86 |
|
84 | 87 | from ...utils.misc import fix_multi_source_name
|
85 | 88 | from .brain_extraction import init_infant_brain_extraction_wf
|
@@ -122,7 +125,7 @@ def init_infant_anat_wf(
|
122 | 125 | precomp_mask = validated_derivatives.get("anat_mask")
|
123 | 126 | precomp_aseg = validated_derivatives.get("anat_aseg")
|
124 | 127 |
|
125 |
| - wf = Workflow(name=name) |
| 128 | + wf = LiterateWorkflow(name=name) |
126 | 129 | desc = f"""\n
|
127 | 130 | Anatomical data preprocessing
|
128 | 131 |
|
|
0 commit comments