Skip to content

Commit d0e1bbd

Browse files
authored
Fix hardcoded maximum number of CSA tags
1 parent e684bcc commit d0e1bbd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nibabel/nicom/csareader.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ def read(csa_str):
9898
hdr_type = 1
9999
csa_dict['type'] = hdr_type
100100
csa_dict['n_tags'], csa_dict['check'] = up_str.unpack('2I')
101-
if not 0 < csa_dict['n_tags'] <= 128:
101+
if not 0 < csa_dict['n_tags'] <= MAX_CSA_ITEMS:
102102
raise CSAReadError('Number of tags `t` should be '
103-
'0 < t <= 128')
103+
'0 < t <= %s'%MAX_CSA_ITEMS)
104104
for tag_no in range(csa_dict['n_tags']):
105105
name, vm, vr, syngodt, n_items, last3 = \
106106
up_str.unpack('64si4s3i')

0 commit comments

Comments
 (0)