@@ -237,7 +237,7 @@ def prep_conversion(sid, dicoms, outdir, heuristic, converter, anon_sid,
237237 getattr (heuristic , 'DEFAULT_FIELDS' , {}))
238238
239239
240- def update_complex_name (metadata , filename , suffix_counter ):
240+ def update_complex_name (metadata , filename ):
241241 """
242242 Insert `_part-<mag|phase>` entity into filename if data are from a
243243 sequence with magnitude/phase part.
@@ -248,14 +248,11 @@ def update_complex_name(metadata, filename, suffix_counter):
248248 Scan metadata dictionary from BIDS sidecar file.
249249 filename : str
250250 Incoming filename
251- suffix_counter : str
252- An index used for cases where a single scan produces multiple files,
253- but the differences between those files are unknown.
254251
255252 Returns
256253 -------
257254 filename : str
258- Updated filename with rec entity added in appropriate position.
255+ Updated filename with part entity added in appropriate position.
259256 """
260257 # Some scans separate magnitude/phase differently
261258 # A small note: _phase is deprecated, but this may add part-mag to
@@ -273,7 +270,7 @@ def update_complex_name(metadata, filename, suffix_counter):
273270 elif 'P' in metadata .get ('ImageType' ):
274271 mag_or_phase = 'phase'
275272 else :
276- mag_or_phase = suffix_counter
273+ raise RuntimeError ( "Data type could not be inferred from the metadata." )
277274
278275 # Determine scan suffix
279276 filetype = '_' + filename .split ('_' )[- 1 ]
@@ -816,7 +813,7 @@ def save_converted_files(res, item_dicoms, bids_options, outtype, prefix, outnam
816813
817814 if is_complex :
818815 this_prefix_basename = update_complex_name (
819- bids_meta , this_prefix_basename , suffix
816+ bids_meta , this_prefix_basename
820817 )
821818
822819 if is_uncombined :
0 commit comments