Skip to content

Commit

Permalink
reference fixes for v1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvolgyes committed Jul 22, 2018
1 parent c4720d4 commit e617332
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 24 deletions.
26 changes: 16 additions & 10 deletions TMO4CT/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,37 @@
from .algorithm import tone_mapping
from .tools import eprint, dither

__version__ = '0.9'
__version__ = '1.0'
__title__ = 'TMO4CT'
__summary__ = ('Distance-weighted local histogram equalization'
' based tone mapping for CT images.')
__uri__ = 'https://github.com/dvolgyes/TMO4CT'
__license__ = 'AGPL v3'
__author__ = 'David Völgyes' # Author of the code. The article has co-authors.
__author__ = 'David Völgyes' # Author of the source code. The article has co-authors.
__email__ = 'david.volgyes@ieee.org'
__doi__ = 'unknown'
__doi__ = '10.5281/zenodo.1319084' # Concept DOI, always redirects to the latest version.
__description__ = """
This algorithm is a tone mapping / dynamic range reduction algorithm
mainly for CT images, but it should work with regular (color) photos too.
"""

__bibtex__ = (
"""Unpublished at this moment.
}"""
)
__bibtex__ = ("""
@misc{david_volgyes_2018_1319084,
author = {David Völgyes},
title = {{A Weighted Histogram-Based Tone Mapping Algorithm for CT Images - source code}},
month = jul,
year = 2018,
doi = {""" + __doi__ + """},
url = {https://doi.org/""" + __doi__ + """}
}
""")

__reference__ = (
"""Under review."""
"""David Völgyes. (2018, July 22). A Weighted Histogram-Based Tone Mapping Algorithm for CT Images - source code (Version v"""
+ __version__
+ """).
Zenodo. https://doi.org/"""
+ __doi__
)
+ __doi__)

tone_mapping = tone_mapping
TMO = tone_mapping
Expand Down
40 changes: 27 additions & 13 deletions TMO4CT_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from TMO4CT.tools import eprint, dither
from TMO4CT.algorithm import tone_mapping
from TMO4CT import __version__, __description__, __title__
from TMO4CT import __version__, __description__, __title__, __reference__, __bibtex__
# Libraries implemented for the article
# try:
# from TMO4CT.tools import dither, eprint # Various tools
Expand Down Expand Up @@ -113,18 +113,18 @@ def main():
dest='factors',
help='weight = factor/r^exponent (default factor=1.0)',
)

parser.add_option('-m', '--meta',
action='store_true',
dest='meta',
help='Record metadata to OUTPUT_FILE.meta',
default=True)

parser.add_option('--no-meta',
action='store_false',
dest='meta',
help='Do NOT record metadata.',
default=True)
# Not yet implemented.
# ~parser.add_option('-m', '--meta',
# ~action='store_true',
# ~dest='meta',
# ~help='Record metadata to OUTPUT_FILE.meta',
# ~default=True)

# ~parser.add_option('--no-meta',
# ~action='store_false',
# ~dest='meta',
# ~help='Do NOT record metadata.',
# ~default=True)

parser.add_option('-M', '--maximum',
action='store',
Expand Down Expand Up @@ -202,6 +202,12 @@ def main():
help='Overwrite output file, if it already exists.',
default=False)

parser.add_option('--cite',
dest='cite',
action='store_true',
default=False,
help='print citation information')

color_channel_mapping = {
'HSV': 2,
'YIQ': 0,
Expand All @@ -221,6 +227,14 @@ def main():
check('int, >=0', options.bins, 'number of bins')
check('float, >0', options.climit, 'contrast limit')

if options.cite:
print('Reference for this software:')
print(__reference__)
print()
print('Bibtex format:')
print(__bibtex__)
sys.exit(0)

if len(args) == 0:
parser.print_help()
sys.exit(0)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.9
current_version = 1.0
commit = True
tag = True

Expand Down

0 comments on commit e617332

Please sign in to comment.