niwrap-freesurfer 0.5.1__py3-none-any.whl → 0.5.2__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.
- niwrap_freesurfer/freesurfer/__init__.py +0 -11
- niwrap_freesurfer/freesurfer/annot2std.py +32 -1
- niwrap_freesurfer/freesurfer/aparc2feat.py +19 -1
- niwrap_freesurfer/freesurfer/bbregister.py +143 -4
- niwrap_freesurfer/freesurfer/bmedits2surf.py +2 -2
- niwrap_freesurfer/freesurfer/compute_interrater_variability_csh.py +20 -2
- niwrap_freesurfer/freesurfer/compute_label_volumes_csh.py +17 -2
- niwrap_freesurfer/freesurfer/conf2hires.py +59 -1
- niwrap_freesurfer/freesurfer/connected_components.py +34 -2
- niwrap_freesurfer/freesurfer/dcmdir_info_mgh.py +3 -2
- niwrap_freesurfer/freesurfer/dcmdjpeg_fs.py +2 -2
- niwrap_freesurfer/freesurfer/dcmdrle_fs.py +2 -2
- niwrap_freesurfer/freesurfer/dicom_rename.py +21 -2
- niwrap_freesurfer/freesurfer/dmri_bset.py +14 -2
- niwrap_freesurfer/freesurfer/dmri_forrest.py +10 -1
- niwrap_freesurfer/freesurfer/dmri_mergepaths.py +2 -2
- niwrap_freesurfer/freesurfer/dmri_pathstats.py +2 -2
- niwrap_freesurfer/freesurfer/dmri_stats_ac.py +1 -3
- niwrap_freesurfer/freesurfer/exvivo_hemi_proc.py +10 -1
- niwrap_freesurfer/freesurfer/fiducials_calibration.py +15 -1
- niwrap_freesurfer/freesurfer/fiducials_correction.py +10 -3
- niwrap_freesurfer/freesurfer/fix_subject_corrected_rh.py +3 -2
- niwrap_freesurfer/freesurfer/fix_subject_rh.py +3 -2
- niwrap_freesurfer/freesurfer/fs_check_version.py +19 -1
- niwrap_freesurfer/freesurfer/fs_spmreg_glnxa64.py +19 -4
- niwrap_freesurfer/freesurfer/fs_temp_file.py +36 -1
- niwrap_freesurfer/freesurfer/fs_update.py +19 -1
- niwrap_freesurfer/freesurfer/fsl_sub_mgh.py +1 -2
- niwrap_freesurfer/freesurfer/fsr_import.py +55 -5
- niwrap_freesurfer/freesurfer/fvcompare.py +10 -1
- niwrap_freesurfer/freesurfer/gca_apply.py +3 -2
- niwrap_freesurfer/freesurfer/gdcmconv_fs.py +2 -2
- niwrap_freesurfer/freesurfer/get_label_thickness.py +1 -2
- niwrap_freesurfer/freesurfer/groupstats.py +97 -1
- niwrap_freesurfer/freesurfer/groupstatsdiff.py +4 -4
- niwrap_freesurfer/freesurfer/hiam_make_surfaces.py +1 -2
- niwrap_freesurfer/freesurfer/histo_synthesize.py +1 -2
- niwrap_freesurfer/freesurfer/inflate_subject_lh.py +3 -2
- niwrap_freesurfer/freesurfer/inflate_subject_new_lh.py +3 -3
- niwrap_freesurfer/freesurfer/inflate_subject_new_rh.py +3 -2
- niwrap_freesurfer/freesurfer/inflate_subject_rh.py +3 -2
- niwrap_freesurfer/freesurfer/inflate_subject_sc.py +28 -3
- niwrap_freesurfer/freesurfer/irepifitvol_glnx64.py +2 -2
- niwrap_freesurfer/freesurfer/is_surface.py +3 -2
- niwrap_freesurfer/freesurfer/isolate_labels_csh.py +17 -2
- niwrap_freesurfer/freesurfer/label_subject_flash.py +2 -2
- niwrap_freesurfer/freesurfer/label_subject_mixed.py +2 -2
- niwrap_freesurfer/freesurfer/listsubj.py +82 -2
- niwrap_freesurfer/freesurfer/long_stats_combine.py +1 -2
- niwrap_freesurfer/freesurfer/long_stats_tps.py +7 -7
- niwrap_freesurfer/freesurfer/long_submit_jobs.py +1 -5
- niwrap_freesurfer/freesurfer/longmc.py +10 -1
- niwrap_freesurfer/freesurfer/lta_convert.py +157 -1
- niwrap_freesurfer/freesurfer/make_average_volume.py +19 -1
- niwrap_freesurfer/freesurfer/make_folding_atlas.py +10 -1
- niwrap_freesurfer/freesurfer/map_all_labels_lh.py +11 -3
- niwrap_freesurfer/freesurfer/map_central_sulcus.py +2 -2
- niwrap_freesurfer/freesurfer/merge_stats_tables.py +58 -35
- niwrap_freesurfer/freesurfer/mideface.py +121 -14
- niwrap_freesurfer/freesurfer/mni152reg.py +2 -2
- niwrap_freesurfer/freesurfer/morph_only_subject_lh.py +3 -2
- niwrap_freesurfer/freesurfer/morph_only_subject_rh.py +3 -2
- niwrap_freesurfer/freesurfer/morph_rgb_lh.py +3 -2
- niwrap_freesurfer/freesurfer/morph_rgb_rh.py +3 -2
- niwrap_freesurfer/freesurfer/morph_subject_lh.py +3 -2
- niwrap_freesurfer/freesurfer/morph_subject_rh.py +3 -2
- niwrap_freesurfer/freesurfer/morph_tables_lh.py +3 -2
- niwrap_freesurfer/freesurfer/morph_tables_rh.py +3 -2
- niwrap_freesurfer/freesurfer/mri_aparc2aseg.py +10 -1
- niwrap_freesurfer/freesurfer/mri_apply_bias.py +1 -2
- niwrap_freesurfer/freesurfer/mri_average.py +10 -1
- niwrap_freesurfer/freesurfer/mri_brain_volume.py +23 -2
- niwrap_freesurfer/freesurfer/mri_ca_label.py +603 -2
- niwrap_freesurfer/freesurfer/mri_ca_train.py +10 -1
- niwrap_freesurfer/freesurfer/mri_convert.py +188 -2
- niwrap_freesurfer/freesurfer/mri_fuse_segmentations.py +10 -3
- niwrap_freesurfer/freesurfer/mri_gcab_train.py +15 -1
- niwrap_freesurfer/freesurfer/mri_gdfglm.py +13 -1
- niwrap_freesurfer/freesurfer/mri_gtmpvc.py +19 -1
- niwrap_freesurfer/freesurfer/mri_hausdorff_dist.py +1 -2
- niwrap_freesurfer/freesurfer/mri_head.py +19 -1
- niwrap_freesurfer/freesurfer/mri_jacobian.py +10 -1
- niwrap_freesurfer/freesurfer/mri_nl_align.py +27 -1
- niwrap_freesurfer/freesurfer/mri_relabel_nonwm_hypos.py +3 -3
- niwrap_freesurfer/freesurfer/mri_reorient_lr_csh.py +2 -2
- niwrap_freesurfer/freesurfer/mri_seg_diff.py +14 -1
- niwrap_freesurfer/freesurfer/mri_twoclass.py +1 -2
- niwrap_freesurfer/freesurfer/mri_validate_skull_stripped.py +2 -2
- niwrap_freesurfer/freesurfer/mri_warp_convert.py +131 -1
- niwrap_freesurfer/freesurfer/mri_z2p.py +37 -1
- niwrap_freesurfer/freesurfer/mris_add_template.py +11 -1
- niwrap_freesurfer/freesurfer/mris_apply_reg.py +1 -2
- niwrap_freesurfer/freesurfer/mris_curvature_stats.py +419 -7
- niwrap_freesurfer/freesurfer/mris_diff.py +255 -1
- niwrap_freesurfer/freesurfer/mris_distance_map.py +1 -2
- niwrap_freesurfer/freesurfer/mris_errors.py +1 -2
- niwrap_freesurfer/freesurfer/mris_info.py +45 -46
- niwrap_freesurfer/freesurfer/mris_label_calc.py +14 -1
- niwrap_freesurfer/freesurfer/mris_map_cuts.py +1 -2
- niwrap_freesurfer/freesurfer/mris_nudge.py +1 -2
- niwrap_freesurfer/freesurfer/mris_place_surface.py +1 -2
- niwrap_freesurfer/freesurfer/mris_preproc.py +16 -2
- niwrap_freesurfer/freesurfer/mris_spherical_average.py +93 -8
- niwrap_freesurfer/freesurfer/mris_thickness_diff.py +1 -5
- niwrap_freesurfer/freesurfer/mris_volmask_vtk.py +2 -2
- niwrap_freesurfer/freesurfer/pctsurfcon.py +2 -2
- niwrap_freesurfer/freesurfer/plot_structure_stats_tcl.py +2 -2
- niwrap_freesurfer/freesurfer/post_recon_all.py +39 -2
- niwrap_freesurfer/freesurfer/predict_v1_sh.py +11 -2
- niwrap_freesurfer/freesurfer/print_unique_labels_csh.py +34 -3
- niwrap_freesurfer/freesurfer/rbbr.py +37 -1
- niwrap_freesurfer/freesurfer/rca_base_init.py +3 -2
- niwrap_freesurfer/freesurfer/rca_config.py +3 -2
- niwrap_freesurfer/freesurfer/rca_config2csh.py +3 -2
- niwrap_freesurfer/freesurfer/recon_all.py +75 -1
- niwrap_freesurfer/freesurfer/register_elderly_subject.py +2 -2
- niwrap_freesurfer/freesurfer/reinflate_subject_lh.py +3 -2
- niwrap_freesurfer/freesurfer/reinflate_subject_rh.py +3 -2
- niwrap_freesurfer/freesurfer/renormalize_subject_keep_editting.py +13 -1
- niwrap_freesurfer/freesurfer/rtview.py +34 -1
- niwrap_freesurfer/freesurfer/run_qdec_glm.py +3 -2
- niwrap_freesurfer/freesurfer/samseg.py +14 -1
- niwrap_freesurfer/freesurfer/samseg_long.py +17 -8
- niwrap_freesurfer/freesurfer/samsegmesh2surf.py +5 -7
- niwrap_freesurfer/freesurfer/seg2filled.py +4 -4
- niwrap_freesurfer/freesurfer/segment_subject.py +2 -2
- niwrap_freesurfer/freesurfer/segment_subject_old_skull_strip.py +4 -4
- niwrap_freesurfer/freesurfer/segment_subject_sc.py +4 -4
- niwrap_freesurfer/freesurfer/segment_subject_t2_auto_estimate_alveus_ml.py +11 -1
- niwrap_freesurfer/freesurfer/segpons.py +2 -2
- niwrap_freesurfer/freesurfer/sphere_subject_lh.py +3 -2
- niwrap_freesurfer/freesurfer/sphere_subject_rh.py +3 -2
- niwrap_freesurfer/freesurfer/talairach.py +4 -4
- niwrap_freesurfer/freesurfer/trac_all.py +283 -1
- niwrap_freesurfer/freesurfer/train_gcs_atlas.py +19 -1
- niwrap_freesurfer/freesurfer/update_needed.py +13 -2
- niwrap_freesurfer/freesurfer/vertexvol.py +19 -1
- niwrap_freesurfer/freesurfer/vol2subfield.py +72 -1
- niwrap_freesurfer/freesurfer/wmsaseg.py +2 -2
- {niwrap_freesurfer-0.5.1.dist-info → niwrap_freesurfer-0.5.2.dist-info}/METADATA +1 -1
- {niwrap_freesurfer-0.5.1.dist-info → niwrap_freesurfer-0.5.2.dist-info}/RECORD +142 -153
- niwrap_freesurfer/freesurfer/bet_fsl.py +0 -441
- niwrap_freesurfer/freesurfer/epidewarp_fsl.py +0 -439
- niwrap_freesurfer/freesurfer/flirt_fsl.py +0 -604
- niwrap_freesurfer/freesurfer/fscalc_fsl.py +0 -196
- niwrap_freesurfer/freesurfer/fsfirst_fsl.py +0 -166
- niwrap_freesurfer/freesurfer/fslmaths_fsl.py +0 -196
- niwrap_freesurfer/freesurfer/fslorient_fsl.py +0 -207
- niwrap_freesurfer/freesurfer/fslswapdim_fsl.py +0 -216
- niwrap_freesurfer/freesurfer/fspython.py +0 -175
- niwrap_freesurfer/freesurfer/mri_motion_correct_fsl.py +0 -185
- niwrap_freesurfer/freesurfer/slicetimer_fsl.py +0 -291
- {niwrap_freesurfer-0.5.1.dist-info → niwrap_freesurfer-0.5.2.dist-info}/WHEEL +0 -0
|
@@ -1,604 +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
|
-
FLIRT_FSL_METADATA = Metadata(
|
|
9
|
-
id="398eadb6f9dd1993cfd24de7b26c3a35c5d0f1cd.boutiques",
|
|
10
|
-
name="flirt.fsl",
|
|
11
|
-
package="freesurfer",
|
|
12
|
-
container_image_tag="freesurfer/freesurfer:7.4.1",
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
FlirtFslParameters = typing.TypedDict('FlirtFslParameters', {
|
|
17
|
-
"__STYX_TYPE__": typing.Literal["flirt.fsl"],
|
|
18
|
-
"input_volume": InputPathType,
|
|
19
|
-
"reference_volume": InputPathType,
|
|
20
|
-
"output_volume": typing.NotRequired[str | None],
|
|
21
|
-
"output_matrix": typing.NotRequired[str | None],
|
|
22
|
-
"initial_matrix": typing.NotRequired[InputPathType | None],
|
|
23
|
-
"data_type": typing.NotRequired[typing.Literal["char", "short", "int", "float", "double"] | None],
|
|
24
|
-
"cost_function": typing.NotRequired[typing.Literal["mutualinfo", "corratio", "normcorr", "normmi", "leastsq", "labeldiff"] | None],
|
|
25
|
-
"search_cost_function": typing.NotRequired[typing.Literal["mutualinfo", "corratio", "normcorr", "normmi", "leastsq", "labeldiff"] | None],
|
|
26
|
-
"use_sform_qform": bool,
|
|
27
|
-
"display_initial_matrix": bool,
|
|
28
|
-
"angle_representation": typing.NotRequired[typing.Literal["quaternion", "euler"] | None],
|
|
29
|
-
"interpolation_method": typing.NotRequired[typing.Literal["trilinear", "nearestneighbour", "sinc"] | None],
|
|
30
|
-
"sinc_width": typing.NotRequired[float | None],
|
|
31
|
-
"sinc_window": typing.NotRequired[typing.Literal["rectangular", "hanning", "blackman"] | None],
|
|
32
|
-
"histogram_bins": typing.NotRequired[float | None],
|
|
33
|
-
"degrees_of_freedom": typing.NotRequired[float | None],
|
|
34
|
-
"no_resample": bool,
|
|
35
|
-
"force_scaling": bool,
|
|
36
|
-
"min_voxel_dimension": typing.NotRequired[float | None],
|
|
37
|
-
"apply_transform": bool,
|
|
38
|
-
"apply_isotropic_transform": typing.NotRequired[float | None],
|
|
39
|
-
"padding_size": typing.NotRequired[float | None],
|
|
40
|
-
"search_range_x": typing.NotRequired[list[float] | None],
|
|
41
|
-
"search_range_y": typing.NotRequired[list[float] | None],
|
|
42
|
-
"search_range_z": typing.NotRequired[list[float] | None],
|
|
43
|
-
"no_search": bool,
|
|
44
|
-
"coarse_search_angle": typing.NotRequired[float | None],
|
|
45
|
-
"fine_search_angle": typing.NotRequired[float | None],
|
|
46
|
-
"schedule_file": typing.NotRequired[InputPathType | None],
|
|
47
|
-
"reference_weight": typing.NotRequired[InputPathType | None],
|
|
48
|
-
"input_weight": typing.NotRequired[InputPathType | None],
|
|
49
|
-
"no_clamp": bool,
|
|
50
|
-
"no_resample_blur": bool,
|
|
51
|
-
"rigid_body_mode": bool,
|
|
52
|
-
"verbose": bool,
|
|
53
|
-
"verbose_level": typing.NotRequired[float | None],
|
|
54
|
-
"pause_stages": bool,
|
|
55
|
-
"version_flag": bool,
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
def dyn_cargs(
|
|
60
|
-
t: str,
|
|
61
|
-
) -> typing.Any:
|
|
62
|
-
"""
|
|
63
|
-
Get build cargs function by command type.
|
|
64
|
-
|
|
65
|
-
Args:
|
|
66
|
-
t: Command type.
|
|
67
|
-
Returns:
|
|
68
|
-
Build cargs function.
|
|
69
|
-
"""
|
|
70
|
-
return {
|
|
71
|
-
"flirt.fsl": flirt_fsl_cargs,
|
|
72
|
-
}.get(t)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
def dyn_outputs(
|
|
76
|
-
t: str,
|
|
77
|
-
) -> typing.Any:
|
|
78
|
-
"""
|
|
79
|
-
Get build outputs function by command type.
|
|
80
|
-
|
|
81
|
-
Args:
|
|
82
|
-
t: Command type.
|
|
83
|
-
Returns:
|
|
84
|
-
Build outputs function.
|
|
85
|
-
"""
|
|
86
|
-
return {
|
|
87
|
-
"flirt.fsl": flirt_fsl_outputs,
|
|
88
|
-
}.get(t)
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
class FlirtFslOutputs(typing.NamedTuple):
|
|
92
|
-
"""
|
|
93
|
-
Output object returned when calling `flirt_fsl(...)`.
|
|
94
|
-
"""
|
|
95
|
-
root: OutputPathType
|
|
96
|
-
"""Output root folder. This is the root folder for all outputs."""
|
|
97
|
-
registered_volume: OutputPathType | None
|
|
98
|
-
"""Resulting registered volume"""
|
|
99
|
-
transformation_matrix: OutputPathType | None
|
|
100
|
-
"""Resulting transformation matrix in ASCII format"""
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
def flirt_fsl_params(
|
|
104
|
-
input_volume: InputPathType,
|
|
105
|
-
reference_volume: InputPathType,
|
|
106
|
-
output_volume: str | None = None,
|
|
107
|
-
output_matrix: str | None = None,
|
|
108
|
-
initial_matrix: InputPathType | None = None,
|
|
109
|
-
data_type: typing.Literal["char", "short", "int", "float", "double"] | None = None,
|
|
110
|
-
cost_function: typing.Literal["mutualinfo", "corratio", "normcorr", "normmi", "leastsq", "labeldiff"] | None = "corratio",
|
|
111
|
-
search_cost_function: typing.Literal["mutualinfo", "corratio", "normcorr", "normmi", "leastsq", "labeldiff"] | None = "corratio",
|
|
112
|
-
use_sform_qform: bool = False,
|
|
113
|
-
display_initial_matrix: bool = False,
|
|
114
|
-
angle_representation: typing.Literal["quaternion", "euler"] | None = "euler",
|
|
115
|
-
interpolation_method: typing.Literal["trilinear", "nearestneighbour", "sinc"] | None = "trilinear",
|
|
116
|
-
sinc_width: float | None = 7,
|
|
117
|
-
sinc_window: typing.Literal["rectangular", "hanning", "blackman"] | None = None,
|
|
118
|
-
histogram_bins: float | None = 256,
|
|
119
|
-
degrees_of_freedom: float | None = 12,
|
|
120
|
-
no_resample: bool = False,
|
|
121
|
-
force_scaling: bool = False,
|
|
122
|
-
min_voxel_dimension: float | None = None,
|
|
123
|
-
apply_transform: bool = False,
|
|
124
|
-
apply_isotropic_transform: float | None = None,
|
|
125
|
-
padding_size: float | None = None,
|
|
126
|
-
search_range_x: list[float] | None = [-90, 90],
|
|
127
|
-
search_range_y: list[float] | None = [-90, 90],
|
|
128
|
-
search_range_z: list[float] | None = [-90, 90],
|
|
129
|
-
no_search: bool = False,
|
|
130
|
-
coarse_search_angle: float | None = 60,
|
|
131
|
-
fine_search_angle: float | None = 18,
|
|
132
|
-
schedule_file: InputPathType | None = None,
|
|
133
|
-
reference_weight: InputPathType | None = None,
|
|
134
|
-
input_weight: InputPathType | None = None,
|
|
135
|
-
no_clamp: bool = False,
|
|
136
|
-
no_resample_blur: bool = False,
|
|
137
|
-
rigid_body_mode: bool = False,
|
|
138
|
-
verbose: bool = False,
|
|
139
|
-
verbose_level: float | None = 0,
|
|
140
|
-
pause_stages: bool = False,
|
|
141
|
-
version_flag: bool = False,
|
|
142
|
-
) -> FlirtFslParameters:
|
|
143
|
-
"""
|
|
144
|
-
Build parameters.
|
|
145
|
-
|
|
146
|
-
Args:
|
|
147
|
-
input_volume: Input volume.
|
|
148
|
-
reference_volume: Reference volume.
|
|
149
|
-
output_volume: Output volume.
|
|
150
|
-
output_matrix: Output matrix filename (4x4 ASCII format).
|
|
151
|
-
initial_matrix: Input 4x4 affine matrix filename.
|
|
152
|
-
data_type: Force output data type.
|
|
153
|
-
cost_function: Cost function for registration.
|
|
154
|
-
search_cost_function: Cost function for search.
|
|
155
|
-
use_sform_qform: Initialize using appropriate sform or qform.
|
|
156
|
-
display_initial_matrix: Display initial matrix.
|
|
157
|
-
angle_representation: Set angle representation.
|
|
158
|
-
interpolation_method: Interpolation method.
|
|
159
|
-
sinc_width: Sinc interpolation width.
|
|
160
|
-
sinc_window: Sinc interpolation window.
|
|
161
|
-
histogram_bins: Number of histogram bins.
|
|
162
|
-
degrees_of_freedom: Degrees of freedom.
|
|
163
|
-
no_resample: Do not change input sampling.
|
|
164
|
-
force_scaling: Force rescaling even for low-res images.
|
|
165
|
-
min_voxel_dimension: Minimum voxel dimension for sampling (in mm).
|
|
166
|
-
apply_transform: Apply transform (no optimisation), requires -init.
|
|
167
|
-
apply_isotropic_transform: Apply transform with isotropic resampling.
|
|
168
|
-
padding_size: Padding size for interpolation outside image.
|
|
169
|
-
search_range_x: Search range for rotation around x-axis.
|
|
170
|
-
search_range_y: Search range for rotation around y-axis.
|
|
171
|
-
search_range_z: Search range for rotation around z-axis.
|
|
172
|
-
no_search: Set all angular search ranges to 0.
|
|
173
|
-
coarse_search_angle: Coarse search angle in degrees.
|
|
174
|
-
fine_search_angle: Fine search angle in degrees.
|
|
175
|
-
schedule_file: Custom schedule filename.
|
|
176
|
-
reference_weight: Weights for reference volume.
|
|
177
|
-
input_weight: Weights for input volume.
|
|
178
|
-
no_clamp: Do not use intensity clamping.
|
|
179
|
-
no_resample_blur: Do not use blurring on downsampling.
|
|
180
|
-
rigid_body_mode: Use 2D rigid body mode (ignores dof).
|
|
181
|
-
verbose: Equivalent to -verbose 1.
|
|
182
|
-
verbose_level: Level of verbosity.
|
|
183
|
-
pause_stages: Pause at each stage.
|
|
184
|
-
version_flag: Print version number.
|
|
185
|
-
Returns:
|
|
186
|
-
Parameter dictionary
|
|
187
|
-
"""
|
|
188
|
-
params = {
|
|
189
|
-
"__STYXTYPE__": "flirt.fsl",
|
|
190
|
-
"input_volume": input_volume,
|
|
191
|
-
"reference_volume": reference_volume,
|
|
192
|
-
"use_sform_qform": use_sform_qform,
|
|
193
|
-
"display_initial_matrix": display_initial_matrix,
|
|
194
|
-
"no_resample": no_resample,
|
|
195
|
-
"force_scaling": force_scaling,
|
|
196
|
-
"apply_transform": apply_transform,
|
|
197
|
-
"no_search": no_search,
|
|
198
|
-
"no_clamp": no_clamp,
|
|
199
|
-
"no_resample_blur": no_resample_blur,
|
|
200
|
-
"rigid_body_mode": rigid_body_mode,
|
|
201
|
-
"verbose": verbose,
|
|
202
|
-
"pause_stages": pause_stages,
|
|
203
|
-
"version_flag": version_flag,
|
|
204
|
-
}
|
|
205
|
-
if output_volume is not None:
|
|
206
|
-
params["output_volume"] = output_volume
|
|
207
|
-
if output_matrix is not None:
|
|
208
|
-
params["output_matrix"] = output_matrix
|
|
209
|
-
if initial_matrix is not None:
|
|
210
|
-
params["initial_matrix"] = initial_matrix
|
|
211
|
-
if data_type is not None:
|
|
212
|
-
params["data_type"] = data_type
|
|
213
|
-
if cost_function is not None:
|
|
214
|
-
params["cost_function"] = cost_function
|
|
215
|
-
if search_cost_function is not None:
|
|
216
|
-
params["search_cost_function"] = search_cost_function
|
|
217
|
-
if angle_representation is not None:
|
|
218
|
-
params["angle_representation"] = angle_representation
|
|
219
|
-
if interpolation_method is not None:
|
|
220
|
-
params["interpolation_method"] = interpolation_method
|
|
221
|
-
if sinc_width is not None:
|
|
222
|
-
params["sinc_width"] = sinc_width
|
|
223
|
-
if sinc_window is not None:
|
|
224
|
-
params["sinc_window"] = sinc_window
|
|
225
|
-
if histogram_bins is not None:
|
|
226
|
-
params["histogram_bins"] = histogram_bins
|
|
227
|
-
if degrees_of_freedom is not None:
|
|
228
|
-
params["degrees_of_freedom"] = degrees_of_freedom
|
|
229
|
-
if min_voxel_dimension is not None:
|
|
230
|
-
params["min_voxel_dimension"] = min_voxel_dimension
|
|
231
|
-
if apply_isotropic_transform is not None:
|
|
232
|
-
params["apply_isotropic_transform"] = apply_isotropic_transform
|
|
233
|
-
if padding_size is not None:
|
|
234
|
-
params["padding_size"] = padding_size
|
|
235
|
-
if search_range_x is not None:
|
|
236
|
-
params["search_range_x"] = search_range_x
|
|
237
|
-
if search_range_y is not None:
|
|
238
|
-
params["search_range_y"] = search_range_y
|
|
239
|
-
if search_range_z is not None:
|
|
240
|
-
params["search_range_z"] = search_range_z
|
|
241
|
-
if coarse_search_angle is not None:
|
|
242
|
-
params["coarse_search_angle"] = coarse_search_angle
|
|
243
|
-
if fine_search_angle is not None:
|
|
244
|
-
params["fine_search_angle"] = fine_search_angle
|
|
245
|
-
if schedule_file is not None:
|
|
246
|
-
params["schedule_file"] = schedule_file
|
|
247
|
-
if reference_weight is not None:
|
|
248
|
-
params["reference_weight"] = reference_weight
|
|
249
|
-
if input_weight is not None:
|
|
250
|
-
params["input_weight"] = input_weight
|
|
251
|
-
if verbose_level is not None:
|
|
252
|
-
params["verbose_level"] = verbose_level
|
|
253
|
-
return params
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
def flirt_fsl_cargs(
|
|
257
|
-
params: FlirtFslParameters,
|
|
258
|
-
execution: Execution,
|
|
259
|
-
) -> list[str]:
|
|
260
|
-
"""
|
|
261
|
-
Build command-line arguments from parameters.
|
|
262
|
-
|
|
263
|
-
Args:
|
|
264
|
-
params: The parameters.
|
|
265
|
-
execution: The execution object for resolving input paths.
|
|
266
|
-
Returns:
|
|
267
|
-
Command-line arguments.
|
|
268
|
-
"""
|
|
269
|
-
cargs = []
|
|
270
|
-
cargs.append("flirt")
|
|
271
|
-
cargs.append(execution.input_file(params.get("input_volume")))
|
|
272
|
-
cargs.append(execution.input_file(params.get("reference_volume")))
|
|
273
|
-
if params.get("output_volume") is not None:
|
|
274
|
-
cargs.append(params.get("output_volume"))
|
|
275
|
-
if params.get("output_matrix") is not None:
|
|
276
|
-
cargs.extend([
|
|
277
|
-
"-omat",
|
|
278
|
-
params.get("output_matrix")
|
|
279
|
-
])
|
|
280
|
-
if params.get("initial_matrix") is not None:
|
|
281
|
-
cargs.extend([
|
|
282
|
-
"-init",
|
|
283
|
-
execution.input_file(params.get("initial_matrix"))
|
|
284
|
-
])
|
|
285
|
-
if params.get("data_type") is not None:
|
|
286
|
-
cargs.extend([
|
|
287
|
-
"-datatype",
|
|
288
|
-
params.get("data_type")
|
|
289
|
-
])
|
|
290
|
-
if params.get("cost_function") is not None:
|
|
291
|
-
cargs.extend([
|
|
292
|
-
"-cost",
|
|
293
|
-
params.get("cost_function")
|
|
294
|
-
])
|
|
295
|
-
if params.get("search_cost_function") is not None:
|
|
296
|
-
cargs.extend([
|
|
297
|
-
"-searchcost",
|
|
298
|
-
params.get("search_cost_function")
|
|
299
|
-
])
|
|
300
|
-
if params.get("use_sform_qform"):
|
|
301
|
-
cargs.append("-usesqform")
|
|
302
|
-
if params.get("display_initial_matrix"):
|
|
303
|
-
cargs.append("-displayinit")
|
|
304
|
-
if params.get("angle_representation") is not None:
|
|
305
|
-
cargs.extend([
|
|
306
|
-
"-anglerep",
|
|
307
|
-
params.get("angle_representation")
|
|
308
|
-
])
|
|
309
|
-
if params.get("interpolation_method") is not None:
|
|
310
|
-
cargs.extend([
|
|
311
|
-
"-interp",
|
|
312
|
-
params.get("interpolation_method")
|
|
313
|
-
])
|
|
314
|
-
if params.get("sinc_width") is not None:
|
|
315
|
-
cargs.extend([
|
|
316
|
-
"-sincwidth",
|
|
317
|
-
str(params.get("sinc_width"))
|
|
318
|
-
])
|
|
319
|
-
if params.get("sinc_window") is not None:
|
|
320
|
-
cargs.extend([
|
|
321
|
-
"-sincwindow",
|
|
322
|
-
params.get("sinc_window")
|
|
323
|
-
])
|
|
324
|
-
if params.get("histogram_bins") is not None:
|
|
325
|
-
cargs.extend([
|
|
326
|
-
"-bins",
|
|
327
|
-
str(params.get("histogram_bins"))
|
|
328
|
-
])
|
|
329
|
-
if params.get("degrees_of_freedom") is not None:
|
|
330
|
-
cargs.extend([
|
|
331
|
-
"-dof",
|
|
332
|
-
str(params.get("degrees_of_freedom"))
|
|
333
|
-
])
|
|
334
|
-
if params.get("no_resample"):
|
|
335
|
-
cargs.append("-noresample")
|
|
336
|
-
if params.get("force_scaling"):
|
|
337
|
-
cargs.append("-forcescaling")
|
|
338
|
-
if params.get("min_voxel_dimension") is not None:
|
|
339
|
-
cargs.extend([
|
|
340
|
-
"-minsampling",
|
|
341
|
-
str(params.get("min_voxel_dimension"))
|
|
342
|
-
])
|
|
343
|
-
if params.get("apply_transform"):
|
|
344
|
-
cargs.append("-applyxfm")
|
|
345
|
-
if params.get("apply_isotropic_transform") is not None:
|
|
346
|
-
cargs.extend([
|
|
347
|
-
"-applyisoxfm",
|
|
348
|
-
str(params.get("apply_isotropic_transform"))
|
|
349
|
-
])
|
|
350
|
-
if params.get("padding_size") is not None:
|
|
351
|
-
cargs.extend([
|
|
352
|
-
"-paddingsize",
|
|
353
|
-
str(params.get("padding_size"))
|
|
354
|
-
])
|
|
355
|
-
if params.get("search_range_x") is not None:
|
|
356
|
-
cargs.extend([
|
|
357
|
-
"-searchrx",
|
|
358
|
-
*map(str, params.get("search_range_x"))
|
|
359
|
-
])
|
|
360
|
-
if params.get("search_range_y") is not None:
|
|
361
|
-
cargs.extend([
|
|
362
|
-
"-searchry",
|
|
363
|
-
*map(str, params.get("search_range_y"))
|
|
364
|
-
])
|
|
365
|
-
if params.get("search_range_z") is not None:
|
|
366
|
-
cargs.extend([
|
|
367
|
-
"-searchrz",
|
|
368
|
-
*map(str, params.get("search_range_z"))
|
|
369
|
-
])
|
|
370
|
-
if params.get("no_search"):
|
|
371
|
-
cargs.append("-nosearch")
|
|
372
|
-
if params.get("coarse_search_angle") is not None:
|
|
373
|
-
cargs.extend([
|
|
374
|
-
"-coarsesearch",
|
|
375
|
-
str(params.get("coarse_search_angle"))
|
|
376
|
-
])
|
|
377
|
-
if params.get("fine_search_angle") is not None:
|
|
378
|
-
cargs.extend([
|
|
379
|
-
"-finesearch",
|
|
380
|
-
str(params.get("fine_search_angle"))
|
|
381
|
-
])
|
|
382
|
-
if params.get("schedule_file") is not None:
|
|
383
|
-
cargs.extend([
|
|
384
|
-
"-schedule",
|
|
385
|
-
execution.input_file(params.get("schedule_file"))
|
|
386
|
-
])
|
|
387
|
-
if params.get("reference_weight") is not None:
|
|
388
|
-
cargs.extend([
|
|
389
|
-
"-refweight",
|
|
390
|
-
execution.input_file(params.get("reference_weight"))
|
|
391
|
-
])
|
|
392
|
-
if params.get("input_weight") is not None:
|
|
393
|
-
cargs.extend([
|
|
394
|
-
"-inweight",
|
|
395
|
-
execution.input_file(params.get("input_weight"))
|
|
396
|
-
])
|
|
397
|
-
if params.get("no_clamp"):
|
|
398
|
-
cargs.append("-noclamp")
|
|
399
|
-
if params.get("no_resample_blur"):
|
|
400
|
-
cargs.append("-noresampblur")
|
|
401
|
-
if params.get("rigid_body_mode"):
|
|
402
|
-
cargs.append("-2D")
|
|
403
|
-
if params.get("verbose"):
|
|
404
|
-
cargs.append("-v")
|
|
405
|
-
if params.get("verbose_level") is not None:
|
|
406
|
-
cargs.extend([
|
|
407
|
-
"-verbose",
|
|
408
|
-
str(params.get("verbose_level"))
|
|
409
|
-
])
|
|
410
|
-
if params.get("pause_stages"):
|
|
411
|
-
cargs.append("-i")
|
|
412
|
-
if params.get("version_flag"):
|
|
413
|
-
cargs.append("-version")
|
|
414
|
-
return cargs
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
def flirt_fsl_outputs(
|
|
418
|
-
params: FlirtFslParameters,
|
|
419
|
-
execution: Execution,
|
|
420
|
-
) -> FlirtFslOutputs:
|
|
421
|
-
"""
|
|
422
|
-
Build outputs object containing output file paths and possibly stdout/stderr.
|
|
423
|
-
|
|
424
|
-
Args:
|
|
425
|
-
params: The parameters.
|
|
426
|
-
execution: The execution object for resolving input paths.
|
|
427
|
-
Returns:
|
|
428
|
-
Outputs object.
|
|
429
|
-
"""
|
|
430
|
-
ret = FlirtFslOutputs(
|
|
431
|
-
root=execution.output_file("."),
|
|
432
|
-
registered_volume=execution.output_file(params.get("output_volume") + ".nii") if (params.get("output_volume") is not None) else None,
|
|
433
|
-
transformation_matrix=execution.output_file(params.get("output_matrix")) if (params.get("output_matrix") is not None) else None,
|
|
434
|
-
)
|
|
435
|
-
return ret
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
def flirt_fsl_execute(
|
|
439
|
-
params: FlirtFslParameters,
|
|
440
|
-
execution: Execution,
|
|
441
|
-
) -> FlirtFslOutputs:
|
|
442
|
-
"""
|
|
443
|
-
FMRIB's Linear Image Registration Tool.
|
|
444
|
-
|
|
445
|
-
Author: FreeSurfer Developers
|
|
446
|
-
|
|
447
|
-
URL: https://github.com/freesurfer/freesurfer
|
|
448
|
-
|
|
449
|
-
Args:
|
|
450
|
-
params: The parameters.
|
|
451
|
-
execution: The execution object.
|
|
452
|
-
Returns:
|
|
453
|
-
NamedTuple of outputs (described in `FlirtFslOutputs`).
|
|
454
|
-
"""
|
|
455
|
-
params = execution.params(params)
|
|
456
|
-
cargs = flirt_fsl_cargs(params, execution)
|
|
457
|
-
ret = flirt_fsl_outputs(params, execution)
|
|
458
|
-
execution.run(cargs)
|
|
459
|
-
return ret
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
def flirt_fsl(
|
|
463
|
-
input_volume: InputPathType,
|
|
464
|
-
reference_volume: InputPathType,
|
|
465
|
-
output_volume: str | None = None,
|
|
466
|
-
output_matrix: str | None = None,
|
|
467
|
-
initial_matrix: InputPathType | None = None,
|
|
468
|
-
data_type: typing.Literal["char", "short", "int", "float", "double"] | None = None,
|
|
469
|
-
cost_function: typing.Literal["mutualinfo", "corratio", "normcorr", "normmi", "leastsq", "labeldiff"] | None = "corratio",
|
|
470
|
-
search_cost_function: typing.Literal["mutualinfo", "corratio", "normcorr", "normmi", "leastsq", "labeldiff"] | None = "corratio",
|
|
471
|
-
use_sform_qform: bool = False,
|
|
472
|
-
display_initial_matrix: bool = False,
|
|
473
|
-
angle_representation: typing.Literal["quaternion", "euler"] | None = "euler",
|
|
474
|
-
interpolation_method: typing.Literal["trilinear", "nearestneighbour", "sinc"] | None = "trilinear",
|
|
475
|
-
sinc_width: float | None = 7,
|
|
476
|
-
sinc_window: typing.Literal["rectangular", "hanning", "blackman"] | None = None,
|
|
477
|
-
histogram_bins: float | None = 256,
|
|
478
|
-
degrees_of_freedom: float | None = 12,
|
|
479
|
-
no_resample: bool = False,
|
|
480
|
-
force_scaling: bool = False,
|
|
481
|
-
min_voxel_dimension: float | None = None,
|
|
482
|
-
apply_transform: bool = False,
|
|
483
|
-
apply_isotropic_transform: float | None = None,
|
|
484
|
-
padding_size: float | None = None,
|
|
485
|
-
search_range_x: list[float] | None = [-90, 90],
|
|
486
|
-
search_range_y: list[float] | None = [-90, 90],
|
|
487
|
-
search_range_z: list[float] | None = [-90, 90],
|
|
488
|
-
no_search: bool = False,
|
|
489
|
-
coarse_search_angle: float | None = 60,
|
|
490
|
-
fine_search_angle: float | None = 18,
|
|
491
|
-
schedule_file: InputPathType | None = None,
|
|
492
|
-
reference_weight: InputPathType | None = None,
|
|
493
|
-
input_weight: InputPathType | None = None,
|
|
494
|
-
no_clamp: bool = False,
|
|
495
|
-
no_resample_blur: bool = False,
|
|
496
|
-
rigid_body_mode: bool = False,
|
|
497
|
-
verbose: bool = False,
|
|
498
|
-
verbose_level: float | None = 0,
|
|
499
|
-
pause_stages: bool = False,
|
|
500
|
-
version_flag: bool = False,
|
|
501
|
-
runner: Runner | None = None,
|
|
502
|
-
) -> FlirtFslOutputs:
|
|
503
|
-
"""
|
|
504
|
-
FMRIB's Linear Image Registration Tool.
|
|
505
|
-
|
|
506
|
-
Author: FreeSurfer Developers
|
|
507
|
-
|
|
508
|
-
URL: https://github.com/freesurfer/freesurfer
|
|
509
|
-
|
|
510
|
-
Args:
|
|
511
|
-
input_volume: Input volume.
|
|
512
|
-
reference_volume: Reference volume.
|
|
513
|
-
output_volume: Output volume.
|
|
514
|
-
output_matrix: Output matrix filename (4x4 ASCII format).
|
|
515
|
-
initial_matrix: Input 4x4 affine matrix filename.
|
|
516
|
-
data_type: Force output data type.
|
|
517
|
-
cost_function: Cost function for registration.
|
|
518
|
-
search_cost_function: Cost function for search.
|
|
519
|
-
use_sform_qform: Initialize using appropriate sform or qform.
|
|
520
|
-
display_initial_matrix: Display initial matrix.
|
|
521
|
-
angle_representation: Set angle representation.
|
|
522
|
-
interpolation_method: Interpolation method.
|
|
523
|
-
sinc_width: Sinc interpolation width.
|
|
524
|
-
sinc_window: Sinc interpolation window.
|
|
525
|
-
histogram_bins: Number of histogram bins.
|
|
526
|
-
degrees_of_freedom: Degrees of freedom.
|
|
527
|
-
no_resample: Do not change input sampling.
|
|
528
|
-
force_scaling: Force rescaling even for low-res images.
|
|
529
|
-
min_voxel_dimension: Minimum voxel dimension for sampling (in mm).
|
|
530
|
-
apply_transform: Apply transform (no optimisation), requires -init.
|
|
531
|
-
apply_isotropic_transform: Apply transform with isotropic resampling.
|
|
532
|
-
padding_size: Padding size for interpolation outside image.
|
|
533
|
-
search_range_x: Search range for rotation around x-axis.
|
|
534
|
-
search_range_y: Search range for rotation around y-axis.
|
|
535
|
-
search_range_z: Search range for rotation around z-axis.
|
|
536
|
-
no_search: Set all angular search ranges to 0.
|
|
537
|
-
coarse_search_angle: Coarse search angle in degrees.
|
|
538
|
-
fine_search_angle: Fine search angle in degrees.
|
|
539
|
-
schedule_file: Custom schedule filename.
|
|
540
|
-
reference_weight: Weights for reference volume.
|
|
541
|
-
input_weight: Weights for input volume.
|
|
542
|
-
no_clamp: Do not use intensity clamping.
|
|
543
|
-
no_resample_blur: Do not use blurring on downsampling.
|
|
544
|
-
rigid_body_mode: Use 2D rigid body mode (ignores dof).
|
|
545
|
-
verbose: Equivalent to -verbose 1.
|
|
546
|
-
verbose_level: Level of verbosity.
|
|
547
|
-
pause_stages: Pause at each stage.
|
|
548
|
-
version_flag: Print version number.
|
|
549
|
-
runner: Command runner.
|
|
550
|
-
Returns:
|
|
551
|
-
NamedTuple of outputs (described in `FlirtFslOutputs`).
|
|
552
|
-
"""
|
|
553
|
-
runner = runner or get_global_runner()
|
|
554
|
-
execution = runner.start_execution(FLIRT_FSL_METADATA)
|
|
555
|
-
params = flirt_fsl_params(
|
|
556
|
-
input_volume=input_volume,
|
|
557
|
-
reference_volume=reference_volume,
|
|
558
|
-
output_volume=output_volume,
|
|
559
|
-
output_matrix=output_matrix,
|
|
560
|
-
initial_matrix=initial_matrix,
|
|
561
|
-
data_type=data_type,
|
|
562
|
-
cost_function=cost_function,
|
|
563
|
-
search_cost_function=search_cost_function,
|
|
564
|
-
use_sform_qform=use_sform_qform,
|
|
565
|
-
display_initial_matrix=display_initial_matrix,
|
|
566
|
-
angle_representation=angle_representation,
|
|
567
|
-
interpolation_method=interpolation_method,
|
|
568
|
-
sinc_width=sinc_width,
|
|
569
|
-
sinc_window=sinc_window,
|
|
570
|
-
histogram_bins=histogram_bins,
|
|
571
|
-
degrees_of_freedom=degrees_of_freedom,
|
|
572
|
-
no_resample=no_resample,
|
|
573
|
-
force_scaling=force_scaling,
|
|
574
|
-
min_voxel_dimension=min_voxel_dimension,
|
|
575
|
-
apply_transform=apply_transform,
|
|
576
|
-
apply_isotropic_transform=apply_isotropic_transform,
|
|
577
|
-
padding_size=padding_size,
|
|
578
|
-
search_range_x=search_range_x,
|
|
579
|
-
search_range_y=search_range_y,
|
|
580
|
-
search_range_z=search_range_z,
|
|
581
|
-
no_search=no_search,
|
|
582
|
-
coarse_search_angle=coarse_search_angle,
|
|
583
|
-
fine_search_angle=fine_search_angle,
|
|
584
|
-
schedule_file=schedule_file,
|
|
585
|
-
reference_weight=reference_weight,
|
|
586
|
-
input_weight=input_weight,
|
|
587
|
-
no_clamp=no_clamp,
|
|
588
|
-
no_resample_blur=no_resample_blur,
|
|
589
|
-
rigid_body_mode=rigid_body_mode,
|
|
590
|
-
verbose=verbose,
|
|
591
|
-
verbose_level=verbose_level,
|
|
592
|
-
pause_stages=pause_stages,
|
|
593
|
-
version_flag=version_flag,
|
|
594
|
-
)
|
|
595
|
-
return flirt_fsl_execute(params, execution)
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
__all__ = [
|
|
599
|
-
"FLIRT_FSL_METADATA",
|
|
600
|
-
"FlirtFslOutputs",
|
|
601
|
-
"FlirtFslParameters",
|
|
602
|
-
"flirt_fsl",
|
|
603
|
-
"flirt_fsl_params",
|
|
604
|
-
]
|