Skip to content
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
This document contains the Spec2nii release history in reverse chronological order.

0.8.12 (WIP)
0.8.12 (Wednesday 20th May 2026)
------------
- Handle DICOMs missing series and instance numbers (generated through Siemens retrorecon).
- Special case handling of ViennaCrt sequence for VE DICOM.
- Bumped dependency to nifti-mrs 1.4.1

0.8.11 (Monday 20th April 2026)
----------------------------------
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies = [
"scipy>=1.13",
"brukerapi>=0.1.8,<0.1.9",
"pandas",
"nifti-mrs>=1.3.2",
"nifti-mrs>=1.4.1",
"chardet"
]

Expand Down
2 changes: 1 addition & 1 deletion spec2nii/other.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def clean_hdr_ext(args):
nifti_mrs_img = NIFTI_MRS(args.file, validate_on_creation=False)
print("'intent_name' is valid.")
except NotNIFTI_MRS as exc:
if str(exc) != 'NIFTI-MRS intent code not set.':
if 'NIFTI-MRS intent code not valid' not in str(exc):
raise
# if failed, read as a regular NIfTI, update intent and re-save
from fsl.data.image import Image
Expand Down
6 changes: 4 additions & 2 deletions tests/test_other_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ def test_clean_intent(tmp_path):
nib.save(img, tmp_path / 'invalid1.nii.gz')
img.header['intent_name'] = None
nib.save(img, tmp_path / 'invalid2.nii.gz')
img.header['intent_name'] = 'test_v2_1'.encode()
nib.save(img, tmp_path / 'invalid3.nii.gz')

# Create reference intent_name
data_text = files('nifti_mrs.standard').joinpath('definitions.json').read_text(encoding='utf-8')
Expand All @@ -235,8 +237,8 @@ def test_clean_intent(tmp_path):
intent_name = f'mrs_v{v_major}_{v_minor}'.encode()

# Test clean call on this file
for file, intent in zip(['valid', 'invalid1', 'invalid2'],
['mrs_v2_1'.encode(), intent_name, intent_name]):
for file, intent in zip(['valid', 'invalid1', 'invalid2', 'invalid3'],
['mrs_v2_1'.encode(), intent_name, intent_name, intent_name]):
subprocess.check_call(['spec2nii', 'clean',
'-o', tmp_path,
'-f', 'cleaned',
Expand Down