@@ -232,17 +232,17 @@ def prep_conversion(sid, dicoms, outdir, heuristic, converter, anon_sid,
232
232
233
233
def update_complex_name (fileinfo , this_prefix_basename , suffix ):
234
234
"""
235
- Insert `_rec -<magnitude|phase>` entity into filename if data are from a sequence
236
- with magnitude/phase reconstruction .
235
+ Insert `_part -<magnitude|phase>` entity into filename if data are from a sequence
236
+ with magnitude/phase part .
237
237
"""
238
238
# Functional scans separate magnitude/phase differently
239
239
unsupported_types = ['_bold' , '_phase' ]
240
240
if any (ut in this_prefix_basename for ut in unsupported_types ):
241
241
return this_prefix_basename
242
242
243
- # Check to see if it is magnitude or phase reconstruction :
243
+ # Check to see if it is magnitude or phase part :
244
244
if 'M' in fileinfo .get ('ImageType' ):
245
- mag_or_phase = 'magnitude '
245
+ mag_or_phase = 'mag '
246
246
elif 'P' in fileinfo .get ('ImageType' ):
247
247
mag_or_phase = 'phase'
248
248
else :
@@ -251,26 +251,26 @@ def update_complex_name(fileinfo, this_prefix_basename, suffix):
251
251
# Determine scan suffix
252
252
filetype = '_' + this_prefix_basename .split ('_' )[- 1 ]
253
253
254
- # Insert reconstruction label
255
- if not ('_rec -%s' % mag_or_phase ) in this_prefix_basename :
256
- # If "_rec -" is specified, prepend the 'mag_or_phase' value.
257
- if '_rec -' in this_prefix_basename :
254
+ # Insert part label
255
+ if not ('_part -%s' % mag_or_phase ) in this_prefix_basename :
256
+ # If "_part -" is specified, prepend the 'mag_or_phase' value.
257
+ if '_part -' in this_prefix_basename :
258
258
raise BIDSError (
259
- "Rec label for images will be automatically set, remove "
259
+ "Part label for images will be automatically set, remove "
260
260
"from heuristic"
261
261
)
262
262
263
- # If not, insert "_rec -" + 'mag_or_phase' into the prefix_basename
263
+ # If not, insert "_part -" + 'mag_or_phase' into the prefix_basename
264
264
# **before** "_run", "_echo" or "_sbref", whichever appears first:
265
265
for label in ['_dir' , '_run' , '_mod' , '_echo' , '_recording' , '_proc' , '_space' , filetype ]:
266
266
if label == filetype :
267
267
this_prefix_basename = this_prefix_basename .replace (
268
- filetype , "_rec -%s%s" % (mag_or_phase , filetype )
268
+ filetype , "_part -%s%s" % (mag_or_phase , filetype )
269
269
)
270
270
break
271
271
elif (label in this_prefix_basename ):
272
272
this_prefix_basename = this_prefix_basename .replace (
273
- label , "_rec -%s%s" % (mag_or_phase , label )
273
+ label , "_part -%s%s" % (mag_or_phase , label )
274
274
)
275
275
break
276
276
@@ -317,7 +317,7 @@ def update_multiecho_name(fileinfo, this_prefix_basename, echo_times):
317
317
318
318
def update_uncombined_name (fileinfo , this_prefix_basename , channel_names ):
319
319
"""
320
- Insert `_channel -<num>` entity into filename if data are from a sequence
320
+ Insert `_ch -<num>` entity into filename if data are from a sequence
321
321
with "save uncombined".
322
322
"""
323
323
# In case any scan types separate channels differently
@@ -329,6 +329,7 @@ def update_uncombined_name(fileinfo, this_prefix_basename, channel_names):
329
329
channel_number = '' .join ([c for c in fileinfo ['CoilString' ] if c .isdigit ()])
330
330
if not channel_number :
331
331
channel_number = channel_names .index (fileinfo ['CoilString' ]) + 1
332
+ channel_number = channel_number .zfill (2 )
332
333
333
334
# Determine scan suffix
334
335
filetype = '_' + this_prefix_basename .split ('_' )[- 1 ]
@@ -338,12 +339,12 @@ def update_uncombined_name(fileinfo, this_prefix_basename, channel_names):
338
339
for label in ['_recording' , '_proc' , '_space' , filetype ]:
339
340
if label == filetype :
340
341
this_prefix_basename = this_prefix_basename .replace (
341
- filetype , "_channel -%s%s" % (channel_number , filetype )
342
+ filetype , "_ch -%s%s" % (channel_number , filetype )
342
343
)
343
344
break
344
345
elif (label in this_prefix_basename ):
345
346
this_prefix_basename = this_prefix_basename .replace (
346
- label , "_channel -%s%s" % (channel_number , label )
347
+ label , "_ch -%s%s" % (channel_number , label )
347
348
)
348
349
break
349
350
return this_prefix_basename
0 commit comments