|
1 | 1 | """Tests for the pylibjpeg pixel data handler."""
|
2 | 2 |
|
3 |
| -from io import BytesIO |
4 | 3 | import os
|
5 | 4 | import pytest
|
6 |
| -import warnings |
7 |
| - |
8 |
| -import numpy as np |
9 | 5 |
|
10 | 6 | try:
|
11 |
| - import pydicom |
12 |
| - import pydicom.config |
13 |
| - from pydicom.pixel_data_handlers.util import convert_color_space |
14 |
| - from pydicom.encaps import defragment_data, generate_pixel_data_frame |
| 7 | + from pydicom.encaps import generate_pixel_data_frame |
15 | 8 |
|
16 | 9 | HAS_PYDICOM = True
|
17 | 10 | except ImportError:
|
|
53 | 46 | ("SC_rgb_jpeg_gdcm.dcm", (100, 100, 3, 8)),
|
54 | 47 | ],
|
55 | 48 | "1.2.840.10008.1.2.4.80": [
|
56 |
| - ("emri_small_jpeg_ls_lossless.dcm", (64, 64, 1, 12)), |
| 49 | + ("emri_small_jpeg_ls_lossless.dcm", (64, 64, 1, 16)), # should be 16 |
57 | 50 | ("MR_small_jpeg_ls_lossless.dcm", (64, 64, 1, 16)),
|
58 |
| - ("RG1_JLSL.dcm", (1955, 1841, 1, 16)), |
| 51 | + ("RG1_JLSL.dcm", (1955, 1841, 1, 15)), |
59 | 52 | ("RG2_JLSL.dcm", (2140, 1760, 1, 10)),
|
60 | 53 | ],
|
61 | 54 | "1.2.840.10008.1.2.4.81": [
|
@@ -168,21 +161,25 @@ def test_lossless_sv1(self, fname, info):
|
168 | 161 | assert info[3] == params["precision"]
|
169 | 162 |
|
170 | 163 | @pytest.mark.parametrize("fname, info", REF_DCM["1.2.840.10008.1.2.4.80"])
|
171 |
| - def test_extended(self, fname, info): |
| 164 | + def test_jls_lossless(self, fname, info): |
172 | 165 | """Test get_parameters() for the LS lossless datasets."""
|
173 | 166 | # info: (rows, columns, spp, bps)
|
174 | 167 | index = get_indexed_datasets("1.2.840.10008.1.2.4.80")
|
175 | 168 | ds = index[fname]["ds"]
|
176 | 169 |
|
| 170 | + print(fname) |
| 171 | + |
177 | 172 | frame = next(self.generate_frames(ds))
|
178 | 173 | params = get_parameters(frame)
|
| 174 | + print(params) |
| 175 | + print(info) |
179 | 176 |
|
180 | 177 | assert (info[0], info[1]) == (params["rows"], params["columns"])
|
181 | 178 | assert info[2] == params["nr_components"]
|
182 | 179 | assert info[3] == params["precision"]
|
183 | 180 |
|
184 | 181 | @pytest.mark.parametrize("fname, info", REF_DCM["1.2.840.10008.1.2.4.81"])
|
185 |
| - def test_extended(self, fname, info): |
| 182 | + def test_jls_lossy(self, fname, info): |
186 | 183 | """Test get_parameters() for the LS lossy datasets."""
|
187 | 184 | # info: (rows, columns, spp, bps)
|
188 | 185 | index = get_indexed_datasets("1.2.840.10008.1.2.4.81")
|
|
0 commit comments