We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4a73b36 commit 920cf49Copy full SHA for 920cf49
nibabel/nicom/csareader.py
@@ -64,11 +64,14 @@ def get_csa_header(dcm_data, csa_type='image'):
64
return None
65
element_no = section_start + element_offset
66
try:
67
+ # The element could be missing due to anonymization
68
tag = dcm_data[(0x29, element_no)]
69
+ # Non-MRI Dicoms have string values in CSA tag
70
+ # This will cause read to throw a CSAReadError
71
+ # in most instances. If so, we return None
72
return read(tag.value)
73
except (KeyError, CSAReadError):
- # The element could be missing due to anonymization
- return None
74
+ return None
75
76
77
def read(csa_str):
0 commit comments