Skip to content

Commit 0a5f9cf

Browse files
committed
STY: black
1 parent b7f3f43 commit 0a5f9cf

File tree

1 file changed

+55
-33
lines changed

1 file changed

+55
-33
lines changed

nibabies/interfaces/workbench.py

+55-33
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"PUTAMEN_LEFT",
3737
"PUTAMEN_RIGHT",
3838
"THALAMUS_LEFT",
39-
"THALAMUS_RIGHT"
39+
"THALAMUS_RIGHT",
4040
)
4141

4242

@@ -94,12 +94,13 @@ class CiftiCreateDenseFromTemplateInputSpec(CommandLineInputSpec):
9494
desc="the input is cropped to the size of the voxel data in the template file",
9595
)
9696
label_collision = traits.Enum(
97-
'ERROR',
98-
'SURFACES_FIRST',
99-
'LEGACY',
97+
"ERROR",
98+
"SURFACES_FIRST",
99+
"LEGACY",
100100
argstr="-label-collision %s",
101101
position=8,
102-
desc="how to handle conflicts between label keys, use 'LEGACY' to match v1.4.2 and earlier",
102+
desc="how to handle conflicts between label keys, use 'LEGACY' to match v1.4.2 "
103+
"and earlier",
103104
)
104105
cifti = InputMultiObject(
105106
File(exists=True),
@@ -122,7 +123,9 @@ class CiftiCreateDenseFromTemplateInputSpec(CommandLineInputSpec):
122123
volume = InputMultiObject(
123124
traits.Either(
124125
traits.Tuple(traits.Enum(VALID_STRUCTURES), File(exists=True)),
125-
traits.Tuple(traits.Enum(VALID_STRUCTURES), File(exists=True), traits.Bool())
126+
traits.Tuple(
127+
traits.Enum(VALID_STRUCTURES), File(exists=True), traits.Bool()
128+
),
126129
),
127130
argstr="%s",
128131
position=12,
@@ -160,10 +163,12 @@ class CiftiCreateDenseFromTemplate(WBCommand):
160163
'wb_command -cifti-create-dense-from-template .../func.dtseries.nii out.dtseries.nii \
161164
-series 0.8 0.0'
162165
163-
>>> frmtpl.inputs.volume = [("OTHER", data_dir / 'functional.nii', True), ("PUTAMEN_LEFT", data_dir / 'functional.nii')]
166+
>>> frmtpl.inputs.volume = [("OTHER", data_dir / 'functional.nii', True), \
167+
("PUTAMEN_LEFT", data_dir / 'functional.nii')]
164168
>>> frmtpl.cmdline #doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
165169
'wb_command -cifti-create-dense-from-template .../func.dtseries.nii out.dtseries.nii \
166-
-series 0.8 0.0 -volume OTHER .../functional.nii -from-cropped -volume PUTAMEN_LEFT .../functional.nii'
170+
-series 0.8 0.0 -volume OTHER .../functional.nii -from-cropped \
171+
-volume PUTAMEN_LEFT .../functional.nii'
167172
"""
168173

169174
input_spec = CiftiCreateDenseFromTemplateInputSpec
@@ -214,7 +219,7 @@ class CiftiCreateDenseTimeseriesInputSpec(CommandLineInputSpec):
214219
exists=True,
215220
argstr="-roi-left %s",
216221
position=4,
217-
requires=['left_metric'],
222+
requires=["left_metric"],
218223
desc="ROI (as metric file) of vertices to use from left surface",
219224
)
220225
right_metric = File(
@@ -227,7 +232,7 @@ class CiftiCreateDenseTimeseriesInputSpec(CommandLineInputSpec):
227232
exists=True,
228233
argstr="-roi-right %s",
229234
position=6,
230-
requires=['right_metric'],
235+
requires=["right_metric"],
231236
desc="ROI (as metric file) of vertices to use from right surface",
232237
)
233238
cerebellum_metric = File(
@@ -240,7 +245,7 @@ class CiftiCreateDenseTimeseriesInputSpec(CommandLineInputSpec):
240245
exists=True,
241246
argstr="-roi-cerebellum %s",
242247
position=8,
243-
requires=['cerebellum_metric'],
248+
requires=["cerebellum_metric"],
244249
desc="ROI (as metric file) of vertices to use from cerebellum",
245250
)
246251
timestep = traits.Float(
@@ -256,10 +261,14 @@ class CiftiCreateDenseTimeseriesInputSpec(CommandLineInputSpec):
256261
desc="the time at the first frame, in seconds",
257262
)
258263
unit = traits.Enum(
259-
"SECOND", "HERTZ", "METER", "RADIAN",
264+
"SECOND",
265+
"HERTZ",
266+
"METER",
267+
"RADIAN",
260268
usedefault=True,
261269
argstr="-unit %s",
262-
desc="use a unit other than time")
270+
desc="use a unit other than time",
271+
)
263272

264273

265274
class CiftiCreateDenseTimeseriesOutputSpec(TraitedSpec):
@@ -427,7 +436,9 @@ class CiftiDilateInputSpec(CommandLineInputSpec):
427436

428437

429438
class CiftiCreateLabelInputSpec(CommandLineInputSpec):
430-
out_file = File(mandatory=True, argstr="%s", position=0, desc="the output CIFTI file")
439+
out_file = File(
440+
mandatory=True, argstr="%s", position=0, desc="the output CIFTI file"
441+
)
431442
volume_label = File(
432443
exists=True,
433444
requires=["structure_label_volume"],
@@ -453,7 +464,7 @@ class CiftiCreateLabelInputSpec(CommandLineInputSpec):
453464
requires=["left_label"],
454465
argstr="-roi-left %s",
455466
position=4,
456-
desc="roi of vertices to use from left surface as a metric file"
467+
desc="roi of vertices to use from left surface as a metric file",
457468
)
458469
right_label = File(
459470
exists=True,
@@ -466,7 +477,7 @@ class CiftiCreateLabelInputSpec(CommandLineInputSpec):
466477
requires=["right_label"],
467478
argstr="-roi-right %s",
468479
position=6,
469-
desc="roi of vertices to use from right surface as a metric file"
480+
desc="roi of vertices to use from right surface as a metric file",
470481
)
471482
cerebellum_label = File(
472483
exists=True,
@@ -479,9 +490,10 @@ class CiftiCreateLabelInputSpec(CommandLineInputSpec):
479490
requires=["cerebellum_label"],
480491
argstr="-roi-cerebellum %s",
481492
position=8,
482-
desc="roi of vertices to use from cerebellum"
493+
desc="roi of vertices to use from cerebellum",
483494
)
484495

496+
485497
class CiftiCreateLabelOutputSpec(TraitedSpec):
486498
out_file = File(exists=True, desc="the output CIFTI file")
487499

@@ -592,7 +604,8 @@ class CiftiResampleInputSpec(CommandLineInputSpec):
592604
desc="the CIFTI file to resample",
593605
)
594606
direction = traits.Enum(
595-
"ROW", "COLUMN",
607+
"ROW",
608+
"COLUMN",
596609
mandatory=True,
597610
argstr="%s",
598611
position=1,
@@ -606,21 +619,25 @@ class CiftiResampleInputSpec(CommandLineInputSpec):
606619
desc="a CIFTI file containing the CIFTI space to resample to",
607620
)
608621
template_direction = traits.Enum(
609-
"ROW", "COLUMN",
622+
"ROW",
623+
"COLUMN",
610624
mandatory=True,
611625
argstr="%s",
612626
position=3,
613627
desc="the direction of the template to use as the resampling space",
614628
)
615629
surface_method = traits.Enum(
616-
"ADAP_BARY_AREA", "BARYCENTRIC",
630+
"ADAP_BARY_AREA",
631+
"BARYCENTRIC",
617632
mandatory=True,
618633
argstr="%s",
619634
position=4,
620635
desc="surface resampling method",
621636
)
622637
volume_method = traits.Enum(
623-
"CUBIC", "ENCLOSING_VOXEL", "TRILINEAR",
638+
"CUBIC",
639+
"ENCLOSING_VOXEL",
640+
"TRILINEAR",
624641
mandatory=True,
625642
argstr="%s",
626643
position=5,
@@ -657,7 +674,7 @@ class CiftiResampleInputSpec(CommandLineInputSpec):
657674
xor=["volume_predilate_nearest"],
658675
argstr="-weighted",
659676
position=10,
660-
desc="use weighted dilation (default)"
677+
desc="use weighted dilation (default)",
661678
)
662679
volume_predilate_weighted_exponent = traits.Int(
663680
requires=["volume_predilate_weighted"],
@@ -714,7 +731,7 @@ class CiftiResampleInputSpec(CommandLineInputSpec):
714731
exists=True,
715732
argstr="-affine %s",
716733
position=19,
717-
desc="affine file for transformation on the volume components"
734+
desc="affine file for transformation on the volume components",
718735
)
719736
affine_flirt_source = File(
720737
exists=True,
@@ -765,7 +782,7 @@ class CiftiResampleInputSpec(CommandLineInputSpec):
765782
requires=["left_sphere_current", "left_area_surf_new"],
766783
argstr="-left-area-surfs %s",
767784
position=26,
768-
desc="a relevant left anatomical surface with current mesh"
785+
desc="a relevant left anatomical surface with current mesh",
769786
)
770787
left_area_surf_new = File(
771788
exists=True,
@@ -807,7 +824,7 @@ class CiftiResampleInputSpec(CommandLineInputSpec):
807824
requires=["right_sphere_current", "right_area_surf_new"],
808825
argstr="-right-area-surfs %s",
809826
position=32,
810-
desc="a relevant right anatomical surface with current mesh"
827+
desc="a relevant right anatomical surface with current mesh",
811828
)
812829
right_area_surf_new = File(
813830
exists=True,
@@ -849,7 +866,7 @@ class CiftiResampleInputSpec(CommandLineInputSpec):
849866
requires=["cerebellum_sphere_current", "cerebellum_area_surf_new"],
850867
argstr="-cerebellum-area-surfs %s",
851868
position=38,
852-
desc="a relevant cerebellum anatomical surface with current mesh"
869+
desc="a relevant cerebellum anatomical surface with current mesh",
853870
)
854871
cerebellum_area_surf_new = File(
855872
exists=True,
@@ -937,12 +954,14 @@ class VolumeAffineResampleInputSpec(CommandLineInputSpec):
937954
desc="a volume file in the volume space you want for the output",
938955
)
939956
method = traits.Enum(
940-
"CUBIC", "ENCLOSING_VOXEL", "TRILINEAR",
957+
"CUBIC",
958+
"ENCLOSING_VOXEL",
959+
"TRILINEAR",
941960
mandatory=True,
942961
argstr="%s",
943962
position=2,
944963
desc="The resampling method. The recommended methods are CUBIC "
945-
"(cubic spline) for most data, and ENCLOSING_VOXEL for label data.",
964+
"(cubic spline) for most data, and ENCLOSING_VOXEL for label data.",
946965
)
947966
out_file = File(
948967
name_source=["in_file"],
@@ -967,12 +986,12 @@ class VolumeAffineResampleInputSpec(CommandLineInputSpec):
967986
flirt_source_volume = File(
968987
exists=True,
969988
desc="the source volume used when generating the affine; defaults to in_file",
970-
requires=['flirt'],
989+
requires=["flirt"],
971990
)
972991
flirt_target_volume = File(
973992
exists=True,
974993
desc="the target volume used when generating the affine; defaults to volume_space",
975-
requires=['flirt'],
994+
requires=["flirt"],
976995
)
977996

978997

@@ -1037,7 +1056,8 @@ class VolumeAllLabelsToROIsInputSpec(CommandLineInputSpec):
10371056
desc="the input volume label file",
10381057
)
10391058
label_map = traits.Either(
1040-
traits.Int, Str,
1059+
traits.Int,
1060+
Str,
10411061
mandatory=True,
10421062
argstr="%s",
10431063
position=1,
@@ -1086,7 +1106,8 @@ class VolumeLabelExportTableInputSpec(CommandLineInputSpec):
10861106
desc="the input volume label file",
10871107
)
10881108
label_map = traits.Either(
1089-
traits.Int, Str,
1109+
traits.Int,
1110+
Str,
10901111
mandatory=True,
10911112
argstr="%s",
10921113
position=1,
@@ -1158,7 +1179,8 @@ class VolumeLabelImportInputSpec(CommandLineInputSpec):
11581179
desc="the value that will be interpreted as unlabeled",
11591180
)
11601181
subvolume = traits.Either(
1161-
traits.Int, Str,
1182+
traits.Int,
1183+
Str,
11621184
argstr="-subvolume %s",
11631185
desc="select a single subvolume to import (number or name)",
11641186
)

0 commit comments

Comments
 (0)