Skip to content

Commit

Permalink
Extract TR and added phantom XA60
Browse files Browse the repository at this point in the history
  • Loading branch information
darrencl committed Jan 24, 2025
1 parent e7be730 commit cdb5067
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions suspect/io/siemens.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def _load_siemens_dicom_xa(dataset, other_ds):
dt = int(dataset[0x5200, 0x9230].value[0][0x0021,0x10fe][0][0x0021, 0x1042].value) * 1e-9
assert dt == mrsdata.dt, "Recorded dwell time is different from 1/sw."
te = dataset[0x5200, 0x9229][0][0x0018, 0x9114][0][0x0018, 0x9082].value

tr = float(dataset[0x5200, 0x9229][0][0x0018, 0x9112][0][0x0018, 0x0080].value)
# The voxel size etc. below could be moved into load_dicom, but looking at the test data acquired with Philips
# (dicom/No_Name/Mrs_Dti_Qa/MRSshortTELN_401/IM-0001-0002.dcm), the length of volume localization (0018, 9126)
# is 1 as opposed to 3.
Expand Down Expand Up @@ -285,7 +285,7 @@ def _load_siemens_dicom_xa(dataset, other_ds):
dt,
mrsdata.f0,
te=te,
tr=mrsdata.tr,
tr=tr,
transform=transform)

# def anonymize_siemens_dicom(filename, anonymized_filename):
Expand Down
Binary file added tests/test_data/siemens/SVS_XA60.dcm
Binary file not shown.
7 changes: 7 additions & 0 deletions tests/test_mrs/test_ima.py → tests/test_mrs/test_siemens.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ def test_svs_30():
assert data.tr == 2000


def test_svs_xa60():
# Not .ima, but might be best to leave it here for Siemens spectro DICOM
data = suspect.io.siemens.load_siemens_dicom("tests/test_data/siemens/SVS_XA60.dcm")
assert data.shape == (1024,)
assert data.te == 30
assert data.tr == 2000

# def test_svs_30():
# data = suspect.io.siemens.load_siemens_dicom("suspect/tests/test_data/siemens_svs_30.IMA")
# assert data.shape == (1024,)
Expand Down

0 comments on commit cdb5067

Please sign in to comment.