File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -191,6 +191,7 @@ def __init__(
191191 self .SeriesNumber = series_number
192192 self .Modality = modality
193193 if series_description is not None :
194+ _check_long_string (series_description )
194195 self .SeriesDescription = series_description
195196
196197 # Equipment
Original file line number Diff line number Diff line change 1+ import re
12import pytest
23import unittest
34
@@ -99,6 +100,23 @@ def test_implicit_vr(self):
99100 transfer_syntax_uid = ImplicitVRLittleEndian ,
100101 )
101102
103+ def test_series_description_too_long (self ):
104+ msg = (
105+ "Values of DICOM value representation Long "
106+ "String (LO) must not exceed 64 characters."
107+ )
108+ with pytest .raises (ValueError , match = re .escape (msg )):
109+ SOPClass (
110+ study_instance_uid = UID (),
111+ series_instance_uid = UID (),
112+ series_number = 1 ,
113+ sop_instance_uid = UID (),
114+ sop_class_uid = '1.2.840.10008.5.1.4.1.1.88.33' ,
115+ instance_number = 1 ,
116+ modality = 'SR' ,
117+ manufacturer = 'highdicom' ,
118+ series_description = "abc" * 100 ,
119+ )
102120
103121class TestEndianCheck (unittest .TestCase ):
104122
You can’t perform that action at this time.
0 commit comments