Skip to content

Commit b5664bd

Browse files
authored
Update readme, version, docstrings and add release notes (#8)
1 parent 7a99d51 commit b5664bd

File tree

7 files changed

+34
-25
lines changed

7 files changed

+34
-25
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,17 @@ Encoding of JPEG images is not currently supported
5656
from pydicom import dcmread
5757
from pydicom.data import get_testdata_file
5858

59+
import pylibjpeg
60+
5961
ds = dcmread(get_testdata_file('JPEG-LL.dcm'))
6062
arr = ds.pixel_array
6163
```
6264

63-
#### Standalone
65+
#### Standalone JPEG decoding
66+
67+
You can also decode JPEG images to a [numpy ndarray][1]:
68+
69+
[1]: https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html
6470

6571
```python
6672
from libjpeg import decode

docs/release_notes/v1.0.0.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. _v1.0.0:
2+
3+
1.0.0
4+
=====
5+
6+
* Initial release

libjpeg/__init__.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
"""Set package shortcuts."""
22

3-
import sys
4-
53
from ._config import DICOM_ENCODERS, DICOM_DECODERS
64
from ._version import __version__
75
from .utils import decode, decode_pixel_data, get_parameters
8-
9-
10-
# Add the testing data to libjpeg (if available)
11-
try:
12-
import data as _data
13-
globals()['data'] = _data
14-
# Add to cache - needed for pytest
15-
sys.modules['libjpeg.data'] = _data
16-
except ImportError:
17-
pass

libjpeg/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import re
44

55

6-
__version__ = '1.0.0.dev1'
6+
__version__ = '1.0.0'
77

88

99
VERSION_PATTERN = r"""

libjpeg/tests/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11

2+
import sys
3+
24
try:
35
from . import pydicom_handler as handler
46
except ImportError:
57
pass
68

9+
# Add the testing data to libjpeg (if available)
10+
try:
11+
import data as _data
12+
globals()['data'] = _data
13+
# Add to cache - needed for pytest
14+
sys.modules['libjpeg.data'] = _data
15+
except ImportError:
16+
pass
17+
718

819
def add_handler():
920
"""Add the pixel data handler to *pydicom*.

libjpeg/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def decode(arr, colour_transform=0, reshape=True):
6767
| ``2`` : JPEG-LS pseudo RCT or RCT
6868
| ``3`` : Freeform
6969
reshape : bool, optional
70-
Reshape and review the output array so it matches the image data
70+
Reshape and re-view the output array so it matches the image data
7171
(default), otherwise return a 1D array of ``np.uint8``.
7272
7373
Returns
@@ -116,6 +116,8 @@ def decode(arr, colour_transform=0, reshape=True):
116116
def decode_pixel_data(arr, photometric_interp):
117117
"""Return the decoded JPEG data from `arr` as a :class:`numpy.ndarray`.
118118
119+
Intended for use with *pydicom* ``Dataset`` objects.
120+
119121
Parameters
120122
----------
121123
arr : numpy.ndarray or bytes

setup.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -163,28 +163,24 @@ def get_source_files():
163163
license = "GPL V3.0",
164164
keywords = (
165165
"dicom pydicom python medicalimaging radiotherapy oncology imaging "
166-
"jpg jpeg jpg-ls jpeg-ls libjpeg pylibjpeg"
166+
"radiology nuclearmedicine jpg jpeg jpg-ls jpeg-ls libjpeg pylibjpeg"
167167
),
168-
project_urls = {
169-
# Might give it it's own docs eventually
170-
'Documentation' : 'https://pydicom.github.io/pydicom/'
171-
},
172168
classifiers = [
173169
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
174170
"Intended Audience :: Developers",
175171
"Intended Audience :: Healthcare Industry",
176172
"Intended Audience :: Science/Research",
177-
"Development Status :: 3 - Alpha",
173+
#"Development Status :: 3 - Alpha",
178174
#"Development Status :: 4 - Beta",
179-
#"Development Status :: 5 - Production/Stable",
175+
"Development Status :: 5 - Production/Stable",
180176
"Natural Language :: English",
181177
"Programming Language :: C++",
182178
"Programming Language :: Python :: 3.6",
183179
"Programming Language :: Python :: 3.7",
184180
"Programming Language :: Python :: 3.8",
185-
"Operating System :: MacOS :: MacOS X", # Tested OK
186-
"Operating System :: POSIX :: Linux", # Tested OK
187-
"Operating System :: Microsoft :: Windows", # Tested OK
181+
"Operating System :: MacOS :: MacOS X",
182+
"Operating System :: POSIX :: Linux",
183+
"Operating System :: Microsoft :: Windows",
188184
"Topic :: Scientific/Engineering :: Medical Science Apps.",
189185
"Topic :: Software Development :: Libraries",
190186
],

0 commit comments

Comments
 (0)