forked from szullino/XNAT-PIC
-
Notifications
You must be signed in to change notification settings - Fork 1
/
cest_dict.py
executable file
·65 lines (54 loc) · 2.95 KB
/
cest_dict.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 10 11:18:01 2018
@author: Sara Zullino
"""
from pydicom import datadict
import pydicom.encoders.gdcm
def add_cest_dict():
# CEST acquisition
# Create new tag entries
new_dict_items = {
0x10610010: ("LO", "1", "CEST Parameters Creator", "", "Creator"), # (data type, multiplicity, tag displayed name, tag keyword)
0x10611001: ("LO", "1", "Chemical Exchange Saturation Type", "", "ChemicalExchangeSaturationType"),
0x10611002: ("LO", "1", "Saturation Type", "", "SaturationType"),
0x10611003: ("LO", "1", "Pulse Shape", "", "PulseShape"),
0x10611004: ("DS", "1", "B1 Saturation (μT)", "", "B1Saturation"),
0x10611005: ("DS", "1", "Pulse Length (ms)", "", "PulseLength"),
0x10611006: ("DS", "1", "Pulse Number", "", "PulseNumber"),
0x10611007: ("DS", "1", "Interpulse Delay", "", "InterpulseDelay"),
0x10611008: ("DS", "1", "Saturation Length (ms)", "", "SaturationLength"),
0x10611009: ("DS", "1", "Readout Time", "", "ReadoutTime"),
0x10611010: ("DS", "1", "Pulse Length 2 (ms)", "", "PulseLength2"),
0x10611011: ("DS", "1", "Duty Cycle", "", "DutyCycle"),
0x10611012: ("DS", "1", "Recovery Time (ms)", "", "RecoveryTime"),
0x10611013: ("DS", "1", "Measurement Number", "", "MeasurementNumber"),
0x10611014: ("DS", "1", "Saturation Offset (Hz)", "", "SaturationOffsetHz"),
0x10611015: ("DS", "1", "Saturation Offset (ppm)", "", "SaturationOffsetPpm"),
}
# Update the dictionary itself
datadict.DicomDictionary.update(new_dict_items)
# Update the reverse mapping from name to tag
new_names_dict = dict([(val[4], tag) for tag, val in new_dict_items.items()])
datadict.keyword_dict.update(new_names_dict)
def codify_cest_dict(private_creator):
dict_items = {
# tag: (VR, VM, description, is_retired)
0x10610010: ("LO", "1", "CEST Parameters Creator", ""),
0x10611001: ("LO", "1", "Chemical Exchange Saturation Type", ""),
0x10611002: ("LO", "1", "Saturation Type", ""),
0x10611003: ("LO", "1", "Pulse Shape", ""),
0x10611004: ("DS", "1", "B1 Saturation (μT)", ""),
0x10611005: ("DS", "1", "Pulse Length (ms)", ""),
0x10611006: ("DS", "1", "Pulse Number", ""),
0x10611007: ("DS", "1", "Interpulse Delay", ""),
0x10611008: ("DS", "1", "Saturation Length (ms)", ""),
0x10611009: ("DS", "1", "Readout Time", ""),
0x10611010: ("DS", "1", "Pulse Length 2 (ms)", ""),
0x10611011: ("DS", "1", "Duty Cycle", ""),
0x10611012: ("DS", "1", "Recovery Time (ms)", ""),
0x10611013: ("DS", "1", "Measurement Number", ""),
0x10611014: ("DS", "1", "Saturation Offset (Hz)", ""),
0x10611015: ("DS", "1", "Saturation Offset (ppm)", ""),
}
datadict.add_private_dict_entries(private_creator, dict_items)