Beispiel #1
0
 def test_UN_sequence(self):
     p = get_testdata_file("UN_sequence.dcm")
     msg = "This reader does not handle undefined length except for SQ"
     with dicomfile(p) as ds:
         with pytest.raises(NotImplementedError, match=msg):
             for elem in ds:
                 pass
Beispiel #2
0
 def test_no_meta(self):
     p = get_testdata_file("no_meta.dcm")
     msg = "No transfer syntax in file meta info"
     with dicomfile(p) as ds:
         assert ds.preamble is None
         with pytest.raises(NotImplementedError, match=msg):
             for elem in ds:
                 pass
Beispiel #3
0
 def test_explicit_big(self):
     p = get_testdata_file("MR_small_bigendian.dcm")
     ds = dcmread(p)
     assert ds.file_meta.TransferSyntaxUID == ExplicitVRBigEndian
     with dicomfile(p) as ds:
         assert ds.preamble is not None
         for elem in ds:
             if elem[0] == (0x7fe0, 0x0010):
                 assert elem[2] == 8192
Beispiel #4
0
 def test_explicit_little(self):
     p = get_testdata_file("CT_small.dcm")
     ds = dcmread(p)
     assert ds.file_meta.TransferSyntaxUID == ExplicitVRLittleEndian
     with dicomfile(p) as ds:
         assert ds.preamble is not None
         for elem in ds:
             if elem[0] == (0x7fe0, 0x0010):
                 assert elem[2] == 32768
Beispiel #5
0
 def test_no_tsyntax(self):
     p = get_testdata_file("meta_missing_tsyntax.dcm")
     ds = dcmread(p)
     assert "TransferSyntaxUID" not in ds.file_meta
     msg = "No transfer syntax in file meta info"
     with dicomfile(p) as ds:
         assert ds.preamble is not None
         with pytest.raises(NotImplementedError, match=msg):
             for elem in ds:
                 pass