Skip to content

Commit

Permalink
Fix dicom naming bug with mixed types
Browse files Browse the repository at this point in the history
  • Loading branch information
wtclarke committed Dec 7, 2023
1 parent b795e7b commit 7b84f78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This document contains the Spec2nii release history in reverse chronological ord
- SpectralWidth now added to header extension automatically to match bids specification.
- NIfTI-MRS V0.8 now generated.
- Better handling of philips spar/sdat tags and singleton dimensions.
- Fixed bug where no name was set when a mixed folder of imaging and spectroscopy dicom was provided.

0.7.1 (Tuesday 7th November 2023)
---------------------------------
Expand Down
4 changes: 3 additions & 1 deletion spec2nii/Siemens/dicomfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def multi_file_dicom(files_in, fname_out, tag, verbose):
reference = []
str_suffix = []
mainStr = ''
first_mrs_dcm_found = False
for idx, fn in enumerate(files_in):
if verbose:
print(f'Converting dicom file {fn}')
Expand Down Expand Up @@ -129,7 +130,8 @@ def multi_file_dicom(files_in, fname_out, tag, verbose):
reference.append(ref_ind)
str_suffix.append(str_suf)

if idx == 0:
if not first_mrs_dcm_found:
first_mrs_dcm_found = True
if fname_out:
mainStr = fname_out
elif 'SeriesDescription' in img.dcm_data:
Expand Down

0 comments on commit 7b84f78

Please sign in to comment.