Skip to content

Commit 111e14c

Browse files
committed
STY: Black
1 parent f3939f8 commit 111e14c

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

nibabies/cli/parser.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ def _slice_time_ref(value, parser):
6868
try:
6969
value = float(value)
7070
except ValueError:
71-
raise parser.error("Slice time reference must be number, 'start', or 'middle'. "
72-
f"Received {value}.")
71+
raise parser.error(
72+
"Slice time reference must be number, 'start', or 'middle'. " f"Received {value}."
73+
)
7374
if not 0 <= value <= 1:
7475
raise parser.error(f"Slice time reference must be in range 0-1. Received {value}.")
7576
return value
@@ -325,9 +326,9 @@ def _slice_time_ref(value, parser):
325326
default=None,
326327
type=SliceTimeRef,
327328
help="The time of the reference slice to correct BOLD values to, as a fraction "
328-
"acquisition time. 0 indicates the start, 0.5 the midpoint, and 1 the end "
329-
"of acquisition. The alias `start` corresponds to 0, and `middle` to 0.5. "
330-
"The default value is 0.5.",
329+
"acquisition time. 0 indicates the start, 0.5 the midpoint, and 1 the end "
330+
"of acquisition. The alias `start` corresponds to 0, and `middle` to 0.5. "
331+
"The default value is 0.5.",
331332
)
332333
g_conf.add_argument(
333334
"--dummy-scans",

nibabies/workflows/bold/outputs.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
def prepare_timing_parameters(metadata):
13-
""" Convert initial timing metadata to post-realignment timing metadata
13+
"""Convert initial timing metadata to post-realignment timing metadata
1414
In particular, SliceTiming metadata is invalid once STC or any realignment is applied,
1515
as a matrix of voxels no longer corresponds to an acquisition slice.
1616
Therefore, if SliceTiming is present in the metadata dictionary, and a sparse
@@ -53,11 +53,17 @@ def prepare_timing_parameters(metadata):
5353
"""
5454
timing_parameters = {
5555
key: metadata[key]
56-
for key in ("RepetitionTime", "VolumeTiming", "DelayTime",
57-
"AcquisitionDuration", "SliceTiming")
58-
if key in metadata}
56+
for key in (
57+
"RepetitionTime",
58+
"VolumeTiming",
59+
"DelayTime",
60+
"AcquisitionDuration",
61+
"SliceTiming",
62+
)
63+
if key in metadata
64+
}
5965

60-
run_stc = "SliceTiming" in metadata and 'slicetiming' not in config.workflow.ignore
66+
run_stc = "SliceTiming" in metadata and "slicetiming" not in config.workflow.ignore
6167
timing_parameters["SliceTimingCorrected"] = run_stc
6268

6369
if "SliceTiming" in timing_parameters:

nibabies/workflows/bold/stc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def init_bold_stc_wf(metadata, name="bold_stc_wf"):
6363
frac = config.workflow.slice_time_ref
6464
tzero = np.round(first + frac * (last - first), 3)
6565

66-
afni_ver = ''.join('%02d' % v for v in afni.Info().version() or [])
66+
afni_ver = "".join("%02d" % v for v in afni.Info().version() or [])
6767
workflow = Workflow(name=name)
6868
workflow.__desc__ = f"""\
6969
BOLD runs were slice-time corrected to {tzero:0.3g}s ({frac:g} of slice acquisition range
@@ -72,7 +72,7 @@ def init_bold_stc_wf(metadata, name="bold_stc_wf"):
7272
inputnode = pe.Node(niu.IdentityInterface(fields=["bold_file", "skip_vols"]), name="inputnode")
7373
outputnode = pe.Node(niu.IdentityInterface(fields=["stc_file"]), name="outputnode")
7474

75-
LOGGER.log(25, f'BOLD series will be slice-timing corrected to an offset of {tzero:.3g}s.')
75+
LOGGER.log(25, f"BOLD series will be slice-timing corrected to an offset of {tzero:.3g}s.")
7676

7777
# It would be good to fingerprint memory use of afni.TShift
7878
slice_timing_correction = pe.Node(

0 commit comments

Comments
 (0)