niwrap-freesurfer 0.5.1__py3-none-any.whl → 0.5.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of niwrap-freesurfer might be problematic. Click here for more details.

Files changed (153) hide show
  1. niwrap_freesurfer/freesurfer/__init__.py +0 -11
  2. niwrap_freesurfer/freesurfer/annot2std.py +32 -1
  3. niwrap_freesurfer/freesurfer/aparc2feat.py +19 -1
  4. niwrap_freesurfer/freesurfer/bbregister.py +143 -4
  5. niwrap_freesurfer/freesurfer/bmedits2surf.py +2 -2
  6. niwrap_freesurfer/freesurfer/compute_interrater_variability_csh.py +20 -2
  7. niwrap_freesurfer/freesurfer/compute_label_volumes_csh.py +17 -2
  8. niwrap_freesurfer/freesurfer/conf2hires.py +59 -1
  9. niwrap_freesurfer/freesurfer/connected_components.py +34 -2
  10. niwrap_freesurfer/freesurfer/dcmdir_info_mgh.py +3 -2
  11. niwrap_freesurfer/freesurfer/dcmdjpeg_fs.py +2 -2
  12. niwrap_freesurfer/freesurfer/dcmdrle_fs.py +2 -2
  13. niwrap_freesurfer/freesurfer/dicom_rename.py +21 -2
  14. niwrap_freesurfer/freesurfer/dmri_bset.py +14 -2
  15. niwrap_freesurfer/freesurfer/dmri_forrest.py +10 -1
  16. niwrap_freesurfer/freesurfer/dmri_mergepaths.py +2 -2
  17. niwrap_freesurfer/freesurfer/dmri_pathstats.py +2 -2
  18. niwrap_freesurfer/freesurfer/dmri_stats_ac.py +1 -3
  19. niwrap_freesurfer/freesurfer/exvivo_hemi_proc.py +10 -1
  20. niwrap_freesurfer/freesurfer/fiducials_calibration.py +15 -1
  21. niwrap_freesurfer/freesurfer/fiducials_correction.py +10 -3
  22. niwrap_freesurfer/freesurfer/fix_subject_corrected_rh.py +3 -2
  23. niwrap_freesurfer/freesurfer/fix_subject_rh.py +3 -2
  24. niwrap_freesurfer/freesurfer/fs_check_version.py +19 -1
  25. niwrap_freesurfer/freesurfer/fs_spmreg_glnxa64.py +19 -4
  26. niwrap_freesurfer/freesurfer/fs_temp_file.py +36 -1
  27. niwrap_freesurfer/freesurfer/fs_update.py +19 -1
  28. niwrap_freesurfer/freesurfer/fsl_sub_mgh.py +1 -2
  29. niwrap_freesurfer/freesurfer/fsr_import.py +55 -5
  30. niwrap_freesurfer/freesurfer/fvcompare.py +10 -1
  31. niwrap_freesurfer/freesurfer/gca_apply.py +3 -2
  32. niwrap_freesurfer/freesurfer/gdcmconv_fs.py +2 -2
  33. niwrap_freesurfer/freesurfer/get_label_thickness.py +1 -2
  34. niwrap_freesurfer/freesurfer/groupstats.py +97 -1
  35. niwrap_freesurfer/freesurfer/groupstatsdiff.py +4 -4
  36. niwrap_freesurfer/freesurfer/hiam_make_surfaces.py +1 -2
  37. niwrap_freesurfer/freesurfer/histo_synthesize.py +1 -2
  38. niwrap_freesurfer/freesurfer/inflate_subject_lh.py +3 -2
  39. niwrap_freesurfer/freesurfer/inflate_subject_new_lh.py +3 -3
  40. niwrap_freesurfer/freesurfer/inflate_subject_new_rh.py +3 -2
  41. niwrap_freesurfer/freesurfer/inflate_subject_rh.py +3 -2
  42. niwrap_freesurfer/freesurfer/inflate_subject_sc.py +28 -3
  43. niwrap_freesurfer/freesurfer/irepifitvol_glnx64.py +2 -2
  44. niwrap_freesurfer/freesurfer/is_surface.py +3 -2
  45. niwrap_freesurfer/freesurfer/isolate_labels_csh.py +17 -2
  46. niwrap_freesurfer/freesurfer/label_subject_flash.py +2 -2
  47. niwrap_freesurfer/freesurfer/label_subject_mixed.py +2 -2
  48. niwrap_freesurfer/freesurfer/listsubj.py +82 -2
  49. niwrap_freesurfer/freesurfer/long_stats_combine.py +1 -2
  50. niwrap_freesurfer/freesurfer/long_stats_tps.py +7 -7
  51. niwrap_freesurfer/freesurfer/long_submit_jobs.py +1 -5
  52. niwrap_freesurfer/freesurfer/longmc.py +10 -1
  53. niwrap_freesurfer/freesurfer/lta_convert.py +157 -1
  54. niwrap_freesurfer/freesurfer/make_average_volume.py +19 -1
  55. niwrap_freesurfer/freesurfer/make_folding_atlas.py +10 -1
  56. niwrap_freesurfer/freesurfer/map_all_labels_lh.py +11 -3
  57. niwrap_freesurfer/freesurfer/map_central_sulcus.py +2 -2
  58. niwrap_freesurfer/freesurfer/merge_stats_tables.py +58 -35
  59. niwrap_freesurfer/freesurfer/mideface.py +121 -14
  60. niwrap_freesurfer/freesurfer/mni152reg.py +2 -2
  61. niwrap_freesurfer/freesurfer/morph_only_subject_lh.py +3 -2
  62. niwrap_freesurfer/freesurfer/morph_only_subject_rh.py +3 -2
  63. niwrap_freesurfer/freesurfer/morph_rgb_lh.py +3 -2
  64. niwrap_freesurfer/freesurfer/morph_rgb_rh.py +3 -2
  65. niwrap_freesurfer/freesurfer/morph_subject_lh.py +3 -2
  66. niwrap_freesurfer/freesurfer/morph_subject_rh.py +3 -2
  67. niwrap_freesurfer/freesurfer/morph_tables_lh.py +3 -2
  68. niwrap_freesurfer/freesurfer/morph_tables_rh.py +3 -2
  69. niwrap_freesurfer/freesurfer/mri_aparc2aseg.py +10 -1
  70. niwrap_freesurfer/freesurfer/mri_apply_bias.py +1 -2
  71. niwrap_freesurfer/freesurfer/mri_average.py +10 -1
  72. niwrap_freesurfer/freesurfer/mri_brain_volume.py +23 -2
  73. niwrap_freesurfer/freesurfer/mri_ca_label.py +603 -2
  74. niwrap_freesurfer/freesurfer/mri_ca_train.py +10 -1
  75. niwrap_freesurfer/freesurfer/mri_convert.py +188 -2
  76. niwrap_freesurfer/freesurfer/mri_fuse_segmentations.py +10 -3
  77. niwrap_freesurfer/freesurfer/mri_gcab_train.py +15 -1
  78. niwrap_freesurfer/freesurfer/mri_gdfglm.py +13 -1
  79. niwrap_freesurfer/freesurfer/mri_gtmpvc.py +19 -1
  80. niwrap_freesurfer/freesurfer/mri_hausdorff_dist.py +1 -2
  81. niwrap_freesurfer/freesurfer/mri_head.py +19 -1
  82. niwrap_freesurfer/freesurfer/mri_jacobian.py +10 -1
  83. niwrap_freesurfer/freesurfer/mri_nl_align.py +27 -1
  84. niwrap_freesurfer/freesurfer/mri_relabel_nonwm_hypos.py +3 -3
  85. niwrap_freesurfer/freesurfer/mri_reorient_lr_csh.py +2 -2
  86. niwrap_freesurfer/freesurfer/mri_seg_diff.py +14 -1
  87. niwrap_freesurfer/freesurfer/mri_twoclass.py +1 -2
  88. niwrap_freesurfer/freesurfer/mri_validate_skull_stripped.py +2 -2
  89. niwrap_freesurfer/freesurfer/mri_warp_convert.py +131 -1
  90. niwrap_freesurfer/freesurfer/mri_z2p.py +37 -1
  91. niwrap_freesurfer/freesurfer/mris_add_template.py +11 -1
  92. niwrap_freesurfer/freesurfer/mris_apply_reg.py +1 -2
  93. niwrap_freesurfer/freesurfer/mris_curvature_stats.py +419 -7
  94. niwrap_freesurfer/freesurfer/mris_diff.py +255 -1
  95. niwrap_freesurfer/freesurfer/mris_distance_map.py +1 -2
  96. niwrap_freesurfer/freesurfer/mris_errors.py +1 -2
  97. niwrap_freesurfer/freesurfer/mris_info.py +45 -46
  98. niwrap_freesurfer/freesurfer/mris_label_calc.py +14 -1
  99. niwrap_freesurfer/freesurfer/mris_map_cuts.py +1 -2
  100. niwrap_freesurfer/freesurfer/mris_nudge.py +1 -2
  101. niwrap_freesurfer/freesurfer/mris_place_surface.py +1 -2
  102. niwrap_freesurfer/freesurfer/mris_preproc.py +16 -2
  103. niwrap_freesurfer/freesurfer/mris_spherical_average.py +93 -8
  104. niwrap_freesurfer/freesurfer/mris_thickness_diff.py +1 -5
  105. niwrap_freesurfer/freesurfer/mris_volmask_vtk.py +2 -2
  106. niwrap_freesurfer/freesurfer/pctsurfcon.py +2 -2
  107. niwrap_freesurfer/freesurfer/plot_structure_stats_tcl.py +2 -2
  108. niwrap_freesurfer/freesurfer/post_recon_all.py +39 -2
  109. niwrap_freesurfer/freesurfer/predict_v1_sh.py +11 -2
  110. niwrap_freesurfer/freesurfer/print_unique_labels_csh.py +34 -3
  111. niwrap_freesurfer/freesurfer/rbbr.py +37 -1
  112. niwrap_freesurfer/freesurfer/rca_base_init.py +3 -2
  113. niwrap_freesurfer/freesurfer/rca_config.py +3 -2
  114. niwrap_freesurfer/freesurfer/rca_config2csh.py +3 -2
  115. niwrap_freesurfer/freesurfer/recon_all.py +75 -1
  116. niwrap_freesurfer/freesurfer/register_elderly_subject.py +2 -2
  117. niwrap_freesurfer/freesurfer/reinflate_subject_lh.py +3 -2
  118. niwrap_freesurfer/freesurfer/reinflate_subject_rh.py +3 -2
  119. niwrap_freesurfer/freesurfer/renormalize_subject_keep_editting.py +13 -1
  120. niwrap_freesurfer/freesurfer/rtview.py +34 -1
  121. niwrap_freesurfer/freesurfer/run_qdec_glm.py +3 -2
  122. niwrap_freesurfer/freesurfer/samseg.py +14 -1
  123. niwrap_freesurfer/freesurfer/samseg_long.py +17 -8
  124. niwrap_freesurfer/freesurfer/samsegmesh2surf.py +5 -7
  125. niwrap_freesurfer/freesurfer/seg2filled.py +4 -4
  126. niwrap_freesurfer/freesurfer/segment_subject.py +2 -2
  127. niwrap_freesurfer/freesurfer/segment_subject_old_skull_strip.py +4 -4
  128. niwrap_freesurfer/freesurfer/segment_subject_sc.py +4 -4
  129. niwrap_freesurfer/freesurfer/segment_subject_t2_auto_estimate_alveus_ml.py +11 -1
  130. niwrap_freesurfer/freesurfer/segpons.py +2 -2
  131. niwrap_freesurfer/freesurfer/sphere_subject_lh.py +3 -2
  132. niwrap_freesurfer/freesurfer/sphere_subject_rh.py +3 -2
  133. niwrap_freesurfer/freesurfer/talairach.py +4 -4
  134. niwrap_freesurfer/freesurfer/trac_all.py +283 -1
  135. niwrap_freesurfer/freesurfer/train_gcs_atlas.py +19 -1
  136. niwrap_freesurfer/freesurfer/update_needed.py +13 -2
  137. niwrap_freesurfer/freesurfer/vertexvol.py +19 -1
  138. niwrap_freesurfer/freesurfer/vol2subfield.py +72 -1
  139. niwrap_freesurfer/freesurfer/wmsaseg.py +2 -2
  140. {niwrap_freesurfer-0.5.1.dist-info → niwrap_freesurfer-0.5.3.dist-info}/METADATA +1 -1
  141. {niwrap_freesurfer-0.5.1.dist-info → niwrap_freesurfer-0.5.3.dist-info}/RECORD +142 -153
  142. niwrap_freesurfer/freesurfer/bet_fsl.py +0 -441
  143. niwrap_freesurfer/freesurfer/epidewarp_fsl.py +0 -439
  144. niwrap_freesurfer/freesurfer/flirt_fsl.py +0 -604
  145. niwrap_freesurfer/freesurfer/fscalc_fsl.py +0 -196
  146. niwrap_freesurfer/freesurfer/fsfirst_fsl.py +0 -166
  147. niwrap_freesurfer/freesurfer/fslmaths_fsl.py +0 -196
  148. niwrap_freesurfer/freesurfer/fslorient_fsl.py +0 -207
  149. niwrap_freesurfer/freesurfer/fslswapdim_fsl.py +0 -216
  150. niwrap_freesurfer/freesurfer/fspython.py +0 -175
  151. niwrap_freesurfer/freesurfer/mri_motion_correct_fsl.py +0 -185
  152. niwrap_freesurfer/freesurfer/slicetimer_fsl.py +0 -291
  153. {niwrap_freesurfer-0.5.1.dist-info → niwrap_freesurfer-0.5.3.dist-info}/WHEEL +0 -0
