@@ -114,14 +114,14 @@ def main():
114
114
center = np .average ([bbox_min , bbox_max ], axis = 0 )
115
115
116
116
if opts .hist_eq :
117
- ref_file = op .join (tmp_sub , '%s .mgz' % subid )
117
+ ref_file = op .join (tmp_sub , f' { subid } .mgz' )
118
118
img = nb .load (op .join (sub_path , 'mri' , 'norm.mgz' ))
119
119
data = exposure .equalize_adapthist (img .get_fdata (), clip_limit = 0.03 )
120
120
nb .MGHImage (data , img .affine , img .header ).to_filename (ref_file )
121
121
122
122
if not opts .zoom :
123
123
# Export tiffs for left hemisphere
124
- tcl_file = op .join (tmp_sub , '%s .tcl' % subid )
124
+ tcl_file = op .join (tmp_sub , f' { subid } .tcl' )
125
125
with open (tcl_file , 'w' ) as tclfp :
126
126
tclfp .write (tcl_contents )
127
127
tclfp .write (
@@ -147,7 +147,7 @@ def main():
147
147
if opts .use_xvfb :
148
148
cmd = _xvfb_run () + cmd
149
149
150
- print ('Running tkmedit: %s' % ' ' .join (cmd ))
150
+ print ('Running tkmedit: {}' . format ( ' ' .join (cmd ) ))
151
151
sp .call (cmd , env = environ )
152
152
# Convert to animated gif
153
153
print ('Stacking coronal slices' )
@@ -165,7 +165,7 @@ def main():
165
165
166
166
else :
167
167
# Export tiffs for left hemisphere
168
- tcl_file = op .join (tmp_sub , 'lh-%s .tcl' % subid )
168
+ tcl_file = op .join (tmp_sub , f 'lh-{ subid } .tcl' )
169
169
with open (tcl_file , 'w' ) as tclfp :
170
170
tclfp .write (tcl_contents )
171
171
tclfp .write ('SetZoomLevel 2' )
@@ -184,13 +184,13 @@ def main():
184
184
if opts .use_xvfb :
185
185
cmd = _xvfb_run () + cmd
186
186
187
- print ('Running tkmedit: %s' % ' ' .join (cmd ))
187
+ print ('Running tkmedit: {}' . format ( ' ' .join (cmd ) ))
188
188
sp .call (cmd , env = environ )
189
189
# Convert to animated gif
190
190
print ('Stacking coronal slices' )
191
191
192
192
# Export tiffs for right hemisphere
193
- tcl_file = op .join (tmp_sub , 'rh-%s .tcl' % subid )
193
+ tcl_file = op .join (tmp_sub , f 'rh-{ subid } .tcl' )
194
194
with open (tcl_file , 'w' ) as tclfp :
195
195
tclfp .write (tcl_contents )
196
196
tclfp .write ('SetZoomLevel 2' )
@@ -209,7 +209,7 @@ def main():
209
209
if opts .use_xvfb :
210
210
cmd = _xvfb_run () + cmd
211
211
212
- print ('Running tkmedit: %s' % ' ' .join (cmd ))
212
+ print ('Running tkmedit: {}' . format ( ' ' .join (cmd ) ))
213
213
sp .call (cmd , env = environ )
214
214
# Convert to animated gif
215
215
print ('Stacking coronal slices' )
@@ -260,7 +260,7 @@ def _xvfb_run(wait=5, server_args='-screen 0, 1600x1200x24', logs=None):
260
260
261
261
262
262
def _myerror (msg ):
263
- print ('WARNING: Error deleting temporal files: %s' % msg )
263
+ print (f 'WARNING: Error deleting temporal files: { msg } ' )
264
264
265
265
266
266
if __name__ == '__main__' :
0 commit comments