File tree Expand file tree Collapse file tree 3 files changed +19
-12
lines changed Expand file tree Collapse file tree 3 files changed +19
-12
lines changed Original file line number Diff line number Diff line change @@ -68,8 +68,9 @@ def _slice_time_ref(value, parser):
68
68
try :
69
69
value = float (value )
70
70
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
+ )
73
74
if not 0 <= value <= 1 :
74
75
raise parser .error (f"Slice time reference must be in range 0-1. Received { value } ." )
75
76
return value
@@ -325,9 +326,9 @@ def _slice_time_ref(value, parser):
325
326
default = None ,
326
327
type = SliceTimeRef ,
327
328
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." ,
331
332
)
332
333
g_conf .add_argument (
333
334
"--dummy-scans" ,
Original file line number Diff line number Diff line change 10
10
11
11
12
12
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
14
14
In particular, SliceTiming metadata is invalid once STC or any realignment is applied,
15
15
as a matrix of voxels no longer corresponds to an acquisition slice.
16
16
Therefore, if SliceTiming is present in the metadata dictionary, and a sparse
@@ -53,11 +53,17 @@ def prepare_timing_parameters(metadata):
53
53
"""
54
54
timing_parameters = {
55
55
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
+ }
59
65
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
61
67
timing_parameters ["SliceTimingCorrected" ] = run_stc
62
68
63
69
if "SliceTiming" in timing_parameters :
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ def init_bold_stc_wf(metadata, name="bold_stc_wf"):
63
63
frac = config .workflow .slice_time_ref
64
64
tzero = np .round (first + frac * (last - first ), 3 )
65
65
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 [])
67
67
workflow = Workflow (name = name )
68
68
workflow .__desc__ = f"""\
69
69
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"):
72
72
inputnode = pe .Node (niu .IdentityInterface (fields = ["bold_file" , "skip_vols" ]), name = "inputnode" )
73
73
outputnode = pe .Node (niu .IdentityInterface (fields = ["stc_file" ]), name = "outputnode" )
74
74
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." )
76
76
77
77
# It would be good to fingerprint memory use of afni.TShift
78
78
slice_timing_correction = pe .Node (
You can’t perform that action at this time.
0 commit comments