@@ -1,441 +0,0 @@
1
- # This file was auto generated by Styx.
2
- # Do not edit this file directly.
3
-
4
- import typing
5
- import pathlib
6
- from styxdefs import *
7
-
8
- BET_FSL_METADATA = Metadata(
9
- id="05134dd9049bee70d91cad11059af4110900a569.boutiques",
10
- name="bet.fsl",
11
- package="freesurfer",
12
- container_image_tag="freesurfer/freesurfer:7.4.1",
13
- )
14
-
15
-
16
- BetFslParameters = typing.TypedDict('BetFslParameters', {
17
- "__STYX_TYPE__": typing.Literal["bet.fsl"],
18
- "infile": InputPathType,
19
- "maskfile": str,
20
- "fractional_intensity": typing.NotRequired[float | None],
21
- "vg_fractional_intensity": typing.NotRequired[float | None],
22
- "center_of_gravity": typing.NotRequired[list[float] | None],
23
- "overlay": bool,
24
- "binary_mask": bool,
25
- "approx_skull": bool,
26
- "no_seg_output": bool,
27
- "vtk_mesh": bool,
28
- "head_radius": typing.NotRequired[float | None],
29
- "thresholding": bool,
30
- "robust_iters": bool,
31
- "residual_optic_cleanup": bool,
32
- "reduce_bias": bool,
33
- "slice_padding": bool,
34
- "whole_set_mask": bool,
35
- "additional_surfaces": bool,
36
- "additional_surfaces_t2": typing.NotRequired[InputPathType | None],
37
- "verbose": bool,
38
- "debug": bool,
39
- })
40
-
41
-
42
- def dyn_cargs(
43
- t: str,
44
- ) -> typing.Any:
45
- """
46
- Get build cargs function by command type.
47
-
48
- Args:
49
- t: Command type.
50
- Returns:
51
- Build cargs function.
52
- """
53
- return {
54
- "bet.fsl": bet_fsl_cargs,
55
- }.get(t)
56
-
57
-
58
- def dyn_outputs(
59
- t: str,
60
- ) -> typing.Any:
61
- """
62
- Get build outputs function by command type.
63
-
64
- Args:
65
- t: Command type.
66
- Returns:
67
- Build outputs function.
68
- """
69
- return {
70
- "bet.fsl": bet_fsl_outputs,
71
- }.get(t)
72
-
73
-
74
- class BetFslOutputs(typing.NamedTuple):
75
- """
76
- Output object returned when calling `bet_fsl(...)`.
77
- """
78
- root: OutputPathType
79
- """Output root folder. This is the root folder for all outputs."""
80
- outfile: OutputPathType
81
- """Main default mask output of BET"""
82
- binary_mask: OutputPathType
83
- """Binary mask file (from -m option)"""
84
- overlay_file: OutputPathType
85
- """Overlaid brain surface onto original image"""
86
- approx_skull_img: OutputPathType
87
- """Approximate skull image file"""
88
- output_vtk_mesh: OutputPathType
89
- """Mesh in VTK format"""
90
- skull_mask: OutputPathType
91
- """Output mask for skull image"""
92
- out_inskull_mask: OutputPathType
93
- """The in-skull mask file from betsurf"""
94
- out_inskull_mesh: OutputPathType
95
- """The in-skull mesh file from betsurf"""
96
- out_inskull_off: OutputPathType
97
- """The in-skull mesh .off file from betsurf"""
98
- out_outskin_mask: OutputPathType
99
- """The out-skin mask file from betsurf"""
100
- out_outskin_mesh: OutputPathType
101
- """The out-skin mesh file from betsurf"""
102
- out_outskin_off: OutputPathType
103
- """The out-skin mesh .off file from betsurf"""
104
- out_outskull_mask: OutputPathType
105
- """The out-skull mask file from betsurf"""
106
- out_outskull_mesh: OutputPathType
107
- """The out-skull mesh file from betsurf"""
108
- out_outskull_off: OutputPathType
109
- """The out-skull mesh .off file from betsurf"""
110
-
111
-
112
- def bet_fsl_params(
113
- infile: InputPathType,
114
- maskfile: str = "img_bet",
115
- fractional_intensity: float | None = None,
116
- vg_fractional_intensity: float | None = None,
117
- center_of_gravity: list[float] | None = None,
118
- overlay: bool = False,
119
- binary_mask: bool = False,
120
- approx_skull: bool = False,
121
- no_seg_output: bool = False,
122
- vtk_mesh: bool = False,
123
- head_radius: float | None = None,
124
- thresholding: bool = False,
125
- robust_iters: bool = False,
126
- residual_optic_cleanup: bool = False,
127
- reduce_bias: bool = False,
128
- slice_padding: bool = False,
129
- whole_set_mask: bool = False,
130
- additional_surfaces: bool = False,
131
- additional_surfaces_t2: InputPathType | None = None,
132
- verbose: bool = False,
133
- debug: bool = False,
134
- ) -> BetFslParameters:
135
- """
136
- Build parameters.
137
-
138
- Args:
139
- infile: Input image (e.g. img.nii.gz).
140
- maskfile: Output brain mask (e.g. img_bet.nii.gz).
141
- fractional_intensity: Fractional intensity threshold (0->1);\
142
- default=0.5; smaller values give larger brain outline estimates.
143
- vg_fractional_intensity: Vertical gradient in fractional intensity\
144
- threshold (-1->1); default=0; positive values give larger brain outline\
145
- at bottom, smaller at top.
146
- center_of_gravity: The xyz coordinates of the center of gravity\
147
- (voxels, not mm) of initial mesh surface. Must have exactly three\
148
- numerical entries in the list (3-vector).
149
- overlay: Generate brain surface outline overlaid onto original image.
150
- binary_mask: Generate binary brain mask.
151
- approx_skull: Generate approximate skull image.
152
- no_seg_output: Don't generate segmented brain image output.
153
- vtk_mesh: Generate brain surface as mesh in .vtk format.
154
- head_radius: Head radius (mm not voxels); initial surface sphere is set\
155
- to half of this.
156
- thresholding: Apply thresholding to segmented brain image and mask.
157
- robust_iters: Robust brain centre estimation (iterates BET several\
158
- times).
159
- residual_optic_cleanup: Eye & optic nerve cleanup (can be useful in\
160
- SIENA).
161
- reduce_bias: Bias field & neck cleanup (can be useful in SIENA).
162
- slice_padding: Improve BET if FOV is very small in Z (by temporarily\
163
- padding end slices).
164
- whole_set_mask: Apply to 4D FMRI data (uses -f 0.3 and dilates brain\
165
- mask slightly).
166
- additional_surfaces: Run bet2 and then betsurf to get additional skull\
167
- and scalp surfaces (includes registrations).
168
- additional_surfaces_t2: As with -A, when also feeding in\
169
- non-brain-extracted T2 (includes registrations).
170
- verbose: Verbose (switch on diagnostic messages).
171
- debug: Debug (don't delete temporary intermediate images).
172
- Returns:
173
- Parameter dictionary
174
- """
175
- params = {
176
- "__STYXTYPE__": "bet.fsl",
177
- "infile": infile,
178
- "maskfile": maskfile,
179
- "overlay": overlay,
180
- "binary_mask": binary_mask,
181
- "approx_skull": approx_skull,
182
- "no_seg_output": no_seg_output,
183
- "vtk_mesh": vtk_mesh,
184
- "thresholding": thresholding,
185
- "robust_iters": robust_iters,
186
- "residual_optic_cleanup": residual_optic_cleanup,
187
- "reduce_bias": reduce_bias,
188
- "slice_padding": slice_padding,
189
- "whole_set_mask": whole_set_mask,
190
- "additional_surfaces": additional_surfaces,
191
- "verbose": verbose,
192
- "debug": debug,
193
- }
194
- if fractional_intensity is not None:
195
- params["fractional_intensity"] = fractional_intensity
196
- if vg_fractional_intensity is not None:
197
- params["vg_fractional_intensity"] = vg_fractional_intensity
198
- if center_of_gravity is not None:
199
- params["center_of_gravity"] = center_of_gravity
200
- if head_radius is not None:
201
- params["head_radius"] = head_radius
202
- if additional_surfaces_t2 is not None:
203
- params["additional_surfaces_t2"] = additional_surfaces_t2
204
- return params
205
-
206
-
207
- def bet_fsl_cargs(
208
- params: BetFslParameters,
209
- execution: Execution,
210
- ) -> list[str]:
211
- """
212
- Build command-line arguments from parameters.
213
-
214
- Args:
215
- params: The parameters.
216
- execution: The execution object for resolving input paths.
217
- Returns:
218
- Command-line arguments.
219
- """
220
- cargs = []
221
- cargs.append("bet.fsl")
222
- cargs.append(execution.input_file(params.get("infile")))
223
- cargs.append(params.get("maskfile"))
224
- if params.get("fractional_intensity") is not None:
225
- cargs.extend([
226
- "-f",
227
- str(params.get("fractional_intensity"))
228
- ])
229
- if params.get("vg_fractional_intensity") is not None:
230
- cargs.extend([
231
- "-g",
232
- str(params.get("vg_fractional_intensity"))
233
- ])
234
- if params.get("center_of_gravity") is not None:
235
- cargs.extend([
236
- "-c",
237
- *map(str, params.get("center_of_gravity"))
238
- ])
239
- if params.get("overlay"):
240
- cargs.append("-o")
241
- if params.get("binary_mask"):
242
- cargs.append("-m")
243
- if params.get("approx_skull"):
244
- cargs.append("-s")
245
- if params.get("no_seg_output"):
246
- cargs.append("-n")
247
- if params.get("vtk_mesh"):
248
- cargs.append("-e")
249
- if params.get("head_radius") is not None:
250
- cargs.extend([
251
- "-r",
252
- str(params.get("head_radius"))
253
- ])
254
- if params.get("thresholding"):
255
- cargs.append("-t")
256
- if params.get("robust_iters"):
257
- cargs.append("-R")
258
- if params.get("residual_optic_cleanup"):
259
- cargs.append("-S")
260
- if params.get("reduce_bias"):
261
- cargs.append("-B")
262
- if params.get("slice_padding"):
263
- cargs.append("-Z")
264
- if params.get("whole_set_mask"):
265
- cargs.append("-F")
266
- if params.get("additional_surfaces"):
267
- cargs.append("-A")
268
- if params.get("additional_surfaces_t2") is not None:
269
- cargs.extend([
270
- "-A2",
271
- execution.input_file(params.get("additional_surfaces_t2"))
272
- ])
273
- if params.get("verbose"):
274
- cargs.append("-v")
275
- if params.get("debug"):
276
- cargs.append("-d")
277
- return cargs
278
-
279
-
280
- def bet_fsl_outputs(
281
- params: BetFslParameters,
282
- execution: Execution,
283
- ) -> BetFslOutputs:
284
- """
285
- Build outputs object containing output file paths and possibly stdout/stderr.
286
-
287
- Args:
288
- params: The parameters.
289
- execution: The execution object for resolving input paths.
290
- Returns:
291
- Outputs object.
292
- """
293
- ret = BetFslOutputs(
294
- root=execution.output_file("."),
295
- outfile=execution.output_file(params.get("maskfile") + ".nii.gz"),
296
- binary_mask=execution.output_file(params.get("maskfile") + "_mask.nii.gz"),
297
- overlay_file=execution.output_file(params.get("maskfile") + "_overlay.nii.gz"),
298
- approx_skull_img=execution.output_file(params.get("maskfile") + "_skull.nii.gz"),
299
- output_vtk_mesh=execution.output_file(params.get("maskfile") + "_mesh.vtk"),
300
- skull_mask=execution.output_file(params.get("maskfile") + "_skull_mask.nii.gz"),
301
- out_inskull_mask=execution.output_file(params.get("maskfile") + "_inskull_mask.nii.gz"),
302
- out_inskull_mesh=execution.output_file(params.get("maskfile") + "_inskull_mesh.nii.gz"),
303
- out_inskull_off=execution.output_file(params.get("maskfile") + "_inskull_mesh.off"),
304
- out_outskin_mask=execution.output_file(params.get("maskfile") + "_outskin_mask.nii.gz"),
305
- out_outskin_mesh=execution.output_file(params.get("maskfile") + "_outskin_mesh.nii.gz"),
306
- out_outskin_off=execution.output_file(params.get("maskfile") + "_outskin_mesh.off"),
307
- out_outskull_mask=execution.output_file(params.get("maskfile") + "_outskull_mask.nii.gz"),
308
- out_outskull_mesh=execution.output_file(params.get("maskfile") + "_outskull_mesh.nii.gz"),
309
- out_outskull_off=execution.output_file(params.get("maskfile") + "_outskull_mesh.off"),
310
- )
311
- return ret
312
-
313
-
314
- def bet_fsl_execute(
315
- params: BetFslParameters,
316
- execution: Execution,
317
- ) -> BetFslOutputs:
318
- """
319
- Automated brain extraction tool for FSL.
320
-
321
- Author: FreeSurfer Developers
322
-
323
- URL: https://github.com/freesurfer/freesurfer
324
-
325
- Args:
326
- params: The parameters.
327
- execution: The execution object.
328
- Returns:
329
- NamedTuple of outputs (described in `BetFslOutputs`).
330
- """
331
- params = execution.params(params)
332
- cargs = bet_fsl_cargs(params, execution)
333
- ret = bet_fsl_outputs(params, execution)
334
- execution.run(cargs)
335
- return ret
336
-
337
-
338
- def bet_fsl(
339
- infile: InputPathType,
340
- maskfile: str = "img_bet",
341
- fractional_intensity: float | None = None,
342
- vg_fractional_intensity: float | None = None,
343
- center_of_gravity: list[float] | None = None,
344
- overlay: bool = False,
345
- binary_mask: bool = False,
346
- approx_skull: bool = False,
347
- no_seg_output: bool = False,
348
- vtk_mesh: bool = False,
349
- head_radius: float | None = None,
350
- thresholding: bool = False,
351
- robust_iters: bool = False,
352
- residual_optic_cleanup: bool = False,
353
- reduce_bias: bool = False,
354
- slice_padding: bool = False,
355
- whole_set_mask: bool = False,
356
- additional_surfaces: bool = False,
357
- additional_surfaces_t2: InputPathType | None = None,
358
- verbose: bool = False,
359
- debug: bool = False,
360
- runner: Runner | None = None,
361
- ) -> BetFslOutputs:
362
- """
363
- Automated brain extraction tool for FSL.
364
-
365
- Author: FreeSurfer Developers
366
-
367
- URL: https://github.com/freesurfer/freesurfer
368
-
369
- Args:
370
- infile: Input image (e.g. img.nii.gz).
371
- maskfile: Output brain mask (e.g. img_bet.nii.gz).
372
- fractional_intensity: Fractional intensity threshold (0->1);\
373
- default=0.5; smaller values give larger brain outline estimates.
374
- vg_fractional_intensity: Vertical gradient in fractional intensity\
375
- threshold (-1->1); default=0; positive values give larger brain outline\
376
- at bottom, smaller at top.
377
- center_of_gravity: The xyz coordinates of the center of gravity\
378
- (voxels, not mm) of initial mesh surface. Must have exactly three\
379
- numerical entries in the list (3-vector).
380
- overlay: Generate brain surface outline overlaid onto original image.
381
- binary_mask: Generate binary brain mask.
382
- approx_skull: Generate approximate skull image.
383
- no_seg_output: Don't generate segmented brain image output.
384
- vtk_mesh: Generate brain surface as mesh in .vtk format.
385
- head_radius: Head radius (mm not voxels); initial surface sphere is set\
386
- to half of this.
387
- thresholding: Apply thresholding to segmented brain image and mask.
388
- robust_iters: Robust brain centre estimation (iterates BET several\
389
- times).
390
- residual_optic_cleanup: Eye & optic nerve cleanup (can be useful in\
391
- SIENA).
392
- reduce_bias: Bias field & neck cleanup (can be useful in SIENA).
393
- slice_padding: Improve BET if FOV is very small in Z (by temporarily\
394
- padding end slices).
395
- whole_set_mask: Apply to 4D FMRI data (uses -f 0.3 and dilates brain\
396
- mask slightly).
397
- additional_surfaces: Run bet2 and then betsurf to get additional skull\
398
- and scalp surfaces (includes registrations).
399
- additional_surfaces_t2: As with -A, when also feeding in\
400
- non-brain-extracted T2 (includes registrations).
401
- verbose: Verbose (switch on diagnostic messages).
402
- debug: Debug (don't delete temporary intermediate images).
403
- runner: Command runner.
404
- Returns:
405
- NamedTuple of outputs (described in `BetFslOutputs`).
406
- """
407
- runner = runner or get_global_runner()
408
- execution = runner.start_execution(BET_FSL_METADATA)
409
- params = bet_fsl_params(
410
- infile=infile,
411
- maskfile=maskfile,
412
- fractional_intensity=fractional_intensity,
413
- vg_fractional_intensity=vg_fractional_intensity,
414
- center_of_gravity=center_of_gravity,
415
- overlay=overlay,
416
- binary_mask=binary_mask,
417
- approx_skull=approx_skull,
418
- no_seg_output=no_seg_output,
419
- vtk_mesh=vtk_mesh,
420
- head_radius=head_radius,
421
- thresholding=thresholding,
422
- robust_iters=robust_iters,
423
- residual_optic_cleanup=residual_optic_cleanup,
424
- reduce_bias=reduce_bias,
425
- slice_padding=slice_padding,
426
- whole_set_mask=whole_set_mask,
427
- additional_surfaces=additional_surfaces,
428
- additional_surfaces_t2=additional_surfaces_t2,
429
- verbose=verbose,
430
- debug=debug,
431
- )
432
- return bet_fsl_execute(params, execution)
433
-
434
-
435
- __all__ = [
436
- "BET_FSL_METADATA",
437
- "BetFslOutputs",
438
- "BetFslParameters",
439
- "bet_fsl",
440
- "bet_fsl_params",
441
- ]