Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BF: Fix DICOM naming bug with mixed types #122

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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