Added 'glymur.data.nemo()'. Closes #20
This commit is contained in:
parent
37f3d0ea15
commit
fdf73dadf0
4 changed files with 9 additions and 16 deletions
|
|
@ -9,9 +9,8 @@ Printing the Jp2k object should reveal the number of resolutions (look in the
|
|||
COD segment section), but you can take a shortcut by supplying -1 as the reduce
|
||||
level. ::
|
||||
|
||||
>>> import pkg_resources
|
||||
>>> import glymur
|
||||
>>> file = pkg_resources.resource_filename(glymur.__name__, "data/nemo.jp2")
|
||||
>>> file = glymur.data.nemo()
|
||||
>>> j = glymur.Jp2k(file)
|
||||
>>> thumbnail = j.read(reduce=-1)
|
||||
|
||||
|
|
@ -24,9 +23,8 @@ available. ::
|
|||
|
||||
From within Python, it is as simple as printing the Jp2k object, i.e. ::
|
||||
|
||||
>>> import pkg_resources
|
||||
>>> from glymur import Jp2k
|
||||
>>> file = pkg_resources.resource_filename(glymur.__name__, "data/nemo.jp2")
|
||||
>>> file = glymur.data.nemo()
|
||||
>>> j = Jp2k(file)
|
||||
>>> print(j)
|
||||
|
||||
|
|
@ -40,9 +38,8 @@ Work with XMP UUIDs?
|
|||
====================
|
||||
The example JP2 file shipped with glymur has an XMP UUID. ::
|
||||
|
||||
>>> import pkg_resources
|
||||
>>> from glymur import Jp2k
|
||||
>>> file = pkg_resources.resource_filename(glymur.__name__, "data/nemo.jp2")
|
||||
>>> file = glymur.data.nemo()
|
||||
>>> j = Jp2k(file)
|
||||
>>> print(j.box[4])
|
||||
UUID Box (uuid) @ (715, 2412)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
"""glymur - read, write, and interrogate JPEG 2000 files
|
||||
"""
|
||||
|
||||
|
||||
def _glymurrc_fname():
|
||||
"""Return the path to the configuration file.
|
||||
|
||||
|
|
@ -88,4 +87,5 @@ _OPENJP2 = _config()
|
|||
from .jp2k import Jp2k
|
||||
from .jp2dump import jp2dump
|
||||
|
||||
from . import data
|
||||
from . import test
|
||||
|
|
|
|||
|
|
@ -197,8 +197,7 @@ class Jp2k(Jp2kBox):
|
|||
Examples
|
||||
--------
|
||||
>>> import glymur
|
||||
>>> import pkg_resources as pkg
|
||||
>>> jfile = pkg.resource_filename(glymur.__name__, "data/nemo.jp2")
|
||||
>>> jfile = glymur.data.nemo()
|
||||
>>> jp2 = glymur.Jp2k(jfile)
|
||||
>>> data = jp2.read(reduce=3)
|
||||
>>> from tempfile import NamedTemporaryFile
|
||||
|
|
@ -430,8 +429,7 @@ class Jp2k(Jp2kBox):
|
|||
Examples
|
||||
--------
|
||||
>>> import glymur
|
||||
>>> import pkg_resources as pkg
|
||||
>>> jfile = pkg.resource_filename(glymur.__name__, "data/nemo.jp2")
|
||||
>>> jfile = glymur.data.nemo()
|
||||
>>> jp = glymur.Jp2k(jfile)
|
||||
>>> image = jp.read()
|
||||
>>> image.shape
|
||||
|
|
@ -633,8 +631,7 @@ class Jp2k(Jp2kBox):
|
|||
Examples
|
||||
--------
|
||||
>>> import glymur
|
||||
>>> import pkg_resources as pkg
|
||||
>>> jfile = pkg.resource_filename(glymur.__name__, "data/nemo.jp2")
|
||||
>>> jfile = glymur.data.nemo()
|
||||
>>> jp = glymur.Jp2k(jfile)
|
||||
>>> components_lst = jp.read_bands(reduce=1)
|
||||
"""
|
||||
|
|
@ -663,8 +660,7 @@ class Jp2k(Jp2kBox):
|
|||
Examples
|
||||
--------
|
||||
>>> import glymur
|
||||
>>> import pkg_resources as pkg
|
||||
>>> jfile = pkg.resource_filename(glymur.__name__, "data/nemo.jp2")
|
||||
>>> jfile = glymur.data.nemo()
|
||||
>>> jp = glymur.Jp2k(jfile)
|
||||
>>> codestream = jp.get_codestream()
|
||||
>>> print(codestream.segment[1])
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -7,7 +7,7 @@ kwargs = {'name': 'Glymur',
|
|||
'author': 'John Evans',
|
||||
'author_email': 'johnevans938 at gmail dot com',
|
||||
'url': 'https://github.com/quintusdias/glymur',
|
||||
'packages': ['glymur', 'glymur.test', 'glymur.lib',
|
||||
'packages': ['glymur', 'glymur.data', 'glymur.test', 'glymur.lib',
|
||||
'glymur.lib.test'],
|
||||
'package_data': {'glymur': ['data/*.jp2']},
|
||||
'scripts': ['bin/jp2dump'],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue